fix tautological comparisons in Conv.h
authorLouis Brandy <ldbrandy@fb.com>
Thu, 20 Jun 2013 00:01:38 +0000 (17:01 -0700)
committerJordan DeLong <jdelong@fb.com>
Wed, 26 Jun 2013 02:47:07 +0000 (19:47 -0700)
commit423eed2d591e7b43c0aeb4e3814ebd5b1a127aa9
treef7c04ffe0ebe2cd51915962fec228c86083a1449
parent8949d553667b268698258fa41759bc655568d91b
fix tautological comparisons in Conv.h

Summary:
We have an off-by-one in our enable_if/sfinae logic here. We do not want to actually do the comparison in `less_than` when the rhs is exactly the minimum possible lhs. This results in a tautological comparison.

I added a unit test for these traits that test all the various sfinae cases.

Test Plan: See the clang tautological warnings go away. Under gcc, rerun all tests. All pass.

Reviewed By: marcelo.juchem@fb.com

FB internal diff: D856869
folly/Traits.h
folly/test/TraitsTest.cpp