Add support for getting the current thread's name
[folly.git] / folly / FBString.h
index 45710dc79bbcb40bd52c1f47806d58c831891bcb..f5b577a777d61cb939ae66e89c9475fe7222fe1e 100644 (file)
@@ -1234,10 +1234,19 @@ public:
   // value_type overload is dangerous, so we're explicitly deleting
   // any overloads of operator= that could implicitly convert to
   // value_type.
+  // Note that we do need to explicitly specify the template types because
+  // otherwise MSVC 2017 will aggressively pre-resolve value_type to
+  // traits_type::char_type, which won't compare as equal when determining
+  // which overload the implementation is referring to.
+  // Also note that MSVC 2015 Update 3 requires us to explicitly specify the
+  // namespace in-which to search for basic_fbstring, otherwise it tries to
+  // look for basic_fbstring::basic_fbstring, which is just plain wrong.
   template <typename TP>
   typename std::enable_if<
-      std::is_same<typename std::decay<TP>::type, value_type>::value,
-      basic_fbstring&>::type
+      std::is_same<
+          typename std::decay<TP>::type,
+          typename folly::basic_fbstring<E, T, A, Storage>::value_type>::value,
+      basic_fbstring<E, T, A, Storage>&>::type
   operator=(TP c);
 
   basic_fbstring& operator=(std::initializer_list<value_type> il) {