
6 Jan
2011
6 Jan
'11
8:14 a.m.
Howard Hinnant <howard.hinnant <at> gmail.com> writes:
I've used a simple bool return rather than any of the fancier tricks. The speed hit didn't seem that severe and is actually zero if the compiler can see that the functor always returns false.
Fwiw, despite my previous messages, I think using plain bool is the right thing to do. For callables that would not need the test, the call will either be : 1°) out of line : the function call will dwarf the useless test 2°) inlined : the compiler will remove the useless test. (Not even speaking of the actual processing performed by the callable). I got carried away by my fondness for boost::mpl :). Best Regards, Bernard