Enable a missing test in the CMake build
[folly.git] / folly / Range.h
index 9e392cf42de4f20b35e610fd0cfdd846d89d2e51..f80e635de58d5686ff59b0115070a8c72a492da8 100644 (file)
@@ -56,8 +56,8 @@
 #include <folly/detail/RangeSse42.h>
 
 // Ignore shadowing warnings within this file, so includers can use -Wshadow.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wshadow"
+FOLLY_PUSH_WARNING
+FOLLY_GCC_DISABLE_WARNING("-Wshadow")
 
 namespace folly {
 
@@ -206,7 +206,9 @@ public:
   constexpr Range(Iter start, size_t size)
       : b_(start), e_(start + size) { }
 
+# if !__clang__ || __CLANG_PREREQ(3, 7) // Clang 3.6 crashes on this line
   /* implicit */ Range(std::nullptr_t) = delete;
+# endif
 
   template <class T = Iter, typename detail::IsCharPointer<T>::type = 0>
   constexpr /* implicit */ Range(Iter str)
@@ -692,6 +694,12 @@ public:
         trunc.begin(), trunc.end(), other.begin(), std::forward<Comp>(eq));
   }
 
+  template <class Comp>
+  bool equals(const const_range_type& other, Comp&& eq) const {
+    return size() == other.size() &&
+        std::equal(begin(), end(), other.begin(), std::forward<Comp>(eq));
+  }
+
   /**
    * Remove the items in [b, e), as long as this subrange is at the beginning
    * or end of the Range.
@@ -1268,6 +1276,6 @@ template <class T> struct IsSomeString {
 
 }  // !namespace folly
 
-#pragma GCC diagnostic pop
+FOLLY_POP_WARNING
 
 FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(folly::Range);