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
#include <pthread.h>
#include <folly/Range.h>
#include <pthread.h>
#include <folly/Range.h>
+#include <folly/Traits.h>
-template <>
-inline typename std::enable_if<
- std::is_same<pthread_t, std::thread::native_handle_type>::value,
- bool>::type
-setThreadName(std::thread::id id, StringPiece name) {
+template <
+ typename = folly::_t<std::enable_if<
+ std::is_same<pthread_t, std::thread::native_handle_type>::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 "
static_assert(
sizeof(std::thread::native_handle_type) == sizeof(decltype(id)),
"This assumes std::thread::id is a thin wrapper around "