boost i'm sure does a lot more checking, plus it is generic for any comparison. While my new code is specific only to strings. But like Kyle said, it could be the x.size() == y.size().