From f3782a946f8d01fd5282c150a6d64c4a5a0fccdb Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 25 Aug 2018 01:47:47 +0300 Subject: [PATCH] Derive noncopyable from a base_token class to allow it to be detected by Type Traits without an #include --- include/boost/core/noncopyable.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/core/noncopyable.hpp b/include/boost/core/noncopyable.hpp index 6ae8c24..ab30505 100644 --- a/include/boost/core/noncopyable.hpp +++ b/include/boost/core/noncopyable.hpp @@ -20,7 +20,14 @@ namespace boost { namespace noncopyable_ // protection from unintended ADL { - class noncopyable +#ifndef BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED +#define BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED + + 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)