From: Christopher Dykes Date: Wed, 25 Jan 2017 00:15:19 +0000 (-0800) Subject: Actually allow SFINAE to occur with setThreadName X-Git-Tag: v2017.03.06.00~84 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eb8b2d91a88a063d6b783c54fc3447b2046a974b;p=folly.git Actually allow SFINAE to occur with setThreadName Summary: It wasn't actually SFINAE the way it was setup previously, which meant it was just a hard error under MSVC. Whoops. Reviewed By: yfeldblum Differential Revision: D4453702 fbshipit-source-id: 5be600fb5ecdc8255795fefbd37c1fe26e7266dd --- diff --git a/folly/ThreadName.h b/folly/ThreadName.h index 018f8abc..09508856 100644 --- a/folly/ThreadName.h +++ b/folly/ThreadName.h @@ -22,6 +22,7 @@ #include #include +#include namespace folly { @@ -70,11 +71,10 @@ inline bool setThreadName(pthread_t id, StringPiece name) { } #endif -template <> -inline typename std::enable_if< - std::is_same::value, - bool>::type -setThreadName(std::thread::id id, StringPiece name) { +template < + typename = folly::_t::value>>> +inline bool setThreadName(std::thread::id id, StringPiece name) { static_assert( sizeof(std::thread::native_handle_type) == sizeof(decltype(id)), "This assumes std::thread::id is a thin wrapper around "