mirror of
https://github.com/Vita3K/ext-boost.git
synced 2024-11-23 05:29:39 +00:00
Add Boost.Optional
This commit is contained in:
parent
aea6b5c416
commit
6b780f14b6
74
boost/bind/apply.hpp
Normal file
74
boost/bind/apply.hpp
Normal file
@ -0,0 +1,74 @@
|
||||
#ifndef BOOST_BIND_APPLY_HPP_INCLUDED
|
||||
#define BOOST_BIND_APPLY_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// apply.hpp
|
||||
//
|
||||
// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<class R> struct apply
|
||||
{
|
||||
typedef R result_type;
|
||||
|
||||
template<class F> result_type operator()(F & f) const
|
||||
{
|
||||
return f();
|
||||
}
|
||||
|
||||
template<class F, class A1> result_type operator()(F & f, A1 & a1) const
|
||||
{
|
||||
return f(a1);
|
||||
}
|
||||
|
||||
template<class F, class A1, class A2> result_type operator()(F & f, A1 & a1, A2 & a2) const
|
||||
{
|
||||
return f(a1, a2);
|
||||
}
|
||||
|
||||
template<class F, class A1, class A2, class A3> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3) const
|
||||
{
|
||||
return f(a1, a2, a3);
|
||||
}
|
||||
|
||||
template<class F, class A1, class A2, class A3, class A4> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
|
||||
{
|
||||
return f(a1, a2, a3, a4);
|
||||
}
|
||||
|
||||
template<class F, class A1, class A2, class A3, class A4, class A5> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
|
||||
{
|
||||
return f(a1, a2, a3, a4, a5);
|
||||
}
|
||||
|
||||
template<class F, class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
|
||||
{
|
||||
return f(a1, a2, a3, a4, a5, a6);
|
||||
}
|
||||
|
||||
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
|
||||
{
|
||||
return f(a1, a2, a3, a4, a5, a6, a7);
|
||||
}
|
||||
|
||||
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
|
||||
{
|
||||
return f(a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
}
|
||||
|
||||
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
|
||||
{
|
||||
return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_APPLY_HPP_INCLUDED
|
56
boost/core/lightweight_test_trait.hpp
Normal file
56
boost/core/lightweight_test_trait.hpp
Normal file
@ -0,0 +1,56 @@
|
||||
#ifndef BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
|
||||
#define BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// boost/core/lightweight_test_trait.hpp
|
||||
//
|
||||
// BOOST_TEST_TRAIT_TRUE, BOOST_TEST_TRAIT_FALSE
|
||||
//
|
||||
// Copyright 2014 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/core/typeinfo.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template< class T > inline void test_trait_impl( char const * trait, void (*)( T ),
|
||||
bool expected, char const * file, int line, char const * function )
|
||||
{
|
||||
if( T::value == expected )
|
||||
{
|
||||
report_errors_remind();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): predicate '" << trait << "' ["
|
||||
<< boost::core::demangled_name( BOOST_CORE_TYPEID(T) ) << "]"
|
||||
<< " test failed in function '" << function
|
||||
<< "' (should have been " << ( expected? "true": "false" ) << ")"
|
||||
<< std::endl;
|
||||
|
||||
++test_errors();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_TEST_TRAIT_TRUE(type) ( ::boost::detail::test_trait_impl(#type, (void(*)type)0, true, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
|
||||
#define BOOST_TEST_TRAIT_FALSE(type) ( ::boost::detail::test_trait_impl(#type, (void(*)type)0, false, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
|
||||
|
||||
#endif // #ifndef BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
|
98
boost/optional/detail/experimental_traits.hpp
Normal file
98
boost/optional/detail/experimental_traits.hpp
Normal file
@ -0,0 +1,98 @@
|
||||
// Copyright (C) 2017 Andrzej Krzemienski.
|
||||
//
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/optional for documentation.
|
||||
//
|
||||
// You are welcome to contact the author at:
|
||||
// akrzemi1@gmail.com
|
||||
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_EXPERIMENTAL_TRAITS_04NOV2017_HPP
|
||||
#define BOOST_OPTIONAL_DETAIL_EXPERIMENTAL_TRAITS_04NOV2017_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
namespace boost { namespace optional_detail {
|
||||
|
||||
// The condition to use POD implementation
|
||||
|
||||
#ifdef BOOST_OPTIONAL_CONFIG_NO_POD_SPEC
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
#elif defined BOOST_OPTIONAL_CONFIG_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
#elif !defined BOOST_HAS_TRIVIAL_CONSTRUCTOR
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
#elif !defined BOOST_HAS_TRIVIAL_MOVE_ASSIGN
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
#elif !defined BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
#elif !defined BOOST_HAS_TRIVIAL_COPY
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
#elif !defined BOOST_HAS_TRIVIAL_ASSIGN
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
#elif !defined BOOST_HAS_TRIVIAL_DESTRUCTOR
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
#elif BOOST_WORKAROUND(BOOST_GCC, < 50000)
|
||||
# define BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
# if BOOST_WORKAROUND(BOOST_GCC, >= 50000)
|
||||
# define BOOST_OPTIONAL_DETAIL_USE_STD_TYPE_TRAITS
|
||||
# elif (defined BOOST_CLANG)
|
||||
# define BOOST_OPTIONAL_DETAIL_USE_STD_TYPE_TRAITS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_USE_STD_TYPE_TRAITS
|
||||
# define BOOST_OPTIONAL_DETAIL_HAS_TRIVIAL_CTOR(T) BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)
|
||||
#else
|
||||
# define BOOST_OPTIONAL_DETAIL_HAS_TRIVIAL_CTOR(T) std::is_trivially_default_constructible<T>::value
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
template <typename T>
|
||||
struct is_type_trivially_copyable
|
||||
: boost::conditional<(boost::has_trivial_copy_constructor<T>::value &&
|
||||
boost::has_trivial_move_constructor<T>::value &&
|
||||
boost::has_trivial_destructor<T>::value &&
|
||||
boost::has_trivial_move_assign<T>::value &&
|
||||
boost::has_trivial_assign<T>::value),
|
||||
boost::true_type, boost::false_type>::type
|
||||
{};
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_type_trivially_copyable
|
||||
: boost::conditional<(boost::is_scalar<T>::value && !boost::is_const<T>::value && !boost::is_volatile<T>::value),
|
||||
boost::true_type, boost::false_type>::type
|
||||
{};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_SPEC_FOR_TRIVIAL_TYPES
|
||||
template <typename T>
|
||||
struct optional_uses_direct_storage_for_
|
||||
: boost::conditional< (is_type_trivially_copyable<T>::value && BOOST_OPTIONAL_DETAIL_HAS_TRIVIAL_CTOR(T)) ||
|
||||
(boost::is_scalar<T>::value && !boost::is_const<T>::value && !boost::is_volatile<T>::value)
|
||||
, boost::true_type, boost::false_type>::type
|
||||
{};
|
||||
#else
|
||||
template <typename T>
|
||||
struct optional_uses_direct_storage_for_
|
||||
: boost::conditional<(boost::is_scalar<T>::value && !boost::is_const<T>::value && !boost::is_volatile<T>::value)
|
||||
, boost::true_type, boost::false_type>::type
|
||||
{};
|
||||
#endif
|
||||
|
||||
|
||||
}} // boost::optional_detail
|
||||
|
||||
#endif
|
94
boost/optional/optional_io.hpp
Normal file
94
boost/optional/optional_io.hpp
Normal file
@ -0,0 +1,94 @@
|
||||
// Copyright (C) 2005, Fernando Luis Cacciola Carballal.
|
||||
//
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/optional for documentation.
|
||||
//
|
||||
// You are welcome to contact the author at:
|
||||
// fernando_cacciola@hotmail.com
|
||||
//
|
||||
#ifndef BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
|
||||
#define BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
|
||||
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
|
||||
#include "boost/none.hpp"
|
||||
#include "boost/optional/optional.hpp"
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<class CharType, class CharTrait>
|
||||
inline
|
||||
std::basic_ostream<CharType, CharTrait>&
|
||||
operator<<(std::basic_ostream<CharType, CharTrait>& out, none_t)
|
||||
{
|
||||
if (out.good())
|
||||
{
|
||||
out << "--";
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
template<class CharType, class CharTrait, class T>
|
||||
inline
|
||||
std::basic_ostream<CharType, CharTrait>&
|
||||
operator<<(std::basic_ostream<CharType, CharTrait>& out, optional<T> const& v)
|
||||
{
|
||||
if (out.good())
|
||||
{
|
||||
if (!v)
|
||||
out << "--" ;
|
||||
else out << ' ' << *v ;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
template<class CharType, class CharTrait, class T>
|
||||
inline
|
||||
std::basic_istream<CharType, CharTrait>&
|
||||
operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v)
|
||||
{
|
||||
if (in.good())
|
||||
{
|
||||
int d = in.get();
|
||||
if (d == ' ')
|
||||
{
|
||||
T x;
|
||||
in >> x;
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
|
||||
v = boost::move(x);
|
||||
#else
|
||||
v = x;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d == '-')
|
||||
{
|
||||
d = in.get();
|
||||
|
||||
if (d == '-')
|
||||
{
|
||||
v = none;
|
||||
return in;
|
||||
}
|
||||
}
|
||||
|
||||
in.setstate( std::ios::failbit );
|
||||
}
|
||||
}
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
23
boost/preprocessor/punctuation/paren.hpp
Normal file
23
boost/preprocessor/punctuation/paren.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Paul Mensonides 2002.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_PUNCTUATION_PAREN_HPP
|
||||
# define BOOST_PREPROCESSOR_PUNCTUATION_PAREN_HPP
|
||||
#
|
||||
# /* BOOST_PP_LPAREN */
|
||||
#
|
||||
# define BOOST_PP_LPAREN() (
|
||||
#
|
||||
# /* BOOST_PP_RPAREN */
|
||||
#
|
||||
# define BOOST_PP_RPAREN() )
|
||||
#
|
||||
# endif
|
154
boost/type_traits.hpp
Normal file
154
boost/type_traits.hpp
Normal file
@ -0,0 +1,154 @@
|
||||
// (C) Copyright John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
// See boost/type_traits/*.hpp for full copyright notices.
|
||||
|
||||
#ifndef BOOST_TYPE_TRAITS_HPP
|
||||
#define BOOST_TYPE_TRAITS_HPP
|
||||
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/add_cv.hpp>
|
||||
#include <boost/type_traits/add_lvalue_reference.hpp>
|
||||
#include <boost/type_traits/add_pointer.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/add_rvalue_reference.hpp>
|
||||
#include <boost/type_traits/add_volatile.hpp>
|
||||
#include <boost/type_traits/aligned_storage.hpp>
|
||||
#include <boost/type_traits/alignment_of.hpp>
|
||||
#include <boost/type_traits/common_type.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <boost/type_traits/copy_cv.hpp>
|
||||
#include <boost/type_traits/decay.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/extent.hpp>
|
||||
#include <boost/type_traits/floating_point_promotion.hpp>
|
||||
#include <boost/type_traits/function_traits.hpp>
|
||||
|
||||
#include <boost/type_traits/has_bit_and.hpp>
|
||||
#include <boost/type_traits/has_bit_and_assign.hpp>
|
||||
#include <boost/type_traits/has_bit_or.hpp>
|
||||
#include <boost/type_traits/has_bit_or_assign.hpp>
|
||||
#include <boost/type_traits/has_bit_xor.hpp>
|
||||
#include <boost/type_traits/has_bit_xor_assign.hpp>
|
||||
#include <boost/type_traits/has_complement.hpp>
|
||||
#include <boost/type_traits/has_dereference.hpp>
|
||||
#include <boost/type_traits/has_divides.hpp>
|
||||
#include <boost/type_traits/has_divides_assign.hpp>
|
||||
#include <boost/type_traits/has_equal_to.hpp>
|
||||
#include <boost/type_traits/has_greater.hpp>
|
||||
#include <boost/type_traits/has_greater_equal.hpp>
|
||||
#include <boost/type_traits/has_left_shift.hpp>
|
||||
#include <boost/type_traits/has_left_shift_assign.hpp>
|
||||
#include <boost/type_traits/has_less.hpp>
|
||||
#include <boost/type_traits/has_less_equal.hpp>
|
||||
#include <boost/type_traits/has_logical_and.hpp>
|
||||
#include <boost/type_traits/has_logical_not.hpp>
|
||||
#include <boost/type_traits/has_logical_or.hpp>
|
||||
#include <boost/type_traits/has_minus.hpp>
|
||||
#include <boost/type_traits/has_minus_assign.hpp>
|
||||
#include <boost/type_traits/has_modulus.hpp>
|
||||
#include <boost/type_traits/has_modulus_assign.hpp>
|
||||
#include <boost/type_traits/has_multiplies.hpp>
|
||||
#include <boost/type_traits/has_multiplies_assign.hpp>
|
||||
#include <boost/type_traits/has_negate.hpp>
|
||||
#if !defined(__BORLANDC__) && !defined(__CUDACC__)
|
||||
#include <boost/type_traits/has_new_operator.hpp>
|
||||
#endif
|
||||
#include <boost/type_traits/has_not_equal_to.hpp>
|
||||
#include <boost/type_traits/has_nothrow_assign.hpp>
|
||||
#include <boost/type_traits/has_nothrow_constructor.hpp>
|
||||
#include <boost/type_traits/has_nothrow_copy.hpp>
|
||||
#include <boost/type_traits/has_nothrow_destructor.hpp>
|
||||
#include <boost/type_traits/has_plus.hpp>
|
||||
#include <boost/type_traits/has_plus_assign.hpp>
|
||||
#include <boost/type_traits/has_post_decrement.hpp>
|
||||
#include <boost/type_traits/has_post_increment.hpp>
|
||||
#include <boost/type_traits/has_pre_decrement.hpp>
|
||||
#include <boost/type_traits/has_pre_increment.hpp>
|
||||
#include <boost/type_traits/has_right_shift.hpp>
|
||||
#include <boost/type_traits/has_right_shift_assign.hpp>
|
||||
#include <boost/type_traits/has_trivial_assign.hpp>
|
||||
#include <boost/type_traits/has_trivial_constructor.hpp>
|
||||
#include <boost/type_traits/has_trivial_copy.hpp>
|
||||
#include <boost/type_traits/has_trivial_destructor.hpp>
|
||||
#include <boost/type_traits/has_trivial_move_assign.hpp>
|
||||
#include <boost/type_traits/has_trivial_move_constructor.hpp>
|
||||
#include <boost/type_traits/has_unary_minus.hpp>
|
||||
#include <boost/type_traits/has_unary_plus.hpp>
|
||||
#include <boost/type_traits/has_virtual_destructor.hpp>
|
||||
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
#include <boost/type_traits/is_abstract.hpp>
|
||||
#include <boost/type_traits/is_arithmetic.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/type_traits/is_assignable.hpp>
|
||||
#include <boost/type_traits/is_base_and_derived.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/type_traits/is_class.hpp>
|
||||
#include <boost/type_traits/is_complex.hpp>
|
||||
#include <boost/type_traits/is_compound.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/is_copy_assignable.hpp>
|
||||
#include <boost/type_traits/is_copy_constructible.hpp>
|
||||
#include <boost/type_traits/is_default_constructible.hpp>
|
||||
#include <boost/type_traits/is_destructible.hpp>
|
||||
#include <boost/type_traits/is_empty.hpp>
|
||||
#include <boost/type_traits/is_enum.hpp>
|
||||
#include <boost/type_traits/is_final.hpp>
|
||||
#include <boost/type_traits/is_float.hpp>
|
||||
#include <boost/type_traits/is_floating_point.hpp>
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#include <boost/type_traits/is_fundamental.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_list_constructible.hpp>
|
||||
#include <boost/type_traits/is_lvalue_reference.hpp>
|
||||
#include <boost/type_traits/is_member_function_pointer.hpp>
|
||||
#include <boost/type_traits/is_member_object_pointer.hpp>
|
||||
#include <boost/type_traits/is_member_pointer.hpp>
|
||||
#include <boost/type_traits/is_nothrow_move_assignable.hpp>
|
||||
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
|
||||
#include <boost/type_traits/is_nothrow_swappable.hpp>
|
||||
#include <boost/type_traits/is_object.hpp>
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/type_traits/is_polymorphic.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_rvalue_reference.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/is_signed.hpp>
|
||||
#include <boost/type_traits/is_stateless.hpp>
|
||||
#include <boost/type_traits/is_union.hpp>
|
||||
#include <boost/type_traits/is_unsigned.hpp>
|
||||
#include <boost/type_traits/is_virtual_base_of.hpp>
|
||||
#include <boost/type_traits/is_void.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/make_signed.hpp>
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
#include <boost/type_traits/make_void.hpp>
|
||||
#include <boost/type_traits/rank.hpp>
|
||||
#include <boost/type_traits/remove_all_extents.hpp>
|
||||
#include <boost/type_traits/remove_bounds.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/remove_cv_ref.hpp>
|
||||
#include <boost/type_traits/remove_extent.hpp>
|
||||
#include <boost/type_traits/remove_pointer.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/remove_volatile.hpp>
|
||||
#include <boost/type_traits/type_identity.hpp>
|
||||
#include <boost/type_traits/type_with_alignment.hpp>
|
||||
|
||||
#if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238))
|
||||
#include <boost/type_traits/integral_promotion.hpp>
|
||||
#include <boost/type_traits/promote.hpp>
|
||||
#endif
|
||||
|
||||
#endif // BOOST_TYPE_TRAITS_HPP
|
195
boost/type_traits/detail/has_postfix_operator.hpp
Normal file
195
boost/type_traits/detail/has_postfix_operator.hpp
Normal file
@ -0,0 +1,195 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron, Robert Stewart, Steven Watanabe & Roman Perepelitsa.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_fundamental.hpp>
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_void.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/remove_pointer.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
// avoid warnings
|
||||
#if defined(__GNUC__)
|
||||
# pragma GCC system_header
|
||||
#elif defined(BOOST_MSVC)
|
||||
# pragma warning ( push )
|
||||
# pragma warning ( disable : 4244 4913 4800)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
|
||||
# pragma warning ( disable : 6334)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
// This namespace ensures that argument-dependent name lookup does not mess things up.
|
||||
namespace BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) {
|
||||
|
||||
// 1. a function to have an instance of type T without requiring T to be default
|
||||
// constructible
|
||||
template <typename T> T &make();
|
||||
|
||||
|
||||
// 2. we provide our operator definition for types that do not have one already
|
||||
|
||||
// a type returned from operator BOOST_TT_TRAIT_OP when no such operator is
|
||||
// found in the type's own namespace (our own operator is used) so that we have
|
||||
// a means to know that our operator was used
|
||||
struct no_operator { };
|
||||
|
||||
// this class allows implicit conversions and makes the following operator
|
||||
// definition less-preferred than any other such operators that might be found
|
||||
// via argument-dependent name lookup
|
||||
struct any { template <class T> any(T const&); };
|
||||
|
||||
// when operator BOOST_TT_TRAIT_OP is not available, this one is used
|
||||
no_operator operator BOOST_TT_TRAIT_OP (const any&, int);
|
||||
|
||||
|
||||
// 3. checks if the operator returns void or not
|
||||
// conditions: Lhs!=void
|
||||
|
||||
// we first redefine "operator," so that we have no compilation error if
|
||||
// operator BOOST_TT_TRAIT_OP returns void and we can use the return type of
|
||||
// (lhs BOOST_TT_TRAIT_OP, returns_void_t()) to deduce if
|
||||
// operator BOOST_TT_TRAIT_OP returns void or not:
|
||||
// - operator BOOST_TT_TRAIT_OP returns void -> (lhs BOOST_TT_TRAIT_OP, returns_void_t()) returns returns_void_t
|
||||
// - operator BOOST_TT_TRAIT_OP returns !=void -> (lhs BOOST_TT_TRAIT_OP, returns_void_t()) returns int
|
||||
struct returns_void_t { };
|
||||
template <typename T> int operator,(const T&, returns_void_t);
|
||||
template <typename T> int operator,(const volatile T&, returns_void_t);
|
||||
|
||||
// this intermediate trait has member value of type bool:
|
||||
// - value==true -> operator BOOST_TT_TRAIT_OP returns void
|
||||
// - value==false -> operator BOOST_TT_TRAIT_OP does not return void
|
||||
template < typename Lhs >
|
||||
struct operator_returns_void {
|
||||
// overloads of function returns_void make the difference
|
||||
// yes_type and no_type have different size by construction
|
||||
static ::boost::type_traits::yes_type returns_void(returns_void_t);
|
||||
static ::boost::type_traits::no_type returns_void(int);
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((make<Lhs>() BOOST_TT_TRAIT_OP,returns_void_t())))));
|
||||
};
|
||||
|
||||
|
||||
// 4. checks if the return type is Ret or Ret==dont_care
|
||||
// conditions: Lhs!=void
|
||||
|
||||
struct dont_care { };
|
||||
|
||||
template < typename Lhs, typename Ret, bool Returns_void >
|
||||
struct operator_returns_Ret;
|
||||
|
||||
template < typename Lhs >
|
||||
struct operator_returns_Ret < Lhs, dont_care, true > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
template < typename Lhs >
|
||||
struct operator_returns_Ret < Lhs, dont_care, false > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
template < typename Lhs >
|
||||
struct operator_returns_Ret < Lhs, void, true > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
template < typename Lhs >
|
||||
struct operator_returns_Ret < Lhs, void, false > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template < typename Lhs, typename Ret >
|
||||
struct operator_returns_Ret < Lhs, Ret, true > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
// otherwise checks if it is convertible to Ret using the sizeof trick
|
||||
// based on overload resolution
|
||||
// condition: Ret!=void and Ret!=dont_care and the operator does not return void
|
||||
template < typename Lhs, typename Ret >
|
||||
struct operator_returns_Ret < Lhs, Ret, false > {
|
||||
static ::boost::type_traits::yes_type is_convertible_to_Ret(Ret); // this version is preferred for types convertible to Ret
|
||||
static ::boost::type_traits::no_type is_convertible_to_Ret(...); // this version is used otherwise
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(is_convertible_to_Ret(make<Lhs>() BOOST_TT_TRAIT_OP))==sizeof(::boost::type_traits::yes_type)));
|
||||
};
|
||||
|
||||
|
||||
// 5. checks for operator existence
|
||||
// condition: Lhs!=void
|
||||
|
||||
// checks if our definition of operator BOOST_TT_TRAIT_OP is used or an other
|
||||
// existing one;
|
||||
// this is done with redefinition of "operator," that returns no_operator or has_operator
|
||||
struct has_operator { };
|
||||
no_operator operator,(no_operator, has_operator);
|
||||
|
||||
template < typename Lhs >
|
||||
struct operator_exists {
|
||||
static ::boost::type_traits::yes_type s_check(has_operator); // this version is preferred when operator exists
|
||||
static ::boost::type_traits::no_type s_check(no_operator); // this version is used otherwise
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(s_check(((make<Lhs>() BOOST_TT_TRAIT_OP),make<has_operator>())))==sizeof(::boost::type_traits::yes_type)));
|
||||
};
|
||||
|
||||
|
||||
// 6. main trait: to avoid any compilation error, this class behaves
|
||||
// differently when operator BOOST_TT_TRAIT_OP(Lhs) is forbidden by the
|
||||
// standard.
|
||||
// Forbidden_if is a bool that is:
|
||||
// - true when the operator BOOST_TT_TRAIT_OP(Lhs) is forbidden by the standard
|
||||
// (would yield compilation error if used)
|
||||
// - false otherwise
|
||||
template < typename Lhs, typename Ret, bool Forbidden_if >
|
||||
struct trait_impl1;
|
||||
|
||||
template < typename Lhs, typename Ret >
|
||||
struct trait_impl1 < Lhs, Ret, true > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template < typename Lhs, typename Ret >
|
||||
struct trait_impl1 < Lhs, Ret, false > {
|
||||
BOOST_STATIC_CONSTANT(bool,
|
||||
value = (operator_exists < Lhs >::value && operator_returns_Ret < Lhs, Ret, operator_returns_void < Lhs >::value >::value));
|
||||
};
|
||||
|
||||
// specialization needs to be declared for the special void case
|
||||
template < typename Ret >
|
||||
struct trait_impl1 < void, Ret, false > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
// defines some typedef for convenience
|
||||
template < typename Lhs, typename Ret >
|
||||
struct trait_impl {
|
||||
typedef typename ::boost::remove_reference<Lhs>::type Lhs_noref;
|
||||
typedef typename ::boost::remove_cv<Lhs_noref>::type Lhs_nocv;
|
||||
typedef typename ::boost::remove_cv< typename ::boost::remove_reference< typename ::boost::remove_pointer<Lhs_noref>::type >::type >::type Lhs_noptr;
|
||||
BOOST_STATIC_CONSTANT(bool, value = (trait_impl1 < Lhs_noref, Ret, BOOST_TT_FORBIDDEN_IF >::value));
|
||||
};
|
||||
|
||||
} // namespace impl
|
||||
} // namespace detail
|
||||
|
||||
// this is the accessible definition of the trait to end user
|
||||
template <class Lhs, class Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care>
|
||||
struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _impl)::trait_impl< Lhs, Ret >::value)>{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning ( pop )
|
||||
#endif
|
208
boost/type_traits/detail/has_prefix_operator.hpp
Normal file
208
boost/type_traits/detail/has_prefix_operator.hpp
Normal file
@ -0,0 +1,208 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron, Robert Stewart, Steven Watanabe & Roman Perepelitsa.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_fundamental.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_void.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/remove_pointer.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
// cannot include this header without getting warnings of the kind:
|
||||
// gcc:
|
||||
// warning: value computed is not used
|
||||
// warning: comparison between signed and unsigned integer expressions
|
||||
// msvc:
|
||||
// warning C4146: unary minus operator applied to unsigned type, result still unsigned
|
||||
// warning C4804: '-' : unsafe use of type 'bool' in operation
|
||||
// cannot find another implementation -> declared as system header to suppress these warnings.
|
||||
#if defined(__GNUC__)
|
||||
# pragma GCC system_header
|
||||
#elif defined(BOOST_MSVC)
|
||||
# pragma warning ( push )
|
||||
# pragma warning ( disable : 4146 4804 4913 4244 4800)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
|
||||
# pragma warning ( disable : 6334)
|
||||
# endif
|
||||
# if BOOST_WORKAROUND(_MSC_VER, >= 1913)
|
||||
# pragma warning ( disable : 4834)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
// This namespace ensures that argument-dependent name lookup does not mess things up.
|
||||
namespace BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) {
|
||||
|
||||
// 1. a function to have an instance of type T without requiring T to be default
|
||||
// constructible
|
||||
template <typename T> T &make();
|
||||
|
||||
|
||||
// 2. we provide our operator definition for types that do not have one already
|
||||
|
||||
// a type returned from operator BOOST_TT_TRAIT_OP when no such operator is
|
||||
// found in the type's own namespace (our own operator is used) so that we have
|
||||
// a means to know that our operator was used
|
||||
struct no_operator { };
|
||||
|
||||
// this class allows implicit conversions and makes the following operator
|
||||
// definition less-preferred than any other such operators that might be found
|
||||
// via argument-dependent name lookup
|
||||
struct any { template <class T> any(T const&); };
|
||||
|
||||
// when operator BOOST_TT_TRAIT_OP is not available, this one is used
|
||||
no_operator operator BOOST_TT_TRAIT_OP (const any&);
|
||||
|
||||
|
||||
// 3. checks if the operator returns void or not
|
||||
// conditions: Rhs!=void
|
||||
|
||||
// we first redefine "operator," so that we have no compilation error if
|
||||
// operator BOOST_TT_TRAIT_OP returns void and we can use the return type of
|
||||
// (BOOST_TT_TRAIT_OP rhs, returns_void_t()) to deduce if
|
||||
// operator BOOST_TT_TRAIT_OP returns void or not:
|
||||
// - operator BOOST_TT_TRAIT_OP returns void -> (BOOST_TT_TRAIT_OP rhs, returns_void_t()) returns returns_void_t
|
||||
// - operator BOOST_TT_TRAIT_OP returns !=void -> (BOOST_TT_TRAIT_OP rhs, returns_void_t()) returns int
|
||||
struct returns_void_t { };
|
||||
template <typename T> int operator,(const T&, returns_void_t);
|
||||
template <typename T> int operator,(const volatile T&, returns_void_t);
|
||||
|
||||
// this intermediate trait has member value of type bool:
|
||||
// - value==true -> operator BOOST_TT_TRAIT_OP returns void
|
||||
// - value==false -> operator BOOST_TT_TRAIT_OP does not return void
|
||||
template < typename Rhs >
|
||||
struct operator_returns_void {
|
||||
// overloads of function returns_void make the difference
|
||||
// yes_type and no_type have different size by construction
|
||||
static ::boost::type_traits::yes_type returns_void(returns_void_t);
|
||||
static ::boost::type_traits::no_type returns_void(int);
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((BOOST_TT_TRAIT_OP make<Rhs>(),returns_void_t())))));
|
||||
};
|
||||
|
||||
|
||||
// 4. checks if the return type is Ret or Ret==dont_care
|
||||
// conditions: Rhs!=void
|
||||
|
||||
struct dont_care { };
|
||||
|
||||
template < typename Rhs, typename Ret, bool Returns_void >
|
||||
struct operator_returns_Ret;
|
||||
|
||||
template < typename Rhs >
|
||||
struct operator_returns_Ret < Rhs, dont_care, true > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
template < typename Rhs >
|
||||
struct operator_returns_Ret < Rhs, dont_care, false > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
template < typename Rhs >
|
||||
struct operator_returns_Ret < Rhs, void, true > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
};
|
||||
|
||||
template < typename Rhs >
|
||||
struct operator_returns_Ret < Rhs, void, false > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template < typename Rhs, typename Ret >
|
||||
struct operator_returns_Ret < Rhs, Ret, true > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
// otherwise checks if it is convertible to Ret using the sizeof trick
|
||||
// based on overload resolution
|
||||
// condition: Ret!=void and Ret!=dont_care and the operator does not return void
|
||||
template < typename Rhs, typename Ret >
|
||||
struct operator_returns_Ret < Rhs, Ret, false > {
|
||||
static ::boost::type_traits::yes_type is_convertible_to_Ret(Ret); // this version is preferred for types convertible to Ret
|
||||
static ::boost::type_traits::no_type is_convertible_to_Ret(...); // this version is used otherwise
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(is_convertible_to_Ret(BOOST_TT_TRAIT_OP make<Rhs>()))==sizeof(::boost::type_traits::yes_type)));
|
||||
};
|
||||
|
||||
|
||||
// 5. checks for operator existence
|
||||
// condition: Rhs!=void
|
||||
|
||||
// checks if our definition of operator BOOST_TT_TRAIT_OP is used or an other
|
||||
// existing one;
|
||||
// this is done with redefinition of "operator," that returns no_operator or has_operator
|
||||
struct has_operator { };
|
||||
no_operator operator,(no_operator, has_operator);
|
||||
|
||||
template < typename Rhs >
|
||||
struct operator_exists {
|
||||
static ::boost::type_traits::yes_type s_check(has_operator); // this version is preferred when operator exists
|
||||
static ::boost::type_traits::no_type s_check(no_operator); // this version is used otherwise
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(s_check(((BOOST_TT_TRAIT_OP make<Rhs>()),make<has_operator>())))==sizeof(::boost::type_traits::yes_type)));
|
||||
};
|
||||
|
||||
|
||||
// 6. main trait: to avoid any compilation error, this class behaves
|
||||
// differently when operator BOOST_TT_TRAIT_OP(Rhs) is forbidden by the
|
||||
// standard.
|
||||
// Forbidden_if is a bool that is:
|
||||
// - true when the operator BOOST_TT_TRAIT_OP(Rhs) is forbidden by the standard
|
||||
// (would yield compilation error if used)
|
||||
// - false otherwise
|
||||
template < typename Rhs, typename Ret, bool Forbidden_if >
|
||||
struct trait_impl1;
|
||||
|
||||
template < typename Rhs, typename Ret >
|
||||
struct trait_impl1 < Rhs, Ret, true > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template < typename Rhs, typename Ret >
|
||||
struct trait_impl1 < Rhs, Ret, false > {
|
||||
BOOST_STATIC_CONSTANT(bool,
|
||||
value = (operator_exists < Rhs >::value && operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::value));
|
||||
};
|
||||
|
||||
// specialization needs to be declared for the special void case
|
||||
template < typename Ret >
|
||||
struct trait_impl1 < void, Ret, false > {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
// defines some typedef for convenience
|
||||
template < typename Rhs, typename Ret >
|
||||
struct trait_impl {
|
||||
typedef typename ::boost::remove_reference<Rhs>::type Rhs_noref;
|
||||
typedef typename ::boost::remove_cv<Rhs_noref>::type Rhs_nocv;
|
||||
typedef typename ::boost::remove_cv< typename ::boost::remove_reference< typename ::boost::remove_pointer<Rhs_noref>::type >::type >::type Rhs_noptr;
|
||||
BOOST_STATIC_CONSTANT(bool, value = (trait_impl1 < Rhs_noref, Ret, BOOST_TT_FORBIDDEN_IF >::value));
|
||||
};
|
||||
|
||||
} // namespace impl
|
||||
} // namespace detail
|
||||
|
||||
// this is the accessible definition of the trait to end user
|
||||
template <class Rhs, class Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care>
|
||||
struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _impl)::trait_impl < Rhs, Ret >::value)>{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning ( pop )
|
||||
#endif
|
139
boost/type_traits/extent.hpp
Normal file
139
boost/type_traits/extent.hpp
Normal file
@ -0,0 +1,139 @@
|
||||
|
||||
// (C) Copyright John Maddock 2005.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
|
||||
#ifndef BOOST_TT_EXTENT_HPP_INCLUDED
|
||||
#define BOOST_TT_EXTENT_HPP_INCLUDED
|
||||
|
||||
#include <cstddef> // size_t
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail{
|
||||
|
||||
#if defined( __CODEGEARC__ )
|
||||
// wrap the impl as main trait provides additional MPL lambda support
|
||||
template < typename T, std::size_t N >
|
||||
struct extent_imp {
|
||||
static const std::size_t value = __array_extent(T, N);
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template <class T, std::size_t N>
|
||||
struct extent_imp
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = 0);
|
||||
};
|
||||
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
|
||||
template <class T, std::size_t R, std::size_t N>
|
||||
struct extent_imp<T[R], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
|
||||
};
|
||||
|
||||
template <class T, std::size_t R, std::size_t N>
|
||||
struct extent_imp<T const[R], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
|
||||
};
|
||||
|
||||
template <class T, std::size_t R, std::size_t N>
|
||||
struct extent_imp<T volatile[R], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
|
||||
};
|
||||
|
||||
template <class T, std::size_t R, std::size_t N>
|
||||
struct extent_imp<T const volatile[R], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
|
||||
};
|
||||
|
||||
template <class T, std::size_t R>
|
||||
struct extent_imp<T[R],0>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = R);
|
||||
};
|
||||
|
||||
template <class T, std::size_t R>
|
||||
struct extent_imp<T const[R], 0>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = R);
|
||||
};
|
||||
|
||||
template <class T, std::size_t R>
|
||||
struct extent_imp<T volatile[R], 0>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = R);
|
||||
};
|
||||
|
||||
template <class T, std::size_t R>
|
||||
struct extent_imp<T const volatile[R], 0>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = R);
|
||||
};
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) && !defined(__MWERKS__)
|
||||
template <class T, std::size_t N>
|
||||
struct extent_imp<T[], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
|
||||
};
|
||||
template <class T, std::size_t N>
|
||||
struct extent_imp<T const[], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
|
||||
};
|
||||
template <class T, std::size_t N>
|
||||
struct extent_imp<T volatile[], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
|
||||
};
|
||||
template <class T, std::size_t N>
|
||||
struct extent_imp<T const volatile[], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
|
||||
};
|
||||
template <class T>
|
||||
struct extent_imp<T[], 0>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = 0);
|
||||
};
|
||||
template <class T>
|
||||
struct extent_imp<T const[], 0>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = 0);
|
||||
};
|
||||
template <class T>
|
||||
struct extent_imp<T volatile[], 0>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = 0);
|
||||
};
|
||||
template <class T>
|
||||
struct extent_imp<T const volatile[], 0>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = 0);
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // non-CodeGear implementation
|
||||
} // ::boost::detail
|
||||
|
||||
template <class T, std::size_t N = 0>
|
||||
struct extent
|
||||
: public ::boost::integral_constant<std::size_t, ::boost::detail::extent_imp<T,N>::value>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
|
28
boost/type_traits/floating_point_promotion.hpp
Normal file
28
boost/type_traits/floating_point_promotion.hpp
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright 2005 Alexander Nasonov.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED
|
||||
#define FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class T> struct floating_point_promotion { typedef T type; };
|
||||
template<> struct floating_point_promotion<float> { typedef double type; };
|
||||
template<> struct floating_point_promotion<float const> { typedef double const type; };
|
||||
template<> struct floating_point_promotion<float volatile>{ typedef double volatile type; };
|
||||
template<> struct floating_point_promotion<float const volatile> { typedef double const volatile type; };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using floating_point_promotion_t = typename floating_point_promotion<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED
|
||||
|
49
boost/type_traits/has_bit_and.hpp
Normal file
49
boost/type_traits/has_bit_and.hpp
Normal file
@ -0,0 +1,49 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_BIT_AND_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_BIT_AND_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_bit_and
|
||||
#define BOOST_TT_TRAIT_OP &
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
( \
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
55
boost/type_traits/has_bit_and_assign.hpp
Normal file
55
boost/type_traits/has_bit_and_assign.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_BIT_AND_ASSIGN_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_BIT_AND_ASSIGN_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_bit_and_assign
|
||||
#define BOOST_TT_TRAIT_OP &=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
(\
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_const< Lhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
49
boost/type_traits/has_bit_or.hpp
Normal file
49
boost/type_traits/has_bit_or.hpp
Normal file
@ -0,0 +1,49 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_BIT_OR_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_BIT_OR_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_bit_or
|
||||
#define BOOST_TT_TRAIT_OP |
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
( \
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
55
boost/type_traits/has_bit_or_assign.hpp
Normal file
55
boost/type_traits/has_bit_or_assign.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_BIT_OR_ASSIGN_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_BIT_OR_ASSIGN_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_bit_or_assign
|
||||
#define BOOST_TT_TRAIT_OP |=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
( \
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_const< Lhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
49
boost/type_traits/has_bit_xor.hpp
Normal file
49
boost/type_traits/has_bit_xor.hpp
Normal file
@ -0,0 +1,49 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_BIT_XOR_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_BIT_XOR_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_bit_xor
|
||||
#define BOOST_TT_TRAIT_OP ^
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
( \
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
55
boost/type_traits/has_bit_xor_assign.hpp
Normal file
55
boost/type_traits/has_bit_xor_assign.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_BIT_XOR_ASSIGN_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_BIT_XOR_ASSIGN_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_bit_xor_assign
|
||||
#define BOOST_TT_TRAIT_OP ^=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
( \
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_const< Lhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
32
boost/type_traits/has_complement.hpp
Normal file
32
boost/type_traits/has_complement.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_COMPLEMENT_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_COMPLEMENT_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_complement
|
||||
#define BOOST_TT_TRAIT_OP ~
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* pointer */\
|
||||
::boost::is_pointer< Rhs_noref >::value || \
|
||||
/* fundamental non integral */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_noref >::value && \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_prefix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
31
boost/type_traits/has_dereference.hpp
Normal file
31
boost/type_traits/has_dereference.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_dereference
|
||||
#define BOOST_TT_TRAIT_OP *
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
/* void* or fundamental */\
|
||||
(\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
) || \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_prefix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
40
boost/type_traits/has_divides.hpp
Normal file
40
boost/type_traits/has_divides.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_DIVIDES_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_DIVIDES_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_divides
|
||||
#define BOOST_TT_TRAIT_OP /
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
/* pointer with pointer or fundamental */\
|
||||
(\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
( \
|
||||
::boost::is_fundamental< Rhs_nocv >::value || \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)\
|
||||
)||\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
( \
|
||||
::boost::is_fundamental< Lhs_nocv >::value || \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
47
boost/type_traits/has_divides_assign.hpp
Normal file
47
boost/type_traits/has_divides_assign.hpp
Normal file
@ -0,0 +1,47 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_DIVIDES_ASSIGN_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_DIVIDES_ASSIGN_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_divides_assign
|
||||
#define BOOST_TT_TRAIT_OP /=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Lhs==const and Rhs==fundamental */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_const< Lhs_noref >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
) || \
|
||||
/* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
( \
|
||||
::boost::is_fundamental< Rhs_nocv >::value || \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)\
|
||||
)||\
|
||||
/* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
( \
|
||||
::boost::is_fundamental< Lhs_nocv >::value || \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
52
boost/type_traits/has_equal_to.hpp
Normal file
52
boost/type_traits/has_equal_to.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_EQUAL_TO_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_EQUAL_TO_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_equal_to
|
||||
#define BOOST_TT_TRAIT_OP ==
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==pointer and Rhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
) || \
|
||||
/* Rhs==pointer and Lhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_fundamental< Lhs_nocv >::value\
|
||||
) || \
|
||||
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
(! \
|
||||
(\
|
||||
::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
|
||||
::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_void< Lhs_noptr >::value || \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
)\
|
||||
)\
|
||||
) || \
|
||||
(\
|
||||
::boost::type_traits_detail::is_likely_stateless_lambda<Lhs_noref>::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
52
boost/type_traits/has_greater.hpp
Normal file
52
boost/type_traits/has_greater.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_GREATER_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_GREATER_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_greater
|
||||
#define BOOST_TT_TRAIT_OP >
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==pointer and Rhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
) || \
|
||||
/* Rhs==pointer and Lhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_fundamental< Lhs_nocv >::value\
|
||||
) || \
|
||||
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
(! \
|
||||
( \
|
||||
::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
|
||||
::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_void< Lhs_noptr >::value || \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
)\
|
||||
)\
|
||||
) || \
|
||||
(\
|
||||
::boost::type_traits_detail::is_likely_stateless_lambda<Lhs_noref>::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
52
boost/type_traits/has_greater_equal.hpp
Normal file
52
boost/type_traits/has_greater_equal.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_GREATER_EQUAL_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_GREATER_EQUAL_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_greater_equal
|
||||
#define BOOST_TT_TRAIT_OP >=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==pointer and Rhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
) || \
|
||||
/* Rhs==pointer and Lhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_fundamental< Lhs_nocv >::value\
|
||||
) || \
|
||||
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
(! \
|
||||
( \
|
||||
::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
|
||||
::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_void< Lhs_noptr >::value || \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
)\
|
||||
)\
|
||||
) || \
|
||||
(\
|
||||
::boost::type_traits_detail::is_likely_stateless_lambda<Lhs_noref>::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
55
boost/type_traits/has_left_shift_assign.hpp
Normal file
55
boost/type_traits/has_left_shift_assign.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_LEFT_SHIFT_ASSIGN_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_LEFT_SHIFT_ASSIGN_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_left_shift_assign
|
||||
#define BOOST_TT_TRAIT_OP <<=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
( \
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_const< Lhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
52
boost/type_traits/has_less.hpp
Normal file
52
boost/type_traits/has_less.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_LESS_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_LESS_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_less
|
||||
#define BOOST_TT_TRAIT_OP <
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==pointer and Rhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
) || \
|
||||
/* Rhs==pointer and Lhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_fundamental< Lhs_nocv >::value\
|
||||
) || \
|
||||
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
(! \
|
||||
( \
|
||||
::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
|
||||
::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_void< Lhs_noptr >::value || \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
)\
|
||||
)\
|
||||
) || \
|
||||
(\
|
||||
::boost::type_traits_detail::is_likely_stateless_lambda<Lhs_noref>::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
52
boost/type_traits/has_less_equal.hpp
Normal file
52
boost/type_traits/has_less_equal.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_LESS_EQUAL_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_LESS_EQUAL_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_less_equal
|
||||
#define BOOST_TT_TRAIT_OP <=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==pointer and Rhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
) || \
|
||||
/* Rhs==pointer and Lhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_fundamental< Lhs_nocv >::value\
|
||||
) || \
|
||||
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
(! \
|
||||
( \
|
||||
::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
|
||||
::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_void< Lhs_noptr >::value || \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
)\
|
||||
)\
|
||||
) || \
|
||||
(\
|
||||
::boost::type_traits_detail::is_likely_stateless_lambda<Lhs_noref>::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
40
boost/type_traits/has_logical_and.hpp
Normal file
40
boost/type_traits/has_logical_and.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_LOGICAL_AND_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_LOGICAL_AND_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_logical_and
|
||||
#define BOOST_TT_TRAIT_OP &&
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
/* pointer with fundamental non convertible to bool */\
|
||||
(\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
( \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
(! ::boost::is_convertible< Rhs_nocv, bool >::value )\
|
||||
)\
|
||||
)||\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
( \
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
(! ::boost::is_convertible< Lhs_nocv, bool >::value )\
|
||||
)\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
32
boost/type_traits/has_logical_not.hpp
Normal file
32
boost/type_traits/has_logical_not.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_LOGICAL_NOT_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_LOGICAL_NOT_HPP_INCLUDED
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ > 40800)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-value"
|
||||
#endif
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_logical_not
|
||||
#define BOOST_TT_TRAIT_OP !
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
false
|
||||
|
||||
#include <boost/type_traits/detail/has_prefix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ > 40800)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
40
boost/type_traits/has_logical_or.hpp
Normal file
40
boost/type_traits/has_logical_or.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_LOGICAL_OR_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_LOGICAL_OR_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_logical_or
|
||||
#define BOOST_TT_TRAIT_OP ||
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
/* pointer with fundamental non convertible to bool */\
|
||||
(\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
(! ::boost::is_convertible< Rhs_nocv, bool >::value )\
|
||||
)\
|
||||
)||\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
(! ::boost::is_convertible< Lhs_nocv, bool >::value )\
|
||||
)\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
49
boost/type_traits/has_modulus.hpp
Normal file
49
boost/type_traits/has_modulus.hpp
Normal file
@ -0,0 +1,49 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_MODULUS_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_MODULUS_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_modulus
|
||||
#define BOOST_TT_TRAIT_OP %
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
(\
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
55
boost/type_traits/has_modulus_assign.hpp
Normal file
55
boost/type_traits/has_modulus_assign.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_MODULUS_ASSIGN_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_MODULUS_ASSIGN_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_modulus_assign
|
||||
#define BOOST_TT_TRAIT_OP %=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
( \
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_const< Lhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
40
boost/type_traits/has_multiplies.hpp
Normal file
40
boost/type_traits/has_multiplies.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_MULTIPLIES_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_MULTIPLIES_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_multiplies
|
||||
#define BOOST_TT_TRAIT_OP *
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
/* pointer with pointer or fundamental */\
|
||||
(\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value || \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)\
|
||||
)||\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value || \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
47
boost/type_traits/has_multiplies_assign.hpp
Normal file
47
boost/type_traits/has_multiplies_assign.hpp
Normal file
@ -0,0 +1,47 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_MULTIPLIES_ASSIGN_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_MULTIPLIES_ASSIGN_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_multiplies_assign
|
||||
#define BOOST_TT_TRAIT_OP *=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Lhs==const and Rhs==fundamental */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_const< Lhs_noref >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
) || \
|
||||
/* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
( \
|
||||
::boost::is_fundamental< Rhs_nocv >::value || \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)\
|
||||
)||\
|
||||
/* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
( \
|
||||
::boost::is_fundamental< Lhs_nocv >::value || \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
25
boost/type_traits/has_negate.hpp
Normal file
25
boost/type_traits/has_negate.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_NEGATE_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_NEGATE_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_negate
|
||||
#define BOOST_TT_TRAIT_OP -
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
/* pointer */\
|
||||
::boost::is_pointer< Rhs_noref >::value
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_prefix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
147
boost/type_traits/has_new_operator.hpp
Normal file
147
boost/type_traits/has_new_operator.hpp
Normal file
@ -0,0 +1,147 @@
|
||||
|
||||
// (C) Copyright Runar Undheim, Robert Ramey & John Maddock 2008.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED
|
||||
|
||||
#include <new> // std::nothrow_t
|
||||
#include <cstddef> // std::size_t
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if defined(new)
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, >= 1310)
|
||||
# define BOOST_TT_AUX_MACRO_NEW_DEFINED
|
||||
# pragma push_macro("new")
|
||||
# undef new
|
||||
# else
|
||||
# error "Sorry but you can't include this header if 'new' is defined as a macro."
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
template <class U, U x>
|
||||
struct test;
|
||||
|
||||
template <typename T>
|
||||
struct has_new_operator_impl {
|
||||
template<class U>
|
||||
static type_traits::yes_type check_sig1(
|
||||
U*,
|
||||
test<
|
||||
void *(*)(std::size_t),
|
||||
&U::operator new
|
||||
>* = NULL
|
||||
);
|
||||
template<class U>
|
||||
static type_traits::no_type check_sig1(...);
|
||||
|
||||
template<class U>
|
||||
static type_traits::yes_type check_sig2(
|
||||
U*,
|
||||
test<
|
||||
void *(*)(std::size_t, const std::nothrow_t&),
|
||||
&U::operator new
|
||||
>* = NULL
|
||||
);
|
||||
template<class U>
|
||||
static type_traits::no_type check_sig2(...);
|
||||
|
||||
template<class U>
|
||||
static type_traits::yes_type check_sig3(
|
||||
U*,
|
||||
test<
|
||||
void *(*)(std::size_t, void*),
|
||||
&U::operator new
|
||||
>* = NULL
|
||||
);
|
||||
template<class U>
|
||||
static type_traits::no_type check_sig3(...);
|
||||
|
||||
|
||||
template<class U>
|
||||
static type_traits::yes_type check_sig4(
|
||||
U*,
|
||||
test<
|
||||
void *(*)(std::size_t),
|
||||
&U::operator new[]
|
||||
>* = NULL
|
||||
);
|
||||
template<class U>
|
||||
static type_traits::no_type check_sig4(...);
|
||||
|
||||
template<class U>
|
||||
static type_traits::yes_type check_sig5(
|
||||
U*,
|
||||
test<
|
||||
void *(*)(std::size_t, const std::nothrow_t&),
|
||||
&U::operator new[]
|
||||
>* = NULL
|
||||
);
|
||||
template<class U>
|
||||
static type_traits::no_type check_sig5(...);
|
||||
|
||||
template<class U>
|
||||
static type_traits::yes_type check_sig6(
|
||||
U*,
|
||||
test<
|
||||
void *(*)(std::size_t, void*),
|
||||
&U::operator new[]
|
||||
>* = NULL
|
||||
);
|
||||
template<class U>
|
||||
static type_traits::no_type check_sig6(...);
|
||||
|
||||
// GCC2 won't even parse this template if we embed the computation
|
||||
// of s1 in the computation of value.
|
||||
#ifdef __GNUC__
|
||||
BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(has_new_operator_impl<T>::template check_sig1<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(has_new_operator_impl<T>::template check_sig2<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s3 = sizeof(has_new_operator_impl<T>::template check_sig3<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s4 = sizeof(has_new_operator_impl<T>::template check_sig4<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s5 = sizeof(has_new_operator_impl<T>::template check_sig5<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s6 = sizeof(has_new_operator_impl<T>::template check_sig6<T>(0)));
|
||||
#else
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:6334)
|
||||
#endif
|
||||
|
||||
BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig1<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(check_sig2<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s3 = sizeof(check_sig3<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s4 = sizeof(check_sig4<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s5 = sizeof(check_sig5<T>(0)));
|
||||
BOOST_STATIC_CONSTANT(unsigned, s6 = sizeof(check_sig6<T>(0)));
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#endif
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(s1 == sizeof(type_traits::yes_type)) ||
|
||||
(s2 == sizeof(type_traits::yes_type)) ||
|
||||
(s3 == sizeof(type_traits::yes_type)) ||
|
||||
(s4 == sizeof(type_traits::yes_type)) ||
|
||||
(s5 == sizeof(type_traits::yes_type)) ||
|
||||
(s6 == sizeof(type_traits::yes_type))
|
||||
);
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
template <class T> struct has_new_operator : public integral_constant<bool, ::boost::detail::has_new_operator_impl<T>::value>{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if defined(BOOST_TT_AUX_MACRO_NEW_DEFINED)
|
||||
# pragma pop_macro("new")
|
||||
#endif
|
||||
|
||||
#endif // BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED
|
52
boost/type_traits/has_not_equal_to.hpp
Normal file
52
boost/type_traits/has_not_equal_to.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_NOT_EQUAL_TO_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_NOT_EQUAL_TO_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_not_equal_to
|
||||
#define BOOST_TT_TRAIT_OP !=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==pointer and Rhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value\
|
||||
) || \
|
||||
/* Rhs==pointer and Lhs==fundamental */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_fundamental< Lhs_nocv >::value\
|
||||
) || \
|
||||
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
(! \
|
||||
(\
|
||||
::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
|
||||
::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
|
||||
::boost::is_void< Lhs_noptr >::value || \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
)\
|
||||
)\
|
||||
) || \
|
||||
(\
|
||||
::boost::type_traits_detail::is_likely_stateless_lambda<Lhs_noref>::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
56
boost/type_traits/has_nothrow_destructor.hpp
Normal file
56
boost/type_traits/has_nothrow_destructor.hpp
Normal file
@ -0,0 +1,56 @@
|
||||
|
||||
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/has_trivial_destructor.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(__SUNPRO_CC) && !(defined(BOOST_MSVC) && (_MSC_FULL_VER < 190023506))
|
||||
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/is_destructible.hpp>
|
||||
#include <boost/type_traits/is_complete.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace detail{
|
||||
|
||||
template <class T, bool b>
|
||||
struct has_nothrow_destructor_imp : public boost::integral_constant<bool, false>{};
|
||||
template <class T>
|
||||
struct has_nothrow_destructor_imp<T, true> : public boost::integral_constant<bool, noexcept(boost::declval<T*&>()->~T())>{};
|
||||
|
||||
}
|
||||
|
||||
template <class T> struct has_nothrow_destructor : public detail::has_nothrow_destructor_imp<T, boost::is_destructible<T>::value>
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(boost::is_complete<T>::value, "Arguments to has_nothrow_destructor must be complete types");
|
||||
};
|
||||
template <class T, std::size_t N> struct has_nothrow_destructor<T[N]> : public has_nothrow_destructor<T>
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(boost::is_complete<T>::value, "Arguments to has_nothrow_destructor must be complete types");
|
||||
};
|
||||
template <class T> struct has_nothrow_destructor<T&> : public integral_constant<bool, false>{};
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <class T> struct has_nothrow_destructor<T&&> : public integral_constant<bool, false>{};
|
||||
#endif
|
||||
template <> struct has_nothrow_destructor<void> : public false_type {};
|
||||
}
|
||||
#else
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct has_nothrow_destructor : public ::boost::has_trivial_destructor<T> {};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
|
44
boost/type_traits/has_post_decrement.hpp
Normal file
44
boost/type_traits/has_post_decrement.hpp
Normal file
@ -0,0 +1,44 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_post_decrement
|
||||
#define BOOST_TT_TRAIT_OP --
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* bool */\
|
||||
::boost::is_same< bool, Lhs_nocv >::value || \
|
||||
/* void* */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_void< Lhs_noptr >::value\
|
||||
) || \
|
||||
/* (fundamental or pointer) and const */\
|
||||
(\
|
||||
( \
|
||||
::boost::is_fundamental< Lhs_nocv >::value || \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
) && \
|
||||
::boost::is_const< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Arrays */ \
|
||||
::boost::is_array<Lhs_noref>::value\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_postfix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
44
boost/type_traits/has_post_increment.hpp
Normal file
44
boost/type_traits/has_post_increment.hpp
Normal file
@ -0,0 +1,44 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_POST_INCREMENT_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_POST_INCREMENT_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_post_increment
|
||||
#define BOOST_TT_TRAIT_OP ++
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* bool */\
|
||||
::boost::is_same< bool, Lhs_nocv >::value || \
|
||||
/* void* */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_void< Lhs_noptr >::value\
|
||||
) || \
|
||||
/* (fundamental or pointer) and const */\
|
||||
(\
|
||||
( \
|
||||
::boost::is_fundamental< Lhs_nocv >::value || \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
) && \
|
||||
::boost::is_const< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Arrays */ \
|
||||
::boost::is_array<Lhs_noref>::value\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_postfix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
44
boost/type_traits/has_pre_decrement.hpp
Normal file
44
boost/type_traits/has_pre_decrement.hpp
Normal file
@ -0,0 +1,44 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_PRE_DECREMENT_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_PRE_DECREMENT_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_pre_decrement
|
||||
#define BOOST_TT_TRAIT_OP --
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* bool */\
|
||||
::boost::is_same< bool, Rhs_nocv >::value || \
|
||||
/* void* */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
) || \
|
||||
/* (fundamental or pointer) and const */\
|
||||
(\
|
||||
( \
|
||||
::boost::is_fundamental< Rhs_nocv >::value || \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
) && \
|
||||
::boost::is_const< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Arrays */ \
|
||||
::boost::is_array<Rhs_noref>::value\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_prefix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
44
boost/type_traits/has_pre_increment.hpp
Normal file
44
boost/type_traits/has_pre_increment.hpp
Normal file
@ -0,0 +1,44 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_PRE_INCREMENT_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_PRE_INCREMENT_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_pre_increment
|
||||
#define BOOST_TT_TRAIT_OP ++
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* bool */\
|
||||
::boost::is_same< bool, Rhs_nocv >::value || \
|
||||
/* void* */\
|
||||
(\
|
||||
::boost::is_pointer< Rhs_noref >::value && \
|
||||
::boost::is_void< Rhs_noptr >::value\
|
||||
) || \
|
||||
/* (fundamental or pointer) and const */\
|
||||
(\
|
||||
( \
|
||||
::boost::is_fundamental< Rhs_nocv >::value || \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
) && \
|
||||
::boost::is_const< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Arrays */ \
|
||||
::boost::is_array<Rhs_noref>::value\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_prefix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
55
boost/type_traits/has_right_shift_assign.hpp
Normal file
55
boost/type_traits/has_right_shift_assign.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_RIGHT_SHIFT_ASSIGN_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_RIGHT_SHIFT_ASSIGN_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_right_shift_assign
|
||||
#define BOOST_TT_TRAIT_OP >>=
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
(\
|
||||
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
( \
|
||||
(! ::boost::is_integral< Lhs_noref >::value ) || \
|
||||
(! ::boost::is_integral< Rhs_noref >::value )\
|
||||
)\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Rhs==fundamental and Lhs==pointer */\
|
||||
(\
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_pointer< Lhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==pointer and Rhs==pointer */\
|
||||
(\
|
||||
::boost::is_pointer< Lhs_noref >::value && \
|
||||
::boost::is_pointer< Rhs_noref >::value\
|
||||
)||\
|
||||
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
|
||||
(\
|
||||
::boost::is_fundamental< Lhs_nocv >::value && \
|
||||
::boost::is_fundamental< Rhs_nocv >::value && \
|
||||
::boost::is_const< Lhs_noref >::value\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_binary_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
25
boost/type_traits/has_unary_minus.hpp
Normal file
25
boost/type_traits/has_unary_minus.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_UNARY_MINUS_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_UNARY_MINUS_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_unary_minus
|
||||
#define BOOST_TT_TRAIT_OP -
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
/* pointer */\
|
||||
::boost::is_pointer< Rhs_noref >::value
|
||||
|
||||
|
||||
#include <boost/type_traits/detail/has_prefix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
23
boost/type_traits/has_unary_plus.hpp
Normal file
23
boost/type_traits/has_unary_plus.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
// (C) Copyright 2009-2011 Frederic Bron.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_HAS_UNARY_PLUS_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_UNARY_PLUS_HPP_INCLUDED
|
||||
|
||||
#define BOOST_TT_TRAIT_NAME has_unary_plus
|
||||
#define BOOST_TT_TRAIT_OP +
|
||||
#define BOOST_TT_FORBIDDEN_IF\
|
||||
false
|
||||
|
||||
#include <boost/type_traits/detail/has_prefix_operator.hpp>
|
||||
|
||||
#undef BOOST_TT_TRAIT_NAME
|
||||
#undef BOOST_TT_TRAIT_OP
|
||||
#undef BOOST_TT_FORBIDDEN_IF
|
||||
|
||||
#endif
|
26
boost/type_traits/has_virtual_destructor.hpp
Normal file
26
boost/type_traits/has_virtual_destructor.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
// (C) Copyright John Maddock 2005.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
|
||||
#ifndef BOOST_TT_HAS_VIRTUAL_DESTRUCTOR_HPP_INCLUDED
|
||||
#define BOOST_TT_HAS_VIRTUAL_DESTRUCTOR_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/intrinsics.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
#ifdef BOOST_HAS_VIRTUAL_DESTRUCTOR
|
||||
template <class T> struct has_virtual_destructor : public integral_constant<bool, BOOST_HAS_VIRTUAL_DESTRUCTOR(T)>{};
|
||||
#else
|
||||
template <class T> struct has_virtual_destructor : public integral_constant<bool, false>{};
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
|
187
boost/type_traits/integral_promotion.hpp
Normal file
187
boost/type_traits/integral_promotion.hpp
Normal file
@ -0,0 +1,187 @@
|
||||
// Copyright 2005 Alexander Nasonov.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED
|
||||
#define FILE_boost_type_traits_integral_promotion_hpp_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_enum.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace type_traits { namespace detail {
|
||||
|
||||
// 4.5/2
|
||||
template <class T> struct need_promotion : public boost::is_enum<T> {};
|
||||
|
||||
// 4.5/1
|
||||
template<> struct need_promotion<char > : public true_type {};
|
||||
template<> struct need_promotion<signed char > : public true_type {};
|
||||
template<> struct need_promotion<unsigned char > : public true_type {};
|
||||
template<> struct need_promotion<signed short int > : public true_type {};
|
||||
template<> struct need_promotion<unsigned short int> : public true_type {};
|
||||
|
||||
|
||||
// Specializations for non-standard types.
|
||||
// Type is promoted if it's smaller then int.
|
||||
|
||||
#define BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(T) \
|
||||
template<> struct need_promotion<T> \
|
||||
: public integral_constant<bool, (sizeof(T) < sizeof(int))> {};
|
||||
|
||||
// Same set of integral types as in boost/type_traits/is_integral.hpp.
|
||||
// Please, keep in sync.
|
||||
#if (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \
|
||||
|| (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300))
|
||||
// TODO: common macro for this #if. Or better yet, PP SEQ of non-standard types.
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int8 )
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int8 )
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int16 )
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int16)
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int32 )
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int32)
|
||||
#ifdef __BORLANDC__
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int64)
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_LONG_LONG)
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(boost::ulong_long_type)
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(boost::long_long_type )
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int64)
|
||||
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64)
|
||||
#endif
|
||||
|
||||
#undef BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE
|
||||
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
// 4.5/2
|
||||
template<> struct need_promotion<wchar_t> : public true_type {};
|
||||
#endif
|
||||
|
||||
// 4.5/3 (integral bit-field) is not supported.
|
||||
|
||||
// 4.5/4
|
||||
template<> struct need_promotion<bool> : public true_type {};
|
||||
|
||||
|
||||
// Get promoted type by index and cv qualifiers.
|
||||
|
||||
template<int Index, int IsConst, int IsVolatile> struct promote_from_index;
|
||||
|
||||
#define BOOST_TT_AUX_PROMOTE_FROM_INDEX(N,T) \
|
||||
template<> struct promote_from_index<N,0,0> { typedef T type; }; \
|
||||
template<> struct promote_from_index<N,0,1> { typedef T volatile type; }; \
|
||||
template<> struct promote_from_index<N,1,0> { typedef T const type; }; \
|
||||
template<> struct promote_from_index<N,1,1> { typedef T const volatile type; };
|
||||
|
||||
|
||||
BOOST_TT_AUX_PROMOTE_FROM_INDEX(1, int )
|
||||
BOOST_TT_AUX_PROMOTE_FROM_INDEX(2, unsigned int )
|
||||
BOOST_TT_AUX_PROMOTE_FROM_INDEX(3, long )
|
||||
BOOST_TT_AUX_PROMOTE_FROM_INDEX(4, unsigned long)
|
||||
|
||||
|
||||
// WARNING: integral promotions to non-standard types
|
||||
// long long and __int64 are not defined by the standard.
|
||||
// Additional specialisations and overloads shouldn't
|
||||
// introduce ambiguity, though.
|
||||
|
||||
#if defined(BOOST_HAS_LONG_LONG)
|
||||
BOOST_TT_AUX_PROMOTE_FROM_INDEX(5, boost::long_long_type )
|
||||
BOOST_TT_AUX_PROMOTE_FROM_INDEX(6, boost::ulong_long_type)
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
BOOST_TT_AUX_PROMOTE_FROM_INDEX(7, __int64 )
|
||||
BOOST_TT_AUX_PROMOTE_FROM_INDEX(8, unsigned __int64)
|
||||
#endif
|
||||
|
||||
#undef BOOST_TT_AUX_PROMOTE_FROM_INDEX
|
||||
|
||||
|
||||
// Define BOOST_TT_AUX_PROMOTED_INDEX_TESTER:
|
||||
#if !defined(BOOST_MSVC)
|
||||
|
||||
template<int N>
|
||||
struct sized_type_for_promotion
|
||||
{
|
||||
typedef char (&type)[N];
|
||||
};
|
||||
|
||||
#define BOOST_TT_AUX_PROMOTED_INDEX_TESTER(I,T) \
|
||||
sized_type_for_promotion<I>::type promoted_index_tester(T);
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_TT_AUX_PROMOTED_INDEX_TESTER(I,T) \
|
||||
char (&promoted_index_tester(T))[I];
|
||||
|
||||
#endif
|
||||
|
||||
BOOST_TT_AUX_PROMOTED_INDEX_TESTER(1, int )
|
||||
BOOST_TT_AUX_PROMOTED_INDEX_TESTER(2, unsigned int )
|
||||
BOOST_TT_AUX_PROMOTED_INDEX_TESTER(3, long )
|
||||
BOOST_TT_AUX_PROMOTED_INDEX_TESTER(4, unsigned long)
|
||||
|
||||
#if defined(BOOST_HAS_LONG_LONG)
|
||||
BOOST_TT_AUX_PROMOTED_INDEX_TESTER(5, boost::long_long_type )
|
||||
BOOST_TT_AUX_PROMOTED_INDEX_TESTER(6, boost::ulong_long_type)
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
BOOST_TT_AUX_PROMOTED_INDEX_TESTER(7, __int64 )
|
||||
BOOST_TT_AUX_PROMOTED_INDEX_TESTER(8, unsigned __int64)
|
||||
#endif
|
||||
|
||||
#undef BOOST_TT_AUX_PROMOTED_INDEX_TESTER
|
||||
|
||||
|
||||
// Get an index of promoted type for type T.
|
||||
// Precondition: need_promotion<T>
|
||||
template<class T>
|
||||
struct promoted_index
|
||||
{
|
||||
static T testee; // undefined
|
||||
BOOST_STATIC_CONSTANT(int, value = sizeof(promoted_index_tester(+testee)) );
|
||||
// Unary plus promotes testee LOOK HERE ---> ^
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct integral_promotion_impl
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME promote_from_index<
|
||||
(boost::type_traits::detail::promoted_index<T>::value)
|
||||
, (boost::is_const<T>::value)
|
||||
, (boost::is_volatile<T>::value)
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template<class T, bool b> struct integral_promotion { typedef T type; };
|
||||
template<class T> struct integral_promotion<T, true> : public integral_promotion_impl<T>{};
|
||||
|
||||
} }
|
||||
|
||||
template <class T> struct integral_promotion
|
||||
{
|
||||
private:
|
||||
typedef boost::type_traits::detail::need_promotion<typename remove_cv<T>::type> tag_type;
|
||||
public:
|
||||
typedef typename boost::type_traits::detail::integral_promotion<T, tag_type::value>::type type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using integral_promotion_t = typename integral_promotion<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED
|
||||
|
25
boost/type_traits/is_complex.hpp
Normal file
25
boost/type_traits/is_complex.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_IS_COMPLEX_HPP
|
||||
#define BOOST_TT_IS_COMPLEX_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <complex>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct is_complex : public false_type {};
|
||||
template <class T> struct is_complex<const T > : public is_complex<T>{};
|
||||
template <class T> struct is_complex<volatile const T > : public is_complex<T>{};
|
||||
template <class T> struct is_complex<volatile T > : public is_complex<T>{};
|
||||
template <class T> struct is_complex<std::complex<T> > : public true_type{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif //BOOST_TT_IS_COMPLEX_HPP
|
24
boost/type_traits/is_compound.hpp
Normal file
24
boost/type_traits/is_compound.hpp
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_IS_COMPOUND_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_COMPOUND_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_fundamental.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
#if defined( __CODEGEARC__ )
|
||||
template <class T> struct is_compound : public integral_constant<bool, __is_compound(T)> {};
|
||||
#else
|
||||
template <class T> struct is_compound : public integral_constant<bool, ! ::boost::is_fundamental<T>::value> {};
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_COMPOUND_HPP_INCLUDED
|
141
boost/type_traits/is_copy_assignable.hpp
Normal file
141
boost/type_traits/is_copy_assignable.hpp
Normal file
@ -0,0 +1,141 @@
|
||||
// (C) Copyright Ion Gaztanaga 2014.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
#include <boost/type_traits/is_base_and_derived.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_NO_CXX11_DECLTYPE) \
|
||||
&& !defined(BOOST_INTEL_CXX_VERSION) && \
|
||||
!(defined(BOOST_MSVC) && _MSC_VER == 1800)
|
||||
#define BOOST_TT_CXX11_IS_COPY_ASSIGNABLE
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#else
|
||||
//For compilers without decltype
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail{
|
||||
|
||||
template <bool DerivedFromNoncopyable, class T>
|
||||
struct is_copy_assignable_impl2 {
|
||||
|
||||
// Intel compiler has problems with SFINAE for copy constructors and deleted functions:
|
||||
//
|
||||
// error: function *function_name* cannot be referenced -- it is a deleted function
|
||||
// static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval<T1&>()))* = 0);
|
||||
// ^
|
||||
//
|
||||
// MSVC 12.0 (Visual 2013) has problems when the copy constructor has been deleted. See:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken
|
||||
#if defined(BOOST_TT_CXX11_IS_COPY_ASSIGNABLE)
|
||||
typedef boost::type_traits::yes_type yes_type;
|
||||
typedef boost::type_traits::no_type no_type;
|
||||
|
||||
template <class U>
|
||||
static decltype(::boost::declval<U&>() = ::boost::declval<const U&>(), yes_type() ) test(int);
|
||||
|
||||
template <class>
|
||||
static no_type test(...);
|
||||
|
||||
static const bool value = sizeof(test<T>(0)) == sizeof(yes_type);
|
||||
|
||||
#else
|
||||
static BOOST_DEDUCED_TYPENAME boost::add_reference<T>::type produce();
|
||||
|
||||
template <class T1>
|
||||
static boost::type_traits::no_type test(T1&, typename T1::boost_move_no_copy_constructor_or_assign* = 0);
|
||||
|
||||
static boost::type_traits::yes_type test(...);
|
||||
// If you see errors like this:
|
||||
//
|
||||
// `'T::operator=(const T&)' is private`
|
||||
// `boost/type_traits/is_copy_assignable.hpp:NN:M: error: within this context`
|
||||
//
|
||||
// then you are trying to call that macro for a structure defined like that:
|
||||
//
|
||||
// struct T {
|
||||
// ...
|
||||
// private:
|
||||
// T & operator=(const T &);
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// To fix that you must modify your structure:
|
||||
//
|
||||
// // C++03 and C++11 version
|
||||
// struct T: private boost::noncopyable {
|
||||
// ...
|
||||
// private:
|
||||
// T & operator=(const T &);
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// // C++11 version
|
||||
// struct T {
|
||||
// ...
|
||||
// private:
|
||||
// T& operator=(const T &) = delete;
|
||||
// ...
|
||||
// };
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
sizeof(test(produce())) == sizeof(boost::type_traits::yes_type)
|
||||
));
|
||||
#endif
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_copy_assignable_impl2<true, T> {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_copy_assignable_impl {
|
||||
|
||||
#if !defined(BOOST_TT_CXX11_IS_COPY_ASSIGNABLE)
|
||||
//For compilers without decltype, at least return false on const types, arrays
|
||||
//types derived from boost::noncopyable and types defined as BOOST_MOVEABLE_BUT_NOT_COPYABLE
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::remove_reference<T>::type unreferenced_t;
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
boost::detail::is_copy_assignable_impl2<
|
||||
boost::is_base_and_derived<boost::noncopyable, T>::value
|
||||
|| boost::is_const<unreferenced_t>::value || boost::is_array<unreferenced_t>::value
|
||||
,T
|
||||
>::value
|
||||
));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
boost::detail::is_copy_assignable_impl2<
|
||||
boost::is_base_and_derived<boost::noncopyable, T>::value,T
|
||||
>::value
|
||||
));
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <class T> struct is_copy_assignable : public integral_constant<bool, ::boost::detail::is_copy_assignable_impl<T>::value>{};
|
||||
template <> struct is_copy_assignable<void> : public false_type{};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <> struct is_copy_assignable<void const> : public false_type{};
|
||||
template <> struct is_copy_assignable<void const volatile> : public false_type{};
|
||||
template <> struct is_copy_assignable<void volatile> : public false_type{};
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
|
120
boost/type_traits/is_empty.hpp
Normal file
120
boost/type_traits/is_empty.hpp
Normal file
@ -0,0 +1,120 @@
|
||||
|
||||
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_IS_EMPTY_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_EMPTY_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/detail/config.hpp>
|
||||
#include <boost/type_traits/intrinsics.hpp>
|
||||
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/is_class.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
|
||||
#ifndef BOOST_INTERNAL_IS_EMPTY
|
||||
#define BOOST_INTERNAL_IS_EMPTY(T) false
|
||||
#else
|
||||
#define BOOST_INTERNAL_IS_EMPTY(T) BOOST_IS_EMPTY(T)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail {
|
||||
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4624) // destructor could not be generated
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
struct empty_helper_t1 : public T
|
||||
{
|
||||
empty_helper_t1(); // hh compiler bug workaround
|
||||
int i[256];
|
||||
private:
|
||||
// suppress compiler warnings:
|
||||
empty_helper_t1(const empty_helper_t1&);
|
||||
empty_helper_t1& operator=(const empty_helper_t1&);
|
||||
};
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
struct empty_helper_t2 { int i[256]; };
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
|
||||
template <typename T, bool is_a_class = false>
|
||||
struct empty_helper
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct empty_helper<T, true>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value = (sizeof(empty_helper_t1<T>) == sizeof(empty_helper_t2))
|
||||
);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_empty_impl
|
||||
{
|
||||
typedef typename remove_cv<T>::type cvt;
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool,
|
||||
value = ( ::boost::detail::empty_helper<cvt,::boost::is_class<T>::value>::value || BOOST_INTERNAL_IS_EMPTY(cvt)));
|
||||
};
|
||||
|
||||
#else // __BORLANDC__
|
||||
|
||||
template <typename T, bool is_a_class, bool convertible_to_int>
|
||||
struct empty_helper
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct empty_helper<T, true, false>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
sizeof(empty_helper_t1<T>) == sizeof(empty_helper_t2)
|
||||
));
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_empty_impl
|
||||
{
|
||||
typedef typename remove_cv<T>::type cvt;
|
||||
typedef typename add_reference<T>::type r_type;
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value = (
|
||||
::boost::detail::empty_helper<
|
||||
cvt
|
||||
, ::boost::is_class<T>::value
|
||||
, ::boost::is_convertible< r_type,int>::value
|
||||
>::value || BOOST_INTERNAL_IS_EMPTY(cvt));
|
||||
};
|
||||
|
||||
#endif // __BORLANDC__
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <class T> struct is_empty : integral_constant<bool, ::boost::detail::is_empty_impl<T>::value> {};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#undef BOOST_INTERNAL_IS_EMPTY
|
||||
|
||||
#endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED
|
||||
|
30
boost/type_traits/is_final.hpp
Normal file
30
boost/type_traits/is_final.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
// Copyright (c) 2014 Agustin Berge
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
|
||||
#ifndef BOOST_TT_IS_FINAL_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_FINAL_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/intrinsics.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#ifdef BOOST_IS_FINAL
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
#ifdef BOOST_IS_FINAL
|
||||
template <class T> struct is_final : public integral_constant<bool, BOOST_IS_FINAL(typename remove_cv<T>::type)> {};
|
||||
#else
|
||||
template <class T> struct is_final : public integral_constant<bool, false> {};
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_FINAL_HPP_INCLUDED
|
48
boost/type_traits/is_list_constructible.hpp
Normal file
48
boost/type_traits/is_list_constructible.hpp
Normal file
@ -0,0 +1,48 @@
|
||||
#ifndef BOOST_TYPE_TRAITS_IS_LIST_CONSTRUCTIBLE_HPP_INCLUDED
|
||||
#define BOOST_TYPE_TRAITS_IS_LIST_CONSTRUCTIBLE_HPP_INCLUDED
|
||||
|
||||
// Copyright 2017 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/is_complete.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
#if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_DECLTYPE) \
|
||||
|| defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)\
|
||||
|| BOOST_WORKAROUND(BOOST_GCC, < 40700)
|
||||
|
||||
template<class T, class = void, class = void, class = void, class = void, class = void, class = void> struct is_list_constructible: false_type
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(boost::is_complete<T>::value, "Arguments to is_list_constructible must be complete types");
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
namespace type_traits_detail
|
||||
{
|
||||
|
||||
template<class T, class... A, class = decltype( T{declval<A>()...} )> true_type is_list_constructible_impl( int );
|
||||
template<class T, class... A> false_type is_list_constructible_impl( ... );
|
||||
|
||||
} // namespace type_traits_detail
|
||||
|
||||
template<class T, class... A> struct is_list_constructible: decltype( type_traits_detail::is_list_constructible_impl<T, A...>(0) )
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(boost::is_complete<T>::value, "Arguments to is_list_constructible must be complete types");
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_TYPE_TRAITS_IS_LIST_CONSTRUCTIBLE_HPP_INCLUDED
|
24
boost/type_traits/is_member_object_pointer.hpp
Normal file
24
boost/type_traits/is_member_object_pointer.hpp
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
// (C) Copyright John Maddock 2005.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
|
||||
#ifndef BOOST_TT_IS_MEMBER_OBJECT_POINTER_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_MEMBER_OBJECT_POINTER_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_member_pointer.hpp>
|
||||
#include <boost/type_traits/is_member_function_pointer.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct is_member_object_pointer
|
||||
: public integral_constant<bool,
|
||||
::boost::is_member_pointer<T>::value && !::boost::is_member_function_pointer<T>::value>{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
|
67
boost/type_traits/is_nothrow_swappable.hpp
Normal file
67
boost/type_traits/is_nothrow_swappable.hpp
Normal file
@ -0,0 +1,67 @@
|
||||
#ifndef BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_HPP_INCLUDED
|
||||
#define BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_HPP_INCLUDED
|
||||
|
||||
// Copyright 2017 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_DECLTYPE) \
|
||||
|| defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) || BOOST_WORKAROUND(BOOST_GCC, < 40700)
|
||||
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <class T> struct is_nothrow_swappable : boost::integral_constant<bool,
|
||||
boost::is_scalar<T>::value && !boost::is_const<T>::value> {};
|
||||
|
||||
template <class T, class U> struct is_nothrow_swappable_with : false_type {};
|
||||
template <class T> struct is_nothrow_swappable_with<T, T> : is_nothrow_swappable<T> {};
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace type_traits_swappable_detail
|
||||
{
|
||||
|
||||
using std::swap;
|
||||
|
||||
template<class T, class U, bool B = noexcept(swap(declval<T>(), declval<U>()))> integral_constant<bool, B> is_nothrow_swappable_with_impl( int );
|
||||
template<class T, class U> false_type is_nothrow_swappable_with_impl( ... );
|
||||
template<class T, class U>
|
||||
struct is_nothrow_swappable_with_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_with_impl<T, U>(0) ) type; };
|
||||
|
||||
template<class T, bool B = noexcept(swap(declval<T&>(), declval<T&>()))> integral_constant<bool, B> is_nothrow_swappable_impl( int );
|
||||
template<class T> false_type is_nothrow_swappable_impl( ... );
|
||||
template<class T>
|
||||
struct is_nothrow_swappable_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_impl<T>(0) ) type; };
|
||||
|
||||
} // namespace type_traits_swappable_detail
|
||||
|
||||
template<class T, class U> struct is_nothrow_swappable_with: type_traits_swappable_detail::is_nothrow_swappable_with_helper<T, U>::type
|
||||
{
|
||||
};
|
||||
|
||||
template<class T> struct is_nothrow_swappable: type_traits_swappable_detail::is_nothrow_swappable_helper<T>::type
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_HPP_INCLUDED
|
28
boost/type_traits/is_object.hpp
Normal file
28
boost/type_traits/is_object.hpp
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_IS_OBJECT_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_OBJECT_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_void.hpp>
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct is_object
|
||||
: public
|
||||
integral_constant<
|
||||
bool,
|
||||
! ::boost::is_reference<T>::value && ! ::boost::is_void<T>::value && ! ::boost::is_function<T>::value >
|
||||
{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_OBJECT_HPP_INCLUDED
|
33
boost/type_traits/is_stateless.hpp
Normal file
33
boost/type_traits/is_stateless.hpp
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_IS_STATELESS_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_STATELESS_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/has_trivial_constructor.hpp>
|
||||
#include <boost/type_traits/has_trivial_copy.hpp>
|
||||
#include <boost/type_traits/has_trivial_destructor.hpp>
|
||||
#include <boost/type_traits/is_class.hpp>
|
||||
#include <boost/type_traits/is_empty.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T>
|
||||
struct is_stateless
|
||||
: public integral_constant<bool,
|
||||
(::boost::has_trivial_constructor<T>::value
|
||||
&& ::boost::has_trivial_copy<T>::value
|
||||
&& ::boost::has_trivial_destructor<T>::value
|
||||
&& ::boost::is_class<T>::value
|
||||
&& ::boost::is_empty<T>::value)>
|
||||
{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_STATELESS_HPP_INCLUDED
|
105
boost/type_traits/is_virtual_base_of.hpp
Normal file
105
boost/type_traits/is_virtual_base_of.hpp
Normal file
@ -0,0 +1,105 @@
|
||||
// (C) Copyright Daniel Frey and Robert Ramey 2009.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4584 4250 4594)
|
||||
#elif defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
template<typename Base, typename Derived, typename tag>
|
||||
struct is_virtual_base_of_impl
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template<typename Base, typename Derived>
|
||||
struct is_virtual_base_of_impl<Base, Derived, true_type>
|
||||
{
|
||||
union max_align
|
||||
{
|
||||
unsigned u;
|
||||
unsigned long ul;
|
||||
void* v;
|
||||
double d;
|
||||
long double ld;
|
||||
#ifndef BOOST_NO_LONG_LONG
|
||||
long long ll;
|
||||
#endif
|
||||
};
|
||||
#ifdef __BORLANDC__
|
||||
struct boost_type_traits_internal_struct_X : public virtual Derived, public virtual Base
|
||||
{
|
||||
boost_type_traits_internal_struct_X();
|
||||
boost_type_traits_internal_struct_X(const boost_type_traits_internal_struct_X&);
|
||||
boost_type_traits_internal_struct_X& operator=(const boost_type_traits_internal_struct_X&);
|
||||
~boost_type_traits_internal_struct_X()throw();
|
||||
max_align data[4];
|
||||
};
|
||||
struct boost_type_traits_internal_struct_Y : public virtual Derived
|
||||
{
|
||||
boost_type_traits_internal_struct_Y();
|
||||
boost_type_traits_internal_struct_Y(const boost_type_traits_internal_struct_Y&);
|
||||
boost_type_traits_internal_struct_Y& operator=(const boost_type_traits_internal_struct_Y&);
|
||||
~boost_type_traits_internal_struct_Y()throw();
|
||||
max_align data[4];
|
||||
};
|
||||
#else
|
||||
struct boost_type_traits_internal_struct_X : public Derived, virtual Base
|
||||
{
|
||||
boost_type_traits_internal_struct_X();
|
||||
boost_type_traits_internal_struct_X(const boost_type_traits_internal_struct_X&);
|
||||
boost_type_traits_internal_struct_X& operator=(const boost_type_traits_internal_struct_X&);
|
||||
~boost_type_traits_internal_struct_X()throw();
|
||||
max_align data[16];
|
||||
};
|
||||
struct boost_type_traits_internal_struct_Y : public Derived
|
||||
{
|
||||
boost_type_traits_internal_struct_Y();
|
||||
boost_type_traits_internal_struct_Y(const boost_type_traits_internal_struct_Y&);
|
||||
boost_type_traits_internal_struct_Y& operator=(const boost_type_traits_internal_struct_Y&);
|
||||
~boost_type_traits_internal_struct_Y()throw();
|
||||
max_align data[16];
|
||||
};
|
||||
#endif
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(boost_type_traits_internal_struct_X)==sizeof(boost_type_traits_internal_struct_Y)));
|
||||
};
|
||||
|
||||
template<typename Base, typename Derived>
|
||||
struct is_virtual_base_of_impl2
|
||||
{
|
||||
typedef boost::integral_constant<bool, (boost::is_base_of<Base, Derived>::value && ! boost::is_same<Base, Derived>::value)> tag_type;
|
||||
typedef is_virtual_base_of_impl<Base, Derived, tag_type> imp;
|
||||
BOOST_STATIC_CONSTANT(bool, value = imp::value);
|
||||
};
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <class Base, class Derived> struct is_virtual_base_of : public integral_constant<bool, (::boost::detail::is_virtual_base_of_impl2<Base, Derived>::value)>{};
|
||||
|
||||
template <class Base, class Derived> struct is_virtual_base_of<Base&, Derived> : public false_type{};
|
||||
template <class Base, class Derived> struct is_virtual_base_of<Base, Derived&> : public false_type{};
|
||||
template <class Base, class Derived> struct is_virtual_base_of<Base&, Derived&> : public false_type{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
26
boost/type_traits/promote.hpp
Normal file
26
boost/type_traits/promote.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright 2005 Alexander Nasonov.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef FILE_boost_type_traits_promote_hpp_INCLUDED
|
||||
#define FILE_boost_type_traits_promote_hpp_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/integral_promotion.hpp>
|
||||
#include <boost/type_traits/floating_point_promotion.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class T> struct promote : public integral_promotion<typename floating_point_promotion<T>::type>{};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using promote_t = typename promote<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // #ifndef FILE_boost_type_traits_promote_hpp_INCLUDED
|
||||
|
87
boost/type_traits/rank.hpp
Normal file
87
boost/type_traits/rank.hpp
Normal file
@ -0,0 +1,87 @@
|
||||
|
||||
// (C) Copyright John Maddock 2005.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
|
||||
#ifndef BOOST_TT_RANK_HPP_INCLUDED
|
||||
#define BOOST_TT_RANK_HPP_INCLUDED
|
||||
|
||||
#include <cstddef> // size_t
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
#if !defined( __CODEGEARC__ )
|
||||
|
||||
namespace detail{
|
||||
|
||||
template <class T, std::size_t N>
|
||||
struct rank_imp
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = N);
|
||||
};
|
||||
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
|
||||
template <class T, std::size_t R, std::size_t N>
|
||||
struct rank_imp<T[R], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
|
||||
};
|
||||
|
||||
template <class T, std::size_t R, std::size_t N>
|
||||
struct rank_imp<T const[R], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
|
||||
};
|
||||
|
||||
template <class T, std::size_t R, std::size_t N>
|
||||
struct rank_imp<T volatile[R], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
|
||||
};
|
||||
|
||||
template <class T, std::size_t R, std::size_t N>
|
||||
struct rank_imp<T const volatile[R], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
|
||||
};
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
|
||||
template <class T, std::size_t N>
|
||||
struct rank_imp<T[], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
|
||||
};
|
||||
template <class T, std::size_t N>
|
||||
struct rank_imp<T const[], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
|
||||
};
|
||||
template <class T, std::size_t N>
|
||||
struct rank_imp<T volatile[], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
|
||||
};
|
||||
template <class T, std::size_t N>
|
||||
struct rank_imp<T const volatile[], N>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // !defined( __CODEGEARC__ )
|
||||
|
||||
#if defined( __CODEGEARC__ )
|
||||
template <class T> struct rank : public integral_constant<std::size_t, __array_rank(T)>{};
|
||||
#else
|
||||
template <class T> struct rank : public integral_constant<std::size_t, (::boost::detail::rank_imp<T, 0>::value)>{};
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
|
30
boost/type_traits/remove_cv_ref.hpp
Normal file
30
boost/type_traits/remove_cv_ref.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
// (C) Copyright Peter Dimov 2017.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
|
||||
#ifndef BOOST_TT_REMOVE_CV_REF_HPP_INCLUDED
|
||||
#define BOOST_TT_REMOVE_CV_REF_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct remove_cv_ref: remove_cv<typename remove_reference<T>::type> {};
|
||||
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template <class T> using remove_cv_ref_t = typename remove_cv_ref<T>::type;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_REMOVE_CV_REF_HPP_INCLUDED
|
36
boost/utility/detail/in_place_factory_prefix.hpp
Normal file
36
boost/utility/detail/in_place_factory_prefix.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
|
||||
// Copyright (C) 2007, Tobias Schwinger.
|
||||
//
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/optional for documentation.
|
||||
//
|
||||
// You are welcome to contact the author at:
|
||||
// fernando_cacciola@hotmail.com
|
||||
//
|
||||
#ifndef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_04APR2007_HPP
|
||||
#define BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_04APR2007_HPP
|
||||
|
||||
#include <new>
|
||||
#include <cstddef>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/punctuation/paren.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||
|
||||
#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT(z,n,_) BOOST_PP_CAT(m_a,n) BOOST_PP_LPAREN() BOOST_PP_CAT(a,n) BOOST_PP_RPAREN()
|
||||
#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL(z,n,_) BOOST_PP_CAT(A,n) const& BOOST_PP_CAT(m_a,n);
|
||||
|
||||
#define BOOST_MAX_INPLACE_FACTORY_ARITY 10
|
||||
|
||||
#undef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_04APR2007_HPP
|
||||
|
||||
#endif
|
||||
|
23
boost/utility/detail/in_place_factory_suffix.hpp
Normal file
23
boost/utility/detail/in_place_factory_suffix.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
|
||||
// Copyright (C) 2007, Tobias Schwinger.
|
||||
//
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/optional for documentation.
|
||||
//
|
||||
// You are welcome to contact the author at:
|
||||
// fernando_cacciola@hotmail.com
|
||||
//
|
||||
#ifndef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_04APR2007_HPP
|
||||
#define BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_04APR2007_HPP
|
||||
|
||||
#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT
|
||||
#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL
|
||||
#undef BOOST_MAX_INPLACE_FACTORY_ARITY
|
||||
|
||||
#undef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_04APR2007_HPP
|
||||
|
||||
#endif
|
||||
|
86
boost/utility/in_place_factory.hpp
Normal file
86
boost/utility/in_place_factory.hpp
Normal file
@ -0,0 +1,86 @@
|
||||
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
|
||||
// Copyright (C) 2007, Tobias Schwinger.
|
||||
//
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/optional for documentation.
|
||||
//
|
||||
// You are welcome to contact the author at:
|
||||
// fernando_cacciola@hotmail.com
|
||||
//
|
||||
#ifndef BOOST_UTILITY_INPLACE_FACTORY_04APR2007_HPP
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
|
||||
#include <boost/utility/detail/in_place_factory_prefix.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
class in_place_factory_base {} ;
|
||||
|
||||
#define BOOST_PP_ITERATION_LIMITS (0, BOOST_MAX_INPLACE_FACTORY_ARITY)
|
||||
#define BOOST_PP_FILENAME_1 <boost/utility/in_place_factory.hpp>
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/utility/detail/in_place_factory_suffix.hpp>
|
||||
|
||||
#define BOOST_UTILITY_INPLACE_FACTORY_04APR2007_HPP
|
||||
#else
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
#if N
|
||||
template< BOOST_PP_ENUM_PARAMS(N, class A) >
|
||||
#endif
|
||||
class BOOST_PP_CAT(in_place_factory,N)
|
||||
:
|
||||
public in_place_factory_base
|
||||
{
|
||||
public:
|
||||
|
||||
explicit BOOST_PP_CAT(in_place_factory,N)
|
||||
( BOOST_PP_ENUM_BINARY_PARAMS(N,A,const& a) )
|
||||
#if N > 0
|
||||
: BOOST_PP_ENUM(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _)
|
||||
#endif
|
||||
{}
|
||||
|
||||
template<class T>
|
||||
void* apply(void* address) const
|
||||
{
|
||||
return new(address) T( BOOST_PP_ENUM_PARAMS(N, m_a) );
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void* apply(void* address, std::size_t n) const
|
||||
{
|
||||
for(char* next = address = this->BOOST_NESTED_TEMPLATE apply<T>(address);
|
||||
!! --n;)
|
||||
this->BOOST_NESTED_TEMPLATE apply<T>(next = next+sizeof(T));
|
||||
return address;
|
||||
}
|
||||
|
||||
BOOST_PP_REPEAT(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _)
|
||||
};
|
||||
|
||||
#if N > 0
|
||||
template< BOOST_PP_ENUM_PARAMS(N, class A) >
|
||||
inline BOOST_PP_CAT(in_place_factory,N)< BOOST_PP_ENUM_PARAMS(N, A) >
|
||||
in_place( BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a) )
|
||||
{
|
||||
return BOOST_PP_CAT(in_place_factory,N)< BOOST_PP_ENUM_PARAMS(N, A) >
|
||||
( BOOST_PP_ENUM_PARAMS(N, a) );
|
||||
}
|
||||
#else
|
||||
inline in_place_factory0 in_place()
|
||||
{
|
||||
return in_place_factory0();
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef N
|
||||
#endif
|
||||
#endif
|
||||
|
77
boost/utility/typed_in_place_factory.hpp
Normal file
77
boost/utility/typed_in_place_factory.hpp
Normal file
@ -0,0 +1,77 @@
|
||||
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
|
||||
// Copyright (C) 2007, Tobias Schwinger.
|
||||
//
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/optional for documentation.
|
||||
//
|
||||
// You are welcome to contact the author at:
|
||||
// fernando_cacciola@hotmail.com
|
||||
//
|
||||
#ifndef BOOST_UTILITY_TYPED_INPLACE_FACTORY_04APR2007_HPP
|
||||
#ifndef BOOST_PP_IS_ITERATING
|
||||
|
||||
#include <boost/utility/detail/in_place_factory_prefix.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
class typed_in_place_factory_base {} ;
|
||||
|
||||
#define BOOST_PP_ITERATION_LIMITS (0, BOOST_MAX_INPLACE_FACTORY_ARITY)
|
||||
#define BOOST_PP_FILENAME_1 <boost/utility/typed_in_place_factory.hpp>
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/utility/detail/in_place_factory_suffix.hpp>
|
||||
|
||||
#define BOOST_UTILITY_TYPED_INPLACE_FACTORY_04APR2007_HPP
|
||||
#else
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
template< class T BOOST_PP_ENUM_TRAILING_PARAMS(N,class A) >
|
||||
class BOOST_PP_CAT(typed_in_place_factory,N)
|
||||
:
|
||||
public typed_in_place_factory_base
|
||||
{
|
||||
public:
|
||||
|
||||
typedef T value_type;
|
||||
|
||||
explicit BOOST_PP_CAT(typed_in_place_factory,N)
|
||||
( BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a) )
|
||||
#if N > 0
|
||||
: BOOST_PP_ENUM(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _)
|
||||
#endif
|
||||
{}
|
||||
|
||||
void* apply (void* address) const
|
||||
{
|
||||
return new(address) T( BOOST_PP_ENUM_PARAMS(N, m_a) );
|
||||
}
|
||||
|
||||
void* apply (void* address, std::size_t n) const
|
||||
{
|
||||
for(void* next = address = this->apply(address); !! --n;)
|
||||
this->apply(next = static_cast<char *>(next) + sizeof(T));
|
||||
return address;
|
||||
}
|
||||
|
||||
BOOST_PP_REPEAT(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _)
|
||||
};
|
||||
|
||||
template< class T BOOST_PP_ENUM_TRAILING_PARAMS(N, class A) >
|
||||
inline BOOST_PP_CAT(typed_in_place_factory,N)<
|
||||
T BOOST_PP_ENUM_TRAILING_PARAMS(N, A) >
|
||||
in_place( BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a) )
|
||||
{
|
||||
return BOOST_PP_CAT(typed_in_place_factory,N)<
|
||||
T BOOST_PP_ENUM_TRAILING_PARAMS(N, A) >( BOOST_PP_ENUM_PARAMS(N, a) );
|
||||
}
|
||||
|
||||
#undef N
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user