From: Christopher Dykes Date: Tue, 2 May 2017 01:41:19 +0000 (-0700) Subject: Fix FBString under MSVC X-Git-Tag: v2017.05.08.00~24 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=24c892da36fc7d4f8cad6a3c94bdf6f1024d99c4 Fix FBString under MSVC Summary: MSVC requires the declaration to match a bit closer than GCC does. Reviewed By: yfeldblum, ot Differential Revision: D4981404 fbshipit-source-id: 92ee40c40f66725c09a3087e49d99ebae222c2f2 --- diff --git a/folly/FBString.h b/folly/FBString.h index 45710dc7..c10490ab 100644 --- a/folly/FBString.h +++ b/folly/FBString.h @@ -1234,10 +1234,16 @@ 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. template typename std::enable_if< - std::is_same::type, value_type>::value, - basic_fbstring&>::type + std::is_same< + typename std::decay::type, + typename basic_fbstring::value_type>::value, + basic_fbstring&>::type operator=(TP c); basic_fbstring& operator=(std::initializer_list il) {