Remove CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT macro and emulating code
authorkhizmax <libcds.dev@gmail.com>
Tue, 23 Sep 2014 18:18:09 +0000 (22:18 +0400)
committerkhizmax <libcds.dev@gmail.com>
Tue, 23 Sep 2014 18:18:09 +0000 (22:18 +0400)
cds/compiler/clang/defs.h
cds/compiler/cxx11_atomic.h
cds/compiler/defs.h
cds/compiler/gcc/defs.h
cds/compiler/icl/defs.h
cds/compiler/vc/defs.h
cds/details/cxx11_features.h
cds/details/marked_ptr.h
cds/gc/hrc_decl.h
cds/memory/michael/allocator.h
doxygen/cds.doxy

index 42c59ed2562326053916bbdeebed516f8daff0a2..b3a054cb54bd09f6c21e841712ff1de95c3213be 100644 (file)
@@ -28,9 +28,6 @@
 // C++11 delete definition ( function declaration = delete)
 #define CDS_CXX11_DELETE_DEFINITION_SUPPORT
 
-// C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]]
-#define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
-
 // C++11 inline namespace
 #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
 
index 9ad958a6eaa13255b7e4f700f81c006da4f674e9..5508361c10d58162070c3403dcc3ebf09e60d8e3 100644 (file)
@@ -1284,12 +1284,7 @@ namespace cds { namespace cxx11_atomic {
             atomic_noncopyable& operator=(const atomic_noncopyable&);
             //atomic_noncopyable& operator=(const atomic_noncopyable&) volatile;
         protected:
-#   ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
             atomic_noncopyable() = default;
-#   else
-            atomic_noncopyable()
-            {}
-#   endif
         };
 #endif
 
@@ -1425,12 +1420,7 @@ namespace cds { namespace cxx11_atomic {
                 return atomic_ops::atomic_fetch_xor_explicit( &m_val, val, order );
             }
 
-#ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
             atomic_integral() = default;
-#else
-            atomic_integral() CDS_NOEXCEPT
-            {}
-#endif
             CDS_CONSTEXPR atomic_integral(T val) CDS_NOEXCEPT
                 : m_val(val)
                 {}
@@ -1630,12 +1620,7 @@ namespace cds { namespace cxx11_atomic {
             return compare_exchange_strong( expected, desired, success_order, memory_order_relaxed );
         }
 
-#ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
         atomic() = default;
-#else
-        atomic()
-        {}
-#endif
         CDS_CONSTEXPR atomic(T val)
             : m_data( val )
             {}
@@ -1658,7 +1643,7 @@ namespace cds { namespace cxx11_atomic {
         }
     };
 
-#if defined(CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT) && defined(CDS_CXX11_DELETE_DEFINITION_SUPPORT)
+#if defined(CDS_CXX11_DELETE_DEFINITION_SUPPORT)
 #   define CDS_DECLARE_ATOMIC_INTEGRAL( _type ) \
     template <> \
     struct atomic<_type>: public details::atomic_integral<_type> \
@@ -1815,12 +1800,7 @@ namespace cds { namespace cxx11_atomic {
             return atomic_ops::atomic_fetch_sub_explicit( &m_ptr, offset, order );
         }
 
-#ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
         atomic() = default;
-#else
-        atomic() CDS_NOEXCEPT
-        {}
-#endif
         CDS_CONSTEXPR atomic(T * val) CDS_NOEXCEPT
             : m_ptr( val )
         {}
@@ -2201,14 +2181,7 @@ namespace cds { namespace cxx11_atomic {
             return platform::atomic_flag_tas( &m_Flag, order );
         }
 
-#ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
         atomic_flag() = default;
-#elif CDS_COMPILER != CDS_COMPILER_MSVC
-        // MS VC generate error C2552 "non-aggregates cannot be initialized with initializer list"
-        // when atomic_flag initializes with ATOMIC_FLAG_INIT
-        atomic_flag()
-        {}
-#endif
 
 #ifdef CDS_CXX11_DELETE_DEFINITION_SUPPORT
         atomic_flag(const atomic_flag&) = delete;
index 5ad09b942a9d73584ac47d49d0e29610f26eb755..5402102c660a2dd42853f112274514fa87702eb7 100644 (file)
@@ -9,6 +9,7 @@
     - template alias [CDS_CXX11_TEMPLATE_ALIAS_SUPPORT]
     - explicit conversion operator [CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT]
     - default template argument for function [CDS_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS_SUPPORT]
+    - explicit default functions (=default) [CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT]
 */
 
 #if CDS_COMPILER == CDS_COMPILER_MSVC
index 8e0952ca0a98836dab0bab593b1e5f28534eb124..a142d9ba853d869826b1990bdd4e023ad5ce4b41 100644 (file)
@@ -36,9 +36,6 @@
 // C++11 delete definition ( function declaration = delete)
 #define CDS_CXX11_DELETE_DEFINITION_SUPPORT
 
-// C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]]
-#define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
-
 // Lambda
 #define CDS_CXX11_LAMBDA_SUPPORT
 
index d0683af75cd61aac215e76551f1e9c48612b7c96..7b7c311a3d7c35968d311f196251c3df52c42f00 100644 (file)
@@ -94,9 +94,6 @@
 // C++11 delete definition ( function declaration = delete)
 #define CDS_CXX11_DELETE_DEFINITION_SUPPORT
 
-// C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]]
-#define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
-
 // C++11 inline namespace
 #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
 
index 9450e9041727994b783b4b53a614ba08175fd5d5..8be169f1d7e34b4036224ce48b8f107d3e283cc0 100644 (file)
@@ -97,9 +97,6 @@
 // C++11 delete definition ( function declaration = delete)
 #define CDS_CXX11_DELETE_DEFINITION_SUPPORT
 
-// C++11 explicitly-defaulted function (= default) [std 8.4.2 [dcl.fct.def.default]]
-#define CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
-
 // C++11 inline namespace
 //#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT
 
index cbafeb91a0528d3c37982bdace2fa4c9af1e9552..f8166ea38589086d2c89b7258bc5e3ca57d5f9c8 100644 (file)
 #   define CDS_DELETE_SPECIFIER
 #endif
 
-// =default function specifier
-#ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
-#   define CDS_DEFAULT_SPECIFIER    =default
-#else
-#   define CDS_DEFAULT_SPECIFIER
-#endif
-
 //@endcond
 #endif // #ifndef __CDS_DETAILS_CXX11_FEATURES_H
index b656f0204dde1216773aa91e5507701f22b6718e..12a9b9aebcbe90bf64cfcf9283176a0c7370b5c3 100644 (file)
@@ -52,7 +52,6 @@ namespace cds {
                 *this |= nMask;
             }
 
-#   ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
             /// Copy constructor
             marked_ptr( marked_ptr const& src ) CDS_NOEXCEPT_DEFAULTED = default;
             /// Copy-assignment operator
@@ -63,19 +62,6 @@ namespace cds {
             marked_ptr& operator =( marked_ptr&& p ) CDS_NOEXCEPT_DEFAULTED = default;
             //@endcond
 #       endif
-#   else
-            /// Copy constructor
-            marked_ptr( marked_ptr const& src ) CDS_NOEXCEPT
-                : m_ptr( src.m_ptr )
-            {}
-
-            /// Copy-assignment operator
-            marked_ptr& operator =( marked_ptr const& p ) CDS_NOEXCEPT
-            {
-                m_ptr = p.m_ptr;
-                return *this;
-            }
-#   endif
 
             //TODO: make move ctor
 
index bd33362bcf39c9b14b8ef8098fc5ebfc0317f144..ecf5e9159ae52effb5f37002e4827d0a27d8c9ee 100644 (file)
@@ -145,13 +145,7 @@ namespace cds { namespace gc {
             //@endcond
         public:
             //@cond
-#   ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
             atomic_ref() = default;
-#   else
-            atomic_ref() CDS_NOEXCEPT
-                : base_class()
-            {}
-#   endif
             explicit CDS_CONSTEXPR atomic_ref(T * p) CDS_NOEXCEPT
                 : base_class( p )
             {}
index f7efa001fbc07bcb8d05a5c19ad7adb8e149030c..d25fa5ffa50f24bbbb7dab4f505f3c3b87374ee5 100644 (file)
@@ -967,7 +967,6 @@ namespace michael {
                 , nCredits(0)
             {}
 
-#   ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
             active_tag( active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
             ~active_tag() CDS_NOEXCEPT_DEFAULTED = default;
             active_tag& operator=(active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
@@ -975,7 +974,6 @@ namespace michael {
             active_tag( active_tag&& ) CDS_NOEXCEPT_DEFAULTED = default;
             active_tag& operator=(active_tag&&) CDS_NOEXCEPT_DEFAULTED = default;
 #       endif
-#   endif
 
             /// Returns pointer to superblock descriptor
             superblock_desc * ptr() const
@@ -1026,7 +1024,6 @@ namespace michael {
             active_tag() CDS_NOEXCEPT
                 : pDesc( nullptr )
             {}
-#   ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
             // Clang 3.1: error: first argument to atomic operation must be a pointer to a trivially-copyable type
             //active_tag() CDS_NOEXCEPT_DEFAULTED = default;
             active_tag( active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
@@ -1036,7 +1033,6 @@ namespace michael {
             active_tag( active_tag&& ) CDS_NOEXCEPT_DEFAULTED = default;
             active_tag& operator=(active_tag&&) CDS_NOEXCEPT_DEFAULTED = default;
 #       endif
-#   endif
             superblock_desc *    ptr() const
             {
                 return pDesc.ptr();
index 882df3a4f370b65873916400ef48f7fce5d65e75..47a235e2119837a0b52a87ff45a438e0f0d8bae4 100644 (file)
@@ -1397,7 +1397,6 @@ PREDEFINED             = CDS_BUILD_BITS=32 \
                          cds_std=std \
                          CDS_URCU_SIGNAL_HANDLING_ENABLED \
                          CDS_CXX11_DELETE_DEFINITION_SUPPORT \
-                         CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT \
                          CDS_CXX11_INLINE_NAMESPACE_SUPPORT \
                          CDS_CXX11_INLINE_NAMESPACE=inline \
                          CDS_CXX11_DECLTYPE_SUPPORT \