Add boost::optional

This commit is contained in:
MerryMage 2016-01-25 23:31:44 +00:00
parent d81b926990
commit 0482e6b8cb
114 changed files with 9062 additions and 0 deletions

143
boost/aligned_storage.hpp Normal file
View File

@ -0,0 +1,143 @@
//-----------------------------------------------------------------------------
// boost aligned_storage.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002-2003
// Eric Friedman, Itay Maman
//
// 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 BOOST_ALIGNED_STORAGE_HPP
#define BOOST_ALIGNED_STORAGE_HPP
#include <cstddef> // for std::size_t
#include "boost/config.hpp"
#include "boost/detail/workaround.hpp"
#include "boost/type_traits/alignment_of.hpp"
#include "boost/type_traits/type_with_alignment.hpp"
#include "boost/type_traits/is_pod.hpp"
#include "boost/mpl/eval_if.hpp"
#include "boost/mpl/identity.hpp"
#include "boost/type_traits/detail/bool_trait_def.hpp"
namespace boost {
namespace detail { namespace aligned_storage {
BOOST_STATIC_CONSTANT(
std::size_t
, alignment_of_max_align = ::boost::alignment_of<max_align>::value
);
//
// To be TR1 conforming this must be a POD type:
//
template <
std::size_t size_
, std::size_t alignment_
>
struct aligned_storage_imp
{
union data_t
{
char buf[size_];
typename ::boost::mpl::eval_if_c<
alignment_ == std::size_t(-1)
, ::boost::mpl::identity< ::boost::detail::max_align >
, ::boost::type_with_alignment<alignment_>
>::type align_;
} data_;
void* address() const { return const_cast<aligned_storage_imp*>(this); }
};
template< std::size_t alignment_ >
struct aligned_storage_imp<0u,alignment_>
{
/* intentionally empty */
void* address() const { return 0; }
};
}} // namespace detail::aligned_storage
template <
std::size_t size_
, std::size_t alignment_ = std::size_t(-1)
>
class aligned_storage :
#ifndef __BORLANDC__
private
#else
public
#endif
::boost::detail::aligned_storage::aligned_storage_imp<size_, alignment_>
{
public: // constants
typedef ::boost::detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
BOOST_STATIC_CONSTANT(
std::size_t
, size = size_
);
BOOST_STATIC_CONSTANT(
std::size_t
, alignment = (
alignment_ == std::size_t(-1)
? ::boost::detail::aligned_storage::alignment_of_max_align
: alignment_
)
);
private: // noncopyable
aligned_storage(const aligned_storage&);
aligned_storage& operator=(const aligned_storage&);
public: // structors
aligned_storage()
{
}
~aligned_storage()
{
}
public: // accessors
void* address()
{
return static_cast<type*>(this)->address();
}
const void* address() const
{
return static_cast<const type*>(this)->address();
}
};
//
// Make sure that is_pod recognises aligned_storage<>::type
// as a POD (Note that aligned_storage<> itself is not a POD):
//
template <std::size_t size_, std::size_t alignment_>
struct is_pod< ::boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> >
BOOST_TT_AUX_BOOL_C_BASE(true)
{
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true)
};
} // namespace boost
#include "boost/type_traits/detail/bool_trait_undef.hpp"
#endif // BOOST_ALIGNED_STORAGE_HPP

View File

@ -0,0 +1,154 @@
/*
* Copyright Andrey Semashev 2007 - 2013.
* 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)
*/
/*!
* \file explicit_operator_bool.hpp
* \author Andrey Semashev
* \date 08.03.2009
*
* This header defines a compatibility macro that implements an unspecified
* \c bool operator idiom, which is superseded with explicit conversion operators in
* C++11.
*/
#ifndef BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP
#define BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP
#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
/*!
* \brief The macro defines an explicit operator of conversion to \c bool
*
* The macro should be used inside the definition of a class that has to
* support the conversion. The class should also implement <tt>operator!</tt>,
* in terms of which the conversion operator will be implemented.
*/
#define BOOST_EXPLICIT_OPERATOR_BOOL()\
BOOST_FORCEINLINE explicit operator bool () const\
{\
return !this->operator! ();\
}
/*!
* \brief The macro defines a noexcept explicit operator of conversion to \c bool
*
* The macro should be used inside the definition of a class that has to
* support the conversion. The class should also implement <tt>operator!</tt>,
* in terms of which the conversion operator will be implemented.
*/
#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\
BOOST_FORCEINLINE explicit operator bool () const BOOST_NOEXCEPT\
{\
return !this->operator! ();\
}
/*!
* \brief The macro defines a constexpr explicit operator of conversion to \c bool
*
* The macro should be used inside the definition of a class that has to
* support the conversion. The class should also implement <tt>operator!</tt>,
* in terms of which the conversion operator will be implemented.
*/
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
BOOST_FORCEINLINE BOOST_CONSTEXPR explicit operator bool () const BOOST_NOEXCEPT\
{\
return !this->operator! ();\
}
#else // !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
#if (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) && !defined(BOOST_NO_COMPILER_CONFIG)
// Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it
#define BOOST_NO_UNSPECIFIED_BOOL
#endif // (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) && !defined(BOOST_NO_COMPILER_CONFIG)
#if !defined(BOOST_NO_UNSPECIFIED_BOOL)
namespace boost {
namespace detail {
#if !defined(_MSC_VER) && !defined(__IBMCPP__)
struct unspecified_bool
{
// NOTE TO THE USER: If you see this in error messages then you tried
// to apply an unsupported operator on the object that supports
// explicit conversion to bool.
struct OPERATORS_NOT_ALLOWED;
static void true_value(OPERATORS_NOT_ALLOWED*) {}
};
typedef void (*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*);
#else
// MSVC and VACPP are too eager to convert pointer to function to void* even though they shouldn't
struct unspecified_bool
{
// NOTE TO THE USER: If you see this in error messages then you tried
// to apply an unsupported operator on the object that supports
// explicit conversion to bool.
struct OPERATORS_NOT_ALLOWED;
void true_value(OPERATORS_NOT_ALLOWED*) {}
};
typedef void (unspecified_bool::*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*);
#endif
} // namespace detail
} // namespace boost
#define BOOST_EXPLICIT_OPERATOR_BOOL()\
BOOST_FORCEINLINE operator boost::detail::unspecified_bool_type () const\
{\
return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
}
#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\
BOOST_FORCEINLINE operator boost::detail::unspecified_bool_type () const BOOST_NOEXCEPT\
{\
return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
}
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
BOOST_FORCEINLINE BOOST_CONSTEXPR operator boost::detail::unspecified_bool_type () const BOOST_NOEXCEPT\
{\
return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
}
#else // !defined(BOOST_NO_UNSPECIFIED_BOOL)
#define BOOST_EXPLICIT_OPERATOR_BOOL()\
BOOST_FORCEINLINE operator bool () const\
{\
return !this->operator! ();\
}
#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\
BOOST_FORCEINLINE operator bool () const BOOST_NOEXCEPT\
{\
return !this->operator! ();\
}
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
BOOST_FORCEINLINE BOOST_CONSTEXPR operator bool () const BOOST_NOEXCEPT\
{\
return !this->operator! ();\
}
#endif // !defined(BOOST_NO_UNSPECIFIED_BOOL)
#endif // !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
#endif // BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP

60
boost/core/swap.hpp Normal file
View File

@ -0,0 +1,60 @@
// Copyright (C) 2007, 2008 Steven Watanabe, Joseph Gauterin, Niels Dekker
//
// 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)
// For more information, see http://www.boost.org
#ifndef BOOST_CORE_SWAP_HPP
#define BOOST_CORE_SWAP_HPP
// Note: the implementation of this utility contains various workarounds:
// - swap_impl is put outside the boost namespace, to avoid infinite
// recursion (causing stack overflow) when swapping objects of a primitive
// type.
// - swap_impl has a using-directive, rather than a using-declaration,
// because some compilers (including MSVC 7.1, Borland 5.9.3, and
// Intel 8.1) don't do argument-dependent lookup when it has a
// using-declaration instead.
// - boost::swap has two template arguments, instead of one, to
// avoid ambiguity when swapping objects of a Boost type that does
// not have its own boost::swap overload.
#include <utility> //for std::swap (C++11)
#include <algorithm> //for std::swap (C++98)
#include <cstddef> //for std::size_t
#include <boost/config.hpp>
namespace boost_swap_impl
{
template<class T>
BOOST_GPU_ENABLED
void swap_impl(T& left, T& right)
{
using namespace std;//use std::swap if argument dependent lookup fails
swap(left,right);
}
template<class T, std::size_t N>
BOOST_GPU_ENABLED
void swap_impl(T (& left)[N], T (& right)[N])
{
for (std::size_t i = 0; i < N; ++i)
{
::boost_swap_impl::swap_impl(left[i], right[i]);
}
}
}
namespace boost
{
template<class T1, class T2>
BOOST_GPU_ENABLED
void swap(T1& left, T2& right)
{
::boost_swap_impl::swap_impl(left, right);
}
}
#endif

View File

@ -0,0 +1,120 @@
//-----------------------------------------------------------------------------
// boost detail/reference_content.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2003
// Eric Friedman
//
// 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 BOOST_DETAIL_REFERENCE_CONTENT_HPP
#define BOOST_DETAIL_REFERENCE_CONTENT_HPP
#include "boost/config.hpp"
# include "boost/mpl/bool.hpp"
# include "boost/type_traits/has_nothrow_copy.hpp"
#include "boost/mpl/void.hpp"
namespace boost {
namespace detail {
///////////////////////////////////////////////////////////////////////////////
// (detail) class template reference_content
//
// Non-Assignable wrapper for references.
//
template <typename RefT>
class reference_content
{
private: // representation
RefT content_;
public: // structors
~reference_content()
{
}
reference_content(RefT r)
: content_( r )
{
}
reference_content(const reference_content& operand)
: content_( operand.content_ )
{
}
private: // non-Assignable
reference_content& operator=(const reference_content&);
public: // queries
RefT get() const
{
return content_;
}
};
///////////////////////////////////////////////////////////////////////////////
// (detail) metafunction make_reference_content
//
// Wraps with reference_content if specified type is reference.
//
template <typename T = mpl::void_> struct make_reference_content;
template <typename T>
struct make_reference_content
{
typedef T type;
};
template <typename T>
struct make_reference_content< T& >
{
typedef reference_content<T&> type;
};
template <>
struct make_reference_content< mpl::void_ >
{
template <typename T>
struct apply
: make_reference_content<T>
{
};
typedef mpl::void_ type;
};
} // namespace detail
///////////////////////////////////////////////////////////////////////////////
// reference_content<T&> type traits specializations
//
template <typename T>
struct has_nothrow_copy<
::boost::detail::reference_content< T& >
>
: mpl::true_
{
};
} // namespace boost
#endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP

View File

@ -0,0 +1,489 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//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 UUID_274DA366004E11DCB1DDFE2E56D89593
#define UUID_274DA366004E11DCB1DDFE2E56D89593
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
namespace
boost
{
namespace
exception_detail
{
template <class T>
class
refcount_ptr
{
public:
refcount_ptr():
px_(0)
{
}
~refcount_ptr()
{
release();
}
refcount_ptr( refcount_ptr const & x ):
px_(x.px_)
{
add_ref();
}
refcount_ptr &
operator=( refcount_ptr const & x )
{
adopt(x.px_);
return *this;
}
void
adopt( T * px )
{
release();
px_=px;
add_ref();
}
T *
get() const
{
return px_;
}
private:
T * px_;
void
add_ref()
{
if( px_ )
px_->add_ref();
}
void
release()
{
if( px_ && px_->release() )
px_=0;
}
};
}
////////////////////////////////////////////////////////////////////////
template <class Tag,class T>
class error_info;
typedef error_info<struct throw_function_,char const *> throw_function;
typedef error_info<struct throw_file_,char const *> throw_file;
typedef error_info<struct throw_line_,int> throw_line;
template <>
class
error_info<throw_function_,char const *>
{
public:
typedef char const * value_type;
value_type v_;
explicit
error_info( value_type v ):
v_(v)
{
}
};
template <>
class
error_info<throw_file_,char const *>
{
public:
typedef char const * value_type;
value_type v_;
explicit
error_info( value_type v ):
v_(v)
{
}
};
template <>
class
error_info<throw_line_,int>
{
public:
typedef int value_type;
value_type v_;
explicit
error_info( value_type v ):
v_(v)
{
}
};
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
class exception;
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
template <class T>
class shared_ptr;
namespace
exception_detail
{
class error_info_base;
struct type_info_;
struct
error_info_container
{
virtual char const * diagnostic_information( char const * ) const = 0;
virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
virtual void add_ref() const = 0;
virtual bool release() const = 0;
virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;
protected:
~error_info_container() throw()
{
}
};
template <class>
struct get_info;
template <>
struct get_info<throw_function>;
template <>
struct get_info<throw_file>;
template <>
struct get_info<throw_line>;
char const * get_diagnostic_information( exception const &, char const * );
void copy_boost_exception( exception *, exception const * );
template <class E,class Tag,class T>
E const & set_info( E const &, error_info<Tag,T> const & );
template <class E>
E const & set_info( E const &, throw_function const & );
template <class E>
E const & set_info( E const &, throw_file const & );
template <class E>
E const & set_info( E const &, throw_line const & );
}
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
class
exception
{
//<N3757>
public:
template <class Tag> void set( typename Tag::type const & );
template <class Tag> typename Tag::type const * get() const;
//</N3757>
protected:
exception():
throw_function_(0),
throw_file_(0),
throw_line_(-1)
{
}
#ifdef __HP_aCC
//On HP aCC, this protected copy constructor prevents throwing boost::exception.
//On all other platforms, the same effect is achieved by the pure virtual destructor.
exception( exception const & x ) throw():
data_(x.data_),
throw_function_(x.throw_function_),
throw_file_(x.throw_file_),
throw_line_(x.throw_line_)
{
}
#endif
virtual ~exception() throw()
#ifndef __HP_aCC
= 0 //Workaround for HP aCC, =0 incorrectly leads to link errors.
#endif
;
#if (defined(__MWERKS__) && __MWERKS__<=0x3207) || (defined(_MSC_VER) && _MSC_VER<=1310)
public:
#else
private:
template <class E>
friend E const & exception_detail::set_info( E const &, throw_function const & );
template <class E>
friend E const & exception_detail::set_info( E const &, throw_file const & );
template <class E>
friend E const & exception_detail::set_info( E const &, throw_line const & );
template <class E,class Tag,class T>
friend E const & exception_detail::set_info( E const &, error_info<Tag,T> const & );
friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
template <class>
friend struct exception_detail::get_info;
friend struct exception_detail::get_info<throw_function>;
friend struct exception_detail::get_info<throw_file>;
friend struct exception_detail::get_info<throw_line>;
friend void exception_detail::copy_boost_exception( exception *, exception const * );
#endif
mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
mutable char const * throw_function_;
mutable char const * throw_file_;
mutable int throw_line_;
};
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
inline
exception::
~exception() throw()
{
}
namespace
exception_detail
{
template <class E>
E const &
set_info( E const & x, throw_function const & y )
{
x.throw_function_=y.v_;
return x;
}
template <class E>
E const &
set_info( E const & x, throw_file const & y )
{
x.throw_file_=y.v_;
return x;
}
template <class E>
E const &
set_info( E const & x, throw_line const & y )
{
x.throw_line_=y.v_;
return x;
}
}
////////////////////////////////////////////////////////////////////////
namespace
exception_detail
{
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
template <class T>
struct
error_info_injector:
public T,
public exception
{
explicit
error_info_injector( T const & x ):
T(x)
{
}
~error_info_injector() throw()
{
}
};
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
struct large_size { char c[256]; };
large_size dispatch_boost_exception( exception const * );
struct small_size { };
small_size dispatch_boost_exception( void const * );
template <class,int>
struct enable_error_info_helper;
template <class T>
struct
enable_error_info_helper<T,sizeof(large_size)>
{
typedef T type;
};
template <class T>
struct
enable_error_info_helper<T,sizeof(small_size)>
{
typedef error_info_injector<T> type;
};
template <class T>
struct
enable_error_info_return_type
{
typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch_boost_exception(static_cast<T *>(0)))>::type type;
};
}
template <class T>
inline
typename
exception_detail::enable_error_info_return_type<T>::type
enable_error_info( T const & x )
{
typedef typename exception_detail::enable_error_info_return_type<T>::type rt;
return rt(x);
}
////////////////////////////////////////////////////////////////////////
namespace
exception_detail
{
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
class
clone_base
{
public:
virtual clone_base const * clone() const = 0;
virtual void rethrow() const = 0;
virtual
~clone_base() throw()
{
}
};
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
inline
void
copy_boost_exception( exception * a, exception const * b )
{
refcount_ptr<error_info_container> data;
if( error_info_container * d=b->data_.get() )
data = d->clone();
a->throw_file_ = b->throw_file_;
a->throw_line_ = b->throw_line_;
a->throw_function_ = b->throw_function_;
a->data_ = data;
}
inline
void
copy_boost_exception( void *, void const * )
{
}
template <class T>
class
clone_impl:
public T,
public virtual clone_base
{
struct clone_tag { };
clone_impl( clone_impl const & x, clone_tag ):
T(x)
{
copy_boost_exception(this,&x);
}
public:
explicit
clone_impl( T const & x ):
T(x)
{
copy_boost_exception(this,&x);
}
~clone_impl() throw()
{
}
private:
clone_base const *
clone() const
{
return new clone_impl(*this,clone_tag());
}
void
rethrow() const
{
throw*this;
}
};
}
template <class T>
inline
exception_detail::clone_impl<T>
enable_current_exception( T const & x )
{
return exception_detail::clone_impl<T>(x);
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

149
boost/move/utility.hpp Normal file
View File

@ -0,0 +1,149 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2012-2012.
// 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/libs/move for documentation.
//
//////////////////////////////////////////////////////////////////////////////
//! \file
//! This header includes core utilities from <tt><boost/move/utility_core.hpp></tt> and defines
//! some more advanced utilities such as:
#ifndef BOOST_MOVE_MOVE_UTILITY_HPP
#define BOOST_MOVE_MOVE_UTILITY_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/move/detail/config_begin.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/move/traits.hpp>
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
namespace boost {
//////////////////////////////////////////////////////////////////////////////
//
// move_if_noexcept()
//
//////////////////////////////////////////////////////////////////////////////
template <class T>
inline typename ::boost::move_detail::enable_if_c
< enable_move_utility_emulation<T>::value && !has_move_emulation_enabled<T>::value
, typename ::boost::move_detail::add_const<T>::type &
>::type
move_if_noexcept(T& x) BOOST_NOEXCEPT
{
return x;
}
template <class T>
inline typename ::boost::move_detail::enable_if_c
< enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
&& ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, rv<T>&>::type
move_if_noexcept(T& x) BOOST_NOEXCEPT
{
return *static_cast<rv<T>* >(::boost::move_detail::addressof(x));
}
template <class T>
inline typename ::boost::move_detail::enable_if_c
< enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
&& ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
, rv<T>&
>::type
move_if_noexcept(rv<T>& x) BOOST_NOEXCEPT
{
return x;
}
template <class T>
inline typename ::boost::move_detail::enable_if_c
< enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
&& !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
, typename ::boost::move_detail::add_const<T>::type &
>::type
move_if_noexcept(T& x) BOOST_NOEXCEPT
{
return x;
}
template <class T>
inline typename ::boost::move_detail::enable_if_c
< enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
&& !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
, typename ::boost::move_detail::add_const<T>::type &
>::type
move_if_noexcept(rv<T>& x) BOOST_NOEXCEPT
{
return x;
}
} //namespace boost
#else //#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
#if defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
#include <utility>
namespace boost{
using ::std::move_if_noexcept;
} //namespace boost
#else //!BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE
namespace boost {
//////////////////////////////////////////////////////////////////////////////
//
// move_if_noexcept()
//
//////////////////////////////////////////////////////////////////////////////
#if defined(BOOST_MOVE_DOXYGEN_INVOKED)
//! This function provides a way to convert a reference into a rvalue reference
//! in compilers with rvalue references. For other compilers converts T & into
//! <i>::boost::rv<T> &</i> so that move emulation is activated. Reference
//! would be converted to rvalue reference only if input type is nothrow move
//! constructible or if it has no copy constructor. In all other cases const
//! reference would be returned
template <class T>
rvalue_reference_or_const_lvalue_reference move_if_noexcept(input_reference) noexcept;
#else //BOOST_MOVE_DOXYGEN_INVOKED
template <class T>
typename ::boost::move_detail::enable_if_c
< ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, T&&>::type
move_if_noexcept(T& x) BOOST_NOEXCEPT
{ return ::boost::move(x); }
template <class T>
typename ::boost::move_detail::enable_if_c
< !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, const T&>::type
move_if_noexcept(T& x) BOOST_NOEXCEPT
{ return x; }
#endif //BOOST_MOVE_DOXYGEN_INVOKED
} //namespace boost {
#endif //#if defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
#endif //BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/move/detail/config_end.hpp>
#endif //#ifndef BOOST_MOVE_MOVE_UTILITY_HPP

25
boost/mpl/size_t.hpp Normal file
View File

@ -0,0 +1,25 @@
#ifndef BOOST_MPL_SIZE_T_HPP_INCLUDED
#define BOOST_MPL_SIZE_T_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// 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/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/size_t_fwd.hpp>
#define AUX_WRAPPER_VALUE_TYPE std::size_t
#define AUX_WRAPPER_NAME size_t
#define AUX_WRAPPER_PARAMS(N) std::size_t N
#include <boost/mpl/aux_/integral_wrapper.hpp>
#endif // BOOST_MPL_SIZE_T_HPP_INCLUDED

28
boost/mpl/size_t_fwd.hpp Normal file
View File

@ -0,0 +1,28 @@
#ifndef BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED
#define BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// 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/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/aux_/adl_barrier.hpp>
#include <boost/config.hpp> // make sure 'size_t' is placed into 'std'
#include <cstddef>
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
template< std::size_t N > struct size_t;
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
BOOST_MPL_AUX_ADL_BARRIER_DECL(size_t)
#endif // BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED

53
boost/none.hpp Normal file
View File

@ -0,0 +1,53 @@
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
// Copyright (C) 2014 Andrzej Krzemienski.
//
// 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/libs/optional for documentation.
//
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
//
#ifndef BOOST_NONE_17SEP2003_HPP
#define BOOST_NONE_17SEP2003_HPP
#include "boost/none_t.hpp"
// NOTE: Borland users have to include this header outside any precompiled headers
// (bcc<=5.64 cannot include instance data in a precompiled header)
// -- * To be verified, now that there's no unnamed namespace
namespace boost {
#ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
none_t const none = (static_cast<none_t>(0)) ;
#else
namespace detail { namespace optional_detail {
// the trick here is to make boost::none defined once as a global but in a header file
template <typename T>
struct none_instance
{
static const T instance;
};
template <typename T>
const T none_instance<T>::instance = T(); // global, but because 'tis a template, no cpp file required
} } // namespace detail::optional_detail
namespace {
// TU-local
const none_t& none = detail::optional_detail::none_instance<none_t>::instance;
}
#endif
} // namespace boost
#endif

28
boost/none_t.hpp Normal file
View File

@ -0,0 +1,28 @@
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
// Copyright (C) 2014 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:
// fernando_cacciola@hotmail.com
//
#ifndef BOOST_NONE_T_17SEP2003_HPP
#define BOOST_NONE_T_17SEP2003_HPP
namespace boost {
#ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
namespace detail { struct none_helper{}; }
typedef int detail::none_helper::*none_t ;
#else
class none_t {};
#endif
} // namespace boost
#endif

18
boost/optional.hpp Normal file
View File

@ -0,0 +1,18 @@
// Copyright (C) 2003, 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_FLC_19NOV2002_HPP
#define BOOST_OPTIONAL_FLC_19NOV2002_HPP
#include "boost/optional/optional.hpp"
#endif

View File

@ -0,0 +1,32 @@
// Copyright (C) 2014, 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_BAD_OPTIONAL_ACCESS_22MAY2014_HPP
#define BOOST_BAD_OPTIONAL_ACCESS_22MAY2014_HPP
#include <stdexcept>
#if __cplusplus < 201103L
#include <string> // to make converting-ctor std::string(char const*) visible
#endif
namespace boost {
class bad_optional_access : public std::logic_error
{
public:
bad_optional_access()
: std::logic_error("Attempted to access the value of an uninitialized optional object.")
{}
};
} // namespace boost
#endif

1567
boost/optional/optional.hpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
// Copyright (C) 2003, 2008 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
//
// Revisions:
// 10 May 2008 (added swap related forward declaration) Niels Dekker
//
#ifndef BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
#define BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
namespace boost {
template<class T> class optional ;
template<class T> void swap ( optional<T>& , optional<T>& );
template<class T> struct optional_swap_should_use_default_constructor ;
} // namespace boost
#endif

View 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 const&)
{
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

View File

@ -0,0 +1,40 @@
# /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.com
# *
# * 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)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_LIST_APPEND_HPP
# define BOOST_PREPROCESSOR_LIST_APPEND_HPP
#
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/list/fold_right.hpp>
#
# /* BOOST_PP_LIST_APPEND */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LIST_APPEND(a, b) BOOST_PP_LIST_FOLD_RIGHT(BOOST_PP_LIST_APPEND_O, b, a)
# else
# define BOOST_PP_LIST_APPEND(a, b) BOOST_PP_LIST_APPEND_I(a, b)
# define BOOST_PP_LIST_APPEND_I(a, b) BOOST_PP_LIST_FOLD_RIGHT(BOOST_PP_LIST_APPEND_O, b, a)
# endif
#
# define BOOST_PP_LIST_APPEND_O(d, s, x) (x, s)
#
# /* BOOST_PP_LIST_APPEND_D */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LIST_APPEND_D(d, a, b) BOOST_PP_LIST_FOLD_RIGHT_ ## d(BOOST_PP_LIST_APPEND_O, b, a)
# else
# define BOOST_PP_LIST_APPEND_D(d, a, b) BOOST_PP_LIST_APPEND_D_I(d, a, b)
# define BOOST_PP_LIST_APPEND_D_I(d, a, b) BOOST_PP_LIST_FOLD_RIGHT_ ## d(BOOST_PP_LIST_APPEND_O, b, a)
# endif
#
# endif

View File

@ -0,0 +1,49 @@
# /* Copyright (C) 2001
# * Housemarque Oy
# * http://www.housemarque.com
# *
# * 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)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
# define BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
#
# include <boost/preprocessor/config/config.hpp>
# include <boost/preprocessor/list/fold_right.hpp>
# include <boost/preprocessor/tuple/elem.hpp>
# include <boost/preprocessor/tuple/rem.hpp>
#
# /* BOOST_PP_LIST_TRANSFORM */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LIST_TRANSFORM(op, data, list) BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_LIST_FOLD_RIGHT(BOOST_PP_LIST_TRANSFORM_O, (op, data, BOOST_PP_NIL), list))
# else
# define BOOST_PP_LIST_TRANSFORM(op, data, list) BOOST_PP_LIST_TRANSFORM_I(op, data, list)
# define BOOST_PP_LIST_TRANSFORM_I(op, data, list) BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_LIST_FOLD_RIGHT(BOOST_PP_LIST_TRANSFORM_O, (op, data, BOOST_PP_NIL), list))
# endif
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LIST_TRANSFORM_O(d, odr, elem) BOOST_PP_LIST_TRANSFORM_O_D(d, BOOST_PP_TUPLE_ELEM(3, 0, odr), BOOST_PP_TUPLE_ELEM(3, 1, odr), BOOST_PP_TUPLE_ELEM(3, 2, odr), elem)
# else
# define BOOST_PP_LIST_TRANSFORM_O(d, odr, elem) BOOST_PP_LIST_TRANSFORM_O_I(d, BOOST_PP_TUPLE_REM_3 odr, elem)
# define BOOST_PP_LIST_TRANSFORM_O_I(d, im, elem) BOOST_PP_LIST_TRANSFORM_O_D(d, im, elem)
# endif
#
# define BOOST_PP_LIST_TRANSFORM_O_D(d, op, data, res, elem) (op, data, (op(d, data, elem), res))
#
# /* BOOST_PP_LIST_TRANSFORM_D */
#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LIST_TRANSFORM_D(d, op, data, list) BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_LIST_FOLD_RIGHT_ ## d(BOOST_PP_LIST_TRANSFORM_O, (op, data, BOOST_PP_NIL), list))
# else
# define BOOST_PP_LIST_TRANSFORM_D(d, op, data, list) BOOST_PP_LIST_TRANSFORM_D_I(d, op, data, list)
# define BOOST_PP_LIST_TRANSFORM_D_I(d, op, data, list) BOOST_PP_TUPLE_ELEM(3, 2, BOOST_PP_LIST_FOLD_RIGHT_ ## d(BOOST_PP_LIST_TRANSFORM_O, (op, data, BOOST_PP_NIL), list))
# endif
#
# endif

102
boost/throw_exception.hpp Normal file
View File

@ -0,0 +1,102 @@
#ifndef UUID_AA15E74A856F11E08B8D93F24824019B
#define UUID_AA15E74A856F11E08B8D93F24824019B
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma GCC system_header
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(push,1)
#endif
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// boost/throw_exception.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2008-2009 Emil Dotchevski and Reverge Studios, Inc.
//
// 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)
//
// http://www.boost.org/libs/utility/throw_exception.html
//
#include <boost/detail/workaround.hpp>
#include <boost/config.hpp>
#include <exception>
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
# define BOOST_EXCEPTION_DISABLE
#endif
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
# define BOOST_EXCEPTION_DISABLE
#endif
#if !defined( BOOST_EXCEPTION_DISABLE )
# include <boost/exception/exception.hpp>
#if !defined(BOOST_THROW_EXCEPTION_CURRENT_FUNCTION)
# include <boost/current_function.hpp>
# define BOOST_THROW_EXCEPTION_CURRENT_FUNCTION BOOST_CURRENT_FUNCTION
#endif
# define BOOST_THROW_EXCEPTION(x) ::boost::exception_detail::throw_exception_(x,BOOST_THROW_EXCEPTION_CURRENT_FUNCTION,__FILE__,__LINE__)
#else
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
#endif
namespace boost
{
#ifdef BOOST_NO_EXCEPTIONS
void throw_exception( std::exception const & e ); // user defined
#else
inline void throw_exception_assert_compatibility( std::exception const & ) { }
template<class E> BOOST_NORETURN inline void throw_exception( E const & e )
{
//All boost exceptions are required to derive from std::exception,
//to ensure compatibility with BOOST_NO_EXCEPTIONS.
throw_exception_assert_compatibility(e);
#ifndef BOOST_EXCEPTION_DISABLE
throw enable_current_exception(enable_error_info(e));
#else
throw e;
#endif
}
#endif
#if !defined( BOOST_EXCEPTION_DISABLE )
namespace
exception_detail
{
template <class E>
BOOST_NORETURN
void
throw_exception_( E const & x, char const * current_function, char const * file, int line )
{
boost::throw_exception(
set_info(
set_info(
set_info(
enable_error_info(x),
throw_function(current_function)),
throw_file(file)),
throw_line(line)));
}
}
#endif
} // namespace boost
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

18
boost/type.hpp Normal file
View File

@ -0,0 +1,18 @@
// (C) Copyright David Abrahams 2001.
// 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 BOOST_TYPE_DWA20010120_HPP
# define BOOST_TYPE_DWA20010120_HPP
namespace boost {
// Just a simple "type envelope". Useful in various contexts, mostly to work
// around some MSVC deficiencies.
template <class T>
struct type {};
}
#endif // BOOST_TYPE_DWA20010120_HPP

102
boost/type_traits.hpp Normal file
View File

@ -0,0 +1,102 @@
// (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/decay.hpp"
#include "boost/type_traits/extent.hpp"
#include "boost/type_traits/floating_point_promotion.hpp"
#include "boost/type_traits/function_traits.hpp"
#if !defined(__BORLANDC__) && !defined(__CUDACC__)
#include "boost/type_traits/has_new_operator.hpp"
#endif
#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_operator.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_virtual_destructor.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_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_convertible.hpp"
#include "boost/type_traits/is_copy_constructible.hpp"
#include "boost/type_traits/is_copy_assignable.hpp"
#include "boost/type_traits/is_empty.hpp"
#include "boost/type_traits/is_enum.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_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_object.hpp"
#include "boost/type_traits/is_pod.hpp"
#include "boost/type_traits/is_polymorphic.hpp"
#include "boost/type_traits/is_pointer.hpp"
#include "boost/type_traits/is_reference.hpp"
#include "boost/type_traits/is_rvalue_reference.hpp"
#include "boost/type_traits/is_signed.hpp"
#include "boost/type_traits/is_same.hpp"
#include "boost/type_traits/is_scalar.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_void.hpp"
#include "boost/type_traits/is_virtual_base_of.hpp"
#include "boost/type_traits/is_volatile.hpp"
#include <boost/type_traits/make_unsigned.hpp>
#include <boost/type_traits/make_signed.hpp>
#include "boost/type_traits/rank.hpp"
#include "boost/type_traits/remove_bounds.hpp"
#include "boost/type_traits/remove_extent.hpp"
#include "boost/type_traits/remove_all_extents.hpp"
#include "boost/type_traits/remove_const.hpp"
#include "boost/type_traits/remove_cv.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_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
#include "boost/type_traits/ice.hpp"
#endif // BOOST_TYPE_TRAITS_HPP

View File

@ -0,0 +1,46 @@
// (C) Copyright Dave Abrahams, 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_ADD_CV_HPP_INCLUDED
#define BOOST_TT_ADD_CV_HPP_INCLUDED
#include <boost/config.hpp>
// should be the last #include
#include <boost/type_traits/detail/type_trait_def.hpp>
namespace boost {
// * convert a type T to a const volatile type - add_cv<T>
// this is not required since the result is always
// the same as "T const volatile", but it does suppress warnings
// from some compilers:
#if defined(BOOST_MSVC)
// This bogus warning will appear when add_volatile is applied to a
// const volatile reference because we can't detect const volatile
// references with MSVC6.
# pragma warning(push)
# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
#endif
BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_cv,T,T const volatile)
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_cv,T&,T&)
} // namespace boost
#include <boost/type_traits/detail/type_trait_undef.hpp>
#endif // BOOST_TT_ADD_CV_HPP_INCLUDED

View File

@ -0,0 +1,13 @@
// Copyright (C) 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_ALIGNED_STORAGE_HPP_INCLUDED
# define BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED
# include <boost/aligned_storage.hpp>
#endif // BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED

View File

@ -0,0 +1,126 @@
// (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.
#ifndef BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED
#define BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED
#include <boost/config.hpp>
#include <cstddef>
#include <boost/type_traits/intrinsics.hpp>
// should be the last #include
#include <boost/type_traits/detail/size_t_trait_def.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4121 4512) // alignment is sensitive to packing
#endif
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
#pragma option push -Vx- -Ve-
#endif
namespace boost {
template <typename T> struct alignment_of;
// get the alignment of some arbitrary type:
namespace detail {
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4324) // structure was padded due to __declspec(align())
#endif
template <typename T>
struct alignment_of_hack
{
char c;
T t;
alignment_of_hack();
};
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
template <unsigned A, unsigned S>
struct alignment_logic
{
BOOST_STATIC_CONSTANT(std::size_t, value = A < S ? A : S);
};
template< typename T >
struct alignment_of_impl
{
#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400)
//
// With MSVC both the native __alignof operator
// and our own logic gets things wrong from time to time :-(
// Using a combination of the two seems to make the most of a bad job:
//
BOOST_STATIC_CONSTANT(std::size_t, value =
(::boost::detail::alignment_logic<
sizeof(::boost::detail::alignment_of_hack<T>) - sizeof(T),
__alignof(T)
>::value));
#elif !defined(BOOST_ALIGNMENT_OF)
BOOST_STATIC_CONSTANT(std::size_t, value =
(::boost::detail::alignment_logic<
sizeof(::boost::detail::alignment_of_hack<T>) - sizeof(T),
sizeof(T)
>::value));
#else
//
// We put this here, rather than in the definition of
// alignment_of below, because MSVC's __alignof doesn't
// always work in that context for some unexplained reason.
// (See type_with_alignment tests for test cases).
//
BOOST_STATIC_CONSTANT(std::size_t, value = BOOST_ALIGNMENT_OF(T));
#endif
};
} // namespace detail
BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(alignment_of,T,::boost::detail::alignment_of_impl<T>::value)
// references have to be treated specially, assume
// that a reference is just a special pointer:
template <typename T>
struct alignment_of<T&>
: public alignment_of<T*>
{
};
#ifdef __BORLANDC__
// long double gives an incorrect value of 10 (!)
// unless we do this...
struct long_double_wrapper{ long double ld; };
template<> struct alignment_of<long double>
: public alignment_of<long_double_wrapper>{};
#endif
// void has to be treated specially:
BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void,0)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void const,0)
BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void volatile,0)
BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void const volatile,0)
#endif
} // namespace boost
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
#pragma option pop
#endif
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#include <boost/type_traits/detail/size_t_trait_undef.hpp>
#endif // BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED

View File

@ -0,0 +1,15 @@
// (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.
#ifndef BOOST_TT_ALIGNMENT_TRAITS_HPP_INCLUDED
#define BOOST_TT_ALIGNMENT_TRAITS_HPP_INCLUDED
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#endif // BOOST_TT_ALIGNMENT_TRAITS_HPP_INCLUDED

View File

@ -0,0 +1,20 @@
// (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.
//
// defines traits classes for arithmetic types:
// is_void, is_integral, is_float, is_arithmetic, is_fundamental.
#ifndef BOOST_TT_ARITHMETIC_TRAITS_HPP_INCLUDED
#define BOOST_TT_ARITHMETIC_TRAITS_HPP_INCLUDED
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/type_traits/is_float.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_void.hpp>
#endif // BOOST_TT_ARITHMETIC_TRAITS_HPP_INCLUDED

View File

@ -0,0 +1,15 @@
// (C) Copyright Dave Abrahams, 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_ARRAY_TRAITS_HPP_INCLUDED
#define BOOST_TT_ARRAY_TRAITS_HPP_INCLUDED
#include <boost/type_traits/is_array.hpp>
#endif // BOOST_TT_ARRAY_TRAITS_HPP_INCLUDED

View File

@ -0,0 +1,14 @@
// Copyright 2001-2003 Aleksey Gurtovoy.
// 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_BROKEN_COMPILER_SPEC_HPP_INCLUDED
#define BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#endif

View File

@ -0,0 +1,157 @@
// common_type.hpp ---------------------------------------------------------//
// Copyright 2008 Howard Hinnant
// Copyright 2008 Beman Dawes
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP
#define BOOST_TYPE_TRAITS_COMMON_TYPE_HPP
#include <boost/config.hpp>
#if defined(__SUNPRO_CC) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
# define BOOST_COMMON_TYPE_DONT_USE_TYPEOF
#endif
#if defined(__IBMCPP__) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
# define BOOST_COMMON_TYPE_DONT_USE_TYPEOF
#endif
//----------------------------------------------------------------------------//
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_COMMON_TYPE_ARITY)
#define BOOST_COMMON_TYPE_ARITY 3
#endif
//----------------------------------------------------------------------------//
#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
#include <boost/typeof/typeof.hpp> // boost wonders never cease!
#endif
//----------------------------------------------------------------------------//
#ifndef BOOST_NO_CXX11_STATIC_ASSERT
#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
#elif defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT)
#include <boost/mpl/assert.hpp>
#include <boost/mpl/bool.hpp>
#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) \
BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
#else
#include <boost/static_assert.hpp>
#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND)
#endif
#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT)
#define BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE "must be complete type"
#endif
#if defined(BOOST_NO_CXX11_DECLTYPE) && defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
#include <boost/type_traits/detail/common_type_imp.hpp>
#include <boost/type_traits/remove_cv.hpp>
#endif
#include <boost/mpl/if.hpp>
#include <boost/utility/declval.hpp>
#include <boost/type_traits/add_rvalue_reference.hpp>
//----------------------------------------------------------------------------//
// //
// C++03 implementation of //
// 20.9.7.6 Other transformations [meta.trans.other] //
// Written by Howard Hinnant //
// Adapted for Boost by Beman Dawes, Vicente Botet and Jeffrey Hellrung //
// //
//----------------------------------------------------------------------------//
namespace boost {
// prototype
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<typename... T>
struct common_type;
#else // or no specialization
template <class T, class U = void, class V = void>
struct common_type
{
public:
typedef typename common_type<typename common_type<T, U>::type, V>::type type;
};
#endif
// 1 arg
template<typename T>
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
struct common_type<T>
#else
struct common_type<T, void, void>
#endif
{
BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T));
public:
typedef T type;
};
// 2 args
namespace type_traits_detail {
template <class T, class U>
struct common_type_2
{
private:
BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T));
BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(U) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (U));
static bool declval_bool(); // workaround gcc bug; not required by std
static typename add_rvalue_reference<T>::type declval_T(); // workaround gcc bug; not required by std
static typename add_rvalue_reference<U>::type declval_U(); // workaround gcc bug; not required by std
static typename add_rvalue_reference<bool>::type declval_b();
#if !defined(BOOST_NO_CXX11_DECLTYPE)
public:
typedef decltype(declval<bool>() ? declval<T>() : declval<U>()) type;
#elif defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
public:
typedef typename detail_type_traits_common_type::common_type_impl<
typename remove_cv<T>::type,
typename remove_cv<U>::type
>::type type;
#else
public:
typedef BOOST_TYPEOF_TPL(declval_b() ? declval_T() : declval_U()) type;
#endif
#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 3
public:
void public_dummy_function_just_to_silence_warning();
#endif
};
template <class T>
struct common_type_2<T, T>
{
typedef T type;
};
}
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template <class T, class U>
struct common_type<T, U>
#else
template <class T, class U>
struct common_type<T, U, void>
#endif
: public type_traits_detail::common_type_2<T,U>
{ };
// 3 or more args
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<typename T, typename U, typename... V>
struct common_type<T, U, V...> {
public:
typedef typename common_type<typename common_type<T, U>::type, V...>::type type;
};
#endif
} // namespace boost
#endif // BOOST_TYPE_TRAITS_COMMON_TYPE_HPP

View File

@ -0,0 +1,29 @@
// (C) Copyright Dave Abrahams, 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.
//
// defines traits classes for composite types:
// is_array, is_pointer, is_reference, is_member_pointer, is_enum, is_union.
//
#ifndef BOOST_TT_COMPOSITE_TRAITS_HPP_INCLUDED
#define BOOST_TT_COMPOSITE_TRAITS_HPP_INCLUDED
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_member_pointer.hpp>
#include <boost/type_traits/is_member_function_pointer.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/is_union.hpp>
#endif // BOOST_TT_COMPOSITE_TRAITS_HPP_INCLUDED

View File

@ -0,0 +1,25 @@
// (C) Copyright John Maddock 2010.
// 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_CONDITIONAL_HPP_INCLUDED
#define BOOST_TT_CONDITIONAL_HPP_INCLUDED
#include <boost/mpl/if.hpp>
namespace boost {
template <bool b, class T, class U>
struct conditional : public mpl::if_c<b, T, U>
{
};
} // namespace boost
#endif // BOOST_TT_CONDITIONAL_HPP_INCLUDED

View File

@ -0,0 +1,24 @@
// (C) Copyright Dave Abrahams, 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.
//
// defines traits classes for cv-qualified types:
// is_const, is_volatile, remove_const, remove_volatile, remove_cv.
#ifndef BOOST_TT_CV_TRAITS_HPP_INCLUDED
#define BOOST_TT_CV_TRAITS_HPP_INCLUDED
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_volatile.hpp>
#include <boost/type_traits/add_cv.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_volatile.hpp>
#include <boost/type_traits/remove_cv.hpp>
#endif // BOOST_TT_CV_TRAITS_HPP_INCLUDED

View File

@ -0,0 +1,44 @@
// (C) Copyright John Maddock & Thorsten Ottosen 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_DECAY_HPP_INCLUDED
#define BOOST_TT_DECAY_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_function.hpp>
#include <boost/type_traits/remove_bounds.hpp>
#include <boost/type_traits/add_pointer.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost
{
template< class T >
struct decay
{
private:
typedef BOOST_DEDUCED_TYPENAME remove_reference<T>::type Ty;
public:
typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
is_array<Ty>,
mpl::identity<BOOST_DEDUCED_TYPENAME remove_bounds<Ty>::type*>,
BOOST_DEDUCED_TYPENAME mpl::eval_if<
is_function<Ty>,
add_pointer<Ty>,
mpl::identity<Ty>
>
>::type type;
};
} // namespace boost
#endif // BOOST_TT_DECAY_HPP_INCLUDED

View File

@ -0,0 +1,333 @@
/*******************************************************************************
* boost/type_traits/detail/common_type_imp.hpp
*
* Copyright 2010, Jeffrey Hellrung.
* 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)
*
* struct boost::common_type<T,U>
*
* common_type<T,U>::type is the type of the expression
* b() ? x() : y()
* where b() returns a bool, x() has return type T, and y() has return type U.
* See
* http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm#common_type
*
* Note that this evaluates to void if one or both of T and U is void.
******************************************************************************/
#ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMP_HPP
#define BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMP_HPP
#include <cstddef>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/contains.hpp>
#include <boost/mpl/copy.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/inserter.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/vector/vector0.hpp>
#include <boost/mpl/vector/vector10.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/make_signed.hpp>
#include <boost/type_traits/make_unsigned.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/utility/declval.hpp>
namespace boost
{
namespace detail_type_traits_common_type
{
/*******************************************************************************
* struct propagate_cv< From, To >
*
* This metafunction propagates cv-qualifiers on type From to type To.
******************************************************************************/
template< class From, class To >
struct propagate_cv
{ typedef To type; };
template< class From, class To >
struct propagate_cv< const From, To >
{ typedef To const type; };
template< class From, class To >
struct propagate_cv< volatile From, To >
{ typedef To volatile type; };
template< class From, class To >
struct propagate_cv< const volatile From, To >
{ typedef To const volatile type; };
/*******************************************************************************
* struct is_integral_or_enum<T>
*
* This metafunction determines if T is an integral type which can be made
* signed or unsigned.
******************************************************************************/
template< class T >
struct is_integral_or_enum
: public mpl::or_< is_integral<T>, is_enum<T> >
{ };
template<>
struct is_integral_or_enum< bool >
: public false_type
{ };
/*******************************************************************************
* struct make_unsigned_soft<T>
* struct make_signed_soft<T>
*
* These metafunction are identical to make_unsigned and make_signed,
* respectively, except for special-casing bool.
******************************************************************************/
template< class T >
struct make_unsigned_soft
: public make_unsigned<T>
{ };
template<>
struct make_unsigned_soft< bool >
{ typedef bool type; };
template< class T >
struct make_signed_soft
: public make_signed<T>
{ };
template<>
struct make_signed_soft< bool >
{ typedef bool type; };
/*******************************************************************************
* struct sizeof_t<N>
* typedef ... yes_type
* typedef ... no_type
*
* These types are integral players in the use of the "sizeof trick", i.e., we
* can distinguish overload selection by inspecting the size of the return type
* of the overload.
******************************************************************************/
template< std::size_t N > struct sizeof_t { char _dummy[N]; };
typedef sizeof_t<1> yes_type;
typedef sizeof_t<2> no_type;
BOOST_MPL_ASSERT_RELATION( sizeof( yes_type ), ==, 1 );
BOOST_MPL_ASSERT_RELATION( sizeof( no_type ), ==, 2 );
/*******************************************************************************
* rvalue_test(T&) -> no_type
* rvalue_test(...) -> yes_type
*
* These overloads are used to determine the rvalue-ness of an expression.
******************************************************************************/
template< class T > no_type rvalue_test(T&);
yes_type rvalue_test(...);
/*******************************************************************************
* struct conversion_test_overloads< Sequence >
*
* This struct has multiple overloads of the static member function apply, each
* one taking a single parameter of a type within the Boost.MPL sequence
* Sequence. Each such apply overload has a return type with sizeof equal to
* one plus the index of the parameter type within Sequence. Thus, we can
* deduce the type T of an expression as long as we can generate a finite set of
* candidate types containing T via these apply overloads and the "sizeof
* trick".
******************************************************************************/
template< class First, class Last, std::size_t Index >
struct conversion_test_overloads_iterate
: public conversion_test_overloads_iterate<
typename mpl::next< First >::type, Last, Index + 1
>
{
using conversion_test_overloads_iterate<
typename mpl::next< First >::type, Last, Index + 1
>::apply;
static sizeof_t< Index + 1 >
apply(typename mpl::deref< First >::type);
};
template< class Last, std::size_t Index >
struct conversion_test_overloads_iterate< Last, Last, Index >
{ static sizeof_t< Index + 1 > apply(...); };
template< class Sequence >
struct conversion_test_overloads
: public conversion_test_overloads_iterate<
typename mpl::begin< Sequence >::type,
typename mpl::end< Sequence >::type,
0
>
{ };
/*******************************************************************************
* struct select< Sequence, Index >
*
* select is synonymous with mpl::at_c unless Index equals the size of the
* Boost.MPL Sequence, in which case this evaluates to void.
******************************************************************************/
template<
class Sequence, int Index,
int N = mpl::size< Sequence >::value
>
struct select
: public mpl::at_c< Sequence, Index >
{ };
template< class Sequence, int N >
struct select< Sequence, N, N >
{ typedef void type; };
/*******************************************************************************
* class deduce_common_type< T, U, NominalCandidates >
* struct nominal_candidates<T,U>
* struct common_type_dispatch_on_rvalueness<T,U>
* struct common_type_impl<T,U>
*
* These classes and structs implement the logic behind common_type, which goes
* roughly as follows. Let C be the type of the conditional expression
* declval< bool >() ? declval<T>() : declval<U>()
* if C is an rvalue, then:
* let T' and U' be T and U stripped of reference- and cv-qualifiers
* if T' and U' are pointer types, say, T' = V* and U' = W*, then:
* define the set of NominalCandidates to be
* { V*, W*, V'*, W'* }
* where V' is V with whatever cv-qualifiers are on W, and W' is W
* with whatever cv-qualifiers are on V
* else if T' and U' are both integral or enum types, then:
* define the set of NominalCandidates to be
* {
* unsigned_soft(T'),
* unsigned_soft(U'),
* signed_soft(T'),
* signed_soft(U'),
* T',
* U',
* unsigned int,
* int
* }
* where unsigned_soft(X) is make_unsigned_soft<X>::type and
* signed_soft(X) is make_signed_soft<X>::type (these are all
* generally necessary to cover the various integral promotion cases)
* else
* define the set of NominalCandidates to be
* { T', U' }
* else
* let V and W be T and U stripped of reference-qualifiers
* define the set of NominalCandidates to be
* { V&, W&, V'&, W'& }
* where V' is V with whatever cv-qualifiers are on W, and W' is W with
* whatever cv-qualifiers are on V
* define the set of Candidates to be equal to the set of NominalCandidates with
* duplicates removed, and use this set of Candidates to determine C using the
* conversion_test_overloads struct
******************************************************************************/
template< class T, class U, class NominalCandidates >
class deduce_common_type
{
typedef typename mpl::copy<
NominalCandidates,
mpl::inserter<
mpl::vector0<>,
mpl::if_<
mpl::contains< mpl::_1, mpl::_2 >,
mpl::_1,
mpl::push_back< mpl::_1, mpl::_2 >
>
>
>::type candidate_types;
static const int best_candidate_index =
sizeof( conversion_test_overloads< candidate_types >::apply(
declval< bool >() ? declval<T>() : declval<U>()
) ) - 1;
public:
typedef typename select< candidate_types, best_candidate_index >::type type;
};
template<
class T, class U,
class V = typename remove_cv< typename remove_reference<T>::type >::type,
class W = typename remove_cv< typename remove_reference<U>::type >::type,
bool = is_integral_or_enum<V>::value && is_integral_or_enum<W>::value
>
struct nominal_candidates
{ typedef mpl::vector2<V,W> type; };
template< class T, class U, class V, class W >
struct nominal_candidates< T, U, V, W, true >
{
typedef boost::mpl::vector8<
typename make_unsigned_soft<V>::type,
typename make_unsigned_soft<W>::type,
typename make_signed_soft<V>::type,
typename make_signed_soft<W>::type,
V, W, unsigned int, int
> type;
};
template< class T, class U, class V, class W >
struct nominal_candidates< T, U, V*, W*, false >
{
typedef mpl::vector4<
V*, W*,
typename propagate_cv<W,V>::type *,
typename propagate_cv<V,W>::type *
> type;
};
template<class T, class U, bool b>
struct common_type_dispatch_on_rvalueness
: public deduce_common_type< T, U, typename nominal_candidates<T,U>::type >
{ };
template< class T, class U >
struct common_type_dispatch_on_rvalueness< T, U, false >
{
private:
typedef typename remove_reference<T>::type unrefed_T_type;
typedef typename remove_reference<U>::type unrefed_U_type;
public:
typedef typename deduce_common_type<
T, U,
mpl::vector4<
unrefed_T_type &,
unrefed_U_type &,
typename propagate_cv< unrefed_U_type, unrefed_T_type >::type &,
typename propagate_cv< unrefed_T_type, unrefed_U_type >::type &
>
>::type type;
};
template< class T, class U >
struct common_type_impl
: public common_type_dispatch_on_rvalueness<T,U, sizeof( ::boost::detail_type_traits_common_type::rvalue_test(
declval< bool >() ? declval<T>() : declval<U>() ) ) == sizeof( yes_type ) >
{ };
template< class T > struct common_type_impl< T, void > { typedef void type; };
template< class T > struct common_type_impl< void, T > { typedef void type; };
template<> struct common_type_impl< void, void > { typedef void type; };
} // namespace detail_type_traits_common_type
} // namespace boost
#endif // BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_HPP

View File

@ -0,0 +1,202 @@
// (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/ice.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>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
// avoid warnings
#if defined(__GNUC__)
# pragma GCC system_header
#elif defined(BOOST_MSVC)
# pragma warning ( push )
# pragma warning ( disable : 4244 4913 )
#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 = (
::boost::type_traits::ice_and<
operator_exists < Lhs >::value,
operator_returns_Ret < Lhs, Ret, operator_returns_void < Lhs >::value >::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
BOOST_TT_AUX_BOOL_TRAIT_DEF2(BOOST_TT_TRAIT_NAME, Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl< Lhs, Ret >::value))
} // namespace boost
#if defined(BOOST_MSVC)
# pragma warning ( pop )
#endif
#include <boost/type_traits/detail/bool_trait_undef.hpp>

View File

@ -0,0 +1,210 @@
// (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/ice.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>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.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 )
#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 = (
::boost::type_traits::ice_and<
operator_exists < Rhs >::value,
operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::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
BOOST_TT_AUX_BOOL_TRAIT_DEF2(BOOST_TT_TRAIT_NAME, Rhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Rhs, Ret >::value))
} // namespace boost
#if defined(BOOST_MSVC)
# pragma warning ( pop )
#endif
#include <boost/type_traits/detail/bool_trait_undef.hpp>

View File

@ -0,0 +1,51 @@
// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
// Copyright Aleksey Gurtovoy 2002-2004
//
// 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)
// $Source$
// $Date$
// $Revision$
#include <boost/type_traits/detail/template_arity_spec.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/size_t.hpp>
#include <cstddef>
// Obsolete. Remove.
#define BOOST_TT_AUX_SIZE_T_BASE(C) public ::boost::integral_constant<std::size_t,C>
#define BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) /**/
#define BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(trait,T,C) \
template< typename T > struct trait \
: public ::boost::integral_constant<std::size_t,C> \
{ \
public:\
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \
}; \
\
BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
/**/
#define BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(trait,spec,C) \
template<> struct trait<spec> \
: public ::boost::integral_constant<std::size_t,C> \
{ \
public:\
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \
}; \
/**/
#define BOOST_TT_AUX_SIZE_T_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,C) \
template< param > struct trait<spec> \
: public ::boost::integral_constant<std::size_t,C> \
{ \
}; \
/**/

View File

@ -0,0 +1,16 @@
// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
// Copyright Aleksey Gurtovoy 2002-2004
//
// 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)
// $Source$
// $Date$
// $Revision$
#undef BOOST_TT_AUX_SIZE_T_TRAIT_DEF1
#undef BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1
#undef BOOST_TT_AUX_SIZE_T_TRAIT_PARTIAL_SPEC1_1

View File

@ -0,0 +1,18 @@
// (C) Copyright David Abrahams 2002.
// 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_DETAIL_WRAP_HPP_INCLUDED
#define BOOST_TT_DETAIL_WRAP_HPP_INCLUDED
namespace boost {
namespace type_traits {
template <class T> struct wrap {};
}} // namespace boost::type_traits
#endif // BOOST_TT_DETAIL_WRAP_HPP_INCLUDED

View File

@ -0,0 +1,141 @@
// (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
// should be the last #include
#include <boost/type_traits/detail/size_t_trait_def.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>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,extent,(T))
};
} // namespace boost
#include <boost/type_traits/detail/size_t_trait_undef.hpp>
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED

View File

@ -0,0 +1,91 @@
// 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>
#ifdef BOOST_NO_CV_SPECIALIZATIONS
#include <boost/mpl/at.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/multiplies.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
// Should be the last #include
#include <boost/type_traits/detail/type_trait_def.hpp>
namespace boost {
namespace type_traits { namespace detail {
#ifndef BOOST_NO_CV_SPECIALIZATIONS
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;
};
#else
template<class T>
struct floating_point_promotion
: mpl::at<
mpl::vector< T, double, double const, double volatile,
double const volatile >
, mpl::plus<
is_same<T, float>
, mpl::multiplies< is_same<T, float const> , mpl::int_<2> >
, mpl::multiplies< is_same<T, float volatile> , mpl::int_<3> >
, mpl::multiplies< is_same<T, float const volatile>, mpl::int_<4> >
>
>
{
};
#endif
} }
BOOST_TT_AUX_TYPE_TRAIT_DEF1(
floating_point_promotion
, T
, BOOST_DEDUCED_TYPENAME
boost::type_traits::detail::floating_point_promotion<T>::type
)
}
#include <boost/type_traits/detail/type_trait_undef.hpp>
#endif // #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_const< Lhs_noref >::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_const< Lhs_noref >::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_const< Lhs_noref >::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* pointer */\
::boost::is_pointer< Rhs_noref >::value,\
/* fundamental non integral */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_noref >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::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

View 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::type_traits::ice_or<\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::is_void< Rhs_noptr >::value\
>::value,\
::boost::is_fundamental< Rhs_nocv >::value\
>::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

View 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::type_traits::ice_or<\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::value,\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Lhs==const and Rhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_const< Lhs_noref >::value,\
::boost::is_fundamental< Rhs_nocv >::value\
>::value,\
/* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::value,\
/* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value\
>::value\
>::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

View 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_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\
::boost::type_traits::ice_or<\
/* Lhs==pointer and Rhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_fundamental< Rhs_nocv >::value\
>::value,\
/* Rhs==pointer and Lhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::is_fundamental< Lhs_nocv >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_not<\
::boost::type_traits::ice_or<\
::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\
>::value\
>::value\
>::value\
>::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

View 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_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\
::boost::type_traits::ice_or<\
/* Lhs==pointer and Rhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_fundamental< Rhs_nocv >::value\
>::value,\
/* Rhs==pointer and Lhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::is_fundamental< Lhs_nocv >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_not<\
::boost::type_traits::ice_or<\
::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\
>::value\
>::value\
>::value\
>::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

View 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_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\
::boost::type_traits::ice_or<\
/* Lhs==pointer and Rhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_fundamental< Rhs_nocv >::value\
>::value,\
/* Rhs==pointer and Lhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::is_fundamental< Lhs_nocv >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_not<\
::boost::type_traits::ice_or<\
::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\
>::value\
>::value\
>::value\
>::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

View 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_LEFT_SHIFT_HPP_INCLUDED
#define BOOST_TT_HAS_LEFT_SHIFT_HPP_INCLUDED
#define BOOST_TT_TRAIT_NAME has_left_shift
#define BOOST_TT_TRAIT_OP <<
#define BOOST_TT_FORBIDDEN_IF\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_const< Lhs_noref >::value\
>::value\
>::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

View 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_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\
::boost::type_traits::ice_or<\
/* Lhs==pointer and Rhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_fundamental< Rhs_nocv >::value\
>::value,\
/* Rhs==pointer and Lhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::is_fundamental< Lhs_nocv >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_not<\
::boost::type_traits::ice_or<\
::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\
>::value\
>::value\
>::value\
>::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

View 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_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\
::boost::type_traits::ice_or<\
/* Lhs==pointer and Rhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_fundamental< Rhs_nocv >::value\
>::value,\
/* Rhs==pointer and Lhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::is_fundamental< Lhs_nocv >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_not<\
::boost::type_traits::ice_or<\
::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\
>::value\
>::value\
>::value\
>::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

View 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::type_traits::ice_or<\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_not< ::boost::is_convertible< Rhs_nocv, bool >::value >::value\
>::value\
>::value,\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::type_traits::ice_not< ::boost::is_convertible< Lhs_nocv, bool >::value >::value\
>::value\
>::value\
>::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

View 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

View 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::type_traits::ice_or<\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_not< ::boost::is_convertible< Rhs_nocv, bool >::value >::value\
>::value\
>::value,\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::type_traits::ice_not< ::boost::is_convertible< Lhs_nocv, bool >::value >::value\
>::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_const< Lhs_noref >::value\
>::value\
>::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

View 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::type_traits::ice_or<\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::value,\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Lhs==const and Rhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_const< Lhs_noref >::value,\
::boost::is_fundamental< Rhs_nocv >::value\
>::value,\
/* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::value,\
/* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value\
>::value\
>::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

View 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

View File

@ -0,0 +1,154 @@
// (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/config.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.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 =
(::boost::type_traits::ice_or<
(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))
>::value)
);
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_new_operator,T,::boost::detail::has_new_operator_impl<T>::value)
} // namespace boost
#if defined(BOOST_TT_AUX_MACRO_NEW_DEFINED)
# pragma pop_macro("new")
#endif
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED

View 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_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\
::boost::type_traits::ice_or<\
/* Lhs==pointer and Rhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_fundamental< Rhs_nocv >::value\
>::value,\
/* Rhs==pointer and Lhs==fundamental */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::is_fundamental< Lhs_nocv >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value,\
::boost::type_traits::ice_not<\
::boost::type_traits::ice_or<\
::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\
>::value\
>::value\
>::value\
>::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

View File

@ -0,0 +1,44 @@
// (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_ASSIGN_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED
#include <boost/type_traits/has_trivial_assign.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail{
template <class T>
struct has_nothrow_assign_imp{
#ifndef BOOST_HAS_NOTHROW_ASSIGN
BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_assign<T>::value);
#else
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_ASSIGN(T));
#endif
};
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::detail::has_nothrow_assign_imp<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED

View File

@ -0,0 +1,53 @@
// (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_CONSTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED
#include <boost/type_traits/has_trivial_constructor.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail{
template <class T>
struct has_nothrow_constructor_imp{
#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_CONSTRUCTOR(T));
#else
BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_constructor<T>::value);
#endif
};
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::detail::has_nothrow_constructor_imp<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_default_constructor,T,::boost::detail::has_nothrow_constructor_imp<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void volatile,false)
#endif
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED

View File

@ -0,0 +1,53 @@
// (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_COPY_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED
#include <boost/type_traits/has_trivial_copy.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail{
template <class T>
struct has_nothrow_copy_imp{
#ifdef BOOST_HAS_NOTHROW_COPY
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_COPY(T));
#else
BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_copy<T>::value);
#endif
};
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::detail::has_nothrow_copy_imp<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy_constructor,T,::boost::detail::has_nothrow_copy_imp<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void volatile,false)
#endif
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED

View File

@ -0,0 +1,25 @@
// (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>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_destructor,T,::boost::has_trivial_destructor<T>::value)
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED

View File

@ -0,0 +1,51 @@
// (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_OPERATOR_HPP_INCLUDED
#define BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
#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>
#include <boost/type_traits/has_not_equal_to.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_unary_minus.hpp>
#include <boost/type_traits/has_unary_plus.hpp>
#endif

View 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\
::boost::type_traits::ice_or<\
/* bool */\
::boost::is_same< bool, Lhs_nocv >::value,\
/* void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_void< Lhs_noptr >::value\
>::value,\
/* (fundamental or pointer) and const */\
::boost::type_traits::ice_and<\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
::boost::is_const< Lhs_noref >::value\
>::value,\
/* Arrays */ \
::boost::is_array<Lhs_noref>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* bool */\
::boost::is_same< bool, Lhs_nocv >::value,\
/* void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_void< Lhs_noptr >::value\
>::value,\
/* (fundamental or pointer) and const */\
::boost::type_traits::ice_and<\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
::boost::is_const< Lhs_noref >::value\
>::value,\
/* Arrays */ \
::boost::is_array<Lhs_noref>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* bool */\
::boost::is_same< bool, Rhs_nocv >::value,\
/* void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::is_void< Rhs_noptr >::value\
>::value,\
/* (fundamental or pointer) and const */\
::boost::type_traits::ice_and<\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
::boost::is_const< Rhs_noref >::value\
>::value,\
/* Arrays */ \
::boost::is_array<Rhs_noref>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* bool */\
::boost::is_same< bool, Rhs_nocv >::value,\
/* void* */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Rhs_noref >::value,\
::boost::is_void< Rhs_noptr >::value\
>::value,\
/* (fundamental or pointer) and const */\
::boost::type_traits::ice_and<\
::boost::type_traits::ice_or<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
::boost::is_const< Rhs_noref >::value\
>::value,\
/* Arrays */ \
::boost::is_array<Rhs_noref>::value\
>::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

View 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_RIGHT_SHIFT_HPP_INCLUDED
#define BOOST_TT_HAS_RIGHT_SHIFT_HPP_INCLUDED
#define BOOST_TT_TRAIT_NAME has_right_shift
#define BOOST_TT_TRAIT_OP >>
#define BOOST_TT_FORBIDDEN_IF\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value\
>::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

View 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\
::boost::type_traits::ice_or<\
/* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::type_traits::ice_or<\
::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\
::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
>::value\
>::value,\
/* Lhs==fundamental and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Rhs==fundamental and Lhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_pointer< Lhs_noref >::value\
>::value,\
/* Lhs==pointer and Rhs==pointer */\
::boost::type_traits::ice_and<\
::boost::is_pointer< Lhs_noref >::value,\
::boost::is_pointer< Rhs_noref >::value\
>::value,\
/* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
::boost::type_traits::ice_and<\
::boost::is_fundamental< Lhs_nocv >::value,\
::boost::is_fundamental< Rhs_nocv >::value,\
::boost::is_const< Lhs_noref >::value\
>::value\
>::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

View File

@ -0,0 +1,57 @@
// (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_TRIVIAL_ASSIGN_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
template <typename T>
struct has_trivial_assign_impl
{
#ifdef BOOST_HAS_TRIVIAL_ASSIGN
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_ASSIGN(T));
#else
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::is_pod<T>::value,
::boost::type_traits::ice_not< ::boost::is_const<T>::value >::value,
::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
>::value));
#endif
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_assign,T,::boost::detail::has_trivial_assign_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED

View File

@ -0,0 +1,51 @@
// (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_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
template <typename T>
struct has_trivial_ctor_impl
{
#ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_or<
::boost::is_pod<T>::value,
BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)
>::value));
#else
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_or<
::boost::is_pod<T>::value,
false
>::value));
#endif
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_constructor,T,::boost::detail::has_trivial_ctor_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_default_constructor,T,::boost::detail::has_trivial_ctor_impl<T>::value)
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED

View File

@ -0,0 +1,82 @@
// (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_TRIVIAL_COPY_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
#ifdef __clang__
#include <boost/type_traits/is_copy_constructible.hpp>
#endif
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
template <typename T>
struct has_trivial_copy_impl
{
#ifdef BOOST_HAS_TRIVIAL_COPY
# ifdef __clang__
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_COPY(T) && boost::is_copy_constructible<T>::value);
# else
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_COPY(T));
# endif
#else
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::is_pod<T>::value,
::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
>::value));
#endif
};
#ifdef __clang__
template <typename T, std::size_t N>
struct has_trivial_copy_impl<T[N]>
{
static const bool value = has_trivial_copy_impl<T>::value;
};
#endif
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy,T,::boost::detail::has_trivial_copy_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy_constructor,T,::boost::detail::has_trivial_copy_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void volatile,false)
#endif
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED

View File

@ -0,0 +1,49 @@
// (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_TRIVIAL_DESTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
template <typename T>
struct has_trivial_dtor_impl
{
#ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_DESTRUCTOR(T));
#else
BOOST_STATIC_CONSTANT(bool, value = ::boost::is_pod<T>::value);
#endif
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_destructor,T,::boost::detail::has_trivial_dtor_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED

View File

@ -0,0 +1,57 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// (C) Copyright Eric Friedman 2002-2003.
// (C) Copyright Antony Polukhin 2013.
// 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_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
template <typename T>
struct has_trivial_move_assign_impl
{
#ifdef BOOST_HAS_TRIVIAL_MOVE_ASSIGN
BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)));
#else
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::is_pod<T>::value,
::boost::type_traits::ice_not< ::boost::is_const<T>::value >::value,
::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
>::value));
#endif
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_assign,T,::boost::detail::has_trivial_move_assign_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED

View File

@ -0,0 +1,57 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// (C) Copyright Eric Friedman 2002-2003.
// (C) Copyright Antony Polukhin 2013.
// 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_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
template <typename T>
struct has_trivial_move_ctor_impl
{
#ifdef BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR
BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)));
#else
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::is_pod<T>::value,
::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
>::value));
#endif
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_constructor,T,::boost::detail::has_trivial_move_ctor_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED

View 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

View 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

View File

@ -0,0 +1,29 @@
// (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>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
#ifdef BOOST_HAS_VIRTUAL_DESTRUCTOR
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,BOOST_HAS_VIRTUAL_DESTRUCTOR(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED

View File

@ -0,0 +1,48 @@
// (C) Copyright Rani Sharoni 2003-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_BASE_OF_TR1_HPP_INCLUDED
#define BOOST_TT_IS_BASE_OF_TR1_HPP_INCLUDED
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost { namespace tr1{
namespace detail{
template <class B, class D>
struct is_base_of_imp
{
typedef typename remove_cv<B>::type ncvB;
typedef typename remove_cv<D>::type ncvD;
BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or<
(::boost::detail::is_base_and_derived_impl<ncvB,ncvD>::value),
(::boost::is_same<ncvB,ncvD>::value)>::value));
};
}
BOOST_TT_AUX_BOOL_TRAIT_DEF2(
is_base_of
, Base
, Derived
, (::boost::tr1::detail::is_base_of_imp<Base, Derived>::value))
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base,Derived&,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived&,false)
} } // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_BASE_OF_TR1_HPP_INCLUDED

View File

@ -0,0 +1,34 @@
// (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/type_traits/is_convertible.hpp>
#include <complex>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail{
struct is_convertible_from_tester
{
template <class T>
is_convertible_from_tester(const std::complex<T>&);
};
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_complex,T,(::boost::is_convertible<T, boost::detail::is_convertible_from_tester>::value))
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif //BOOST_TT_IS_COMPLEX_HPP

View File

@ -0,0 +1,46 @@
// (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/config.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
#if !defined( __CODEGEARC__ )
namespace detail {
template <typename T>
struct is_compound_impl
{
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_not<
::boost::is_fundamental<T>::value
>::value));
};
} // namespace detail
#endif // !defined( __CODEGEARC__ )
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,__is_compound(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,::boost::detail::is_compound_impl<T>::value)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_COMPOUND_HPP_INCLUDED

View File

@ -0,0 +1,147 @@
// (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/utility/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
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
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
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_copy_assignable,T,::boost::detail::is_copy_assignable_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED

View File

@ -0,0 +1,125 @@
// (C) Copyright Antony Polukhin 2013.
//
// 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_CONSTRUCTIBLE_HPP_INCLUDED
#define BOOST_TT_IS_COPY_CONSTRUCTIBLE_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/type_traits/add_reference.hpp>
#include <boost/type_traits/is_rvalue_reference.hpp>
#include <boost/utility/declval.hpp>
#include <boost/noncopyable.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail{
template <bool DerivedFromNoncopyable, class T>
struct is_copy_constructible_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_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_INTEL_CXX_VERSION) && !(defined(BOOST_MSVC) && _MSC_VER == 1800)
#ifdef BOOST_NO_CXX11_DECLTYPE
template <class T1>
static boost::type_traits::yes_type test(T1&, boost::mpl::int_<sizeof(T1(boost::declval<T1&>()))>* = 0);
#else
template <class T1>
static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval<T1&>()))* = 0);
#endif
static boost::type_traits::no_type test(...);
#else
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(...);
#endif
// If you see errors like this:
//
// `'T::T(const T&)' is private`
// `boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context`
//
// then you are trying to call that macro for a structure defined like that:
//
// struct T {
// ...
// private:
// T(const T &);
// ...
// };
//
// To fix that you must modify your structure:
//
// // C++03 and C++11 version
// struct T: private boost::noncopyable {
// ...
// private:
// T(const T &);
// ...
// };
//
// // C++11 version
// struct T {
// ...
// private:
// T(const T &) = delete;
// ...
// };
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(test(
boost::declval<BOOST_DEDUCED_TYPENAME boost::add_reference<T>::type>()
)) == sizeof(boost::type_traits::yes_type)
||
boost::is_rvalue_reference<T>::value
));
};
template <class T>
struct is_copy_constructible_impl2<true, T> {
BOOST_STATIC_CONSTANT(bool, value = false);
};
template <class T>
struct is_copy_constructible_impl {
BOOST_STATIC_CONSTANT(bool, value = (
boost::detail::is_copy_constructible_impl2<
boost::is_base_and_derived<boost::noncopyable, T>::value,
T
>::value
));
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_copy_constructible,T,::boost::detail::is_copy_constructible_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED

View File

@ -0,0 +1,142 @@
// (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/ice_or.hpp>
#include <boost/type_traits/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>
// should be always the last #include directive
#include <boost/type_traits/detail/bool_trait_def.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::type_traits::ice_or<
::boost::detail::empty_helper<cvt,::boost::is_class<T>::value>::value
, BOOST_INTERNAL_IS_EMPTY(cvt)
>::value
));
};
#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::type_traits::ice_or<
::boost::detail::empty_helper<
cvt
, ::boost::is_class<T>::value
, ::boost::is_convertible< r_type,int>::value
>::value
, BOOST_INTERNAL_IS_EMPTY(cvt)
>::value));
};
#endif // __BORLANDC__
// these help when the compiler has no partial specialization support:
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void const volatile,false)
#endif
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_empty,T,::boost::detail::is_empty_impl<T>::value)
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#undef BOOST_INTERNAL_IS_EMPTY
#endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED

View File

@ -0,0 +1,41 @@
// 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/remove_cv.hpp>
#include <boost/type_traits/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
template <typename T> struct is_final_impl
{
#ifdef BOOST_IS_FINAL
typedef typename remove_cv<T>::type cvt;
BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_FINAL(cvt));
#else
BOOST_STATIC_CONSTANT(bool, value = false);
#endif
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_final,T,::boost::detail::is_final_impl<T>::value)
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_FINAL_HPP_INCLUDED

View File

@ -0,0 +1,27 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000-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_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED
#define BOOST_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
//* is a type T a floating-point type described in the standard (3.9.1p8)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_floating_point,T,false)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_floating_point,float,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_floating_point,double,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_floating_point,long double,true)
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED

View File

@ -0,0 +1,46 @@
// (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/config.hpp>
#include <boost/type_traits/is_member_pointer.hpp>
#include <boost/type_traits/is_member_function_pointer.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail{
template <typename T>
struct is_member_object_pointer_impl
{
BOOST_STATIC_CONSTANT(
bool, value = (::boost::type_traits::ice_and<
::boost::is_member_pointer<T>::value,
::boost::type_traits::ice_not<
::boost::is_member_function_pointer<T>::value
>::value
>::value ));
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_object_pointer,T,::boost::detail::is_member_object_pointer_impl<T>::value)
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED

View File

@ -0,0 +1,108 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// (C) Copyright Eric Friedman 2002-2003.
// (C) Copyright Antony Polukhin 2013.
// 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_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED
#define BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED
#include <boost/config.hpp>
#include <boost/type_traits/has_trivial_move_assign.hpp>
#include <boost/type_traits/has_nothrow_assign.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/utility/declval.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail{
#ifdef BOOST_IS_NOTHROW_MOVE_ASSIGN
template <class T>
struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_NOTHROW_MOVE_ASSIGN(T)); };
template <class T>
struct is_nothrow_move_assignable_imp<T const>{ BOOST_STATIC_CONSTANT(bool, value = false); };
template <class T>
struct is_nothrow_move_assignable_imp<T volatile>{ BOOST_STATIC_CONSTANT(bool, value = false); };
template <class T>
struct is_nothrow_move_assignable_imp<T const volatile>{ BOOST_STATIC_CONSTANT(bool, value = false); };
template <class T>
struct is_nothrow_move_assignable_imp<T&>{ BOOST_STATIC_CONSTANT(bool, value = false); };
template <class T>
struct is_nothrow_move_assignable_imp<T&&>{ BOOST_STATIC_CONSTANT(bool, value = false); };
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
template <class T, class Enable = void>
struct false_or_cpp11_noexcept_move_assignable: public ::boost::false_type {};
template <class T>
struct false_or_cpp11_noexcept_move_assignable <
T,
typename ::boost::enable_if_c<sizeof(T) && BOOST_NOEXCEPT_EXPR(::boost::declval<T&>() = ::boost::declval<T>())>::type
> : public ::boost::integral_constant<bool, BOOST_NOEXCEPT_EXPR(::boost::declval<T&>() = ::boost::declval<T>())>
{};
template <class T>
struct is_nothrow_move_assignable_imp{
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::false_or_cpp11_noexcept_move_assignable<T>::value);
};
template <class T>
struct is_nothrow_move_assignable_imp<T const> : public ::boost::false_type {};
template <class T>
struct is_nothrow_move_assignable_imp<T volatile> : public ::boost::false_type{};
template <class T>
struct is_nothrow_move_assignable_imp<T const volatile> : public ::boost::false_type{};
template <class T>
struct is_nothrow_move_assignable_imp<T&> : public ::boost::false_type{};
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class T>
struct is_nothrow_move_assignable_imp<T&&> : public ::boost::false_type{};
#endif
#else
template <class T>
struct is_nothrow_move_assignable_imp{
BOOST_STATIC_CONSTANT(bool, value = (
::boost::type_traits::ice_and<
::boost::type_traits::ice_or<
::boost::has_trivial_move_assign<T>::value,
::boost::has_nothrow_assign<T>::value
>::value,
::boost::type_traits::ice_not< ::boost::is_array<T>::value >::value
>::value));
};
#endif
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_nothrow_move_assignable,T,::boost::detail::is_nothrow_move_assignable_imp<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED

View File

@ -0,0 +1,109 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// (C) Copyright Eric Friedman 2002-2003.
// (C) Copyright Antony Polukhin 2013.
// 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_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED
#define BOOST_TT_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED
#include <boost/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/has_trivial_move_constructor.hpp>
#include <boost/type_traits/has_nothrow_copy.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/utility/declval.hpp>
#include <boost/utility/enable_if.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail{
#ifdef BOOST_IS_NOTHROW_MOVE_CONSTRUCT
template <class T>
struct is_nothrow_move_constructible_imp{
BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T));
};
template <class T>
struct is_nothrow_move_constructible_imp<volatile T> : public ::boost::false_type {};
template <class T>
struct is_nothrow_move_constructible_imp<const volatile T> : public ::boost::false_type{};
template <class T>
struct is_nothrow_move_constructible_imp<T&> : public ::boost::false_type{};
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class T>
struct is_nothrow_move_constructible_imp<T&&> : public ::boost::false_type{};
#endif
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
template <class T, class Enable = void>
struct false_or_cpp11_noexcept_move_constructible: public ::boost::false_type {};
template <class T>
struct false_or_cpp11_noexcept_move_constructible <
T,
typename ::boost::enable_if_c<sizeof(T) && BOOST_NOEXCEPT_EXPR(T(::boost::declval<T>()))>::type
> : public ::boost::integral_constant<bool, BOOST_NOEXCEPT_EXPR(T(::boost::declval<T>()))>
{};
template <class T>
struct is_nothrow_move_constructible_imp{
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::false_or_cpp11_noexcept_move_constructible<T>::value);
};
template <class T>
struct is_nothrow_move_constructible_imp<volatile T> : public ::boost::false_type {};
template <class T>
struct is_nothrow_move_constructible_imp<const volatile T> : public ::boost::false_type{};
template <class T>
struct is_nothrow_move_constructible_imp<T&> : public ::boost::false_type{};
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class T>
struct is_nothrow_move_constructible_imp<T&&> : public ::boost::false_type{};
#endif
#else
template <class T>
struct is_nothrow_move_constructible_imp{
BOOST_STATIC_CONSTANT(bool, value =(
::boost::type_traits::ice_and<
::boost::type_traits::ice_or<
::boost::has_trivial_move_constructor<T>::value,
::boost::has_nothrow_copy<T>::value
>::value,
::boost::type_traits::ice_not< ::boost::is_array<T>::value >::value
>::value));
};
#endif
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_nothrow_move_constructible,T,::boost::detail::is_nothrow_move_constructible_imp<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void const volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void volatile,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED

View File

@ -0,0 +1,45 @@
// (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/type_traits/is_reference.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/is_function.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
#include <boost/config.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
template <typename T>
struct is_object_impl
{
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::type_traits::ice_not< ::boost::is_reference<T>::value>::value,
::boost::type_traits::ice_not< ::boost::is_void<T>::value>::value,
::boost::type_traits::ice_not< ::boost::is_function<T>::value>::value
>::value));
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_object,T,::boost::detail::is_object_impl<T>::value)
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_OBJECT_HPP_INCLUDED

View File

@ -0,0 +1,48 @@
// (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/type_traits/detail/ice_and.hpp>
#include <boost/config.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
template <typename T>
struct is_stateless_impl
{
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::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
>::value));
};
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_stateless,T,::boost::detail::is_stateless_impl<T>::value)
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_STATELESS_HPP_INCLUDED

Some files were not shown because too many files have changed in this diff Show More