Fix build break for Clang builds.
authorAndrew Tulloch <tulloch@fb.com>
Thu, 1 Aug 2013 21:26:12 +0000 (14:26 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 28 Aug 2013 21:30:11 +0000 (14:30 -0700)
Summary:
Complains about

```
In file included from crypto/lib/cpp/CryptoException.cpp:1:
In file included from crypto/lib/cpp/CryptoException.h:5:
In file included from ./folly/Conv.h:30:
./folly/Range.h:573:19: error: redefinition of default argument
Comp eq = Comp()) {
^    ~~~~~~
./folly/Range.h:55:26: note: previous definition is here
Comp eq = Comp());
^    ~~~~~~
```

Redefinition of default arguments is not allowed in C++.

Test Plan:
```
fbconfig --clang admarket/adpublisher && fbmake dbg
```

contbuild, etc.

Reviewed By: lucian@fb.com

FB internal diff: D910800

folly/Range.h

index b0834b8b956e615c6a1a620dc9322b4a4972c6e7..107bdb00de461b90b00810ada687c0ac7b6c338e 100644 (file)
@@ -567,10 +567,10 @@ struct StringPieceHash {
 /**
  * Finds substrings faster than brute force by borrowing from Boyer-Moore
  */
-template <class T, class Comp = std::equal_to<typename Range<T>::value_type>>
+template <class T, class Comp>
 size_t qfind(const Range<T>& haystack,
              const Range<T>& needle,
-             Comp eq = Comp()) {
+             Comp eq) {
   // Don't use std::search, use a Boyer-Moore-like trick by comparing
   // the last characters first
   auto const nsize = needle.size();