X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FThreadLocal.h;h=b4c031e750b3d8d2b0a47e863918ade33b313b4e;hb=ce4dec4c322aee6b9905be54bb67956d76270b65;hp=0663417f1f7fe0d7f46e54f299fa09284216cd0c;hpb=bbe8ee53ab2e73e900751611e09cd448d58bb07a;p=folly.git diff --git a/folly/ThreadLocal.h b/folly/ThreadLocal.h index 0663417f..b4c031e7 100644 --- a/folly/ThreadLocal.h +++ b/folly/ThreadLocal.h @@ -42,22 +42,6 @@ #include "folly/Likely.h" #include -// Use noexcept on gcc 4.6 or higher -#undef FOLLY_NOEXCEPT -#ifdef __GNUC__ -# ifdef HAVE_FEATURES_H -# include -# if __GNUC_PREREQ(4,6) -# define FOLLY_NOEXCEPT noexcept -# define FOLLY_ASSERT(x) x -# endif -# endif -#endif - -#ifndef FOLLY_NOEXCEPT -# define FOLLY_NOEXCEPT -# define FOLLY_ASSERT(x) /**/ -#endif namespace folly { enum class TLPDestructionMode { @@ -283,7 +267,7 @@ class ThreadLocalPtr { Accessor(const Accessor&) = delete; Accessor& operator=(const Accessor&) = delete; - Accessor(Accessor&& other) FOLLY_NOEXCEPT + Accessor(Accessor&& other) noexcept : meta_(other.meta_), lock_(other.lock_), id_(other.id_) { @@ -291,7 +275,7 @@ class ThreadLocalPtr { other.lock_ = nullptr; } - Accessor& operator=(Accessor&& other) FOLLY_NOEXCEPT { + Accessor& operator=(Accessor&& other) noexcept { // Each Tag has its own unique meta, and accessors with different Tags // have different types. So either *this is empty, or this and other // have the same tag. But if they have the same tag, they have the same @@ -331,8 +315,8 @@ class ThreadLocalPtr { // accessor allows a client to iterate through all thread local child // elements of this ThreadLocal instance. Holds a global lock for each Accessor accessAllThreads() const { - FOLLY_ASSERT(static_assert(!std::is_same::value, - "Must use a unique Tag to use the accessAllThreads feature")); + static_assert(!std::is_same::value, + "Must use a unique Tag to use the accessAllThreads feature"); return Accessor(id_); } @@ -350,8 +334,6 @@ class ThreadLocalPtr { int id_; // every instantiation has a unique id }; -#undef FOLLY_NOEXCEPT - } // namespace folly #endif /* FOLLY_THREADLOCAL_H_ */