Use std::equal<> as qfind default comparator
authorJosh Metzler <joshm@fb.com>
Tue, 30 Jul 2013 17:36:58 +0000 (10:36 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 28 Aug 2013 21:30:11 +0000 (14:30 -0700)
commit9ada53a918e2e29c124f1571a609cf3ca98e377d
treef885ca2114a5b999d47e7c6ab3b1e517244ac381
parentb22d95e46a8a3afee60579144c59ec28376e9807
Use std::equal<> as qfind default comparator

Summary:
qfind(haystack, needle) is templated, but used a non-templated
default comparator that cast everything to char.  This works find for
8-bit types, but not for others such as the uint32_t Ranges we are
using.  Replace the default comparator with std::equal<> to use a
working comparator for whatever type is being searched.

Test Plan:
Compiles, unit tests (including a new one that fails with the
old code) pass.  Not sure how to test other users of this, or measure
performance impact. :(

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D906311
folly/Range.h
folly/test/RangeTest.cpp