diff options
Diffstat (limited to 'boost/core/noncopyable.hpp')
-rw-r--r-- | boost/core/noncopyable.hpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/boost/core/noncopyable.hpp b/boost/core/noncopyable.hpp index 6ae8c244dd..4a4f8baba5 100644 --- a/boost/core/noncopyable.hpp +++ b/boost/core/noncopyable.hpp @@ -20,7 +20,22 @@ namespace boost { namespace noncopyable_ // protection from unintended ADL { - class noncopyable +#ifndef BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED +#define BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED + +// noncopyable derives from base_token to enable Type Traits to detect +// whether a type derives from noncopyable without needing the definition +// of noncopyable itself. +// +// The definition of base_token is macro-guarded so that Type Trais can +// define it locally without including this header, to avoid a dependency +// on Core. + + struct base_token {}; + +#endif // #ifndef BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED + + class noncopyable: base_token { protected: #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS) |