folly: fix make_optional compliation issue with gnu++17
authorPádraig Brady <pbrady@fb.com>
Tue, 23 Jan 2018 18:47:49 +0000 (10:47 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 23 Jan 2018 19:06:29 +0000 (11:06 -0800)
Summary:
This clashes with std::make_optional with -std=gnu++17 giving:
  call of overloaded 'make_optional(std::__cxx11::basic_string<char>)' is ambiguous

Reviewed By: yfeldblum

Differential Revision: D6780579

fbshipit-source-id: fea8c76869e4d9b744fc3182379328a91879b1d2

folly/system/ThreadName.cpp

index ae433cc..d661ad0 100644 (file)
@@ -88,7 +88,7 @@ Optional<std::string> getThreadName(std::thread::id id) {
   if (pthread_getname_np(stdTidToPthreadId(id), buf.data(), buf.size()) != 0) {
     return Optional<std::string>();
   }
-  return make_optional(std::string(buf.data()));
+  return folly::make_optional(std::string(buf.data()));
 #else
   return Optional<std::string>();
 #endif