Delete operator=(std::string&&) from StringPiece
authorChristopher Dykes <cdykes@fb.com>
Fri, 5 May 2017 01:32:45 +0000 (18:32 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 5 May 2017 01:35:15 +0000 (18:35 -0700)
Summary: This can only ever be used unsafely, so delete it.

Reviewed By: yfeldblum

Differential Revision: D4951294

fbshipit-source-id: bbc266d1550fceb48946c7c48e76af07292b4a53

folly/Range.h

index 9c9b68b..9e392cf 100644 (file)
@@ -359,6 +359,9 @@ public:
   Range& operator=(const Range& rhs) & = default;
   Range& operator=(Range&& rhs) & = default;
 
   Range& operator=(const Range& rhs) & = default;
   Range& operator=(Range&& rhs) & = default;
 
+  template <class T = Iter, typename detail::IsCharPointer<T>::const_type = 0>
+  Range& operator=(std::string&& rhs) = delete;
+
   void clear() {
     b_ = Iter();
     e_ = Iter();
   void clear() {
     b_ = Iter();
     e_ = Iter();