Unbreak build.
authorTudor Bosman <tudorb@fb.com>
Fri, 13 Jul 2012 03:18:29 +0000 (20:18 -0700)
committerTudor Bosman <tudorb@fb.com>
Fri, 13 Jul 2012 23:30:13 +0000 (16:30 -0700)
Summary: I could have sworn I undid that un-templatification of the constructor.

Test Plan: build folly/test

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D518981

folly/Range.h

index 9ddf04525737514debbcdf69290c5079dd8a67b0..65b7441d0b53055ab5fd2ffb7db4341c62496e6c 100644 (file)
@@ -188,9 +188,10 @@ public:
   // Allow implicit conversion from Range<const char*> (aka StringPiece) to
   // Range<const unsigned char*> (aka ByteRange), as they're both frequently
   // used to represent ranges of bytes.
-  template <typename std::enable_if<
-      (std::is_same<Iter, const unsigned char*>::value), int>::type = 0>
-  /* implicit */ Range(const Range<const char*>& other)
+  template <class OtherIter, typename std::enable_if<
+      (std::is_same<Iter, const unsigned char*>::value &&
+       std::is_same<OtherIter, const char*>::value), int>::type = 0>
+  /* implicit */ Range(const Range<OtherIter>& other)
     : b_(reinterpret_cast<const unsigned char*>(other.begin())),
       e_(reinterpret_cast<const unsigned char*>(other.end())) {
   }