Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-18 08:53:33

0001 // Copyright (C) 2017 Andrzej Krzemienski.
0002 //
0003 // Use, modification, and distribution is subject to the Boost Software
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // See http://www.boost.org/libs/optional for documentation.
0008 //
0009 // You are welcome to contact the author at:
0010 //  akrzemi1@gmail.com
0011 
0012 #ifndef BOOST_OPTIONAL_DETAIL_EXPERIMENTAL_TRAITS_04NOV2017_HPP
0013 #define BOOST_OPTIONAL_DETAIL_EXPERIMENTAL_TRAITS_04NOV2017_HPP
0014 
0015 #include <boost/type_traits.hpp>
0016 
0017 // The condition to use POD implementation
0018 
0019 #ifdef BOOST_OPTIONAL_CONFIG_NO_POD_SPEC
0020 # define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
0021 #elif defined BOOST_OPTIONAL_CONFIG_NO_SPEC_FOR_TRIVIAL_TYPES
0022 # define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
0023 #elif !defined BOOST_HAS_TRIVIAL_MOVE_ASSIGN
0024 # define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
0025 #elif !defined BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR
0026 # define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
0027 #elif !defined BOOST_HAS_TRIVIAL_COPY
0028 # define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
0029 #elif !defined BOOST_HAS_TRIVIAL_ASSIGN
0030 # define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
0031 #elif !defined BOOST_HAS_TRIVIAL_DESTRUCTOR
0032 # define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
0033 #endif
0034 
0035 
0036 namespace boost { namespace optional_detail {
0037 
0038 #ifndef BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
0039 template <typename T>
0040 struct is_trivially_semiregular
0041   : boost::conditional<(boost::has_trivial_copy_constructor<T>::value &&
0042                         boost::has_trivial_move_constructor<T>::value &&
0043                         boost::has_trivial_destructor<T>::value &&
0044                         boost::has_trivial_move_assign<T>::value &&
0045                         boost::has_trivial_assign<T>::value),
0046                         boost::true_type, boost::false_type>::type
0047 {};
0048 #else
0049 template <typename T>
0050 struct is_trivially_semiregular
0051 : boost::conditional<(boost::is_scalar<T>::value && !boost::is_const<T>::value && !boost::is_volatile<T>::value),
0052                      boost::true_type, boost::false_type>::type
0053 {};
0054 #endif
0055 
0056 
0057 }} // boost::optional_detail
0058 
0059 #endif