Revert "[clang support] removed superfluous declarations from header files"
authorAndrew Gallagher <agallagher@fb.com>
Mon, 5 Aug 2013 23:42:39 +0000 (16:42 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 28 Aug 2013 21:30:11 +0000 (14:30 -0700)
Summary: This reverts commit 49b197dfd02443e958906bac45059cea460e4e10.

Test Plan: contbuild

Reviewed By: akhilravidas@fb.com

FB internal diff: D915386

@override-unit-failures

folly/Range.h
folly/dynamic.h

index 94a3d825ad9c3bfac6931d8bbf75f7f04f9f045c..107bdb00de461b90b00810ada687c0ac7b6c338e 100644 (file)
@@ -43,6 +43,17 @@ namespace folly {
 
 template <class T> class Range;
 
+/**
+ * Finds the first occurrence of needle in haystack. The algorithm is on
+ * average faster than O(haystack.size() * needle.size()) but not as fast
+ * as Boyer-Moore. On the upside, it does not do any upfront
+ * preprocessing and does not allocate memory.
+ */
+template <class T, class Comp = std::equal_to<typename Range<T>::value_type>>
+inline size_t qfind(const Range<T> & haystack,
+                    const Range<T> & needle,
+                    Comp eq = Comp());
+
 /**
  * Finds the first occurrence of needle in haystack. The result is the
  * offset reported to the beginning of haystack, or string::npos if
@@ -554,10 +565,7 @@ struct StringPieceHash {
 };
 
 /**
- * Finds the first occurrence of needle in haystack. The algorithm is on
- * average faster than O(haystack.size() * needle.size()) but not as fast
- * as Boyer-Moore. On the upside, it does not do any upfront
- * preprocessing and does not allocate memory.
+ * Finds substrings faster than brute force by borrowing from Boyer-Moore
  */
 template <class T, class Comp>
 size_t qfind(const Range<T>& haystack,
index 6334cf2a952fcb251e941fe07ec81affc7055a81..6ab5ca1bf84543e93be9e1dfd0069303e29196c8 100644 (file)
@@ -443,6 +443,7 @@ public:
 private:
   friend struct TypeError;
   struct ObjectImpl;
+  struct ObjectMaker;
   template<class T> struct TypeInfo;
   template<class T> struct CompareOp;
   template<class T> struct GetAddrImpl;