/*
(c) 2014 Glen Joseph Fernandes
-glenjofe at gmail dot com
+<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
/*
(c) 2014 Glen Joseph Fernandes
-glenjofe at gmail dot com
+<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
namespace detail {
#if defined(BOOST_HAS_INTPTR_T)
-typedef boost::uintptr_t address_t;
+typedef boost::uintptr_t address;
#else
-typedef std::size_t address_t;
+typedef std::size_t address;
#endif
-} /* :detail */
-} /* :alignment */
-} /* :boost */
+} /* .detail */
+} /* .alignment */
+} /* .boost */
#endif
/*
(c) 2014 Glen Joseph Fernandes
-glenjofe at gmail dot com
+<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
void*& ptr, std::size_t& space)
{
BOOST_ASSERT(detail::is_alignment(alignment));
- std::size_t n = detail::address_t(ptr) & (alignment - 1);
+ std::size_t n = detail::address(ptr) & (alignment - 1);
if (n != 0) {
n = alignment - n;
}
return p;
}
-} /* :alignment */
-} /* :boost */
+} /* .alignment */
+} /* .boost */
#endif
/*
(c) 2014 Glen Joseph Fernandes
-glenjofe at gmail dot com
+<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
using std::align;
-} /* :alignment */
-} /* :boost */
+} /* .alignment */
+} /* .boost */
#endif
/*
(c) 2014 Glen Joseph Fernandes
-glenjofe at gmail dot com
+<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
return (value > 0) && ((value & (value - 1)) == 0);
}
-} /* :detail */
-} /* :alignment */
-} /* :boost */
+} /* .detail */
+} /* .alignment */
+} /* .boost */
#endif
+++ /dev/null
-//-----------------------------------------------------------------------------
-// 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
// BOOST_ASSERT_MSG(expr, msg)
// BOOST_VERIFY(expr)
// BOOST_VERIFY_MSG(expr, msg)
+// BOOST_ASSERT_IS_VOID
//
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2007, 2014 Peter Dimov
// Copyright (c) Beman Dawes 2011
+// Copyright (c) 2015 Ion Gaztanaga
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
//
//
-// BOOST_ASSERT, BOOST_ASSERT_MSG
+// BOOST_ASSERT, BOOST_ASSERT_MSG, BOOST_ASSERT_IS_VOID
//
#undef BOOST_ASSERT
#undef BOOST_ASSERT_MSG
+#undef BOOST_ASSERT_IS_VOID
#if defined(BOOST_DISABLE_ASSERTS) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && defined(NDEBUG) )
# define BOOST_ASSERT(expr) ((void)0)
# define BOOST_ASSERT_MSG(expr, msg) ((void)0)
+# define BOOST_ASSERT_IS_VOID
#elif defined(BOOST_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) )
# define BOOST_ASSERT(expr) assert(expr)
# define BOOST_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
+#if defined(NDEBUG)
+# define BOOST_ASSERT_IS_VOID
+#endif
#endif
//
// bind.hpp - binds function objects to arguments
//
-// Copyright (c) 2009 Peter Dimov
+// Copyright (c) 2009, 2015 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
#include <boost/bind/bind.hpp>
+#ifndef BOOST_BIND_NO_PLACEHOLDERS
+
+#if defined(BOOST_CLANG)
+# pragma clang diagnostic push
+# if __has_warning("-Wheader-hygiene")
+# pragma clang diagnostic ignored "-Wheader-hygiene"
+# endif
+#endif
+
+using namespace boost::placeholders;
+
+#if defined(BOOST_CLANG)
+# pragma clang diagnostic pop
+#endif
+
+#endif // #ifndef BOOST_BIND_NO_PLACEHOLDERS
+
#endif // #ifndef BOOST_BIND_HPP_INCLUDED
template< int I > struct arg
{
- arg()
+ BOOST_CONSTEXPR arg()
{
}
- template< class T > arg( T const & /* t */ )
+ template< class T > BOOST_CONSTEXPR arg( T const & /* t */ )
{
BOOST_STATIC_ASSERT( I == is_placeholder<T>::value );
}
};
-template< int I > bool operator==( arg<I> const &, arg<I> const & )
+template< int I > BOOST_CONSTEXPR bool operator==( arg<I> const &, arg<I> const & )
{
return true;
}
#include <boost/core/enable_if.hpp>
#include <boost/core/is_same.hpp>
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+#include <utility> // std::forward
+#endif
+
// Borland-specific bug, visit_each() silently fails to produce code
#if defined(__BORLANDC__)
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-template< class A > struct list_add_cref
+template< class A1 > class rrlist1
+{
+private:
+
+ A1 & a1_; // not A1&& because of msvc-10.0
+
+public:
+
+ explicit rrlist1( A1 & a1 ): a1_( a1 ) {}
+
+ A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); } // not static_cast because of g++ 4.9
+
+ A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+};
+
+template< class A1, class A2 > class rrlist2
{
- typedef A const & type;
+private:
+
+ A1 & a1_;
+ A2 & a2_;
+
+public:
+
+ rrlist2( A1 & a1, A2 & a2 ): a1_( a1 ), a2_( a2 ) {}
+
+ A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
+
+ A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+};
+
+template< class A1, class A2, class A3 > class rrlist3
+{
+private:
+
+ A1 & a1_;
+ A2 & a2_;
+ A3 & a3_;
+
+public:
+
+ rrlist3( A1 & a1, A2 & a2, A3 & a3 ): a1_( a1 ), a2_( a2 ), a3_( a3 ) {}
+
+ A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
+
+ A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
};
-template< class A > struct list_add_cref< A& >
+template< class A1, class A2, class A3, class A4 > class rrlist4
{
- typedef A & type;
+private:
+
+ A1 & a1_;
+ A2 & a2_;
+ A3 & a3_;
+ A4 & a4_;
+
+public:
+
+ rrlist4( A1 & a1, A2 & a2, A3 & a3, A4 & a4 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ) {}
+
+ A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
+
+ A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+};
+
+template< class A1, class A2, class A3, class A4, class A5 > class rrlist5
+{
+private:
+
+ A1 & a1_;
+ A2 & a2_;
+ A3 & a3_;
+ A4 & a4_;
+ A5 & a5_;
+
+public:
+
+ rrlist5( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ) {}
+
+ A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
+
+ A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+};
+
+template< class A1, class A2, class A3, class A4, class A5, class A6 > class rrlist6
+{
+private:
+
+ A1 & a1_;
+ A2 & a2_;
+ A3 & a3_;
+ A4 & a4_;
+ A5 & a5_;
+ A6 & a6_;
+
+public:
+
+ rrlist6( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ) {}
+
+ A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
+ A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
+
+ A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
+ A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+};
+
+template< class A1, class A2, class A3, class A4, class A5, class A6, class A7 > class rrlist7
+{
+private:
+
+ A1 & a1_;
+ A2 & a2_;
+ A3 & a3_;
+ A4 & a4_;
+ A5 & a5_;
+ A6 & a6_;
+ A7 & a7_;
+
+public:
+
+ rrlist7( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ) {}
+
+ A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
+ A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
+ A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
+
+ A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
+ A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
+ A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+};
+
+template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class rrlist8
+{
+private:
+
+ A1 & a1_;
+ A2 & a2_;
+ A3 & a3_;
+ A4 & a4_;
+ A5 & a5_;
+ A6 & a6_;
+ A7 & a7_;
+ A8 & a8_;
+
+public:
+
+ rrlist8( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ), a8_( a8 ) {}
+
+ A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
+ A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
+ A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
+ A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
+
+ A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
+ A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
+ A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
+ A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+};
+
+template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > class rrlist9
+{
+private:
+
+ A1 & a1_;
+ A2 & a2_;
+ A3 & a3_;
+ A4 & a4_;
+ A5 & a5_;
+ A6 & a6_;
+ A7 & a7_;
+ A8 & a8_;
+ A9 & a9_;
+
+public:
+
+ rrlist9( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ), a8_( a8 ), a9_( a9 ) {}
+
+ A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
+ A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
+ A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
+ A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
+ A9 && operator[] (boost::arg<9>) const { return std::forward<A9>( a9_ ); }
+
+ A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
+ A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
+ A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
+ A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
+ A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
+ A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
+ A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
+ A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
+ A9 && operator[] (boost::arg<9> (*) ()) const { return std::forward<A9>( a9_ ); }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
};
template<class R, class F, class L> class bind_t
template<class A1> result_type operator()( A1 && a1 )
{
- list1< typename list_add_cref<A1>::type > a( a1 );
+ rrlist1< A1 > a( a1 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1> result_type operator()( A1 && a1 ) const
{
- list1< typename list_add_cref<A1>::type > a( a1 );
+ rrlist1< A1 > a( a1 );
return l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 )
{
- list2< typename list_add_cref<A1>::type, typename list_add_cref<A2>::type > a( a1, a2 );
+ rrlist2< A1, A2 > a( a1, a2 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 ) const
{
- list2< typename list_add_cref<A1>::type, typename list_add_cref<A2>::type > a( a1, a2 );
+ rrlist2< A1, A2 > a( a1, a2 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 )
{
- list3<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type
- > a( a1, a2, a3 );
-
+ rrlist3< A1, A2, A3 > a( a1, a2, a3 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 ) const
{
- list3<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type
- > a( a1, a2, a3 );
-
+ rrlist3< A1, A2, A3 > a( a1, a2, a3 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
{
- list4<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type
- > a( a1, a2, a3, a4 );
-
+ rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 ) const
{
- list4<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type
- > a( a1, a2, a3, a4 );
-
+ rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
{
- list5<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type
- > a( a1, a2, a3, a4, a5 );
-
+ rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 ) const
{
- list5<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type
- > a( a1, a2, a3, a4, a5 );
-
+ rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
{
- list6<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type,
- typename list_add_cref<A6>::type
- > a( a1, a2, a3, a4, a5, a6 );
-
+ rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 ) const
{
- list6<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type,
- typename list_add_cref<A6>::type
- > a( a1, a2, a3, a4, a5, a6 );
-
+ rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
{
- list7<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type,
- typename list_add_cref<A6>::type,
- typename list_add_cref<A7>::type
- > a( a1, a2, a3, a4, a5, a6, a7 );
-
+ rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 ) const
{
- list7<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type,
- typename list_add_cref<A6>::type,
- typename list_add_cref<A7>::type
- > a( a1, a2, a3, a4, a5, a6, a7 );
-
+ rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
{
- list8<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type,
- typename list_add_cref<A6>::type,
- typename list_add_cref<A7>::type,
- typename list_add_cref<A8>::type
- > a( a1, a2, a3, a4, a5, a6, a7, a8 );
-
+ rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 ) const
{
- list8<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type,
- typename list_add_cref<A6>::type,
- typename list_add_cref<A7>::type,
- typename list_add_cref<A8>::type
- > a( a1, a2, a3, a4, a5, a6, a7, a8 );
-
+ rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
{
- list9<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type,
- typename list_add_cref<A6>::type,
- typename list_add_cref<A7>::type,
- typename list_add_cref<A8>::type,
- typename list_add_cref<A9>::type
- > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
-
+ rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
return l_( type<result_type>(), f_, a, 0 );
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 ) const
{
- list9<
- typename list_add_cref<A1>::type,
- typename list_add_cref<A2>::type,
- typename list_add_cref<A3>::type,
- typename list_add_cref<A4>::type,
- typename list_add_cref<A5>::type,
- typename list_add_cref<A6>::type,
- typename list_add_cref<A7>::type,
- typename list_add_cref<A8>::type,
- typename list_add_cref<A9>::type
- > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
-
+ rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
return l_( type<result_type>(), f_, a, 0 );
}
// bind/placeholders.hpp - _N definitions
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+// Copyright 2015 Peter Dimov
//
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
+// 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/bind/bind.html for documentation.
//
#include <boost/bind/arg.hpp>
#include <boost/config.hpp>
-namespace
+namespace boost
{
-#if defined(__BORLANDC__) || defined(__GNUC__) && (__GNUC__ < 4)
-
-static inline boost::arg<1> _1() { return boost::arg<1>(); }
-static inline boost::arg<2> _2() { return boost::arg<2>(); }
-static inline boost::arg<3> _3() { return boost::arg<3>(); }
-static inline boost::arg<4> _4() { return boost::arg<4>(); }
-static inline boost::arg<5> _5() { return boost::arg<5>(); }
-static inline boost::arg<6> _6() { return boost::arg<6>(); }
-static inline boost::arg<7> _7() { return boost::arg<7>(); }
-static inline boost::arg<8> _8() { return boost::arg<8>(); }
-static inline boost::arg<9> _9() { return boost::arg<9>(); }
+namespace placeholders
+{
-#elif defined(BOOST_MSVC) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031) || defined(__MWERKS__) || \
- defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
+#if defined(__BORLANDC__) || defined(__GNUC__) && (__GNUC__ < 4)
-static boost::arg<1> _1;
-static boost::arg<2> _2;
-static boost::arg<3> _3;
-static boost::arg<4> _4;
-static boost::arg<5> _5;
-static boost::arg<6> _6;
-static boost::arg<7> _7;
-static boost::arg<8> _8;
-static boost::arg<9> _9;
+inline boost::arg<1> _1() { return boost::arg<1>(); }
+inline boost::arg<2> _2() { return boost::arg<2>(); }
+inline boost::arg<3> _3() { return boost::arg<3>(); }
+inline boost::arg<4> _4() { return boost::arg<4>(); }
+inline boost::arg<5> _5() { return boost::arg<5>(); }
+inline boost::arg<6> _6() { return boost::arg<6>(); }
+inline boost::arg<7> _7() { return boost::arg<7>(); }
+inline boost::arg<8> _8() { return boost::arg<8>(); }
+inline boost::arg<9> _9() { return boost::arg<9>(); }
#else
-boost::arg<1> _1;
-boost::arg<2> _2;
-boost::arg<3> _3;
-boost::arg<4> _4;
-boost::arg<5> _5;
-boost::arg<6> _6;
-boost::arg<7> _7;
-boost::arg<8> _8;
-boost::arg<9> _9;
+BOOST_STATIC_CONSTEXPR boost::arg<1> _1;
+BOOST_STATIC_CONSTEXPR boost::arg<2> _2;
+BOOST_STATIC_CONSTEXPR boost::arg<3> _3;
+BOOST_STATIC_CONSTEXPR boost::arg<4> _4;
+BOOST_STATIC_CONSTEXPR boost::arg<5> _5;
+BOOST_STATIC_CONSTEXPR boost::arg<6> _6;
+BOOST_STATIC_CONSTEXPR boost::arg<7> _7;
+BOOST_STATIC_CONSTEXPR boost::arg<8> _8;
+BOOST_STATIC_CONSTEXPR boost::arg<9> _9;
#endif
-} // unnamed namespace
+} // namespace placeholders
+
+} // namespace boost
#endif // #ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
# include <boost/concept/assert.hpp>
-# include <boost/iterator.hpp>
+# include <iterator>
# include <boost/type_traits/conversion_traits.hpp>
# include <utility>
# include <boost/type_traits/is_same.hpp>
# include <boost/mpl/assert.hpp>
# include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp>
-# include <boost/detail/iterator.hpp>
# include <boost/concept/usage.hpp>
# include <boost/concept/detail/concept_def.hpp>
: Assignable<TT>
, EqualityComparable<TT>
{
- typedef typename boost::detail::iterator_traits<TT>::value_type value_type;
- typedef typename boost::detail::iterator_traits<TT>::difference_type difference_type;
- typedef typename boost::detail::iterator_traits<TT>::reference reference;
- typedef typename boost::detail::iterator_traits<TT>::pointer pointer;
- typedef typename boost::detail::iterator_traits<TT>::iterator_category iterator_category;
+ typedef typename std::iterator_traits<TT>::value_type value_type;
+ typedef typename std::iterator_traits<TT>::difference_type difference_type;
+ typedef typename std::iterator_traits<TT>::reference reference;
+ typedef typename std::iterator_traits<TT>::pointer pointer;
+ typedef typename std::iterator_traits<TT>::iterator_category iterator_category;
BOOST_CONCEPT_USAGE(InputIterator)
{
private:
TT a, b;
TT i, j;
- typename boost::detail::iterator_traits<TT>::difference_type n;
+ typename std::iterator_traits<TT>::difference_type n;
};
BOOST_concept(Mutable_RandomAccessIterator,(TT))
}
private:
TT i;
- typename boost::detail::iterator_traits<TT>::difference_type n;
+ typename std::iterator_traits<TT>::difference_type n;
};
//===========================================================================
#define __has_extension __has_feature
#endif
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
#if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif
// even though it defines __SIZEOF_INT128__.
// See https://svn.boost.org/trac/boost/ticket/10418
// Only re-enable this for nvcc if you're absolutely sure
-// of the circumstances under which it's supported:
+// of the circumstances under which it's supported.
+// Similarly __SIZEOF_INT128__ is defined when targetting msvc
+// compatibility even though the required support functions are absent.
//
-#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
+#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) && !defined(_MSC_VER)
# define BOOST_HAS_INT128
#endif
// All versions with __cplusplus above this value seem to support this:
# define BOOST_NO_CXX14_DIGIT_SEPARATORS
#endif
-
-
-// Unused attribute:
-#if defined(__GNUC__) && (__GNUC__ >= 4)
-# define BOOST_ATTRIBUTE_UNUSED __attribute__((unused))
+//
+// __builtin_unreachable:
+#if defined(__has_builtin) && __has_builtin(__builtin_unreachable)
+#define BOOST_UNREACHABLE_RETURN(x) __builtin_unreachable();
#endif
+// Clang has supported the 'unused' attribute since the first release.
+#define BOOST_ATTRIBUTE_UNUSED __attribute__((__unused__))
+
#ifndef BOOST_COMPILER
# define BOOST_COMPILER "Clang version " __clang_version__
#endif
#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
# define BOOST_HAS_INT128
#endif
+//
+// Recent GCC versions have a __float128 native type, we need to
+// include a std lib header to detect this - not ideal, but we'll
+// be including <cstddef> later anyway when we select the std lib.
+//
+#ifdef __cplusplus
+#include <cstddef>
+#else
+#include <stddef.h>
+#endif
+#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__)
+# define BOOST_HAS_FLOAT128
+#endif
// C++0x features in 4.3.n and later
//
//
// Unused attribute:
#if __GNUC__ >= 4
-# define BOOST_ATTRIBUTE_UNUSED __attribute__((unused))
+# define BOOST_ATTRIBUTE_UNUSED __attribute__((__unused__))
+#endif
+//
+// __builtin_unreachable:
+#if BOOST_GCC_VERSION >= 40800
+#define BOOST_UNREACHABLE_RETURN(x) __builtin_unreachable();
#endif
#ifndef BOOST_COMPILER
#include <boost/config/compiler/visualc.hpp>
+#undef BOOST_MSVC
+#undef BOOST_MSVC_FULL_VER
+
#if (__INTEL_COMPILER >= 1500) && (_MSC_VER >= 1900)
//
// These appear to be supported, even though VC++ may not support them:
#include <boost/config/compiler/gcc.hpp>
+#undef BOOST_GCC_VERSION
+#undef BOOST_GCC_CXX11
+
#endif
#undef BOOST_COMPILER
#define BOOST_NO_CXX11_FINAL
#endif
-//
-// Issues that effect all known versions:
-//
-// Variadic templates pass our test case, but enabling this
-// causes the compiler to issue a signal 11 and bail out
-// in various libraries. The others fail our test cases.
-//
+#if (__SUNPRO_CC < 0x5140) || (__cplusplus < 201103)
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#define BOOST_NO_CXX11_REF_QUALIFIERS
+#endif
+
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
//
// C++0x features
# define BOOST_NO_CXX11_EXTERN_TEMPLATE
// Variadic macros do not exist for VC7.1 and lower
# define BOOST_NO_CXX11_VARIADIC_MACROS
+# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
#endif
#if _MSC_VER < 1500 // 140X == VC++ 8.0
--- /dev/null
+// Copyright Nuxi, https://nuxi.nl/ 2015.
+// 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)
+
+#define BOOST_PLATFORM "CloudABI"
+
+#define BOOST_HAS_DIRENT_H
+#define BOOST_HAS_STDINT_H
+#define BOOST_HAS_UNISTD_H
+
+#define BOOST_HAS_CLOCK_GETTIME
+#define BOOST_HAS_EXPM1
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_LOG1P
+#define BOOST_HAS_NANOSLEEP
+#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_SCHED_YIELD
# define BOOST_NO_STDC_NAMESPACE
# endif
-# if (__GNUC__ == 4)
+# if (__GNUC__ >= 4)
// Both gcc and intel require these.
# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
# define BOOST_HAS_GETSYSTEMTIMEASFILETIME
#endif
+//
+// Windows Runtime
+//
+#if defined(WINAPI_FAMILY) && \
+ (WINAPI_FAMILY == WINAPI_FAMILY_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+# define BOOST_NO_ANSI_APIS
+#endif
+
#ifndef BOOST_DISABLE_WIN32
// WEK: Added
#define BOOST_HAS_FTIME
#elif defined(__VMS)
// VMS:
# define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp"
+
+#elif defined(__CloudABI__)
+// Nuxi CloudABI:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/cloudabi.hpp"
#else
# if defined(unix) \
// Bug specific to VC14,
// See https://connect.microsoft.com/VisualStudio/feedback/details/1348277/link-error-when-using-std-codecvt-utf8-utf16-char16-t
// and discussion here: http://blogs.msdn.com/b/vcblog/archive/2014/11/12/visual-studio-2015-preview-now-available.aspx?PageIndex=2
-#if _CPPLIB_VER == 650
+#if defined(_CPPLIB_VER) && (_CPPLIB_VER == 650)
# define BOOST_NO_CXX11_HDR_CODECVT
#endif
+#if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 650)
+// If _HAS_AUTO_PTR_ETC is defined to 0, std::auto_ptr is not available.
+// See https://www.visualstudio.com/en-us/news/vs2015-vs.aspx#C++
+// and http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
+# if defined(_HAS_AUTO_PTR_ETC) && (_HAS_AUTO_PTR_ETC == 0)
+# define BOOST_NO_AUTO_PTR
+# endif
+#endif
+
#ifdef _CPPLIB_VER
# define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER
#else
#define BOOST_NO_CXX11_HDR_FUTURE
#define BOOST_NO_CXX11_HDR_FORWARD_LIST
#define BOOST_NO_CXX11_HDR_ATOMIC
+// shared_ptr is present, but is not convertible to bool
+// which causes all kinds of problems especially in Boost.Thread
+// but probably elsewhere as well.
+#define BOOST_NO_CXX11_SMART_PTR
#endif
#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1))
// is defined, in which case it evaluates to return x; Use when you have a return
// statement that can never be reached.
-#ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
-# define BOOST_UNREACHABLE_RETURN(x) return x;
-#else
-# define BOOST_UNREACHABLE_RETURN(x)
+#ifndef BOOST_UNREACHABLE_RETURN
+# ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
+# define BOOST_UNREACHABLE_RETURN(x) return x;
+# else
+# define BOOST_UNREACHABLE_RETURN(x)
+# endif
#endif
// BOOST_DEDUCED_TYPENAME workaround ------------------------------------------//
# endif
}
#endif
+// same again for __float128:
+#if defined(BOOST_HAS_FLOAT128) && defined(__cplusplus)
+namespace boost {
+# ifdef __GNUC__
+ __extension__ typedef __float128 float128_type;
+# else
+ typedef __float128 float128_type;
+# endif
+}
+#endif
// BOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------//
//! - boost::container::vector
//! - boost::container::stable_vector
//! - boost::container::static_vector
+//! - boost::container::small_vector
//! - boost::container::slist
//! - boost::container::list
//! - boost::container::set
//! - boost::container::string
//! - boost::container::wstring
//!
-//! It forward declares the following allocators:
+//! Forward declares the following allocators:
//! - boost::container::allocator
//! - boost::container::node_allocator
//! - boost::container::adaptive_pool
//!
+//! Forward declares the following polymorphic resource classes:
+//! - boost::container::pmr::memory_resource
+//! - boost::container::pmr::polymorphic_allocator
+//! - boost::container::pmr::monotonic_buffer_resource
+//! - boost::container::pmr::pool_options
+//! - boost::container::pmr::unsynchronized_pool_resource
+//! - boost::container::pmr::synchronized_pool_resource
+//!
//! And finally it defines the following types
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
namespace boost{
namespace intrusive{
+namespace detail{
//Create namespace to avoid compilation errors
-}}
+}}}
namespace boost{ namespace container{ namespace container_detail{
namespace bi = boost::intrusive;
+ namespace bid = boost::intrusive::detail;
+}}}
+
+namespace boost{ namespace container{ namespace pmr{
+ namespace bi = boost::intrusive;
+ namespace bid = boost::intrusive::detail;
}}}
#include <cstddef>
, std::size_t Version = 2>
class node_allocator;
+namespace pmr {
+
+class memory_resource;
+
+template<class T>
+class polymorphic_allocator;
+
+class monotonic_buffer_resource;
+
+struct pool_options;
+
+template <class Allocator>
+class resource_adaptor_imp;
+
+class unsynchronized_pool_resource;
+
+class synchronized_pool_resource;
+
+} //namespace pmr {
+
#else
//! Default options for tree-based associative containers
// Standard predeclarations
//////////////////////////////////////////////////////////////////////////////
-#if defined(_LIBCPP_VERSION)
- #define BOOST_CONTAINER_CLANG_INLINE_STD_NS
- #pragma GCC diagnostic push
- #if defined(__clang__)
- #pragma GCC diagnostic ignored "-Wc++11-extensions"
- #endif
- #define BOOST_CONTAINER_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD
- #define BOOST_CONTAINER_STD_NS_END _LIBCPP_END_NAMESPACE_STD
-#elif defined(BOOST_GNU_STDLIB) && defined(_GLIBCXX_BEGIN_NAMESPACE_VERSION) //GCC >= 4.6
- #define BOOST_CONTAINER_STD_NS_BEG namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION
- #define BOOST_CONTAINER_STD_NS_END _GLIBCXX_END_NAMESPACE_VERSION } // namespace
-#elif defined(BOOST_GNU_STDLIB) && defined(_GLIBCXX_BEGIN_NAMESPACE) //GCC >= 4.2
- #define BOOST_CONTAINER_STD_NS_BEG _GLIBCXX_BEGIN_NAMESPACE(std)
- #define BOOST_CONTAINER_STD_NS_END _GLIBCXX_END_NAMESPACE
-#else
- #define BOOST_CONTAINER_STD_NS_BEG namespace std{
- #define BOOST_CONTAINER_STD_NS_END }
-#endif
-
-BOOST_CONTAINER_STD_NS_BEG
+#include <boost/move/detail/std_ns_begin.hpp>
+BOOST_MOVE_STD_NS_BEG
template<class T>
class allocator;
struct allocator_arg_t;
-BOOST_CONTAINER_STD_NS_END
+struct piecewise_construct_t;
-#ifdef BOOST_CONTAINER_CLANG_INLINE_STD_NS
- #pragma GCC diagnostic pop
- #undef BOOST_CONTAINER_CLANG_INLINE_STD_NS
-#endif //BOOST_CONTAINER_CLANG_INLINE_STD_NS
+BOOST_MOVE_STD_NS_END
+#include <boost/move/detail/std_ns_end.hpp>
#endif //#ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP
#if defined( BOOST_CORE_HAS_CXXABI_H )
# include <cxxabi.h>
-# include <cstdlib>
-# include <cstddef>
+// For some archtectures (mips, mips64, x86, x86_64) cxxabi.h in Android NDK is implemented by gabi++ library
+// (https://android.googlesource.com/platform/ndk/+/master/sources/cxx-stl/gabi++/), which does not implement
+// abi::__cxa_demangle(). We detect this implementation by checking the include guard here.
+# if defined( __GABIXX_CXXABI_H__ )
+# undef BOOST_CORE_HAS_CXXABI_H
+# else
+# include <cstdlib>
+# include <cstddef>
+# endif
#endif
namespace boost
namespace boost
{
+ template<typename T, typename R=void>
+ struct enable_if_has_type
+ {
+ typedef R type;
+ };
template <bool B, class T = void>
struct enable_if_c {
template <typename T>
struct enable_if_does_not_work_on_this_compiler;
+ template<typename T, typename R=void>
+ struct enable_if_has_type : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
template <bool B, class T = detail::enable_if_default_T>
struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
{ };
# endif
-#ifdef __QNX__
+#if defined(__QNX__) && defined(__EXT_QNX)
// QNX (Dinkumware stdlib) defines these as non-standard names.
// Reflect to the standard names.
{
}
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+# pragma GCC visibility push (default)
+# endif
+#endif
template <class T>
class
clone_impl:
}
};
}
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+# pragma GCC visibility pop
+# endif
+#endif
template <class T>
inline
typedef typename string_type::size_type size_type;
basic_oaltstringstream<Ch, Tr, Alloc> oss( &buf);
+
+ if(loc_p != NULL)
+ oss.imbue(*loc_p);
+
specs.fmtstate_.apply_on(oss, loc_p);
// the stream format state can be modified by manipulators in the argument :
// passed by copy.
//
// BOOST_HASH_SPECIALIZE_REF - define a specialization for a type which is
- // passed by copy.
+ // passed by const reference.
//
// These are undefined later.
#include <boost/range/iterator_range_core.hpp>
#include <boost/lexical_cast/bad_lexical_cast.hpp>
#include <boost/lexical_cast/try_lexical_convert.hpp>
-#include <boost/utility/value_init.hpp>
namespace boost
{
template <typename Target, typename Source>
inline Target lexical_cast(const Source &arg)
{
- boost::value_initialized<Target> result;
+ Target result;
- if (!boost::conversion::detail::try_lexical_convert(arg, get(result))) {
+ if (!boost::conversion::detail::try_lexical_convert(arg, result)) {
boost::conversion::detail::throw_bad_cast<Source, Target>();
}
- return get(result);
+ return result;
}
template <typename Target>
#endif
};
-#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
// Helper for floating point types.
// -1.23456789e-123456
// ^ sign
Source, BOOST_DEDUCED_TYPENAME boost::enable_if<boost::is_float<Source> >::type
>
{
+
+#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
BOOST_STATIC_ASSERT(
std::numeric_limits<Source>::max_exponent10 <= 999999L &&
std::numeric_limits<Source>::min_exponent10 >= -999999L
BOOST_STATIC_CONSTANT(std::size_t, value =
5 + lcast_precision<Source>::value + 6
);
- };
+#else // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+ BOOST_STATIC_CONSTANT(std::size_t, value = 156);
#endif // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+ };
}
namespace detail // lexical_cast_stream_traits<Source, Target>
# pragma once
#endif
+#if defined(__clang__) || (defined(__GNUC__) && \
+ !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuninitialized"
+#endif
+
#include <string>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/identity.hpp>
} // namespace boost
+#if defined(__clang__) || (defined(__GNUC__) && \
+ !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))
+#pragma GCC diagnostic pop
+#endif
+
#endif // BOOST_LEXICAL_CAST_TRY_LEXICAL_CONVERT_HPP
namespace tools{
template <class T>
-int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T));
+BOOST_MATH_CONSTEXPR int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_NOEXCEPT;
template <class T>
-T epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T));
+BOOST_MATH_CONSTEXPR T epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T);
}
//
// Define macros for our default policies, if they're not defined already:
//
+// Special cases for exceptions disabled first:
+//
+#ifdef BOOST_NO_EXCEPTIONS
+# ifndef BOOST_MATH_DOMAIN_ERROR_POLICY
+# define BOOST_MATH_DOMAIN_ERROR_POLICY errno_on_error
+# endif
+# ifndef BOOST_MATH_POLE_ERROR_POLICY
+# define BOOST_MATH_POLE_ERROR_POLICY errno_on_error
+# endif
+# ifndef BOOST_MATH_OVERFLOW_ERROR_POLICY
+# define BOOST_MATH_OVERFLOW_ERROR_POLICY errno_on_error
+# endif
+# ifndef BOOST_MATH_EVALUATION_ERROR_POLICY
+# define BOOST_MATH_EVALUATION_ERROR_POLICY errno_on_error
+# endif
+# ifndef BOOST_MATH_ROUNDING_ERROR_POLICY
+# define BOOST_MATH_ROUNDING_ERROR_POLICY errno_on_error
+# endif
+#endif
+//
+// Then the regular cases:
+//
#ifndef BOOST_MATH_DOMAIN_ERROR_POLICY
#define BOOST_MATH_DOMAIN_ERROR_POLICY throw_on_error
#endif
typedef policy<detail::forwarding_arg1, detail::forwarding_arg2> type;
};
-inline policy<> make_policy()
+inline BOOST_MATH_CONSTEXPR policy<> make_policy() BOOST_NOEXCEPT
{ return policy<>(); }
template <class A1>
-inline typename normalise<policy<>, A1>::type make_policy(const A1&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1>::type make_policy(const A1&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1>::type result_type;
return result_type();
}
template <class A1, class A2>
-inline typename normalise<policy<>, A1, A2>::type make_policy(const A1&, const A2&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2>::type make_policy(const A1&, const A2&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2>::type result_type;
return result_type();
}
template <class A1, class A2, class A3>
-inline typename normalise<policy<>, A1, A2, A3>::type make_policy(const A1&, const A2&, const A3&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2, A3>::type make_policy(const A1&, const A2&, const A3&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2, A3>::type result_type;
return result_type();
}
template <class A1, class A2, class A3, class A4>
-inline typename normalise<policy<>, A1, A2, A3, A4>::type make_policy(const A1&, const A2&, const A3&, const A4&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2, A3, A4>::type make_policy(const A1&, const A2&, const A3&, const A4&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2, A3, A4>::type result_type;
return result_type();
}
template <class A1, class A2, class A3, class A4, class A5>
-inline typename normalise<policy<>, A1, A2, A3, A4, A5>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2, A3, A4, A5>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2, A3, A4, A5>::type result_type;
return result_type();
}
template <class A1, class A2, class A3, class A4, class A5, class A6>
-inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2, A3, A4, A5, A6>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6>::type result_type;
return result_type();
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
-inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7>::type result_type;
return result_type();
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
-inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8>::type result_type;
return result_type();
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
-inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9>::type result_type;
return result_type();
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
-inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&, const A10&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&, const A10&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>::type result_type;
return result_type();
}
template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
-inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&, const A10&, const A11&)
+inline BOOST_MATH_CONSTEXPR typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&, const A10&, const A11&) BOOST_NOEXCEPT
{
typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>::type result_type;
return result_type();
namespace detail{
template <class T, class Policy>
-inline int digits_imp(mpl::true_ const&)
+inline BOOST_MATH_CONSTEXPR int digits_imp(mpl::true_ const&) BOOST_NOEXCEPT
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::is_specialized);
}
template <class T, class Policy>
-inline int digits_imp(mpl::false_ const&)
+inline BOOST_MATH_CONSTEXPR int digits_imp(mpl::false_ const&) BOOST_NOEXCEPT
{
return tools::digits<T>();
}
} // namespace detail
template <class T, class Policy>
-inline int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T))
+inline BOOST_MATH_CONSTEXPR int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_NOEXCEPT
{
typedef mpl::bool_< std::numeric_limits<T>::is_specialized > tag_type;
return detail::digits_imp<T, Policy>(tag_type());
}
template <class T, class Policy>
-inline int digits_base10(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T))
+inline BOOST_MATH_CONSTEXPR int digits_base10(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_NOEXCEPT
{
return boost::math::policies::digits<T, Policy>() * 301 / 1000L;
}
template <class Policy>
-inline unsigned long get_max_series_iterations()
+inline BOOST_MATH_CONSTEXPR unsigned long get_max_series_iterations() BOOST_NOEXCEPT
{
typedef typename Policy::max_series_iterations_type iter_type;
return iter_type::value;
}
template <class Policy>
-inline unsigned long get_max_root_iterations()
+inline BOOST_MATH_CONSTEXPR unsigned long get_max_root_iterations() BOOST_NOEXCEPT
{
typedef typename Policy::max_root_iterations_type iter_type;
return iter_type::value;
template <class T, class Digits, class Small, class Default>
struct series_factor_calc
{
- static T get()
+ static T get() BOOST_MATH_NOEXCEPT(T)
{
return ldexp(T(1.0), 1 - Digits::value);
}
template <class T, class Digits>
struct series_factor_calc<T, Digits, mpl::true_, mpl::true_>
{
- static T get()
+ static BOOST_MATH_CONSTEXPR T get() BOOST_MATH_NOEXCEPT(T)
{
return boost::math::tools::epsilon<T>();
}
template <class T, class Digits>
struct series_factor_calc<T, Digits, mpl::true_, mpl::false_>
{
- static T get()
+ BOOST_STATIC_CONSTANT(boost::uintmax_t, v = static_cast<boost::uintmax_t>(1u) << (Digits::value - 1));
+
+ static BOOST_MATH_CONSTEXPR T get() BOOST_MATH_NOEXCEPT(T)
{
- static const boost::uintmax_t v = static_cast<boost::uintmax_t>(1u) << (Digits::value - 1);
return 1 / static_cast<T>(v);
}
};
template <class T, class Digits>
struct series_factor_calc<T, Digits, mpl::false_, mpl::true_>
{
- static T get()
+ static BOOST_MATH_CONSTEXPR T get() BOOST_MATH_NOEXCEPT(T)
{
return boost::math::tools::epsilon<T>();
}
};
template <class T, class Policy>
-inline T get_epsilon_imp(mpl::true_ const&)
+inline BOOST_MATH_CONSTEXPR T get_epsilon_imp(mpl::true_ const&) BOOST_MATH_NOEXCEPT(T)
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::is_specialized);
}
template <class T, class Policy>
-inline T get_epsilon_imp(mpl::false_ const&)
+inline BOOST_MATH_CONSTEXPR T get_epsilon_imp(mpl::false_ const&) BOOST_MATH_NOEXCEPT(T)
{
return tools::epsilon<T>();
}
} // namespace detail
template <class T, class Policy>
-inline T get_epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T))
+inline BOOST_MATH_CONSTEXPR T get_epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) BOOST_MATH_NOEXCEPT(T)
{
typedef mpl::bool_< (std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::radix == 2)) > tag_type;
return detail::get_epsilon_imp<T, Policy>(tag_type());
{
typedef typename Policy::domain_error_type domain_error_type;
typedef typename mpl::if_c<
- (domain_error_type::value == throw_on_error) || (domain_error_type::value == user_error),
+ (domain_error_type::value == throw_on_error) || (domain_error_type::value == user_error) || (domain_error_type::value == errno_on_error),
mpl::true_,
mpl::false_>::type type;
};
mpl::false_,
mpl::true_>::type type;
};
+//
+// Does the Policy ever throw on error?
+//
+template <class Policy>
+struct is_noexcept_error_policy
+{
+ typedef typename Policy::domain_error_type t1;
+ typedef typename Policy::pole_error_type t2;
+ typedef typename Policy::overflow_error_type t3;
+ typedef typename Policy::underflow_error_type t4;
+ typedef typename Policy::denorm_error_type t5;
+ typedef typename Policy::evaluation_error_type t6;
+ typedef typename Policy::rounding_error_type t7;
+ typedef typename Policy::indeterminate_result_error_type t8;
+
+ BOOST_STATIC_CONSTANT(bool, value =
+ ((t1::value != throw_on_error) && (t1::value != user_error)
+ && (t2::value != throw_on_error) && (t2::value != user_error)
+ && (t3::value != throw_on_error) && (t3::value != user_error)
+ && (t4::value != throw_on_error) && (t4::value != user_error)
+ && (t5::value != throw_on_error) && (t5::value != user_error)
+ && (t6::value != throw_on_error) && (t6::value != user_error)
+ && (t7::value != throw_on_error) && (t7::value != user_error)
+ && (t8::value != throw_on_error) && (t8::value != user_error)));
+};
}}} // namespaces
#endif // BOOST_MATH_POLICY_HPP
-
-
#if defined(_MSC_VER) || defined(__BORLANDC__)
#include <float.h>
#endif
+#ifdef BOOST_MATH_USE_FLOAT128
+#include "quadmath.h"
+#endif
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std{ using ::abs; using ::fabs; }
{
return false;
}
-
+#ifdef BOOST_MATH_USE_FLOAT128
+inline bool is_nan_helper(__float128 f, const boost::true_type&) { return ::isnanq(f); }
+inline bool is_nan_helper(__float128 f, const boost::false_type&) { return ::isnanq(f); }
+#endif
}
namespace math{
return detail::isinf_impl(static_cast<value_type>(x), method());
}
#endif
+#ifdef BOOST_MATH_USE_FLOAT128
+template<>
+inline bool (isinf)(__float128 x)
+{
+ return ::isinfq(x);
+}
+#endif
//------------------------------------------------------------------------------
return detail::isnan_impl(x, method());
}
#endif
+#ifdef BOOST_MATH_USE_FLOAT128
+template<>
+inline bool (isnan)(__float128 x)
+{
+ return ::isnanq(x);
+}
+#endif
} // namespace math
} // namespace boost
template <class T>
typename tools::promote_args<T>::type
legendre_p(int l, T x);
-
+#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
template <class T, class Policy>
typename boost::enable_if_c<policies::is_policy<Policy>::value, typename tools::promote_args<T>::type>::type
legendre_p(int l, T x, const Policy& pol);
-
+#endif
template <class T>
typename tools::promote_args<T>::type
legendre_q(unsigned l, T x);
-
+#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
template <class T, class Policy>
typename boost::enable_if_c<policies::is_policy<Policy>::value, typename tools::promote_args<T>::type>::type
legendre_q(unsigned l, T x, const Policy& pol);
-
+#endif
template <class T1, class T2, class T3>
typename tools::promote_args<T1, T2, T3>::type
legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1);
template <class T1, class T2, class Policy>
struct bessel_traits
{
- typedef typename tools::promote_args<
- T1, T2
+ typedef typename mpl::if_<
+ is_integral<T1>,
+ typename tools::promote_args<T2>::type,
+ typename tools::promote_args<T1, T2>::type
>::type result_type;
typedef typename policies::precision<result_type, Policy>::type precision_type;
template <class T>
typename tools::promote_args<T>::type float_advance(const T& val, int distance);
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type ulp(const T& val, const Policy& pol);
+ template <class T>
+ typename tools::promote_args<T>::type ulp(const T& val);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type relative_difference(const T&, const U&);
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type epsilon_difference(const T&, const U&);
+
template<class T>
T unchecked_bernoulli_b2n(const std::size_t n);
template <class T, class Policy>
template <class T> T float_next(const T& a){ return boost::math::float_next(a, Policy()); }\
template <class T> T float_prior(const T& a){ return boost::math::float_prior(a, Policy()); }\
template <class T> T float_distance(const T& a, const T& b){ return boost::math::float_distance(a, b, Policy()); }\
+ template <class T> T ulp(const T& a){ return boost::math::ulp(a, Policy()); }\
\
template <class RT1, class RT2>\
inline typename boost::math::tools::promote_args<RT1, RT2>::type owens_t(RT1 a, RT2 z){ return boost::math::owens_t(a, z, Policy()); }\
#endif
#include <boost/config.hpp>
+#include <boost/predef.h>
#include <boost/cstdint.hpp> // for boost::uintmax_t
#include <boost/detail/workaround.hpp>
#include <boost/type_traits/is_integral.hpp>
//
#ifdef BOOST_MSVC
# define BOOST_MATH_POLY_METHOD 2
+# define BOOST_MATH_RATIONAL_METHOD 1
#elif defined(BOOST_INTEL)
# define BOOST_MATH_POLY_METHOD 2
-# define BOOST_MATH_RATIONAL_METHOD 2
+# define BOOST_MATH_RATIONAL_METHOD 1
#elif defined(__GNUC__)
+#if __GNUC__ < 4
# define BOOST_MATH_POLY_METHOD 3
# define BOOST_MATH_RATIONAL_METHOD 3
# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
+#else
+# define BOOST_MATH_POLY_METHOD 3
+# define BOOST_MATH_RATIONAL_METHOD 1
+#endif
#endif
#if defined(BOOST_NO_LONG_LONG) && !defined(BOOST_MATH_INT_TABLE_TYPE)
# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
#endif
+//
+// constexpr support, early GCC implementations can't cope so disable
+// constexpr for them:
+//
+#if !defined(__clang) && defined(__GNUC__)
+#if (__GNUC__ * 100 + __GNUC_MINOR__) < 490
+# define BOOST_MATH_DISABLE_CONSTEXPR
+#endif
+#endif
+
+#ifdef BOOST_MATH_DISABLE_CONSTEXPR
+# define BOOST_MATH_CONSTEXPR
+#else
+# define BOOST_MATH_CONSTEXPR BOOST_CONSTEXPR
+#endif
+
+//
+// noexcept support:
+//
+#ifndef BOOST_NO_CXX11_NOEXCEPT
+#ifndef BOOST_NO_CXX11_HDR_TYPE_TRAITS
+#include <type_traits>
+# define BOOST_MATH_NOEXCEPT(T) noexcept(std::is_floating_point<T>::value)
+# define BOOST_MATH_IS_FLOAT(T) (std::is_floating_point<T>::value)
+#else
+#include <boost/type_traits/is_floating_point.hpp>
+# define BOOST_MATH_NOEXCEPT(T) noexcept(boost::is_floating_point<T>::value)
+# define BOOST_MATH_IS_FLOAT(T) (boost::is_floating_point<T>::value)
+#endif
+#else
+# define BOOST_MATH_NOEXCEPT(T)
+# define BOOST_MATH_IS_FLOAT(T) false
+#endif
+
//
// The maximum order of polynomial that will be evaluated
// via an unrolled specialisation:
//
#ifndef BOOST_MATH_MAX_POLY_ORDER
-# define BOOST_MATH_MAX_POLY_ORDER 17
+# define BOOST_MATH_MAX_POLY_ORDER 20
#endif
//
// Set the method used to evaluate polynomials and rationals:
//
#ifndef BOOST_MATH_POLY_METHOD
-# define BOOST_MATH_POLY_METHOD 1
+# define BOOST_MATH_POLY_METHOD 2
#endif
#ifndef BOOST_MATH_RATIONAL_METHOD
-# define BOOST_MATH_RATIONAL_METHOD 0
+# define BOOST_MATH_RATIONAL_METHOD 1
#endif
//
// decide whether to store constants as integers or reals:
# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##SUF
#endif
//
-// Test whether to support __float128:
+// Test whether to support __float128, if we don't have quadmath.h then this can't currently work:
+//
+#ifndef BOOST_MATH_USE_FLOAT128
+#ifdef __has_include
+#if ! __has_include("quadmath.h")
+#define BOOST_MATH_DISABLE_FLOAT128
+#endif
+#elif !defined(BOOST_ARCH_X86)
+#define BOOST_MATH_DISABLE_FLOAT128
+#endif
+#endif
+//
+// And then the actual configuration:
//
#if defined(_GLIBCXX_USE_FLOAT128) && defined(BOOST_GCC) && !defined(__STRICT_ANSI__) \
&& !defined(BOOST_MATH_DISABLE_FLOAT128) || defined(BOOST_MATH_USE_FLOAT128)
{
template <class T>
-inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c)
+inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c) BOOST_MATH_NOEXCEPT(T)
{
return (std::max)((std::max)(a, b), c);
}
template <class T>
-inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d)
+inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d) BOOST_MATH_NOEXCEPT(T)
{
return (std::max)((std::max)(a, b), (std::max)(c, d));
}
} // namespace tools
template <class T>
-void suppress_unused_variable_warning(const T&)
+void suppress_unused_variable_warning(const T&) BOOST_MATH_NOEXCEPT(T)
{
}
typedef typename mpl::if_<
typename mpl::and_<is_floating_point<T1P>, is_floating_point<T2P> >::type, // both T1P and T2P are floating-point?
- typename mpl::if_< typename mpl::or_<is_same<long double, T1P>, is_same<long double, T2P> >::type, // either long double?
- long double, // then result type is long double.
- typename mpl::if_< typename mpl::or_<is_same<double, T1P>, is_same<double, T2P> >::type, // either double?
- double, // result type is double.
- float // else result type is float.
- >::type
- >::type,
+#ifdef BOOST_MATH_USE_FLOAT128
+ typename mpl::if_< typename mpl::or_<is_same<__float128, T1P>, is_same<__float128, T2P> >::type, // either long double?
+ __float128,
+#endif
+ typename mpl::if_< typename mpl::or_<is_same<long double, T1P>, is_same<long double, T2P> >::type, // either long double?
+ long double, // then result type is long double.
+ typename mpl::if_< typename mpl::or_<is_same<double, T1P>, is_same<double, T2P> >::type, // either double?
+ double, // result type is double.
+ float // else result type is float.
+ >::type
+#ifdef BOOST_MATH_USE_FLOAT128
+ >::type
+#endif
+ >::type,
// else one or the other is a user-defined type:
typename mpl::if_< typename mpl::and_<mpl::not_<is_floating_point<T2P> >, ::boost::is_convertible<T1P, T2P> >, T2P, T1P>::type>::type type;
}; // promote_arg2
#ifndef BOOST_MATH_TOOLS_REAL_CAST_HPP
#define BOOST_MATH_TOOLS_REAL_CAST_HPP
+#include <boost/math/tools/config.hpp>
+
#ifdef _MSC_VER
#pragma once
#endif
namespace tools
{
template <class To, class T>
- inline To real_cast(T t)
+ inline BOOST_MATH_CONSTEXPR To real_cast(T t) BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(T) && BOOST_MATH_IS_FLOAT(To))
{
return static_cast<To>(t);
}
#include <boost/move/detail/config_begin.hpp>
#include <boost/move/detail/workaround.hpp>
+// @cond
+
//boost_move_no_copy_constructor_or_assign typedef
//used to detect noncopyable types for other Boost libraries.
#if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
//
#endif //BOOST_NO_CXX11_DELETED_FUNCTIONS
+// @endcond
+
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
#include <boost/move/detail/type_traits.hpp>
: if_<C,T1,T2>::type
{};
+
+#if defined(BOOST_GCC) && (BOOST_GCC <= 40000)
+#define BOOST_MOVE_HELPERS_RETURN_SFINAE_BROKEN
+#endif
+
template<class T, class U, class R = void>
struct enable_if_convertible
: enable_if< is_convertible<T, U>, R>
--- /dev/null
+#//////////////////////////////////////////////////////////////////////////////
+#//
+#// (C) Copyright Ion Gaztanaga 2015-2015.
+#// 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.
+#//
+#//////////////////////////////////////////////////////////////////////////////
+#
+#if defined(_LIBCPP_VERSION)
+ #if defined(__clang__)
+ #define BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wc++11-extensions"
+ #endif
+ #define BOOST_MOVE_STD_NS_BEG _LIBCPP_BEGIN_NAMESPACE_STD
+ #define BOOST_MOVE_STD_NS_END _LIBCPP_END_NAMESPACE_STD
+#elif defined(BOOST_GNU_STDLIB) && defined(_GLIBCXX_BEGIN_NAMESPACE_VERSION) //GCC >= 4.6
+ #define BOOST_MOVE_STD_NS_BEG namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ #define BOOST_MOVE_STD_NS_END _GLIBCXX_END_NAMESPACE_VERSION } // namespace
+#elif defined(BOOST_GNU_STDLIB) && defined(_GLIBCXX_BEGIN_NAMESPACE) //GCC >= 4.2
+ #define BOOST_MOVE_STD_NS_BEG _GLIBCXX_BEGIN_NAMESPACE(std)
+ #define BOOST_MOVE_STD_NS_END _GLIBCXX_END_NAMESPACE
+#else
+ #define BOOST_MOVE_STD_NS_BEG namespace std{
+ #define BOOST_MOVE_STD_NS_END }
+#endif
+
--- /dev/null
+#//////////////////////////////////////////////////////////////////////////////
+#//
+#// (C) Copyright Ion Gaztanaga 2015-2015.
+#// 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.
+#//
+#//////////////////////////////////////////////////////////////////////////////
+#ifdef BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH
+ #pragma GCC diagnostic pop
+ #undef BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH
+#endif //BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH
struct remove_all_extents<T[]>
{ typedef typename remove_all_extents<T>::type type; };
-template <class T, size_t N>
+template <class T, std::size_t N>
struct remove_all_extents<T[N]>
{ typedef typename remove_all_extents<T>::type type;};
#else //BOOST_NO_ALIGNMENT
-template<class T, size_t Len>
+template<class T, std::size_t Len>
union aligned_union
{
T aligner;
#if defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: Calls `boost::move` if `input_reference` is not a lvalue reference.
+ //! Otherwise returns the reference
template <class T> output_reference move_if_not_lvalue_reference(input_reference) noexcept;
#elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
#define BOOST_MPL_MULTICHAR_LENGTH(c) \
(std::size_t)((c<CHAR_MIN) ? 4 : ((c>0xffffff)+(c>0xffff)+(c>0xff)+1))
- #if defined(BOOST_ENDIAN_LITTLE_BYTE) && defined(__SUNPRO_CC)
+ #if BOOST_ENDIAN_LITTLE_BYTE && defined(__SUNPRO_CC)
#define BOOST_MPL_MULTICHAR_AT(c,i) \
(char)(0xff&((unsigned)(c)>>(8*(std::size_t)(i))))
namespace boost {
#ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
+
none_t const none = (static_cast<none_t>(0)) ;
-#else
+
+#elif defined BOOST_OPTIONAL_USE_SINGLETON_DEFINITION_OF_NONE
namespace detail { namespace optional_detail {
const none_t& none = detail::optional_detail::none_instance<none_t>::instance;
}
-#endif
+#else
+
+const none_t none ((none_t::init_tag()));
+
+#endif // older definitions
} // namespace boost
-#endif
+#endif // header guard
namespace boost {
#ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
+
namespace detail { struct none_helper{}; }
typedef int detail::none_helper::*none_t ;
-#else
+
+#elif defined BOOST_OPTIONAL_USE_SINGLETON_DEFINITION_OF_NONE
+
class none_t {};
-#endif
+
+#else
+
+struct none_t
+{
+ struct init_tag{};
+ explicit none_t(init_tag){} // to prevent default constructor
+};
+
+#endif // old implementation workarounds
} // namespace boost
-#endif
+#endif // header guard
#ifndef BOOST_OPERATORS_HPP
#define BOOST_OPERATORS_HPP
+#include <cstddef>
+#include <iterator>
+
#include <boost/config.hpp>
-#include <boost/iterator.hpp>
#include <boost/detail/workaround.hpp>
#if defined(__sgi) && !defined(__GNUC__)
class R = V const &>
struct input_iterator_helper
: input_iteratable<T, P
- , boost::iterator<std::input_iterator_tag, V, D, P, R
+ , std::iterator<std::input_iterator_tag, V, D, P, R
> > {};
template<class T>
struct output_iterator_helper
: output_iteratable<T
- , boost::iterator<std::output_iterator_tag, void, void, void, void
+ , std::iterator<std::output_iterator_tag, void, void, void, void
> >
{
T& operator*() { return static_cast<T&>(*this); }
class R = V&>
struct forward_iterator_helper
: forward_iteratable<T, P
- , boost::iterator<std::forward_iterator_tag, V, D, P, R
+ , std::iterator<std::forward_iterator_tag, V, D, P, R
> > {};
template <class T,
class R = V&>
struct bidirectional_iterator_helper
: bidirectional_iteratable<T, P
- , boost::iterator<std::bidirectional_iterator_tag, V, D, P, R
+ , std::iterator<std::bidirectional_iterator_tag, V, D, P, R
> > {};
template <class T,
class R = V&>
struct random_access_iterator_helper
: random_access_iteratable<T, P, D, R
- , boost::iterator<std::random_access_iterator_tag, V, D, P, R
+ , std::iterator<std::random_access_iterator_tag, V, D, P, R
> >
{
friend D requires_difference_operator(const T& x, const T& y) {
#include <boost/predef/os.h>
#include <boost/predef/other.h>
#include <boost/predef/platform.h>
+#include <boost/predef/hardware.h>
#include <boost/predef/version.h>
#ifndef BOOST_PREDEF_DETAIL__CASSERT_H
#define BOOST_PREDEF_DETAIL__CASSERT_H
-#if defined(__cpluplus)
+#if defined(__cplusplus)
#include <cassert>
#else
#include <assert.h>
#ifndef BOOST_PREDEF_DETAIL__EXCEPTION_H
#define BOOST_PREDEF_DETAIL__EXCEPTION_H
-#if defined(__cpluplus)
+#if defined(__cplusplus)
#include <exception>
#endif
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+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)
+*/
+
+#if !defined(BOOST_PREDEF_HARDWARE_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS)
+#ifndef BOOST_PREDEF_HARDWARE_H
+#define BOOST_PREDEF_HARDWARE_H
+#endif
+
+#include <boost/predef/hardware/simd.h>
+
+#endif
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#include <boost/predef/hardware/simd/x86.h>
+#include <boost/predef/hardware/simd/x86_amd.h>
+#include <boost/predef/hardware/simd/arm.h>
+#include <boost/predef/hardware/simd/ppc.h>
+
+#ifndef BOOST_PREDEF_HARDWARE_SIMD_H
+#define BOOST_PREDEF_HARDWARE_SIMD_H
+
+#include <boost/predef/version_number.h>
+
+/*`
+ [section Using the `BOOST_HW_SIMD_*` predefs]
+ [include ../doc/hardware_simd.qbk]
+ [endsect]
+
+ [/ --------------------------- ]
+
+ [section `BOOST_HW_SIMD_*`]
+
+ [heading `BOOST_HW_SIMD`]
+
+ The SIMD extension detected for a specific architectures.
+ Version number depends on the detected extension.
+
+ [table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`BOOST_HW_SIMD_X86_AVAILABLE`] [__predef_detection__]]
+ [[`BOOST_HW_SIMD_X86_AMD_AVAILABLE`] [__predef_detection__]]
+ [[`BOOST_HW_SIMD_ARM_AVAILABLE`] [__predef_detection__]]
+ [[`BOOST_HW_SIMD_PPC_AVAILABLE`] [__predef_detection__]]
+ ]
+
+ [include ../include/boost/predef/hardware/simd/x86.h]
+ [include ../include/boost/predef/hardware/simd/x86_amd.h]
+ [include ../include/boost/predef/hardware/simd/arm.h]
+ [include ../include/boost/predef/hardware/simd/ppc.h]
+
+ [endsect]
+
+ [/ --------------------------- ]
+
+ [section `BOOST_HW_SIMD_X86_*_VERSION`]
+ [include ../include/boost/predef/hardware/simd/x86/versions.h]
+ [endsect]
+
+ [section `BOOST_HW_SIMD_X86_AMD_*_VERSION`]
+ [include ../include/boost/predef/hardware/simd/x86_amd/versions.h]
+ [endsect]
+
+ [section `BOOST_HW_SIMD_ARM_*_VERSION`]
+ [include ../include/boost/predef/hardware/simd/arm/versions.h]
+ [endsect]
+
+ [section `BOOST_HW_SIMD_PPC_*_VERSION`]
+ [include ../include/boost/predef/hardware/simd/ppc/versions.h]
+ [endsect]
+
+ */
+
+// We check if SIMD extension of multiples architectures have been detected,
+// if yes, then this is an error!
+//
+// NOTE: _X86_AMD implies _X86, so there is no need to check for it here!
+//
+#if defined(BOOST_HW_SIMD_ARM_AVAILABLE) && defined(BOOST_HW_SIMD_PPC_AVAILABLE) ||\
+ defined(BOOST_HW_SIMD_ARM_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AVAILABLE) ||\
+ defined(BOOST_HW_SIMD_PPC_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AVAILABLE)
+# error "Multiple SIMD architectures detected, this cannot happen!"
+#endif
+
+#if defined(BOOST_HW_SIMD_X86_AVAILABLE)
+# define BOOST_HW_SIMD BOOST_HW_SIMD_X86
+#endif
+
+#if defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE)
+# define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD
+#endif
+
+#if defined(BOOST_HW_SIMD_ARM_AVAILABLE)
+# define BOOST_HW_SIMD BOOST_HW_SIMD_ARM
+#endif
+
+#if defined(BOOST_HW_SIMD_PPC_AVAILABLE)
+# define BOOST_HW_SIMD BOOST_HW_SIMD_PPC
+#endif
+
+#if defined(BOOST_HW_SIMD)
+# define BOOST_HW_SIMD_AVAILABLE
+#else
+# define BOOST_HW_SIMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
+#endif
+
+#define BOOST_HW_SIMD_NAME "Hardware SIMD"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD, BOOST_HW_SIMD_NAME)
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+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_PREDEF_HARDWARE_SIMD_ARM_H
+#define BOOST_PREDEF_HARDWARE_SIMD_ARM_H
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/hardware/simd/arm/versions.h>
+
+/*`
+ [heading `BOOST_HW_SIMD_ARM`]
+
+ The SIMD extension for ARM (*if detected*).
+ Version number depends on the most recent detected extension.
+
+ [table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__ARM_NEON__`] [__predef_detection__]]
+ [[`__aarch64__`] [__predef_detection__]]
+ [[`_M_ARM`] [__predef_detection__]]
+ ]
+
+ [table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__ARM_NEON__`] [BOOST_HW_SIMD_ARM_NEON_VERSION]]
+ [[`__aarch64__`] [BOOST_HW_SIMD_ARM_NEON_VERSION]]
+ [[`_M_ARM`] [BOOST_HW_SIMD_ARM_NEON_VERSION]]
+ ]
+
+ */
+
+#define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#undef BOOST_HW_SIMD_ARM
+#if !defined(BOOST_HW_SIMD_ARM) && (defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM))
+# define BOOST_HW_SIMD_ARM BOOST_HW_SIMD_ARM_NEON_VERSION
+#endif
+
+#if !defined(BOOST_HW_SIMD_ARM)
+# define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE
+#else
+# define BOOST_HW_SIMD_ARM_AVAILABLE
+#endif
+
+#define BOOST_HW_SIMD_ARM_NAME "ARM SIMD"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_ARM, BOOST_HW_SIMD_ARM_NAME)
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+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_PREDEF_HARDWARE_SIMD_ARM_VERSIONS_H
+#define BOOST_PREDEF_HARDWARE_SIMD_ARM_VERSIONS_H
+
+#include <boost/predef/version_number.h>
+
+/*`
+ Those defines represent ARM SIMD extensions versions.
+
+ [note You *MUST* compare them with the predef `BOOST_HW_SIMD_ARM`.]
+ */
+
+// ---------------------------------
+
+/*`
+ [heading `BOOST_HW_SIMD_ARM_NEON_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/ARM_architecture#Advanced_SIMD_.28NEON.29 NEON]
+ ARM extension version number.
+
+ Version number is: *1.0.0*.
+ */
+#define BOOST_HW_SIMD_ARM_NEON_VERSION BOOST_VERSION_NUMBER(1, 0, 0)
+
+#endif
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+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_PREDEF_HARDWARE_SIMD_PPC_H
+#define BOOST_PREDEF_HARDWARE_SIMD_PPC_H
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/hardware/simd/ppc/versions.h>
+
+/*`
+ [heading `BOOST_HW_SIMD_PPC`]
+
+ The SIMD extension for PowerPC (*if detected*).
+ Version number depends on the most recent detected extension.
+
+ [table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__VECTOR4DOUBLE__`] [__predef_detection__]]
+
+ [[`__ALTIVEC__`] [__predef_detection__]]
+ [[`__VEC__`] [__predef_detection__]]
+
+ [[`__VSX__`] [__predef_detection__]]
+ ]
+
+ [table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__VECTOR4DOUBLE__`] [BOOST_HW_SIMD_PPC_QPX_VERSION]]
+
+ [[`__ALTIVEC__`] [BOOST_HW_SIMD_PPC_VMX_VERSION]]
+ [[`__VEC__`] [BOOST_HW_SIMD_PPC_VMX_VERSION]]
+
+ [[`__VSX__`] [BOOST_HW_SIMD_PPC_VSX_VERSION]]
+ ]
+
+ */
+
+#define BOOST_HW_SIMD_PPC BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#undef BOOST_HW_SIMD_PPC
+#if !defined(BOOST_HW_SIMD_PPC) && defined(__VECTOR4DOUBLE__)
+# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_QPX_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_PPC) && defined(__VSX__)
+# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VSX_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_PPC) && (defined(__ALTIVEC__) || defined(__VEC__))
+# define BOOST_HW_SIMD_PPC BOOST_HW_SIMD_PPC_VMX_VERSION
+#endif
+
+#if !defined(BOOST_HW_SIMD_PPC)
+# define BOOST_HW_SIMD_PPC BOOST_VERSION_NUMBER_NOT_AVAILABLE
+#else
+# define BOOST_HW_SIMD_PPC_AVAILABLE
+#endif
+
+#define BOOST_HW_SIMD_PPC_NAME "PPC SIMD"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_PPC, BOOST_HW_SIMD_PPC_NAME)
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+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_PREDEF_HARDWARE_SIMD_PPC_VERSIONS_H
+#define BOOST_PREDEF_HARDWARE_SIMD_PPC_VERSIONS_H
+
+#include <boost/predef/version_number.h>
+
+/*`
+ Those defines represent Power PC SIMD extensions versions.
+
+ [note You *MUST* compare them with the predef `BOOST_HW_SIMD_PPC`.]
+ */
+
+// ---------------------------------
+
+/*`
+ [heading `BOOST_HW_SIMD_PPC_VMX_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/AltiVec#VMX128 VMX] powerpc extension
+ version number.
+
+ Version number is: *1.0.0*.
+ */
+#define BOOST_HW_SIMD_PPC_VMX_VERSION BOOST_VERSION_NUMBER(1, 0, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_PPC_VSX_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/AltiVec#VSX VSX] powerpc extension version
+ number.
+
+ Version number is: *1.1.0*.
+ */
+#define BOOST_HW_SIMD_PPC_VSX_VERSION BOOST_VERSION_NUMBER(1, 1, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_PPC_QPX_VERSION`]
+
+ The QPX powerpc extension version number.
+
+ Version number is: *2.0.0*.
+ */
+#define BOOST_HW_SIMD_PPC_QPX_VERSION BOOST_VERSION_NUMBER(2, 0, 0)
+
+#endif
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+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_PREDEF_HARDWARE_SIMD_X86_H
+#define BOOST_PREDEF_HARDWARE_SIMD_X86_H
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/hardware/simd/x86/versions.h>
+
+/*`
+ [heading `BOOST_HW_SIMD_X86`]
+
+ The SIMD extension for x86 (*if detected*).
+ Version number depends on the most recent detected extension.
+
+ [table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__SSE__`] [__predef_detection__]]
+ [[`_M_X64`] [__predef_detection__]]
+ [[`_M_IX86_FP >= 1`] [__predef_detection__]]
+
+ [[`__SSE2__`] [__predef_detection__]]
+ [[`_M_X64`] [__predef_detection__]]
+ [[`_M_IX86_FP >= 2`] [__predef_detection__]]
+
+ [[`__SSE3__`] [__predef_detection__]]
+
+ [[`__SSSE3__`] [__predef_detection__]]
+
+ [[`__SSE4_1__`] [__predef_detection__]]
+
+ [[`__SSE4_2__`] [__predef_detection__]]
+
+ [[`__AVX__`] [__predef_detection__]]
+
+ [[`__FMA__`] [__predef_detection__]]
+
+ [[`__AVX2__`] [__predef_detection__]]
+ ]
+
+ [table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__SSE__`] [BOOST_HW_SIMD_X86_SSE_VERSION]]
+ [[`_M_X64`] [BOOST_HW_SIMD_X86_SSE_VERSION]]
+ [[`_M_IX86_FP >= 1`] [BOOST_HW_SIMD_X86_SSE_VERSION]]
+
+ [[`__SSE2__`] [BOOST_HW_SIMD_X86_SSE2_VERSION]]
+ [[`_M_X64`] [BOOST_HW_SIMD_X86_SSE2_VERSION]]
+ [[`_M_IX86_FP >= 2`] [BOOST_HW_SIMD_X86_SSE2_VERSION]]
+
+ [[`__SSE3__`] [BOOST_HW_SIMD_X86_SSE3_VERSION]]
+
+ [[`__SSSE3__`] [BOOST_HW_SIMD_X86_SSSE3_VERSION]]
+
+ [[`__SSE4_1__`] [BOOST_HW_SIMD_X86_SSE4_1_VERSION]]
+
+ [[`__SSE4_2__`] [BOOST_HW_SIMD_X86_SSE4_2_VERSION]]
+
+ [[`__AVX__`] [BOOST_HW_SIMD_X86_AVX_VERSION]]
+
+ [[`__FMA__`] [BOOST_HW_SIMD_X86_FMA3_VERSION]]
+
+ [[`__AVX2__`] [BOOST_HW_SIMD_x86_AVX2_VERSION]]
+ ]
+
+ */
+
+#define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#undef BOOST_HW_SIMD_X86
+#if !defined(BOOST_HW_SIMD_X86) && defined(__MIC__)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MIC_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && defined(__AVX2__)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX2_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && defined(__AVX__)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && defined(__FMA__)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_FMA_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && defined(__SSE4_2__)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_2_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && defined(__SSE4_1__)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_1_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && defined(__SSSE3__)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSSE3_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && defined(__SSE3__)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE3_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE2__) || defined(_M_X64) || _M_IX86_FP >= 2)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE2_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE__) || defined(_M_X64) || _M_IX86_FP >= 1)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86) && defined(__MMX__)
+# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MMX_VERSION
+#endif
+
+#if !defined(BOOST_HW_SIMD_X86)
+# define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE
+#else
+# define BOOST_HW_SIMD_X86_AVAILABLE
+#endif
+
+#define BOOST_HW_SIMD_X86_NAME "x86 SIMD"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86, BOOST_HW_SIMD_X86_NAME)
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+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_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H
+#define BOOST_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H
+
+#include <boost/predef/version_number.h>
+
+/*`
+ Those defines represent x86 SIMD extensions versions.
+
+ [note You *MUST* compare them with the predef `BOOST_HW_SIMD_X86`.]
+ */
+
+// ---------------------------------
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_MMX_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/MMX_(instruction_set) MMX] x86 extension
+ version number.
+
+ Version number is: *0.99.0*.
+ */
+#define BOOST_HW_SIMD_X86_MMX_VERSION BOOST_VERSION_NUMBER(0, 99, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_SSE_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions SSE] x86 extension
+ version number.
+
+ Version number is: *1.0.0*.
+ */
+#define BOOST_HW_SIMD_X86_SSE_VERSION BOOST_VERSION_NUMBER(1, 0, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_SSE2_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/SSE2 SSE2] x86 extension version number.
+
+ Version number is: *2.0.0*.
+ */
+#define BOOST_HW_SIMD_X86_SSE2_VERSION BOOST_VERSION_NUMBER(2, 0, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_SSE3_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/SSE3 SSE3] x86 extension version number.
+
+ Version number is: *3.0.0*.
+ */
+#define BOOST_HW_SIMD_X86_SSE3_VERSION BOOST_VERSION_NUMBER(3, 0, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_SSSE3_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/SSSE3 SSSE3] x86 extension version number.
+
+ Version number is: *3.1.0*.
+ */
+#define BOOST_HW_SIMD_X86_SSSE3_VERSION BOOST_VERSION_NUMBER(3, 1, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_SSE4_1_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/SSE4#SSE4.1 SSE4_1] x86 extension version
+ number.
+
+ Version number is: *4.1.0*.
+ */
+#define BOOST_HW_SIMD_X86_SSE4_1_VERSION BOOST_VERSION_NUMBER(4, 1, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_SSE4_2_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/SSE4##SSE4.2 SSE4_2] x86 extension version
+ number.
+
+ Version number is: *4.2.0*.
+ */
+#define BOOST_HW_SIMD_X86_SSE4_2_VERSION BOOST_VERSION_NUMBER(4, 2, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_AVX_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions AVX] x86
+ extension version number.
+
+ Version number is: *5.0.0*.
+ */
+#define BOOST_HW_SIMD_X86_AVX_VERSION BOOST_VERSION_NUMBER(5, 0, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_FMA3_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA3] x86 extension
+ version number.
+
+ Version number is: *5.2.0*.
+ */
+#define BOOST_HW_SIMD_X86_FMA3_VERSION BOOST_VERSION_NUMBER(5, 2, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_AVX2_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2]
+ x86 extension version number.
+
+ Version number is: *5.3.0*.
+ */
+#define BOOST_HW_SIMD_X86_AVX2_VERSION BOOST_VERSION_NUMBER(5, 3, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_MIC_VERSION`]
+
+ The [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension
+ version number.
+
+ Version number is: *9.0.0*.
+ */
+#define BOOST_HW_SIMD_X86_MIC_VERSION BOOST_VERSION_NUMBER(9, 0, 0)
+
+#endif
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+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_PREDEF_HARDWARE_SIMD_X86_AMD_H
+#define BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_H
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/hardware/simd/x86_amd/versions.h>
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_AMD`]
+
+ The SIMD extension for x86 (AMD) (*if detected*).
+ Version number depends on the most recent detected extension.
+
+ [table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__SSE4A__`] [__predef_detection__]]
+
+ [[`__FMA4__`] [__predef_detection__]]
+
+ [[`__XOP__`] [__predef_detection__]]
+
+ [[`BOOST_HW_SIMD_X86`] [__predef_detection__]]
+ ]
+
+ [table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__SSE4A__`] [BOOST_HW_SIMD_x86_SSE4A_VERSION]]
+
+ [[`__FMA4__`] [BOOST_HW_SIMD_x86_FMA4_VERSION]]
+
+ [[`__XOP__`] [BOOST_HW_SIMD_x86_XOP_VERSION]]
+
+ [[`BOOST_HW_SIMD_X86`] [BOOST_HW_SIMD_x86]]
+ ]
+
+ [note This predef includes every other x86 SIMD extensions and also has other
+ more specific extensions (FMA4, XOP, SSE4a). You should use this predef
+ instead of `BOOST_HW_SIMD_X86` to test if those specific extensions have
+ been detected.]
+
+ */
+
+#define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+// AMD CPUs also use x86 architecture. We first try to detect if any AMD
+// specific extension are detected, if yes, then try to detect more recent x86
+// common extensions.
+
+#undef BOOST_HW_SIMD_X86_AMD
+#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__XOP__)
+# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_XOP_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__FMA4__)
+# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_FMA4_VERSION
+#endif
+#if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__SSE4A__)
+# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION
+#endif
+
+#if !defined(BOOST_HW_SIMD_X86_AMD)
+# define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
+#else
+ // At this point, we know that we have an AMD CPU, we do need to check for
+ // other x86 extensions to determine the final version number.
+# include <boost/predef/hardware/simd/x86.h>
+# if BOOST_HW_SIMD_X86 > BOOST_HW_SIMD_X86_AMD
+# undef BOOST_HW_SIMD_X86_AMD
+# define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86
+# endif
+# define BOOST_HW_SIMD_X86_AMD_AVAILABLE
+#endif
+
+#define BOOST_HW_SIMD_X86_AMD_NAME "x86 (AMD) SIMD"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_AMD, BOOST_HW_SIMD_X86_AMD_NAME)
--- /dev/null
+/*
+Copyright Charly Chevalier 2015
+Copyright Joel Falcou 2015
+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_PREDEF_HARDWARE_SIMD_X86_AMD_VERSIONS_H
+#define BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_VERSIONS_H
+
+#include <boost/predef/version_number.h>
+
+/*`
+ Those defines represent x86 (AMD specific) SIMD extensions versions.
+
+ [note You *MUST* compare them with the predef `BOOST_HW_SIMD_X86_AMD`.]
+ */
+
+
+// ---------------------------------
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_SSE4A_VERSION`]
+
+ [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension (AMD specific).
+
+ Version number is: *4.0.0*.
+ */
+#define BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION BOOST_VERSION_NUMBER(4, 0, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_XOP_VERSION`]
+
+ [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific).
+
+ Version number is: *5.1.0*.
+ */
+#define BOOST_HW_SIMD_X86_AMD_FMA4_VERSION BOOST_VERSION_NUMBER(5, 1, 0)
+
+/*`
+ [heading `BOOST_HW_SIMD_X86_XOP_VERSION`]
+
+ [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific).
+
+ Version number is: *5.1.1*.
+ */
+#define BOOST_HW_SIMD_X86_AMD_XOP_VERSION BOOST_VERSION_NUMBER(5, 1, 1)
+
+
+#endif
#endif
#if BOOST_PLAT_WINDOWS_DESKTOP
-# define BOOST_PLAT_WINDOWS_DESKTOP_AVALIABLE
+# define BOOST_PLAT_WINDOWS_DESKTOP_AVAILABLE
# include <boost/predef/detail/platform_detected.h>
#endif
#endif
#if BOOST_PLAT_WINDOWS_PHONE
-# define BOOST_PLAT_WINDOWS_PHONE_AVALIABLE
+# define BOOST_PLAT_WINDOWS_PHONE_AVAILABLE
# include <boost/predef/detail/platform_detected.h>
#endif
#endif
#if BOOST_PLAT_WINDOWS_RUNTIME
-# define BOOST_PLAT_WINDOWS_RUNTIME_AVALIABLE
+# define BOOST_PLAT_WINDOWS_RUNTIME_AVAILABLE
# include <boost/predef/detail/platform_detected.h>
#endif
#endif
#if BOOST_PLAT_WINDOWS_STORE
-# define BOOST_PLAT_WINDOWS_STORE_AVALIABLE
+# define BOOST_PLAT_WINDOWS_STORE_AVAILABLE
# include <boost/predef/detail/platform_detected.h>
#endif
#include <boost/predef/version_number.h>
-#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,3,0)
+#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,4,0)
#endif
# */
#
# /* Revised by Paul Mensonides (2002) */
+# /* Revised by Edward Diener (2015) */
#
# /* See http://www.boost.org for most recent version. */
#
# define BOOST_PREPROCESSOR_FACILITIES_IDENTITY_HPP
#
# include <boost/preprocessor/facilities/empty.hpp>
+# include <boost/preprocessor/tuple/eat.hpp>
#
# /* BOOST_PP_IDENTITY */
#
# define BOOST_PP_IDENTITY(item) item BOOST_PP_EMPTY
#
+# define BOOST_PP_IDENTITY_N(item,n) item BOOST_PP_TUPLE_EAT_N(n)
+#
# endif
+++ /dev/null
-# /* 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
+++ /dev/null
-# /* 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
# */
#
# /* Revised by Paul Mensonides (2002-2011) */
-# /* Revised by Edward Diener (2011) */
+# /* Revised by Edward Diener (2011,2015) */
#
# /* See http://www.boost.org for most recent version. */
#
# endif
# define BOOST_PP_TUPLE_EAT_I(size) BOOST_PP_TUPLE_EAT_ ## size
# endif
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
+# define BOOST_PP_TUPLE_EAT_N(size) BOOST_PP_TUPLE_EAT_N_I(size)
+# else
+# define BOOST_PP_TUPLE_EAT_N(size) BOOST_PP_TUPLE_EAT_N_OO((size))
+# define BOOST_PP_TUPLE_EAT_N_OO(par) BOOST_PP_TUPLE_EAT_N_I ## par
+# endif
+# define BOOST_PP_TUPLE_EAT_N_I(size) BOOST_PP_TUPLE_EAT_ ## size
+#
# define BOOST_PP_TUPLE_EAT_1(e0)
# define BOOST_PP_TUPLE_EAT_2(e0, e1)
# define BOOST_PP_TUPLE_EAT_3(e0, e1, e2)
#if defined(__BORLANDC__)
# include <boost/regex/config/borland.hpp>
#endif
+#include <boost/version.hpp>
/*****************************************************************************
*
# include BOOST_REGEX_USER_CONFIG
# include <boost/config.hpp>
+# include <boost/predef.h>
#else
/*
#define UNICODE
#endif
+
+/*
+* Define a macro for the namespace that details are placed in, this includes the Boost
+* version number to avoid mismatched header and library versions:
+*/
+#define BOOST_REGEX_DETAIL_NS BOOST_JOIN(re_detail_, BOOST_VERSION)
+
/*
* Fix for gcc prior to 3.4: std::ctype<wchar_t> doesn't allow
* masks to be combined, for example:
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
#endif
-/*
+ /*
+ * Oracle compiler in C++11 mode doesn't like external templates for some reason:
+ */
+#ifdef __SUNPRO_CC
+# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
+#endif
+ /*
* Shared regex lib will crash without this, frankly it looks a lot like a gcc bug:
*/
#if defined(__MINGW32__)
/* disable our own file-iterators and mapfiles if we can't
* support them: */
-#if !defined(BOOST_HAS_DIRENT_H) && !(defined(_WIN32) && !defined(BOOST_REGEX_NO_W32))
-# define BOOST_REGEX_NO_FILEITER
+#if defined(_WIN32)
+# if defined(BOOST_REGEX_NO_W32) || BOOST_PLAT_WINDOWS_STORE
+# define BOOST_REGEX_NO_FILEITER
+# endif
+#else // defined(_WIN32)
+# if !defined(BOOST_HAS_DIRENT_H)
+# define BOOST_REGEX_NO_FILEITER
+# endif
#endif
/* backwards compatibitity: */
* with MSVC and the /Zc:wchar_t option we place some extra unsigned short versions
* of the non-inline functions in the library, so that users can still link to the lib,
* irrespective of whether their own code is built with /Zc:wchar_t.
- * Note that this does NOT WORK with VC10 when the C++ locale is in effect as
+ * Note that this does NOT WORK with VC10 and VC14 when the C++ locale is in effect as
* the locale's <unsigned short> facets simply do not compile in that case.
+ * As we default to the C++ locale when compiling for the windows runtime we
+ * skip in this case aswell.
*/
-#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && !defined(BOOST_RWSTD_VER) && ((_MSC_VER < 1600) || !defined(BOOST_REGEX_USE_CPP_LOCALE))
+#if defined(__cplusplus) && \
+ (defined(BOOST_MSVC) || defined(__ICL)) && \
+ !defined(BOOST_NO_INTRINSIC_WCHAR_T) && \
+ defined(BOOST_WINDOWS) && \
+ !defined(__SGI_STL_PORT) && \
+ !defined(_STLPORT_VERSION) && \
+ !defined(BOOST_RWSTD_VER) && \
+ ((_MSC_VER < 1600) || !defined(BOOST_REGEX_USE_CPP_LOCALE)) && \
+ !BOOST_PLAT_WINDOWS_RUNTIME
# define BOOST_REGEX_HAS_OTHER_WCHAR_T
# ifdef BOOST_MSVC
# pragma warning(push)
# define BOOST_REGEX_USE_C_LOCALE
#endif
+/* use C++ locale when targeting windows store */
+#if BOOST_PLAT_WINDOWS_RUNTIME
+# define BOOST_REGEX_USE_CPP_LOCALE
+# define BOOST_REGEX_NO_WIN32_LOCALE
+#endif
+
/* Win32 defaults to native Win32 locale: */
-#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32)
+#if defined(_WIN32) && \
+ !defined(BOOST_REGEX_USE_WIN32_LOCALE) && \
+ !defined(BOOST_REGEX_USE_C_LOCALE) && \
+ !defined(BOOST_REGEX_USE_CPP_LOCALE) && \
+ !defined(BOOST_REGEX_NO_W32) && \
+ !defined(BOOST_REGEX_NO_WIN32_LOCALE)
# define BOOST_REGEX_USE_WIN32_LOCALE
#endif
/* otherwise use C++ locale if supported: */
#if defined(__cplusplus) && defined(BOOST_REGEX_HAS_MS_STACK_GUARD)
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
****************************************************************************/
#if defined(__cplusplus) && defined(BOOST_REGEX_NON_RECURSIVE)
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block();
BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void*);
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
//
// Implementation details:
struct boost_extensions_tag{};
icu_regex_traits()
- : m_pimpl(re_detail::get_icu_regex_traits_implementation(U_NAMESPACE_QUALIFIER Locale()))
+ : m_pimpl(BOOST_REGEX_DETAIL_NS::get_icu_regex_traits_implementation(U_NAMESPACE_QUALIFIER Locale()))
{
}
static size_type length(const char_type* p);
::boost::regex_constants::syntax_type syntax_type(char_type c)const
{
- return ((c < 0x7f) && (c > 0)) ? re_detail::get_default_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
+ return ((c < 0x7f) && (c > 0)) ? BOOST_REGEX_DETAIL_NS::get_default_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
}
::boost::regex_constants::escape_syntax_type escape_syntax_type(char_type c) const
{
- return ((c < 0x7f) && (c > 0)) ? re_detail::get_default_escape_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
+ return ((c < 0x7f) && (c > 0)) ? BOOST_REGEX_DETAIL_NS::get_default_escape_syntax_type(static_cast<char>(c)) : regex_constants::syntax_char;
}
char_type translate(char_type c) const
{
bool isctype(char_type c, char_class_type f) const;
int toi(const char_type*& p1, const char_type* p2, int radix)const
{
- return re_detail::global_toi(p1, p2, radix, *this);
+ return BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this);
}
int value(char_type c, int radix)const
{
locale_type imbue(locale_type l)
{
locale_type result(m_pimpl->getloc());
- m_pimpl = re_detail::get_icu_regex_traits_implementation(l);
+ m_pimpl = BOOST_REGEX_DETAIL_NS::get_icu_regex_traits_implementation(l);
return result;
}
locale_type getloc()const
}
std::string error_string(::boost::regex_constants::error_type n) const
{
- return re_detail::get_default_error_string(n);
+ return BOOST_REGEX_DETAIL_NS::get_default_error_string(n);
}
private:
icu_regex_traits(const icu_regex_traits&);
static char_class_type lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2);
- boost::shared_ptr< ::boost::re_detail::icu_regex_traits_implementation> m_pimpl;
+ boost::shared_ptr< ::boost::BOOST_REGEX_DETAIL_NS::icu_regex_traits_implementation> m_pimpl;
};
} // namespace boost
//
// Construction of 32-bit regex types from UTF-8 and UTF-16 primitives:
//
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
#if !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__)
template <class InputIterator>
InputIterator j,
boost::regex_constants::syntax_option_type opt)
{
- return re_detail::do_make_u32regex(i, j, opt, static_cast<boost::mpl::int_<sizeof(*i)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_make_u32regex(i, j, opt, static_cast<boost::mpl::int_<sizeof(*i)> const*>(0));
}
//
// construction from UTF-8 nul-terminated strings:
//
inline u32regex make_u32regex(const char* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
{
- return re_detail::do_make_u32regex(p, p + std::strlen(p), opt, static_cast<boost::mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + std::strlen(p), opt, static_cast<boost::mpl::int_<1> const*>(0));
}
inline u32regex make_u32regex(const unsigned char* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
{
- return re_detail::do_make_u32regex(p, p + std::strlen(reinterpret_cast<const char*>(p)), opt, static_cast<boost::mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + std::strlen(reinterpret_cast<const char*>(p)), opt, static_cast<boost::mpl::int_<1> const*>(0));
}
//
// construction from UTF-16 nul-terminated strings:
#ifndef BOOST_NO_WREGEX
inline u32regex make_u32regex(const wchar_t* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
{
- return re_detail::do_make_u32regex(p, p + std::wcslen(p), opt, static_cast<boost::mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + std::wcslen(p), opt, static_cast<boost::mpl::int_<sizeof(wchar_t)> const*>(0));
}
#endif
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2)
inline u32regex make_u32regex(const UChar* p, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
{
- return re_detail::do_make_u32regex(p, p + u_strlen(p), opt, static_cast<boost::mpl::int_<2> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_make_u32regex(p, p + u_strlen(p), opt, static_cast<boost::mpl::int_<2> const*>(0));
}
#endif
//
template<class C, class T, class A>
inline u32regex make_u32regex(const std::basic_string<C, T, A>& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
{
- return re_detail::do_make_u32regex(s.begin(), s.end(), opt, static_cast<boost::mpl::int_<sizeof(C)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_make_u32regex(s.begin(), s.end(), opt, static_cast<boost::mpl::int_<sizeof(C)> const*>(0));
}
//
// Construction from ICU string type:
//
inline u32regex make_u32regex(const U_NAMESPACE_QUALIFIER UnicodeString& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl)
{
- return re_detail::do_make_u32regex(s.getBuffer(), s.getBuffer() + s.length(), opt, static_cast<boost::mpl::int_<2> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_make_u32regex(s.getBuffer(), s.getBuffer() + s.length(), opt, static_cast<boost::mpl::int_<2> const*>(0));
}
//
// regex_match overloads that widen the character type as appropriate:
//
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template<class MR1, class MR2>
void copy_results(MR1& out, MR2 const& in)
{
if(result) copy_results(m, what);
return result;
}
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
template <class BidiIterator, class Allocator>
inline bool u32regex_match(BidiIterator first, BidiIterator last,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
}
inline bool u32regex_match(const UChar* p,
match_results<const UChar*>& m,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
}
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
inline bool u32regex_match(const wchar_t* p,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
#endif
inline bool u32regex_match(const char* p,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
}
inline bool u32regex_match(const unsigned char* p,
match_results<const unsigned char*>& m,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
}
inline bool u32regex_match(const std::string& s,
match_results<std::string::const_iterator>& m,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
}
#ifndef BOOST_NO_STD_WSTRING
inline bool u32regex_match(const std::wstring& s,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
#endif
inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
//
// regex_match overloads that do not return what matched:
match_flag_type flags = match_default)
{
match_results<BidiIterator> m;
- return re_detail::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(first, last, m, e, flags, static_cast<mpl::int_<sizeof(*first)> const*>(0));
}
inline bool u32regex_match(const UChar* p,
const u32regex& e,
match_flag_type flags = match_default)
{
match_results<const UChar*> m;
- return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast<mpl::int_<2> const*>(0));
}
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
inline bool u32regex_match(const wchar_t* p,
match_flag_type flags = match_default)
{
match_results<const wchar_t*> m;
- return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
#endif
inline bool u32regex_match(const char* p,
match_flag_type flags = match_default)
{
match_results<const char*> m;
- return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
}
inline bool u32regex_match(const unsigned char* p,
const u32regex& e,
match_flag_type flags = match_default)
{
match_results<const unsigned char*> m;
- return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast<mpl::int_<1> const*>(0));
}
inline bool u32regex_match(const std::string& s,
const u32regex& e,
match_flag_type flags = match_default)
{
match_results<std::string::const_iterator> m;
- return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<1> const*>(0));
}
#ifndef BOOST_NO_STD_WSTRING
inline bool u32regex_match(const std::wstring& s,
match_flag_type flags = match_default)
{
match_results<std::wstring::const_iterator> m;
- return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
#endif
inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s,
match_flag_type flags = match_default)
{
match_results<const UChar*> m;
- return re_detail::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
//
// regex_search overloads that widen the character type as appropriate:
//
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template <class BidiIterator, class Allocator>
inline bool do_regex_search(BidiIterator first, BidiIterator last,
match_results<BidiIterator, Allocator>& m,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
}
template <class BidiIterator, class Allocator>
inline bool u32regex_search(BidiIterator first, BidiIterator last,
match_flag_type flags,
BidiIterator base)
{
- return re_detail::do_regex_search(first, last, m, e, flags, base, static_cast<mpl::int_<sizeof(*first)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(first, last, m, e, flags, base, static_cast<mpl::int_<sizeof(*first)> const*>(0));
}
inline bool u32regex_search(const UChar* p,
match_results<const UChar*>& m,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
}
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
inline bool u32regex_search(const wchar_t* p,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
#endif
inline bool u32regex_search(const char* p,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
}
inline bool u32regex_search(const unsigned char* p,
match_results<const unsigned char*>& m,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
}
inline bool u32regex_search(const std::string& s,
match_results<std::string::const_iterator>& m,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
}
#ifndef BOOST_NO_STD_WSTRING
inline bool u32regex_search(const std::wstring& s,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
#endif
inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s,
const u32regex& e,
match_flag_type flags = match_default)
{
- return re_detail::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
template <class BidiIterator>
inline bool u32regex_search(BidiIterator first, BidiIterator last,
match_flag_type flags = match_default)
{
match_results<BidiIterator> m;
- return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(first, last, m, e, flags, first, static_cast<mpl::int_<sizeof(*first)> const*>(0));
}
inline bool u32regex_search(const UChar* p,
const u32regex& e,
match_flag_type flags = match_default)
{
match_results<const UChar*> m;
- return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast<mpl::int_<2> const*>(0));
}
#if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX)
inline bool u32regex_search(const wchar_t* p,
match_flag_type flags = match_default)
{
match_results<const wchar_t*> m;
- return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
#endif
inline bool u32regex_search(const char* p,
match_flag_type flags = match_default)
{
match_results<const char*> m;
- return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
}
inline bool u32regex_search(const unsigned char* p,
const u32regex& e,
match_flag_type flags = match_default)
{
match_results<const unsigned char*> m;
- return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast<mpl::int_<1> const*>(0));
}
inline bool u32regex_search(const std::string& s,
const u32regex& e,
match_flag_type flags = match_default)
{
match_results<std::string::const_iterator> m;
- return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<1> const*>(0));
}
#ifndef BOOST_NO_STD_WSTRING
inline bool u32regex_search(const std::wstring& s,
match_flag_type flags = match_default)
{
match_results<std::wstring::const_iterator> m;
- return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
#endif
inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s,
match_flag_type flags = match_default)
{
match_results<const UChar*> m;
- return re_detail::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
+ return BOOST_REGEX_DETAIL_NS::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0));
}
//
// overloads for regex_replace with utf-8 and utf-16 data types:
//
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template <class I>
inline std::pair< boost::u8_to_u32_iterator<I>, boost::u8_to_u32_iterator<I> >
make_utf32_seq(I i, I j, mpl::int_<1> const*)
if(i == j)
{
if(!(flags & regex_constants::format_no_copy))
- out = re_detail::copy(in.first, in.second, out);
+ out = BOOST_REGEX_DETAIL_NS::copy(in.first, in.second, out);
}
else
{
while(i != j)
{
if(!(flags & regex_constants::format_no_copy))
- out = re_detail::copy(i->prefix().first, i->prefix().second, out);
+ out = BOOST_REGEX_DETAIL_NS::copy(i->prefix().first, i->prefix().second, out);
if(f.size())
- out = ::boost::re_detail::regex_format_imp(out, *i, &*f.begin(), &*f.begin() + f.size(), flags, e.get_traits());
+ out = ::boost::BOOST_REGEX_DETAIL_NS::regex_format_imp(out, *i, &*f.begin(), &*f.begin() + f.size(), flags, e.get_traits());
else
- out = ::boost::re_detail::regex_format_imp(out, *i, static_cast<UChar32 const*>(0), static_cast<UChar32 const*>(0), flags, e.get_traits());
+ out = ::boost::BOOST_REGEX_DETAIL_NS::regex_format_imp(out, *i, static_cast<UChar32 const*>(0), static_cast<UChar32 const*>(0), flags, e.get_traits());
last_m = (*i)[0].second;
if(flags & regex_constants::format_first_only)
break;
++i;
}
if(!(flags & regex_constants::format_no_copy))
- out = re_detail::copy(last_m, in.second, out);
+ out = BOOST_REGEX_DETAIL_NS::copy(last_m, in.second, out);
}
return out;
}
{
return b.base();
}
-} // re_detail
+} // BOOST_REGEX_DETAIL_NS
template <class OutputIterator, class BidirectionalIterator, class charT>
inline OutputIterator u32regex_replace(OutputIterator out,
const charT* fmt,
match_flag_type flags = match_default)
{
- return re_detail::extract_output_base
+ return BOOST_REGEX_DETAIL_NS::extract_output_base
(
- re_detail::do_regex_replace(
- re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
- re_detail::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::do_regex_replace(
+ BOOST_REGEX_DETAIL_NS::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
e,
- re_detail::make_utf32_seq(fmt, static_cast<mpl::int_<sizeof(*fmt)> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt, static_cast<mpl::int_<sizeof(*fmt)> const*>(0)),
flags)
);
}
const std::basic_string<charT>& fmt,
match_flag_type flags = match_default)
{
- return re_detail::extract_output_base
+ return BOOST_REGEX_DETAIL_NS::extract_output_base
(
- re_detail::do_regex_replace(
- re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
- re_detail::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::do_regex_replace(
+ BOOST_REGEX_DETAIL_NS::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
e,
- re_detail::make_utf32_seq(fmt.begin(), fmt.end(), static_cast<mpl::int_<sizeof(charT)> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt.begin(), fmt.end(), static_cast<mpl::int_<sizeof(charT)> const*>(0)),
flags)
);
}
const U_NAMESPACE_QUALIFIER UnicodeString& fmt,
match_flag_type flags = match_default)
{
- return re_detail::extract_output_base
+ return BOOST_REGEX_DETAIL_NS::extract_output_base
(
- re_detail::do_regex_replace(
- re_detail::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
- re_detail::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::do_regex_replace(
+ BOOST_REGEX_DETAIL_NS::make_utf32_out(out, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::make_utf32_seq(first, last, static_cast<mpl::int_<sizeof(*first)> const*>(0)),
e,
- re_detail::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
flags)
);
}
match_flag_type flags = match_default)
{
std::basic_string<charT> result;
- re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+ BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<charT> > i(result);
u32regex_replace(i, s.begin(), s.end(), e, fmt, flags);
return result;
}
match_flag_type flags = match_default)
{
std::basic_string<charT> result;
- re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+ BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<charT> > i(result);
u32regex_replace(i, s.begin(), s.end(), e, fmt.c_str(), flags);
return result;
}
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
class unicode_string_out_iterator
{
match_flag_type flags = match_default)
{
U_NAMESPACE_QUALIFIER UnicodeString result;
- re_detail::unicode_string_out_iterator i(result);
+ BOOST_REGEX_DETAIL_NS::unicode_string_out_iterator i(result);
u32regex_replace(i, s.getBuffer(), s.getBuffer()+s.length(), e, fmt, flags);
return result;
}
match_flag_type flags = match_default)
{
U_NAMESPACE_QUALIFIER UnicodeString result;
- re_detail::unicode_string_out_iterator i(result);
- re_detail::do_regex_replace(
- re_detail::make_utf32_out(i, static_cast<mpl::int_<2> const*>(0)),
- re_detail::make_utf32_seq(s.getBuffer(), s.getBuffer()+s.length(), static_cast<mpl::int_<2> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::unicode_string_out_iterator i(result);
+ BOOST_REGEX_DETAIL_NS::do_regex_replace(
+ BOOST_REGEX_DETAIL_NS::make_utf32_out(i, static_cast<mpl::int_<2> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::make_utf32_seq(s.getBuffer(), s.getBuffer()+s.length(), static_cast<mpl::int_<2> const*>(0)),
e,
- re_detail::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
+ BOOST_REGEX_DETAIL_NS::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
flags);
return result;
}
typedef regex_error bad_pattern;
typedef regex_error bad_expression;
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex);
{
(void)t; // warning suppression
std::runtime_error e(t.error_string(code));
- ::boost::re_detail::raise_runtime_error(e);
+ ::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(e);
}
}
#endif
#endif
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
//
// forward declaration, we will need this one later:
regex_data(const ::boost::shared_ptr<
::boost::regex_traits_wrapper<traits> >& t)
- : m_ptraits(t), m_expression(0), m_expression_len(0) {}
+ : m_ptraits(t), m_expression(0), m_expression_len(0), m_disable_match_any(false) {}
regex_data()
- : m_ptraits(new ::boost::regex_traits_wrapper<traits>()), m_expression(0), m_expression_len(0) {}
+ : m_ptraits(new ::boost::regex_traits_wrapper<traits>()), m_expression(0), m_expression_len(0), m_disable_match_any(false) {}
::boost::shared_ptr<
::boost::regex_traits_wrapper<traits>
const charT* m_expression; // the original expression
std::ptrdiff_t m_expression_len; // the length of the original expression
size_type m_mark_count; // the number of marked sub-expressions
- re_detail::re_syntax_base* m_first_state; // the first state of the machine
+ BOOST_REGEX_DETAIL_NS::re_syntax_base* m_first_state; // the first state of the machine
unsigned m_restart_type; // search optimisation type
unsigned char m_startmap[1 << CHAR_BIT]; // which characters can start a match
unsigned int m_can_be_null; // whether we can match a null string
- re_detail::raw_storage m_data; // the buffer in which our states are constructed
+ BOOST_REGEX_DETAIL_NS::raw_storage m_data; // the buffer in which our states are constructed
typename traits::char_class_type m_word_mask; // mask used to determine if a character is a word character
std::vector<
std::pair<
std::size_t, std::size_t> > m_subs; // Position of sub-expressions within the *string*.
bool m_has_recursions; // whether we have recursive expressions;
+ bool m_disable_match_any; // when set we need to disable the match_any flag as it causes different/buggy behaviour.
};
//
// class basic_regex_implementation
{
return this->m_mark_count - 1;
}
- const re_detail::re_syntax_base* get_first_state()const
+ const BOOST_REGEX_DETAIL_NS::re_syntax_base* get_first_state()const
{
return this->m_first_state;
}
}
};
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
//
// class basic_regex:
// represents the compiled
//
// private access methods:
//
- const re_detail::re_syntax_base* get_first_state()const
+ const BOOST_REGEX_DETAIL_NS::re_syntax_base* get_first_state()const
{
BOOST_ASSERT(0 != m_pimpl.get());
return m_pimpl->get_first_state();
BOOST_ASSERT(0 != m_pimpl.get());
return m_pimpl->can_be_null();
}
- const re_detail::regex_data<charT, traits>& get_data()const
+ const BOOST_REGEX_DETAIL_NS::regex_data<charT, traits>& get_data()const
{
BOOST_ASSERT(0 != m_pimpl.get());
return m_pimpl->get_data();
}
- boost::shared_ptr<re_detail::named_subexpressions > get_named_subs()const
+ boost::shared_ptr<BOOST_REGEX_DETAIL_NS::named_subexpressions > get_named_subs()const
{
return m_pimpl;
}
private:
- shared_ptr<re_detail::basic_regex_implementation<charT, traits> > m_pimpl;
+ shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> > m_pimpl;
};
//
const charT* p2,
flag_type f)
{
- shared_ptr<re_detail::basic_regex_implementation<charT, traits> > temp;
+ shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> > temp;
if(!m_pimpl.get())
{
- temp = shared_ptr<re_detail::basic_regex_implementation<charT, traits> >(new re_detail::basic_regex_implementation<charT, traits>());
+ temp = shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> >(new BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits>());
}
else
{
- temp = shared_ptr<re_detail::basic_regex_implementation<charT, traits> >(new re_detail::basic_regex_implementation<charT, traits>(m_pimpl->m_ptraits));
+ temp = shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> >(new BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits>(m_pimpl->m_ptraits));
}
temp->assign(p1, p2, f);
temp.swap(m_pimpl);
template <class charT, class traits>
typename basic_regex<charT, traits>::locale_type BOOST_REGEX_CALL basic_regex<charT, traits>::imbue(locale_type l)
{
- shared_ptr<re_detail::basic_regex_implementation<charT, traits> > temp(new re_detail::basic_regex_implementation<charT, traits>());
+ shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits> > temp(new BOOST_REGEX_DETAIL_NS::basic_regex_implementation<charT, traits>());
locale_type result = temp->imbue(l);
temp.swap(m_pimpl);
return result;
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template <class charT>
struct digraph : public std::pair<charT, charT>
//
// fill in the basics:
//
- result->csingles = static_cast<unsigned int>(::boost::re_detail::distance(char_set.singles_begin(), char_set.singles_end()));
- result->cranges = static_cast<unsigned int>(::boost::re_detail::distance(char_set.ranges_begin(), char_set.ranges_end())) / 2;
- result->cequivalents = static_cast<unsigned int>(::boost::re_detail::distance(char_set.equivalents_begin(), char_set.equivalents_end()));
+ result->csingles = static_cast<unsigned int>(::boost::BOOST_REGEX_DETAIL_NS::distance(char_set.singles_begin(), char_set.singles_end()));
+ result->cranges = static_cast<unsigned int>(::boost::BOOST_REGEX_DETAIL_NS::distance(char_set.ranges_begin(), char_set.ranges_end())) / 2;
+ result->cequivalents = static_cast<unsigned int>(::boost::BOOST_REGEX_DETAIL_NS::distance(char_set.equivalents_begin(), char_set.equivalents_end()));
result->cclasses = char_set.classes();
result->cnclasses = char_set.negated_classes();
if(flags() & regbase::icase)
return 0;
}
charT* p = static_cast<charT*>(this->m_pdata->m_data.extend(sizeof(charT) * (s1.size() + s2.size() + 2) ) );
- re_detail::copy(s1.begin(), s1.end(), p);
+ BOOST_REGEX_DETAIL_NS::copy(s1.begin(), s1.end(), p);
p[s1.size()] = charT(0);
p += s1.size() + 1;
- re_detail::copy(s2.begin(), s2.end(), p);
+ BOOST_REGEX_DETAIL_NS::copy(s2.begin(), s2.end(), p);
p[s2.size()] = charT(0);
}
//
if(s.empty())
return 0; // invalid or unsupported equivalence class
charT* p = static_cast<charT*>(this->m_pdata->m_data.extend(sizeof(charT) * (s.size()+1) ) );
- re_detail::copy(s.begin(), s.end(), p);
+ BOOST_REGEX_DETAIL_NS::copy(s.begin(), s.end(), p);
p[s.size()] = charT(0);
++first;
}
m_pdata->m_expression_len = len;
charT* ps = static_cast<charT*>(m_pdata->m_data.extend(sizeof(charT) * (1 + (p2 - p1))));
m_pdata->m_expression = ps;
- re_detail::copy(p1, p2, ps);
+ BOOST_REGEX_DETAIL_NS::copy(p1, p2, ps);
ps[p2 - p1] = 0;
// fill in our other data...
// successful parsing implies a zero status:
set_all_masks(l_map, mask);
return;
}
+ case syntax_element_accept:
case syntax_element_match:
{
// must be null, any character can match:
state = state->next.p;
break;
+ case syntax_element_commit:
+ set_all_masks(l_map, mask);
+ // Continue scanning so we can figure out whether we can be null:
+ state = state->next.p;
+ break;
case syntax_element_startmark:
// need to handle independent subs as a special case:
if(static_cast<re_brace*>(state)->index == -3)
{
switch(state->next.p->type)
{
- case re_detail::syntax_element_wild:
- return re_detail::syntax_element_dot_rep;
- case re_detail::syntax_element_literal:
- return re_detail::syntax_element_char_rep;
- case re_detail::syntax_element_set:
- return re_detail::syntax_element_short_set_rep;
- case re_detail::syntax_element_long_set:
- if(static_cast<re_detail::re_set_long<m_type>*>(state->next.p)->singleton)
- return re_detail::syntax_element_long_set_rep;
+ case BOOST_REGEX_DETAIL_NS::syntax_element_wild:
+ return BOOST_REGEX_DETAIL_NS::syntax_element_dot_rep;
+ case BOOST_REGEX_DETAIL_NS::syntax_element_literal:
+ return BOOST_REGEX_DETAIL_NS::syntax_element_char_rep;
+ case BOOST_REGEX_DETAIL_NS::syntax_element_set:
+ return BOOST_REGEX_DETAIL_NS::syntax_element_short_set_rep;
+ case BOOST_REGEX_DETAIL_NS::syntax_element_long_set:
+ if(static_cast<BOOST_REGEX_DETAIL_NS::re_set_long<m_type>*>(state->next.p)->singleton)
+ return BOOST_REGEX_DETAIL_NS::syntax_element_long_set_rep;
break;
default:
break;
}
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#endif
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_MSVC
#pragma warning(push)
bool parse_inner_set(basic_char_set<charT, traits>& char_set);
bool parse_QE();
bool parse_perl_extension();
+ bool parse_perl_verb();
+ bool match_verb(const char*);
bool add_emacs_code(bool negate);
bool unwind_alts(std::ptrdiff_t last_paren_start);
digraph<charT> get_next_set_literal(basic_char_set<charT, traits>& char_set);
// have had an unexpected ')' :
if(!result)
{
- fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_position), "Found a closing ) with no corresponding openening parenthesis.");
+ fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_position), "Found a closing ) with no corresponding openening parenthesis.");
return;
}
// if an error has been set then give up now:
{
if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_question)
return parse_perl_extension();
+ if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_star)
+ return parse_perl_verb();
}
//
// update our mark count, and append the required state:
//
if(m_position == m_end)
{
- this->fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_end));
+ this->fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_end));
return false;
}
BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark);
static_cast<re_dot*>(
this->append_state(syntax_element_wild, sizeof(re_dot))
)->mask = static_cast<unsigned char>(this->flags() & regbase::no_mod_s
- ? re_detail::force_not_newline
+ ? BOOST_REGEX_DETAIL_NS::force_not_newline
: this->flags() & regbase::mod_s ?
- re_detail::force_newline : re_detail::dont_care);
+ BOOST_REGEX_DETAIL_NS::force_newline : BOOST_REGEX_DETAIL_NS::dont_care);
return true;
}
}
if(0 == this->m_last_state)
{
- fail(regex_constants::error_badrepeat, ::boost::re_detail::distance(m_base, m_position), "Nothing to repeat.");
+ fail(regex_constants::error_badrepeat, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_position), "Nothing to repeat.");
return false;
}
if(this->m_last_state->type == syntax_element_endmark)
//
// we need to append a trailing jump:
//
- re_syntax_base* pj = this->append_state(re_detail::syntax_element_jump, sizeof(re_jump));
+ re_syntax_base* pj = this->append_state(BOOST_REGEX_DETAIL_NS::syntax_element_jump, sizeof(re_jump));
std::ptrdiff_t jump_offset = this->getoffset(pj);
//
// now insert the alternative:
{
// an octal escape sequence, the first character must be a zero
// followed by up to 3 octal digits:
- std::ptrdiff_t len = (std::min)(::boost::re_detail::distance(m_position, m_end), static_cast<std::ptrdiff_t>(4));
+ std::ptrdiff_t len = (std::min)(::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end), static_cast<std::ptrdiff_t>(4));
const charT* bp = m_position;
int val = this->m_traits.toi(bp, bp + 1, 8);
if(val != 0)
// Rewind to start of (? sequence:
--m_position;
while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
- this->fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_end));
+ this->fail(regex_constants::error_paren, ::boost::BOOST_REGEX_DETAIL_NS::distance(m_base, m_end));
return false;
}
BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark);
return true;
}
+template <class charT, class traits>
+bool basic_regex_parser<charT, traits>::match_verb(const char* verb)
+{
+ while(*verb)
+ {
+ if(static_cast<charT>(*verb) != *m_position)
+ {
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ if(++m_position == m_end)
+ {
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ ++verb;
+ }
+ return true;
+}
+
+template <class charT, class traits>
+bool basic_regex_parser<charT, traits>::parse_perl_verb()
+{
+ if(++m_position == m_end)
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ switch(*m_position)
+ {
+ case 'F':
+ if(++m_position == m_end)
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ if((this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark) || match_verb("AIL"))
+ {
+ if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ ++m_position;
+ this->append_state(syntax_element_fail);
+ return true;
+ }
+ break;
+ case 'A':
+ if(++m_position == m_end)
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ if(match_verb("CCEPT"))
+ {
+ if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ ++m_position;
+ this->append_state(syntax_element_accept);
+ return true;
+ }
+ break;
+ case 'C':
+ if(++m_position == m_end)
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ if(match_verb("OMMIT"))
+ {
+ if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ ++m_position;
+ static_cast<re_commit*>(this->append_state(syntax_element_commit, sizeof(re_commit)))->action = commit_commit;
+ this->m_pdata->m_disable_match_any = true;
+ return true;
+ }
+ break;
+ case 'P':
+ if(++m_position == m_end)
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ if(match_verb("RUNE"))
+ {
+ if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ ++m_position;
+ static_cast<re_commit*>(this->append_state(syntax_element_commit, sizeof(re_commit)))->action = commit_prune;
+ this->m_pdata->m_disable_match_any = true;
+ return true;
+ }
+ break;
+ case 'S':
+ if(++m_position == m_end)
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ if(match_verb("KIP"))
+ {
+ if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ ++m_position;
+ static_cast<re_commit*>(this->append_state(syntax_element_commit, sizeof(re_commit)))->action = commit_skip;
+ this->m_pdata->m_disable_match_any = true;
+ return true;
+ }
+ break;
+ case 'T':
+ if(++m_position == m_end)
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ if(match_verb("HEN"))
+ {
+ if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+ {
+ // Rewind to start of (* sequence:
+ --m_position;
+ while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position;
+ fail(regex_constants::error_perl_extension, m_position - m_base);
+ return false;
+ }
+ ++m_position;
+ this->append_state(syntax_element_then);
+ this->m_pdata->m_disable_match_any = true;
+ return true;
+ }
+ break;
+ }
+ return false;
+}
+
template <class charT, class traits>
bool basic_regex_parser<charT, traits>::add_emacs_code(bool negate)
{
#pragma warning(pop)
#endif
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#ifdef BOOST_MSVC
template <class charT>
class cpp_regex_traits;
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
//
// class parser_buf:
{
std::string m("Unable to open message catalog: ");
std::runtime_error err(m + cat_name);
- boost::re_detail::raise_runtime_error(err);
+ boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
}
//
class cpp_regex_traits_implementation : public cpp_regex_traits_char_layer<charT>
{
public:
- typedef typename cpp_regex_traits<charT>::char_class_type char_class_type;
- typedef typename std::ctype<charT>::mask native_mask_type;
+ typedef typename cpp_regex_traits<charT>::char_class_type char_class_type;
+ typedef typename std::ctype<charT>::mask native_mask_type;
+ typedef typename boost::make_unsigned<native_mask_type>::type unsigned_native_mask_type;
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
BOOST_STATIC_CONSTANT(char_class_type, mask_blank = 1u << 24);
BOOST_STATIC_CONSTANT(char_class_type, mask_word = 1u << 25);
{
std::string m("Unable to open message catalog: ");
std::runtime_error err(m + cat_name);
- boost::re_detail::raise_runtime_error(err);
+ boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
}
//
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
static const char_class_type masks[16] =
{
- std::ctype<charT>::alnum,
- std::ctype<charT>::alpha,
- std::ctype<charT>::cntrl,
- std::ctype<charT>::digit,
- std::ctype<charT>::graph,
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::alnum),
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::alpha),
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::cntrl),
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::digit),
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::graph),
cpp_regex_traits_implementation<charT>::mask_horizontal,
- std::ctype<charT>::lower,
- std::ctype<charT>::print,
- std::ctype<charT>::punct,
- std::ctype<charT>::space,
- std::ctype<charT>::upper,
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::lower),
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::print),
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::punct),
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::space),
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::upper),
cpp_regex_traits_implementation<charT>::mask_vertical,
- std::ctype<charT>::xdigit,
+ static_cast<unsigned_native_mask_type>(std::ctype<charT>::xdigit),
cpp_regex_traits_implementation<charT>::mask_blank,
cpp_regex_traits_implementation<charT>::mask_word,
cpp_regex_traits_implementation<charT>::mask_unicode,
#else
static const char_class_type masks[16] =
{
- ::boost::re_detail::char_class_alnum,
- ::boost::re_detail::char_class_alpha,
- ::boost::re_detail::char_class_cntrl,
- ::boost::re_detail::char_class_digit,
- ::boost::re_detail::char_class_graph,
- ::boost::re_detail::char_class_horizontal_space,
- ::boost::re_detail::char_class_lower,
- ::boost::re_detail::char_class_print,
- ::boost::re_detail::char_class_punct,
- ::boost::re_detail::char_class_space,
- ::boost::re_detail::char_class_upper,
- ::boost::re_detail::char_class_vertical_space,
- ::boost::re_detail::char_class_xdigit,
- ::boost::re_detail::char_class_blank,
- ::boost::re_detail::char_class_word,
- ::boost::re_detail::char_class_unicode,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_alpha,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_cntrl,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_digit,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_graph,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_horizontal_space,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_lower,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_print,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_punct,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_space,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_upper,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_vertical_space,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_xdigit,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_blank,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_word,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_unicode,
};
#endif
static const string_type null_string;
//
// get the collation format used by m_pcollate:
//
- m_collate_type = re_detail::find_sort_syntax(this, &m_collate_delim);
+ m_collate_type = BOOST_REGEX_DETAIL_NS::find_sort_syntax(this, &m_collate_delim);
}
template <class charT>
static const char_class_type masks[22] =
{
0,
- std::ctype<char>::alnum,
- std::ctype<char>::alpha,
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::alnum),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::alpha),
cpp_regex_traits_implementation<charT>::mask_blank,
- std::ctype<char>::cntrl,
- std::ctype<char>::digit,
- std::ctype<char>::digit,
- std::ctype<char>::graph,
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::cntrl),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::digit),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::digit),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::graph),
cpp_regex_traits_implementation<charT>::mask_horizontal,
- std::ctype<char>::lower,
- std::ctype<char>::lower,
- std::ctype<char>::print,
- std::ctype<char>::punct,
- std::ctype<char>::space,
- std::ctype<char>::space,
- std::ctype<char>::upper,
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::lower),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::lower),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::print),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::punct),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::space),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::space),
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::upper),
cpp_regex_traits_implementation<charT>::mask_unicode,
- std::ctype<char>::upper,
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::upper),
cpp_regex_traits_implementation<charT>::mask_vertical,
- std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word,
- std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word,
- std::ctype<char>::xdigit,
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::alnum) | cpp_regex_traits_implementation<charT>::mask_word,
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::alnum) | cpp_regex_traits_implementation<charT>::mask_word,
+ static_cast<unsigned_native_mask_type>(std::ctype<char>::xdigit),
};
#else
static const char_class_type masks[22] =
{
0,
- ::boost::re_detail::char_class_alnum,
- ::boost::re_detail::char_class_alpha,
- ::boost::re_detail::char_class_blank,
- ::boost::re_detail::char_class_cntrl,
- ::boost::re_detail::char_class_digit,
- ::boost::re_detail::char_class_digit,
- ::boost::re_detail::char_class_graph,
- ::boost::re_detail::char_class_horizontal_space,
- ::boost::re_detail::char_class_lower,
- ::boost::re_detail::char_class_lower,
- ::boost::re_detail::char_class_print,
- ::boost::re_detail::char_class_punct,
- ::boost::re_detail::char_class_space,
- ::boost::re_detail::char_class_space,
- ::boost::re_detail::char_class_upper,
- ::boost::re_detail::char_class_unicode,
- ::boost::re_detail::char_class_upper,
- ::boost::re_detail::char_class_vertical_space,
- ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word,
- ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word,
- ::boost::re_detail::char_class_xdigit,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_alpha,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_blank,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_cntrl,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_digit,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_digit,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_graph,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_horizontal_space,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_lower,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_lower,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_print,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_punct,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_space,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_space,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_upper,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_unicode,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_upper,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_vertical_space,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum | ::boost::BOOST_REGEX_DETAIL_NS::char_class_word,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_alnum | ::boost::BOOST_REGEX_DETAIL_NS::char_class_word,
+ ::boost::BOOST_REGEX_DETAIL_NS::char_class_xdigit,
};
#endif
if(m_custom_class_names.size())
if(pos != m_custom_class_names.end())
return pos->second;
}
- std::size_t state_id = 1 + re_detail::get_default_class_id(p1, p2);
+ std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
BOOST_ASSERT(state_id < sizeof(masks) / sizeof(masks[0]));
return masks[state_id];
}
bool cpp_regex_traits_implementation<charT>::isctype(const charT c, char_class_type mask) const
{
return
- ((mask & ::boost::re_detail::char_class_space) && (this->m_pctype->is(std::ctype<charT>::space, c)))
- || ((mask & ::boost::re_detail::char_class_print) && (this->m_pctype->is(std::ctype<charT>::print, c)))
- || ((mask & ::boost::re_detail::char_class_cntrl) && (this->m_pctype->is(std::ctype<charT>::cntrl, c)))
- || ((mask & ::boost::re_detail::char_class_upper) && (this->m_pctype->is(std::ctype<charT>::upper, c)))
- || ((mask & ::boost::re_detail::char_class_lower) && (this->m_pctype->is(std::ctype<charT>::lower, c)))
- || ((mask & ::boost::re_detail::char_class_alpha) && (this->m_pctype->is(std::ctype<charT>::alpha, c)))
- || ((mask & ::boost::re_detail::char_class_digit) && (this->m_pctype->is(std::ctype<charT>::digit, c)))
- || ((mask & ::boost::re_detail::char_class_punct) && (this->m_pctype->is(std::ctype<charT>::punct, c)))
- || ((mask & ::boost::re_detail::char_class_xdigit) && (this->m_pctype->is(std::ctype<charT>::xdigit, c)))
- || ((mask & ::boost::re_detail::char_class_blank) && (this->m_pctype->is(std::ctype<charT>::space, c)) && !::boost::re_detail::is_separator(c))
- || ((mask & ::boost::re_detail::char_class_word) && (c == '_'))
- || ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c))
- || ((mask & ::boost::re_detail::char_class_vertical_space) && (is_separator(c) || (c == '\v')))
- || ((mask & ::boost::re_detail::char_class_horizontal_space) && this->m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v')));
+ ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_space) && (this->m_pctype->is(std::ctype<charT>::space, c)))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_print) && (this->m_pctype->is(std::ctype<charT>::print, c)))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_cntrl) && (this->m_pctype->is(std::ctype<charT>::cntrl, c)))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_upper) && (this->m_pctype->is(std::ctype<charT>::upper, c)))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_lower) && (this->m_pctype->is(std::ctype<charT>::lower, c)))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_alpha) && (this->m_pctype->is(std::ctype<charT>::alpha, c)))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_digit) && (this->m_pctype->is(std::ctype<charT>::digit, c)))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_punct) && (this->m_pctype->is(std::ctype<charT>::punct, c)))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_xdigit) && (this->m_pctype->is(std::ctype<charT>::xdigit, c)))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_blank) && (this->m_pctype->is(std::ctype<charT>::space, c)) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_word) && (c == '_'))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_unicode) && ::boost::BOOST_REGEX_DETAIL_NS::is_extended(c))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_vertical_space) && (is_separator(c) || (c == '\v')))
+ || ((mask & ::boost::BOOST_REGEX_DETAIL_NS::char_class_horizontal_space) && this->m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v')));
}
#endif
return ::boost::object_cache<cpp_regex_traits_base<charT>, cpp_regex_traits_implementation<charT> >::get(key, 5);
}
-} // re_detail
+} // BOOST_REGEX_DETAIL_NS
template <class charT>
class cpp_regex_traits
struct boost_extensions_tag{};
cpp_regex_traits()
- : m_pimpl(re_detail::create_cpp_regex_traits<charT>(std::locale()))
+ : m_pimpl(BOOST_REGEX_DETAIL_NS::create_cpp_regex_traits<charT>(std::locale()))
{ }
static size_type length(const char_type* p)
{
&& (m_pimpl->m_pctype->is(
static_cast<ctype_mask>(f & mask_base), c)))
return true;
- else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_unicode) && re_detail::is_extended(c))
+ else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_unicode) && BOOST_REGEX_DETAIL_NS::is_extended(c))
return true;
- else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_word) && (c == '_'))
+ else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_word) && (c == '_'))
return true;
- else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_blank)
+ else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_blank)
&& m_pimpl->m_pctype->is(std::ctype<charT>::space, c)
- && !re_detail::is_separator(c))
+ && !BOOST_REGEX_DETAIL_NS::is_separator(c))
return true;
- else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_vertical)
- && (::boost::re_detail::is_separator(c) || (c == '\v')))
+ else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_vertical)
+ && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v')))
return true;
- else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_horizontal)
- && this->isctype(c, std::ctype<charT>::space) && !this->isctype(c, re_detail::cpp_regex_traits_implementation<charT>::mask_vertical))
+ else if((f & BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_horizontal)
+ && this->isctype(c, std::ctype<charT>::space) && !this->isctype(c, BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT>::mask_vertical))
return true;
+#ifdef __CYGWIN__
+ //
+ // Cygwin has a buggy ctype facet, see https://www.cygwin.com/ml/cygwin/2012-08/msg00178.html:
+ //
+ else if((f & std::ctype<charT>::xdigit) == std::ctype<charT>::xdigit)
+ {
+ if((c >= 'a') && (c <= 'f'))
+ return true;
+ if((c >= 'A') && (c <= 'F'))
+ return true;
+ }
+#endif
return false;
#else
return m_pimpl->isctype(c, f);
locale_type imbue(locale_type l)
{
std::locale result(getloc());
- m_pimpl = re_detail::create_cpp_regex_traits<charT>(l);
+ m_pimpl = BOOST_REGEX_DETAIL_NS::create_cpp_regex_traits<charT>(l);
return result;
}
locale_type getloc()const
static std::string get_catalog_name();
private:
- boost::shared_ptr<const re_detail::cpp_regex_traits_implementation<charT> > m_pimpl;
+ boost::shared_ptr<const BOOST_REGEX_DETAIL_NS::cpp_regex_traits_implementation<charT> > m_pimpl;
//
// catalog name handler:
//
template <class charT>
int cpp_regex_traits<charT>::toi(const charT*& first, const charT* last, int radix)const
{
- re_detail::parser_buf<charT> sbuf; // buffer for parsing numbers.
+ BOOST_REGEX_DETAIL_NS::parser_buf<charT> sbuf; // buffer for parsing numbers.
std::basic_istream<charT> is(&sbuf); // stream for parsing numbers.
// we do NOT want to parse any thousands separators inside the stream:
class RegEx;
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
class RegExData;
struct pred1;
struct pred3;
struct pred4;
-} /* namespace re_detail */
+} /* namespace BOOST_REGEX_DETAIL_NS */
#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_DISABLE_WIN32)
typedef bool (__cdecl *GrepCallback)(const RegEx& expression);
class BOOST_REGEX_DECL RegEx
{
private:
- re_detail::RegExData* pdata;
+ BOOST_REGEX_DETAIL_NS::RegExData* pdata;
public:
RegEx();
RegEx(const RegEx& o);
static const std::size_t npos;
- friend struct re_detail::pred1;
- friend struct re_detail::pred2;
- friend struct re_detail::pred3;
- friend struct re_detail::pred4;
+ friend struct BOOST_REGEX_DETAIL_NS::pred1;
+ friend struct BOOST_REGEX_DETAIL_NS::pred2;
+ friend struct BOOST_REGEX_DETAIL_NS::pred3;
+ friend struct BOOST_REGEX_DETAIL_NS::pred4;
};
#ifdef BOOST_MSVC
#include <cstddef>
namespace boost{
- namespace re_detail{
+ namespace BOOST_REGEX_DETAIL_NS{
#ifndef BOOST_NO_ANSI_APIS
typedef WIN32_FIND_DATAA _fi_find_data;
#endif
typedef HANDLE _fi_find_handle;
- } // namespace re_detail
+ } // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#endif
namespace boost{
- namespace re_detail{
+ namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
# include BOOST_ABI_SUFFIX
#endif
- } // namespace re_detail
+ } // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#ifdef FindFirstFile
#endif
namespace boost{
- namespace re_detail{
+ namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
-} // namespace re_detail
-using boost::re_detail::directory_iterator;
-using boost::re_detail::file_iterator;
-using boost::re_detail::mapfile;
+} // namespace BOOST_REGEX_DETAIL_NS
+using boost::BOOST_REGEX_DETAIL_NS::directory_iterator;
+using boost::BOOST_REGEX_DETAIL_NS::file_iterator;
+using boost::BOOST_REGEX_DETAIL_NS::mapfile;
} // namespace boost
#endif // BOOST_REGEX_NO_FILEITER
template class BOOST_REGEX_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
template class BOOST_REGEX_DECL match_results< const BOOST_REGEX_CHAR_T* >;
#ifndef BOOST_NO_STD_ALLOCATOR
-template class BOOST_REGEX_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
+template class BOOST_REGEX_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
#endif
# ifndef BOOST_REGEX_INSTANTIATE
template class BOOST_REGEX_TEMPLATE_DECL match_results< const BOOST_REGEX_CHAR_T* >;
#ifndef BOOST_NO_STD_ALLOCATOR
-template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
+template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
#endif
#if !(defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB <= 1))\
&& !(defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 800))\
&& !defined(BOOST_REGEX_ICU_INSTANCES)
template class BOOST_REGEX_TEMPLATE_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
#ifndef BOOST_NO_STD_ALLOCATOR
-template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
+template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
#endif
#endif
#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE)
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wkeyword-macro"
+#endif
+
# ifndef BOOST_REGEX_INSTANTIATE
# ifdef __GNUC__
# define template __extension__ extern template
# endif
#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_REGEX_ICU_INSTANCES)
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template BOOST_REGEX_DECL
std::locale cpp_regex_traits_base<BOOST_REGEX_CHAR_T>::imbue(const std::locale& l);
match_results<const BOOST_REGEX_CHAR_T*>::maybe_assign(
const match_results<const BOOST_REGEX_CHAR_T*>& m);
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template BOOST_REGEX_DECL void perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::construct_init(
const basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >& e, match_flag_type f);
template BOOST_REGEX_DECL bool perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::match();
match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::maybe_assign(
const match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>& m);
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template BOOST_REGEX_DECL void perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::construct_init(
const basic_regex<BOOST_REGEX_CHAR_T>& e, match_flag_type f);
template BOOST_REGEX_DECL bool perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::match();
# undef template
# endif
-
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
#endif
} // namespace boost
#endif
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
#endif
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#ifdef BOOST_MSVC
# endif
#endif
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
class named_subexpressions;
typedef const_reference reference;
typedef typename vector_type::const_iterator const_iterator;
typedef const_iterator iterator;
- typedef typename re_detail::regex_iterator_traits<
+ typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<
BidiIterator>::difference_type difference_type;
typedef typename Allocator::size_type size_type;
typedef Allocator allocator_type;
- typedef typename re_detail::regex_iterator_traits<
+ typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<
BidiIterator>::value_type char_type;
typedef std::basic_string<char_type> string_type;
- typedef re_detail::named_subexpressions named_sub_type;
+ typedef BOOST_REGEX_DETAIL_NS::named_subexpressions named_sub_type;
// construct/copy/destroy:
explicit match_results(const Allocator& a = Allocator())
const sub_match<BidiIterator>& s = m_subs[sub];
if(s.matched || (sub == 2))
{
- return ::boost::re_detail::distance((BidiIterator)(m_base), (BidiIterator)(s.first));
+ return ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)(m_base), (BidiIterator)(s.first));
}
}
return ~static_cast<difference_type>(0);
//
if(m_is_singular)
raise_logic_error();
- re_detail::named_subexpressions::range_type r = m_named_subs->equal_range(i, j);
+ BOOST_REGEX_DETAIL_NS::named_subexpressions::range_type r = m_named_subs->equal_range(i, j);
while((r.first != r.second) && ((*this)[r.first->index].matched == false))
++r.first;
return r.first != r.second ? (*this)[r.first->index] : m_null;
//
if(m_is_singular)
raise_logic_error();
- re_detail::named_subexpressions::range_type s, r;
+ BOOST_REGEX_DETAIL_NS::named_subexpressions::range_type s, r;
s = r = m_named_subs->equal_range(i, j);
while((r.first != r.second) && ((*this)[r.first->index].matched == false))
++r.first;
{
if(m_is_singular)
raise_logic_error();
- typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator>::type F;
+ typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator>::type F;
F func(fmt);
return func(*this, out, flags);
}
if(m_is_singular)
raise_logic_error();
std::basic_string<char_type> result;
- re_detail::string_out_iterator<std::basic_string<char_type> > i(result);
+ BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<char_type> > i(result);
- typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, re_detail::string_out_iterator<std::basic_string<char_type> > >::type F;
+ typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<char_type> > >::type F;
F func(fmt);
func(*this, i, flags);
if(m_is_singular)
raise_logic_error();
typedef ::boost::regex_traits_wrapper<typename RegexT::traits_type> traits_type;
- typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator, traits_type>::type F;
+ typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator, traits_type>::type F;
F func(fmt);
return func(*this, out, flags, re.get_traits());
}
raise_logic_error();
typedef ::boost::regex_traits_wrapper<typename RegexT::traits_type> traits_type;
std::basic_string<char_type> result;
- re_detail::string_out_iterator<std::basic_string<char_type> > i(result);
+ BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<char_type> > i(result);
- typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, re_detail::string_out_iterator<std::basic_string<char_type> >, traits_type >::type F;
+ typedef typename BOOST_REGEX_DETAIL_NS::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<char_type> >, traits_type >::type F;
F func(fmt);
func(*this, i, flags, re.get_traits());
// p1 better than p2, and no need to calculate distances:
return;
}
- base1 = ::boost::re_detail::distance(l_base, p1->first);
- base2 = ::boost::re_detail::distance(l_base, p2->first);
+ base1 = ::boost::BOOST_REGEX_DETAIL_NS::distance(l_base, p1->first);
+ base2 = ::boost::BOOST_REGEX_DETAIL_NS::distance(l_base, p2->first);
BOOST_ASSERT(base1 >= 0);
BOOST_ASSERT(base2 >= 0);
if(base1 < base2) return;
if(base2 < base1) break;
- len1 = ::boost::re_detail::distance((BidiIterator)p1->first, (BidiIterator)p1->second);
- len2 = ::boost::re_detail::distance((BidiIterator)p2->first, (BidiIterator)p2->second);
+ len1 = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)p1->first, (BidiIterator)p1->second);
+ len2 = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)p2->first, (BidiIterator)p2->second);
BOOST_ASSERT(len1 >= 0);
BOOST_ASSERT(len2 >= 0);
if((len1 != len2) || ((p1->matched == false) && (p2->matched == true)))
#endif
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
struct mem_block_node
{
#endif
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
//
// error checking API:
int state_id;
std::size_t count; // the number of iterations so far
BidiIterator start_pos; // where the last repeat started
+
+ repeater_count* unwind_until(int n, repeater_count* p, int current_recursion_id)
+ {
+ while(p && (p->state_id != n))
+ {
+ if(-2 - current_recursion_id == p->state_id)
+ return 0;
+ p = p->next;
+ if(p && (p->state_id < 0))
+ {
+ p = unwind_until(p->state_id, p, current_recursion_id);
+ if(!p)
+ return p;
+ p = p->next;
+ }
+ }
+ return p;
+ }
public:
repeater_count(repeater_count** s) : stack(s), next(0), state_id(-1), count(0), start_pos() {}
-
- repeater_count(int i, repeater_count** s, BidiIterator start)
+
+ repeater_count(int i, repeater_count** s, BidiIterator start, int current_recursion_id)
: start_pos(start)
{
state_id = i;
stack = s;
next = *stack;
*stack = this;
- if(state_id > next->state_id)
+ if((state_id > next->state_id) && (next->state_id >= 0))
count = 0;
else
{
repeater_count* p = next;
- while(p && (p->state_id != state_id))
- p = p->next;
+ p = unwind_until(state_id, p, current_recursion_id);
if(p)
{
count = p->count;
bool backtrack_till_match(std::size_t count);
#endif
bool match_recursion();
+ bool match_fail();
+ bool match_accept();
+ bool match_commit();
+ bool match_then();
+ bool skip_until_paren(int index, bool match = true);
// find procs stored in s_find_vtable:
bool find_restart_any();
unsigned char match_any_mask;
// recursion information:
std::vector<recursion_info<results_type> > recursion_stack;
-
+#ifdef BOOST_REGEX_RECURSIVE
+ // Set to false by a (*COMMIT):
+ bool m_can_backtrack;
+ bool m_have_accept;
+ bool m_have_then;
+#endif
#ifdef BOOST_REGEX_NON_RECURSIVE
//
// additional members for non-recursive version:
bool unwind_non_greedy_repeat(bool);
bool unwind_recursion(bool);
bool unwind_recursion_pop(bool);
+ bool unwind_commit(bool);
+ bool unwind_then(bool);
void destroy_single_repeat();
void push_matched_paren(int index, const sub_match<BidiIterator>& sub);
void push_recursion_stopper();
saved_state* m_stack_base;
// pointer to current stack position:
saved_state* m_backup_state;
+ // how many memory blocks have we used up?:
+ unsigned used_block_count;
// determines what value to return when unwinding from recursion,
// allows for mixed recursive/non-recursive algorithm:
bool m_recursive_result;
- // how many memory blocks have we used up?:
- unsigned used_block_count;
+ // We have unwound to a lookahead/lookbehind, used by COMMIT/PRUNE/SKIP:
+ bool m_unwound_lookahead;
+ // We have unwound to an alternative, used by THEN:
+ bool m_unwound_alt;
+ // We are unwinding a commit - used by independent subs to determine whether to stop there or carry on unwinding:
+ //bool m_unwind_commit;
#endif
// these operations aren't allowed, so are declared private,
#pragma warning(pop)
#endif
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
#ifdef BOOST_MSVC
#pragma warning(push)
#endif
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template <class BidiIterator, class Allocator, class traits>
void perl_matcher<BidiIterator, Allocator, traits>::construct_init(const basic_regex<char_type, traits>& e, match_flag_type f)
#ifdef BOOST_REGEX_NON_RECURSIVE
m_stack_base = 0;
m_backup_state = 0;
+#elif defined(BOOST_REGEX_RECURSIVE)
+ m_can_backtrack = true;
+ m_have_accept = false;
#endif
// find the value to use for matching word boundaries:
m_word_mask = re.get_data().m_word_mask;
// find bitmask to use for matching '.':
- match_any_mask = static_cast<unsigned char>((f & match_not_dot_newline) ? re_detail::test_not_newline : re_detail::test_newline);
+ match_any_mask = static_cast<unsigned char>((f & match_not_dot_newline) ? BOOST_REGEX_DETAIL_NS::test_not_newline : BOOST_REGEX_DETAIL_NS::test_newline);
+ // Disable match_any if requested in the state machine:
+ if(e.get_data().m_disable_match_any)
+ m_match_flags &= ~regex_constants::match_any;
}
template <class BidiIterator, class Allocator, class traits>
// Calculate NS^2 first:
//
static const std::ptrdiff_t k = 100000;
- std::ptrdiff_t dist = boost::re_detail::distance(base, last);
+ std::ptrdiff_t dist = boost::BOOST_REGEX_DETAIL_NS::distance(base, last);
if(dist == 0)
dist = 1;
std::ptrdiff_t states = re.size();
inline bool perl_matcher<BidiIterator, Allocator, traits>::protected_call(
protected_proc_type proc)
{
- ::boost::re_detail::concrete_protected_call
+ ::boost::BOOST_REGEX_DETAIL_NS::concrete_protected_call
<perl_matcher<BidiIterator, Allocator, traits> >
obj(this, proc);
return obj.execute();
#endif
if(!m_has_found_match)
position = restart; // reset search postion
+#ifdef BOOST_REGEX_RECURSIVE
+ m_can_backtrack = true; // reset for further searches
+#endif
return m_has_found_match;
}
#endif
if( ::boost::is_random_access_iterator<BidiIterator>::value)
{
- std::ptrdiff_t maxlen = ::boost::re_detail::distance(backstop, position);
+ std::ptrdiff_t maxlen = ::boost::BOOST_REGEX_DETAIL_NS::distance(backstop, position);
if(maxlen < static_cast<const re_brace*>(pstate)->index)
return false;
std::advance(position, -static_cast<const re_brace*>(pstate)->index);
return true;
}
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_fail()
+{
+ // Just force a backtrack:
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_accept()
+{
+ if(!recursion_stack.empty())
+ {
+ return skip_until_paren(recursion_stack.back().idx);
+ }
+ else
+ {
+ return skip_until_paren(INT_MAX);
+ }
+}
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::find_restart_any()
return false;
}
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#endif
#ifdef BOOST_MSVC
# pragma warning(push)
-# pragma warning(disable: 4800)
+# pragma warning(disable: 4800 4706)
#endif
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template <class T>
inline void inplace_destroy(T* p)
struct saved_repeater : public saved_state
{
repeater_count<BidiIterator> count;
- saved_repeater(int i, repeater_count<BidiIterator>** s, BidiIterator start)
- : saved_state(saved_state_repeater_count), count(i,s,start){}
+ saved_repeater(int i, repeater_count<BidiIterator>** s, BidiIterator start, int current_recursion_id)
+ : saved_state(saved_state_repeater_count), count(i, s, start, current_recursion_id){}
};
struct saved_extra_block : public saved_state
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
{
- static matcher_proc_type const s_match_vtable[30] =
+ static matcher_proc_type const s_match_vtable[34] =
{
(&perl_matcher<BidiIterator, Allocator, traits>::match_startmark),
&perl_matcher<BidiIterator, Allocator, traits>::match_endmark,
&perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref,
&perl_matcher<BidiIterator, Allocator, traits>::match_toggle_case,
&perl_matcher<BidiIterator, Allocator, traits>::match_recursion,
+ &perl_matcher<BidiIterator, Allocator, traits>::match_fail,
+ &perl_matcher<BidiIterator, Allocator, traits>::match_accept,
+ &perl_matcher<BidiIterator, Allocator, traits>::match_commit,
+ &perl_matcher<BidiIterator, Allocator, traits>::match_then,
};
push_recursion_stopper();
pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
--pmp;
}
- (void) new (pmp)saved_repeater<BidiIterator>(i, s, position);
+ (void) new (pmp)saved_repeater<BidiIterator>(i, s, position, this->recursion_stack.size() ? this->recursion_stack.back().idx : (INT_MIN + 3));
m_backup_state = pmp;
}
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
pstate = pstate->next.p->next.p;
bool r = match_all_states();
+ if(!r && !m_independent)
+ {
+ // Must be unwinding from a COMMIT/SKIP/PRUNE and the independent
+ // sub failed, need to unwind everything else:
+ while(unwind(false));
+ return false;
+ }
pstate = next_pstate;
m_independent = old_independent;
#ifdef BOOST_REGEX_MATCH_EXTRA
const re_repeat* rep = static_cast<const re_repeat*>(pstate);
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
- unsigned count = static_cast<unsigned>((std::min)(static_cast<unsigned>(::boost::re_detail::distance(position, last)), static_cast<unsigned>(greedy ? rep->max : rep->min)));
+ unsigned count = static_cast<unsigned>((std::min)(static_cast<unsigned>(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), static_cast<unsigned>(greedy ? rep->max : rep->min)));
if(rep->min > count)
{
position = last;
BidiIterator end = position;
// Move end forward by "desired", preferably without using distance or advance if we can
// as these can be slow for some iterator types.
- std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
if(desired >= len)
end = last;
else
{
++position;
}
- count = (unsigned)::boost::re_detail::distance(origin, position);
+ count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
}
else
{
BidiIterator end = position;
// Move end forward by "desired", preferably without using distance or advance if we can
// as these can be slow for some iterator types.
- std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
if(desired >= len)
end = last;
else
{
++position;
}
- count = (unsigned)::boost::re_detail::distance(origin, position);
+ count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
}
else
{
BidiIterator end = position;
// Move end forward by "desired", preferably without using distance or advance if we can
// as these can be slow for some iterator types.
- std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
if(desired >= len)
end = last;
else
{
++position;
}
- count = (unsigned)::boost::re_detail::distance(origin, position);
+ count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
}
else
{
recursion_stack.push_back(recursion_info<results_type>());
recursion_stack.back().preturn_address = pstate->next.p;
recursion_stack.back().results = *m_presult;
- if(static_cast<const re_recurse*>(pstate)->state_id > 0)
- {
- push_repeater_count(static_cast<const re_recurse*>(pstate)->state_id, &next_count);
- }
pstate = static_cast<const re_jump*>(pstate)->alt.p;
recursion_stack.back().idx = static_cast<const re_brace*>(pstate)->index;
+ //if(static_cast<const re_recurse*>(pstate)->state_id > 0)
+ {
+ push_repeater_count(-(2 + static_cast<const re_brace*>(pstate)->index), &next_count);
+ }
return true;
}
*m_presult = recursion_stack.back().results;
push_recursion(recursion_stack.back().idx, recursion_stack.back().preturn_address, &recursion_stack.back().results);
recursion_stack.pop_back();
+ push_repeater_count(-(2 + index), &next_count);
}
}
}
return true;
}
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_commit()
+{
+ // Ideally we would just junk all the states that are on the stack,
+ // however we might not unwind correctly in that case, so for now,
+ // just mark that we don't backtrack into whatever is left (or rather
+ // we'll unwind it unconditionally without pausing to try other matches).
+
+ switch(static_cast<const re_commit*>(pstate)->action)
+ {
+ case commit_commit:
+ restart = last;
+ break;
+ case commit_skip:
+ if(base != position)
+ {
+ restart = position;
+ // Have to decrement restart since it will get incremented again later:
+ --restart;
+ }
+ break;
+ case commit_prune:
+ break;
+ }
+
+ saved_state* pmp = m_backup_state;
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = m_backup_state;
+ --pmp;
+ }
+ (void) new (pmp)saved_state(16);
+ m_backup_state = pmp;
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_then()
+{
+ // Just leave a mark that we need to skip to next alternative:
+ saved_state* pmp = m_backup_state;
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = m_backup_state;
+ --pmp;
+ }
+ (void) new (pmp)saved_state(17);
+ m_backup_state = pmp;
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::skip_until_paren(int index, bool have_match)
+{
+ while(pstate)
+ {
+ if(pstate->type == syntax_element_endmark)
+ {
+ if(static_cast<const re_brace*>(pstate)->index == index)
+ {
+ if(have_match)
+ return this->match_endmark();
+ pstate = pstate->next.p;
+ return true;
+ }
+ else
+ {
+ // Unenclosed closing ), occurs when (*ACCEPT) is inside some other
+ // parenthesis which may or may not have other side effects associated with it.
+ match_endmark();
+ if(!pstate)
+ {
+ unwind(true);
+ }
+ }
+ continue;
+ }
+ else if(pstate->type == syntax_element_match)
+ return true;
+ else if(pstate->type == syntax_element_startmark)
+ {
+ int idx = static_cast<const re_brace*>(pstate)->index;
+ pstate = pstate->next.p;
+ skip_until_paren(idx, false);
+ continue;
+ }
+ pstate = pstate->next.p;
+ }
+ return true;
+}
+
/****************************************************************************
Unwind and associated proceedures follow, these perform what normal stack
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::unwind(bool have_match)
{
- static unwind_proc_type const s_unwind_table[18] =
+ static unwind_proc_type const s_unwind_table[19] =
{
&perl_matcher<BidiIterator, Allocator, traits>::unwind_end,
&perl_matcher<BidiIterator, Allocator, traits>::unwind_paren,
&perl_matcher<BidiIterator, Allocator, traits>::unwind_non_greedy_repeat,
&perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion,
&perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_pop,
+ &perl_matcher<BidiIterator, Allocator, traits>::unwind_commit,
+ &perl_matcher<BidiIterator, Allocator, traits>::unwind_then,
};
m_recursive_result = have_match;
+ m_unwound_lookahead = false;
+ m_unwound_alt = false;
unwind_proc_type unwinder;
bool cont;
//
#endif
// unwind stack:
m_backup_state = pmp+1;
- boost::re_detail::inplace_destroy(pmp);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp);
return true; // keep looking
}
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_stopper(bool)
{
- boost::re_detail::inplace_destroy(m_backup_state++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(m_backup_state++);
pstate = 0; // nothing left to search
return false; // end of stack nothing more to search
}
position = pmp->position;
bool result = (r == pmp->positive);
m_recursive_result = pmp->positive ? r : !r;
- boost::re_detail::inplace_destroy(pmp++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
m_backup_state = pmp;
+ m_unwound_lookahead = true;
return !result; // return false if the assertion was matched to stop search.
}
pstate = pmp->pstate;
position = pmp->position;
}
- boost::re_detail::inplace_destroy(pmp++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
m_backup_state = pmp;
+ m_unwound_alt = !r;
return r;
}
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_repeater_counter(bool)
{
saved_repeater<BidiIterator>* pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
- boost::re_detail::inplace_destroy(pmp++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
m_backup_state = pmp;
return true; // keep looking
}
void* condemmed = m_stack_base;
m_stack_base = pmp->base;
m_backup_state = pmp->end;
- boost::re_detail::inplace_destroy(pmp);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp);
put_mem_block(condemmed);
return true; // keep looking
}
inline void perl_matcher<BidiIterator, Allocator, traits>::destroy_single_repeat()
{
saved_single_repeat<BidiIterator>* p = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
- boost::re_detail::inplace_destroy(p++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(p++);
m_backup_state = p;
}
pstate = pmp->pstate;
++(*next_count);
}
- boost::re_detail::inplace_destroy(pmp++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
m_backup_state = pmp;
return r;
}
recursion_stack.back().preturn_address = pmp->preturn_address;
recursion_stack.back().results = pmp->results;
}
- boost::re_detail::inplace_destroy(pmp++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
m_backup_state = pmp;
return true;
}
{
recursion_stack.pop_back();
}
- boost::re_detail::inplace_destroy(pmp++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
m_backup_state = pmp;
return true;
}
(void) new (pmp)saved_state(15);
m_backup_state = pmp;
}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::unwind_commit(bool b)
+{
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(m_backup_state++);
+ while(unwind(b) && !m_unwound_lookahead){}
+ if(m_unwound_lookahead && pstate)
+ {
+ //
+ // If we stop because we just unwound an assertion, put the
+ // commit state back on the stack again:
+ //
+ saved_state* pmp = m_backup_state;
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = m_backup_state;
+ --pmp;
+ }
+ (void) new (pmp)saved_state(16);
+ m_backup_state = pmp;
+ }
+ // This prevents us from stopping when we exit from an independent sub-expression:
+ m_independent = false;
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::unwind_then(bool b)
+{
+ // Unwind everything till we hit an alternative:
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(m_backup_state++);
+ bool result = false;
+ while((result = unwind(b)) && !m_unwound_alt){}
+ // We're now pointing at the next alternative, need one more backtrack
+ // since *all* the other alternatives must fail once we've reached a THEN clause:
+ if(result && m_unwound_alt)
+ unwind(b);
+ return false;
+}
+
/*
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_pop(bool r)
{
--parenthesis_stack_position;
}
- boost::re_detail::inplace_destroy(pmp++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
m_backup_state = pmp;
return true;
}
{
parenthesis_stack[parenthesis_stack_position++] = pmp->position;
}
- boost::re_detail::inplace_destroy(pmp++);
+ boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(pmp++);
m_backup_state = pmp;
return true;
}
m_backup_state = pmp;
}
*/
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#ifdef BOOST_MSVC
#endif
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template <class BidiIterator>
class backup_subex
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
{
- static matcher_proc_type const s_match_vtable[30] =
+ static matcher_proc_type const s_match_vtable[34] =
{
(&perl_matcher<BidiIterator, Allocator, traits>::match_startmark),
&perl_matcher<BidiIterator, Allocator, traits>::match_endmark,
&perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref,
&perl_matcher<BidiIterator, Allocator, traits>::match_toggle_case,
&perl_matcher<BidiIterator, Allocator, traits>::match_recursion,
+ &perl_matcher<BidiIterator, Allocator, traits>::match_fail,
+ &perl_matcher<BidiIterator, Allocator, traits>::match_accept,
+ &perl_matcher<BidiIterator, Allocator, traits>::match_commit,
+ &perl_matcher<BidiIterator, Allocator, traits>::match_then,
};
if(state_count > max_state_count)
r = false;
else
r = true;
+ if(r && m_have_accept)
+ r = skip_until_paren(INT_MAX);
break;
}
case -3:
m_independent = true;
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
pstate = pstate->next.p->next.p;
+ bool can_backtrack = m_can_backtrack;
r = match_all_states();
+ if(r)
+ m_can_backtrack = can_backtrack;
pstate = next_pstate;
m_independent = old_independent;
#ifdef BOOST_REGEX_MATCH_EXTRA
}
}
#endif
+ if(r && m_have_accept)
+ r = skip_until_paren(INT_MAX);
break;
}
case -4:
BidiIterator oldposition(position);
const re_syntax_base* old_pstate = jmp->alt.p;
pstate = pstate->next.p;
+ m_have_then = false;
if(!match_all_states())
{
pstate = old_pstate;
position = oldposition;
+ if(m_have_then)
+ {
+ m_can_backtrack = true;
+ m_have_then = false;
+ return false;
+ }
}
- return true;
+ m_have_then = false;
+ return m_can_backtrack;
}
pstate = pstate->next.p;
return true;
// Always copy the repeat count, so that the state is restored
// when we exit this scope:
//
- repeater_count<BidiIterator> r(rep->state_id, &next_count, position);
+ repeater_count<BidiIterator> r(rep->state_id, &next_count, position, this->recursion_stack.size() ? this->recursion_stack.back().idx : INT_MIN + 3);
//
// If we've had at least one repeat already, and the last one
// matched the NULL string then set the repeat count to
pstate = rep->next.p;
if(match_all_states())
return true;
+ if(!m_can_backtrack)
+ return false;
// failed repeat, reset posistion and fall through for alternative:
position = pos;
}
pstate = rep->alt.p;
if(match_all_states())
return true;
+ if(!m_can_backtrack)
+ return false;
// failed alternative, reset posistion and fall through for repeat:
position = pos;
}
++state_count;
if(match_all_states())
return true;
- if(count >= rep->max)
+ if((count >= rep->max) || !m_can_backtrack)
return false;
++count;
pstate = psingle;
#pragma warning(disable:4267)
#endif
bool greedy = (rep->greedy) && (!(m_match_flags & regex_constants::match_any) || m_independent);
- std::size_t count = (std::min)(static_cast<std::size_t>(::boost::re_detail::distance(position, last)), static_cast<std::size_t>(greedy ? rep->max : rep->min));
+ std::size_t count = (std::min)(static_cast<std::size_t>(::boost::BOOST_REGEX_DETAIL_NS::distance(position, last)), static_cast<std::size_t>(greedy ? rep->max : rep->min));
if(rep->min > count)
{
position = last;
++state_count;
if(match_all_states())
return true;
- if(count >= rep->max)
+ if((count >= rep->max) || !m_can_backtrack)
return false;
if(save_pos == last)
return false;
desired =
(std::min)(
(std::size_t)(greedy ? rep->max : rep->min),
- (std::size_t)::boost::re_detail::distance(position, last));
+ (std::size_t)::boost::BOOST_REGEX_DETAIL_NS::distance(position, last));
count = desired;
++desired;
if(icase)
++state_count;
if(match_all_states())
return true;
- if(count >= rep->max)
+ if((count >= rep->max) || !m_can_backtrack)
return false;
position = save_pos;
if(position == last)
BidiIterator end = position;
// Move end forward by "desired", preferably without using distance or advance if we can
// as these can be slow for some iterator types.
- std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
if(desired >= len)
end = last;
else
{
++position;
}
- count = (unsigned)::boost::re_detail::distance(origin, position);
+ count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
}
else
{
++state_count;
if(match_all_states())
return true;
- if(count >= rep->max)
+ if((count >= rep->max) || !m_can_backtrack)
return false;
position = save_pos;
if(position == last)
BidiIterator end = position;
// Move end forward by "desired", preferably without using distance or advance if we can
// as these can be slow for some iterator types.
- std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::re_detail::distance(position, last);
+ std::size_t len = (desired == (std::numeric_limits<std::size_t>::max)()) ? 0u : ::boost::BOOST_REGEX_DETAIL_NS::distance(position, last);
if(desired >= len)
end = last;
else
{
++position;
}
- count = (unsigned)::boost::re_detail::distance(origin, position);
+ count = (unsigned)::boost::BOOST_REGEX_DETAIL_NS::distance(origin, position);
}
else
{
++state_count;
if(match_all_states())
return true;
- if(count >= rep->max)
+ if((count >= rep->max) || !m_can_backtrack)
return false;
position = save_pos;
if(position == last)
#pragma warning(push)
#pragma warning(disable:4127)
#endif
+ if(!m_can_backtrack)
+ return false;
if((m_match_flags & match_partial) && (position == last))
m_has_partial_match = true;
repeater_count<BidiIterator>* saved = next_count;
repeater_count<BidiIterator> r(&next_count); // resets all repeat counts since we're recursing and starting fresh on those
next_count = &r;
+ bool can_backtrack = m_can_backtrack;
bool result = match_all_states();
+ m_can_backtrack = can_backtrack;
next_count = saved;
if(!result)
return true;
}
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_commit()
+{
+ m_can_backtrack = false;
+ int action = static_cast<const re_commit*>(pstate)->action;
+ switch(action)
+ {
+ case commit_commit:
+ restart = last;
+ break;
+ case commit_skip:
+ restart = position;
+ break;
+ }
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_then()
+{
+ pstate = pstate->next.p;
+ if(match_all_states())
+ return true;
+ m_can_backtrack = false;
+ m_have_then = true;
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::skip_until_paren(int index, bool have_match)
+{
+ while(pstate)
+ {
+ if(pstate->type == syntax_element_endmark)
+ {
+ if(static_cast<const re_brace*>(pstate)->index == index)
+ {
+ if(have_match)
+ return this->match_endmark();
+ pstate = pstate->next.p;
+ return true;
+ }
+ else
+ {
+ // Unenclosed closing ), occurs when (*ACCEPT) is inside some other
+ // parenthesis which may or may not have other side effects associated with it.
+ bool r = match_endmark();
+ m_have_accept = true;
+ if(!pstate)
+ return r;
+ }
+ continue;
+ }
+ else if(pstate->type == syntax_element_match)
+ return true;
+ else if(pstate->type == syntax_element_startmark)
+ {
+ int idx = static_cast<const re_brace*>(pstate)->index;
+ pstate = pstate->next.p;
+ skip_until_paren(idx, false);
+ continue;
+ }
+ pstate = pstate->next.p;
+ }
+ return true;
+}
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
namespace boost{
- namespace re_detail{
+ namespace BOOST_REGEX_DETAIL_NS{
enum{
}
- } // namespace re_detail
+ } // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#ifdef BOOST_MSVC
#endif
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
class BOOST_REGEX_DECL abstract_protected_call
{
template <class BidiIterator, class Allocator = BOOST_DEDUCED_TYPENAME std::vector<sub_match<BidiIterator> >::allocator_type >
class match_results;
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
//
// struct trivial_format_traits:
}
static charT tolower(charT c)
{
- return ::boost::re_detail::global_lower(c);
+ return ::boost::BOOST_REGEX_DETAIL_NS::global_lower(c);
}
static charT toupper(charT c)
{
- return ::boost::re_detail::global_upper(c);
+ return ::boost::BOOST_REGEX_DETAIL_NS::global_upper(c);
}
static int value(const charT c, int radix)
{
default:
// see if we have a number:
{
- std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
+ std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
//len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
int v = this->toi(m_position, m_position + len, 10);
if((v < 0) || (have_brace && ((m_position == m_end) || (*m_position != '}'))))
}
else
{
- std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
+ std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
int val = this->toi(m_position, m_position + len, 16);
if(val < 0)
break;
}
// see if we have a \n sed style backreference:
- std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
+ std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
len = (std::min)(static_cast<std::ptrdiff_t>(1), len);
int v = this->toi(m_position, m_position+len, 10);
if((v > 0) || ((v == 0) && (m_flags & ::boost::regex_constants::format_sed)))
{
// octal ecape sequence:
--m_position;
- len = ::boost::re_detail::distance(m_position, m_end);
+ len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
len = (std::min)(static_cast<std::ptrdiff_t>(4), len);
v = this->toi(m_position, m_position + len, 8);
BOOST_ASSERT(v >= 0);
}
else
{
- std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
+ std::ptrdiff_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance(m_position, m_end);
len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
v = this->toi(m_position, m_position + len, 10);
}
{
if(flags & regex_constants::format_literal)
{
- return re_detail::copy(p1, p2, out);
+ return BOOST_REGEX_DETAIL_NS::copy(p1, p2, out);
}
- re_detail::basic_regex_formatter<
+ BOOST_REGEX_DETAIL_NS::basic_regex_formatter<
OutputIterator,
match_results<Iterator, Alloc>,
traits, ForwardIter> f(out, m, t);
template <class S, class OutputIter>
OutputIter do_format_string(const S& s, OutputIter i)
{
- return re_detail::copy(s.begin(), s.end(), i);
+ return BOOST_REGEX_DETAIL_NS::copy(s.begin(), s.end(), i);
}
template <class S, class OutputIter>
inline OutputIter do_format_string(const S* s, OutputIter i)
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits& t = Traits())
{
//typedef typename Match::char_type char_type;
- return re_detail::regex_format_imp(i, m, func.begin(), func.end(), f, t);
+ return BOOST_REGEX_DETAIL_NS::regex_format_imp(i, m, func.begin(), func.end(), f, t);
}
private:
const Container& func;
format_functor_container& operator=(const format_functor_container&);
};
-template <class Func, class Match, class OutputIterator, class Traits = re_detail::trivial_format_traits<typename Match::char_type> >
+template <class Func, class Match, class OutputIterator, class Traits = BOOST_REGEX_DETAIL_NS::trivial_format_traits<typename Match::char_type> >
struct compute_functor_type
{
typedef typename format_traits<Func, Match, OutputIterator>::type tag;
>::type type;
};
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
template <class OutputIterator, class Iterator, class Allocator, class Functor>
inline OutputIterator regex_format(OutputIterator out,
typedef typename match_results<BidiIterator>::allocator_type match_allocator_type;
match_results<BidiIterator> m;
- re_detail::perl_matcher<BidiIterator, match_allocator_type, traits> matcher(first, last, m, e, flags, first);
+ BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, match_allocator_type, traits> matcher(first, last, m, e, flags, first);
unsigned int count = 0;
while(matcher.find())
{
};
template <class BidirectionalIterator,
- class charT = BOOST_DEDUCED_TYPENAME re_detail::regex_iterator_traits<BidirectionalIterator>::value_type,
+ class charT = BOOST_DEDUCED_TYPENAME BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::value_type,
class traits = regex_traits<charT> >
class regex_iterator
#ifndef BOOST_NO_STD_ITERATOR
: public std::iterator<
std::forward_iterator_tag,
match_results<BidirectionalIterator>,
- typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type,
const match_results<BidirectionalIterator>*,
const match_results<BidirectionalIterator>& >
#endif
public:
typedef basic_regex<charT, traits> regex_type;
typedef match_results<BidirectionalIterator> value_type;
- typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
+ typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
difference_type;
typedef const value_type* pointer;
typedef const value_type& reference;
const basic_regex<charT, traits>& e,
match_flag_type flags = match_default)
{
- re_detail::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, first);
+ BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, first);
return matcher.match();
}
template <class iterator, class charT, class traits>
#include <cstddef>
namespace boost{
- namespace re_detail{
+ namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(pop)
#endif
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
#endif
if(i == j)
{
if(!(flags & regex_constants::format_no_copy))
- out = re_detail::copy(first, last, out);
+ out = BOOST_REGEX_DETAIL_NS::copy(first, last, out);
}
else
{
while(i != j)
{
if(!(flags & regex_constants::format_no_copy))
- out = re_detail::copy(i->prefix().first, i->prefix().second, out);
+ out = BOOST_REGEX_DETAIL_NS::copy(i->prefix().first, i->prefix().second, out);
out = i->format(out, fmt, flags, e);
last_m = (*i)[0].second;
if(flags & regex_constants::format_first_only)
++i;
}
if(!(flags & regex_constants::format_no_copy))
- out = re_detail::copy(last_m, last, out);
+ out = BOOST_REGEX_DETAIL_NS::copy(last_m, last, out);
}
return out;
}
match_flag_type flags = match_default)
{
std::basic_string<charT> result;
- re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+ BOOST_REGEX_DETAIL_NS::string_out_iterator<std::basic_string<charT> > i(result);
regex_replace(i, s.begin(), s.end(), e, fmt, flags);
return result;
}
if(e.flags() & regex_constants::failbit)
return false;
- re_detail::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, base);
+ BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, base);
return matcher.find();
}
match_results<BidiIterator> m;
typedef typename match_results<BidiIterator>::allocator_type match_alloc_type;
- re_detail::perl_matcher<BidiIterator, match_alloc_type, traits> matcher(first, last, m, e, flags | regex_constants::match_any, first);
+ BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, match_alloc_type, traits> matcher(first, last, m, e, flags | regex_constants::match_any, first);
return matcher.find();
}
# pragma warning(disable: 4800)
#endif
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template <class charT>
const basic_regex<charT>& get_default_expression(charT)
return true;
}
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2>
std::size_t regex_split(OutputIterator out,
//typedef typename match_results<ci_t>::allocator_type match_allocator;
ci_t last = s.begin();
std::size_t init_size = max_split;
- re_detail::split_pred<OutputIterator, charT, Traits1, Alloc1> pred(&last, &out, &max_split);
+ BOOST_REGEX_DETAIL_NS::split_pred<OutputIterator, charT, Traits1, Alloc1> pred(&last, &out, &max_split);
ci_t i, j;
i = s.begin();
j = s.end();
inline std::size_t regex_split(OutputIterator out,
std::basic_string<charT, Traits1, Alloc1>& s)
{
- return regex_split(out, s, re_detail::get_default_expression(charT(0)), match_default, UINT_MAX);
+ return regex_split(out, s, BOOST_REGEX_DETAIL_NS::get_default_expression(charT(0)), match_default, UINT_MAX);
}
#ifdef BOOST_MSVC
};
template <class BidirectionalIterator,
- class charT = BOOST_DEDUCED_TYPENAME re_detail::regex_iterator_traits<BidirectionalIterator>::value_type,
+ class charT = BOOST_DEDUCED_TYPENAME BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::value_type,
class traits = regex_traits<charT> >
class regex_token_iterator
#ifndef BOOST_NO_STD_ITERATOR
: public std::iterator<
std::forward_iterator_tag,
sub_match<BidirectionalIterator>,
- typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type,
const sub_match<BidirectionalIterator>*,
const sub_match<BidirectionalIterator>& >
#endif
public:
typedef basic_regex<charT, traits> regex_type;
typedef sub_match<BidirectionalIterator> value_type;
- typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
+ typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
difference_type;
typedef const value_type* pointer;
typedef const value_type& reference;
// interfaces that we support, in addition to the
// required "standard" ones:
//
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
#if !BOOST_WORKAROUND(__HP_aCC, < 60000)
BOOST_MPL_HAS_XXX_TRAIT_DEF(boost_extensions_tag)
#else
typedef typename BaseT::char_type char_type;
std::string error_string(::boost::regex_constants::error_type e)const
{
- return ::boost::re_detail::get_default_error_string(e);
+ return ::boost::BOOST_REGEX_DETAIL_NS::get_default_error_string(e);
}
::boost::regex_constants::syntax_type syntax_type(char_type c)const
{
}
int toi(const char_type*& p1, const char_type* p2, int radix)const
{
- return ::boost::re_detail::global_toi(p1, p2, radix, *this);
+ return ::boost::BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this);
}
char_type translate(char_type c, bool icase)const
{
}
char_type tolower(char_type c)const
{
- return ::boost::re_detail::global_lower(c);
+ return ::boost::BOOST_REGEX_DETAIL_NS::global_lower(c);
}
char_type toupper(char_type c)const
{
- return ::boost::re_detail::global_upper(c);
+ return ::boost::BOOST_REGEX_DETAIL_NS::global_upper(c);
}
};
#endif
#endif
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
template <class BaseT>
struct regex_traits_wrapper
- : public ::boost::re_detail::compute_wrapper_base<
+ : public ::boost::BOOST_REGEX_DETAIL_NS::compute_wrapper_base<
BaseT,
- ::boost::re_detail::has_boost_extensions_tag<BaseT>::value
+ ::boost::BOOST_REGEX_DETAIL_NS::has_boost_extensions_tag<BaseT>::value
>::type
{
regex_traits_wrapper(){}
#pragma warning(pop)
#endif
+#include <boost/regex/config.hpp>
+
#ifndef BOOST_REGEX_SYNTAX_TYPE_HPP
#include <boost/regex/v4/syntax_type.hpp>
#endif
#ifndef BOOST_REGEX_ERROR_TYPE_HPP
#include <boost/regex/v4/error_type.hpp>
#endif
+#include <boost/type_traits/make_unsigned.hpp>
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std{
}
#endif
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
//
//
template <class charT>
inline bool is_extended(charT c)
-{ return c > 256; }
+{
+ typedef typename make_unsigned<charT>::type unsigned_type;
+ return (sizeof(charT) > 1) && (static_cast<unsigned_type>(c) >= 256u);
+}
inline bool is_extended(char)
{ return false; }
// calling std::equal, but there is no other algorithm available:
// not even a non-standard MS one. So forward to unchecked_equal
// in the MS case.
- return ((p2 - p1) == (r.p2 - r.p1)) && re_detail::equal(p1, p2, r.p1);
+ return ((p2 - p1) == (r.p2 - r.p1)) && BOOST_REGEX_DETAIL_NS::equal(p1, p2, r.p1);
}
};
template <class charT>
#endif
}
-} // re_detail
+} // BOOST_REGEX_DETAIL_NS
} // boost
#ifdef BOOST_MSVC
#include <boost/scoped_array.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/mpl/bool_fwd.hpp>
+#include <boost/regex/config.hpp>
#ifndef BOOST_NO_STD_LOCALE
# include <locale>
#endif
}
#endif
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_NO_STD_DISTANCE
template <class T>
std::ptrdiff_t distance(const T& x, const T& y)
****************************************************************************/
#ifdef __cplusplus
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_MSVC
#pragma warning (push)
****************************************************************************/
#ifdef __cplusplus
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && BOOST_WORKAROUND(BOOST_MSVC, <1600) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
//
// MSVC 8 will either emit warnings or else refuse to compile
#endif
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
/*** mask_type *******************************************************
Whenever we have a choice of two alternatives, we use an array of bytes
syntax_element_assert_backref = syntax_element_backstep + 1,
syntax_element_toggle_case = syntax_element_assert_backref + 1,
// a recursive expression:
- syntax_element_recurse = syntax_element_toggle_case + 1
+ syntax_element_recurse = syntax_element_toggle_case + 1,
+ // Verbs:
+ syntax_element_fail = syntax_element_recurse + 1,
+ syntax_element_accept = syntax_element_fail + 1,
+ syntax_element_commit = syntax_element_accept + 1,
+ syntax_element_then = syntax_element_commit + 1
};
#ifdef BOOST_REGEX_DEBUG
int state_id; // identifier of first nested repeat within the recursion.
};
+/*** struct re_commit *************************************************
+Used for the PRUNE, SKIP and COMMIT verbs which basically differ only in what happens
+if no match is found and we start searching forward.
+**********************************************************************/
+enum commit_type
+{
+ commit_prune,
+ commit_skip,
+ commit_commit
+};
+struct re_commit : public re_syntax_base
+{
+ commit_type action;
+};
+
/*** enum re_jump_size_type *******************************************
Provides compiled size of re_jump structure (allowing for trailing alignment).
We provide this so we know how manybytes to insert when constructing the machine
const re_set_long<char_classT>* set_,
const regex_data<charT, traits_type>& e, bool icase);
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
} // namespace boost
template <class BidiIterator>
struct sub_match : public std::pair<BidiIterator, BidiIterator>
{
- typedef typename re_detail::regex_iterator_traits<BidiIterator>::value_type value_type;
+ typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidiIterator>::value_type value_type;
#if defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef std::ptrdiff_t difference_type;
#else
- typedef typename re_detail::regex_iterator_traits<BidiIterator>::difference_type difference_type;
+ typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidiIterator>::difference_type difference_type;
#endif
typedef BidiIterator iterator_type;
typedef BidiIterator iterator;
#endif
difference_type BOOST_REGEX_CALL length()const
{
- difference_type n = matched ? ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second) : 0;
+ difference_type n = matched ? ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)this->first, (BidiIterator)this->second) : 0;
return n;
}
std::basic_string<value_type> str()const
std::basic_string<value_type> result;
if(matched)
{
- std::size_t len = ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second);
+ std::size_t len = ::boost::BOOST_REGEX_DETAIL_NS::distance((BidiIterator)this->first, (BidiIterator)this->second);
result.reserve(len);
BidiIterator i = this->first;
while(i != this->second)
#endif
return *this;
}
+ //
+ // Make this type a range, for both Boost.Range, and C++11:
+ //
+ BidiIterator begin()const { return this->first; }
+ BidiIterator end()const { return this->second; }
#ifdef BOOST_OLD_REGEX_H
// comparison to std::basic_string<> part 1:
template <class RandomAccessIterator, class traits, class Allocator>
-inline bool operator == (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+inline bool operator == (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
const sub_match<RandomAccessIterator>& m)
{ return s.compare(m.str()) == 0; }
template <class RandomAccessIterator, class traits, class Allocator>
-inline bool operator != (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+inline bool operator != (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
const sub_match<RandomAccessIterator>& m)
{ return s.compare(m.str()) != 0; }
template <class RandomAccessIterator, class traits, class Allocator>
-inline bool operator < (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+inline bool operator < (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
const sub_match<RandomAccessIterator>& m)
{ return s.compare(m.str()) < 0; }
template <class RandomAccessIterator, class traits, class Allocator>
-inline bool operator <= (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+inline bool operator <= (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
const sub_match<RandomAccessIterator>& m)
{ return s.compare(m.str()) <= 0; }
template <class RandomAccessIterator, class traits, class Allocator>
-inline bool operator >= (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+inline bool operator >= (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
const sub_match<RandomAccessIterator>& m)
{ return s.compare(m.str()) >= 0; }
template <class RandomAccessIterator, class traits, class Allocator>
-inline bool operator > (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+inline bool operator > (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
const sub_match<RandomAccessIterator>& m)
{ return s.compare(m.str()) > 0; }
// comparison to std::basic_string<> part 2:
template <class RandomAccessIterator, class traits, class Allocator>
inline bool operator == (const sub_match<RandomAccessIterator>& m,
- const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+ const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
{ return m.str().compare(s) == 0; }
template <class RandomAccessIterator, class traits, class Allocator>
inline bool operator != (const sub_match<RandomAccessIterator>& m,
- const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+ const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
{ return m.str().compare(s) != 0; }
template <class RandomAccessIterator, class traits, class Allocator>
inline bool operator < (const sub_match<RandomAccessIterator>& m,
- const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+ const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
{ return m.str().compare(s) < 0; }
template <class RandomAccessIterator, class traits, class Allocator>
inline bool operator > (const sub_match<RandomAccessIterator>& m,
- const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+ const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
{ return m.str().compare(s) > 0; }
template <class RandomAccessIterator, class traits, class Allocator>
inline bool operator <= (const sub_match<RandomAccessIterator>& m,
- const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+ const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
{ return m.str().compare(s) <= 0; }
template <class RandomAccessIterator, class traits, class Allocator>
inline bool operator >= (const sub_match<RandomAccessIterator>& m,
- const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+ const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
{ return m.str().compare(s) >= 0; }
// comparison to const charT* part 1:
template <class RandomAccessIterator>
inline bool operator == (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
{ return m.str().compare(s) == 0; }
template <class RandomAccessIterator>
inline bool operator != (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
{ return m.str().compare(s) != 0; }
template <class RandomAccessIterator>
inline bool operator > (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
{ return m.str().compare(s) > 0; }
template <class RandomAccessIterator>
inline bool operator < (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
{ return m.str().compare(s) < 0; }
template <class RandomAccessIterator>
inline bool operator >= (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
{ return m.str().compare(s) >= 0; }
template <class RandomAccessIterator>
inline bool operator <= (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
{ return m.str().compare(s) <= 0; }
// comparison to const charT* part 2:
template <class RandomAccessIterator>
-inline bool operator == (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+inline bool operator == (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(s) == 0; }
template <class RandomAccessIterator>
-inline bool operator != (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+inline bool operator != (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(s) != 0; }
template <class RandomAccessIterator>
-inline bool operator < (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+inline bool operator < (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(s) > 0; }
template <class RandomAccessIterator>
-inline bool operator > (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+inline bool operator > (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(s) < 0; }
template <class RandomAccessIterator>
-inline bool operator <= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+inline bool operator <= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(s) >= 0; }
template <class RandomAccessIterator>
-inline bool operator >= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+inline bool operator >= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(s) <= 0; }
// comparison to const charT& part 1:
template <class RandomAccessIterator>
inline bool operator == (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
{ return m.str().compare(0, m.length(), &s, 1) == 0; }
template <class RandomAccessIterator>
inline bool operator != (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
{ return m.str().compare(0, m.length(), &s, 1) != 0; }
template <class RandomAccessIterator>
inline bool operator > (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
{ return m.str().compare(0, m.length(), &s, 1) > 0; }
template <class RandomAccessIterator>
inline bool operator < (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
{ return m.str().compare(0, m.length(), &s, 1) < 0; }
template <class RandomAccessIterator>
inline bool operator >= (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
{ return m.str().compare(0, m.length(), &s, 1) >= 0; }
template <class RandomAccessIterator>
inline bool operator <= (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
{ return m.str().compare(0, m.length(), &s, 1) <= 0; }
// comparison to const charT* part 2:
template <class RandomAccessIterator>
-inline bool operator == (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+inline bool operator == (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(0, m.length(), &s, 1) == 0; }
template <class RandomAccessIterator>
-inline bool operator != (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+inline bool operator != (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(0, m.length(), &s, 1) != 0; }
template <class RandomAccessIterator>
-inline bool operator < (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+inline bool operator < (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(0, m.length(), &s, 1) > 0; }
template <class RandomAccessIterator>
-inline bool operator > (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+inline bool operator > (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(0, m.length(), &s, 1) < 0; }
template <class RandomAccessIterator>
-inline bool operator <= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+inline bool operator <= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(0, m.length(), &s, 1) >= 0; }
template <class RandomAccessIterator>
-inline bool operator >= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+inline bool operator >= (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
const sub_match<RandomAccessIterator>& m)
{ return m.str().compare(0, m.length(), &s, 1) <= 0; }
// addition operators:
template <class RandomAccessIterator, class traits, class Allocator>
-inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
-operator + (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
+operator + (const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
const sub_match<RandomAccessIterator>& m)
{
- std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
+ std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
result.reserve(s.size() + m.length() + 1);
return result.append(s).append(m.first, m.second);
}
template <class RandomAccessIterator, class traits, class Allocator>
-inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
+inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
operator + (const sub_match<RandomAccessIterator>& m,
- const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+ const std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
{
- std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
+ std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
result.reserve(s.size() + m.length() + 1);
return result.append(m.first, m.second).append(s);
}
#if !(defined(__GNUC__) && defined(BOOST_NO_STD_LOCALE))
template <class RandomAccessIterator>
-inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
-operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
const sub_match<RandomAccessIterator>& m)
{
- std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
- result.reserve(std::char_traits<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
+ std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ result.reserve(std::char_traits<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
return result.append(s).append(m.first, m.second);
}
template <class RandomAccessIterator>
-inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
operator + (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
{
- std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
- result.reserve(std::char_traits<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
+ std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ result.reserve(std::char_traits<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
return result.append(m.first, m.second).append(s);
}
#else
// worwaround versions:
template <class RandomAccessIterator>
-inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
-operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
const sub_match<RandomAccessIterator>& m)
{
return s + m.str();
}
template <class RandomAccessIterator>
-inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
operator + (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
{
return m.str() + s;
}
#endif
template <class RandomAccessIterator>
-inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
-operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
const sub_match<RandomAccessIterator>& m)
{
- std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
result.reserve(m.length() + 2);
return result.append(1, s).append(m.first, m.second);
}
template <class RandomAccessIterator>
-inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
operator + (const sub_match<RandomAccessIterator>& m,
- typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
{
- std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
result.reserve(m.length() + 2);
return result.append(m.first, m.second).append(1, s);
}
template <class RandomAccessIterator>
-inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+inline std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type>
operator + (const sub_match<RandomAccessIterator>& m1,
const sub_match<RandomAccessIterator>& m2)
{
- std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ std::basic_string<typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<RandomAccessIterator>::value_type> result;
result.reserve(m1.length() + m2.length() + 1);
return result.append(m1.first, m1.second).append(m2.first, m2.second);
}
#endif
#ifdef BOOST_OLD_REGEX_H
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
template <class BidiIterator, class charT>
int do_toi(BidiIterator i, BidiIterator j, char c, int radix)
{
neg = -1;
++i;
}
- neg *= re_detail::do_toi(i, j, *i);
+ neg *= BOOST_REGEX_DETAIL_NS::do_toi(i, j, *i);
if(i != j)raise_regex_exception("Bad sub-expression");
return neg;
}
BidiIterator j = second;
if(i == j)
raise_regex_exception("Bad sub-expression");
- return re_detail::do_toi(i, j, *first);
+ return BOOST_REGEX_DETAIL_NS::do_toi(i, j, *first);
}
#endif
: public std::iterator<
std::forward_iterator_tag,
match_results<BidirectionalIterator>,
- typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type,
const match_results<BidirectionalIterator>*,
const match_results<BidirectionalIterator>& >
#endif
public:
typedef u32regex regex_type;
typedef match_results<BidirectionalIterator> value_type;
- typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
+ typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
difference_type;
typedef const value_type* pointer;
typedef const value_type& reference;
: public std::iterator<
std::forward_iterator_tag,
sub_match<BidirectionalIterator>,
- typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
+ typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type,
const sub_match<BidirectionalIterator>*,
const sub_match<BidirectionalIterator>& >
#endif
public:
typedef u32regex regex_type;
typedef sub_match<BidirectionalIterator> value_type;
- typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
+ typedef typename BOOST_REGEX_DETAIL_NS::regex_iterator_traits<BidirectionalIterator>::difference_type
difference_type;
typedef const value_type* pointer;
typedef const value_type& reference;
#ifndef BOOST_W32_REGEX_TRAITS_HPP_INCLUDED
#define BOOST_W32_REGEX_TRAITS_HPP_INCLUDED
+#ifndef BOOST_REGEX_NO_WIN32_LOCALE
+
#ifndef BOOST_RE_PAT_EXCEPT_HPP
#include <boost/regex/pattern_except.hpp>
#endif
template <class charT>
class w32_regex_traits;
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
//
// start by typedeffing the types we'll need:
map_iterator_type i = m_char_map.find(c);
if(i == m_char_map.end())
{
- if(::boost::re_detail::w32_is_lower(c, this->m_locale)) return regex_constants::escape_type_class;
- if(::boost::re_detail::w32_is_upper(c, this->m_locale)) return regex_constants::escape_type_not_class;
+ if(::boost::BOOST_REGEX_DETAIL_NS::w32_is_lower(c, this->m_locale)) return regex_constants::escape_type_class;
+ if(::boost::BOOST_REGEX_DETAIL_NS::w32_is_upper(c, this->m_locale)) return regex_constants::escape_type_not_class;
return 0;
}
return i->second;
}
charT tolower(charT c)const
{
- return ::boost::re_detail::w32_tolower(c, this->m_locale);
+ return ::boost::BOOST_REGEX_DETAIL_NS::w32_tolower(c, this->m_locale);
}
bool isctype(boost::uint32_t mask, charT c)const
{
- return ::boost::re_detail::w32_is(this->m_locale, mask, c);
+ return ::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, mask, c);
}
private:
};
template <class charT>
-w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::re_detail::lcid_type l)
+w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
: w32_regex_traits_base<charT>(l)
{
// we need to start by initialising our syntax map so we know which
std::string cat_name(w32_regex_traits<charT>::get_catalog_name());
if(cat_name.size())
{
- cat = ::boost::re_detail::w32_cat_open(cat_name);
+ cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name);
if(!cat)
{
std::string m("Unable to open message catalog: ");
std::runtime_error err(m + cat_name);
- boost::re_detail::raise_runtime_error(err);
+ boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
}
//
{
for(regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i)
{
- string_type mss = ::boost::re_detail::w32_cat_get(cat, this->m_locale, i, get_default_message(i));
+ string_type mss = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i, get_default_message(i));
for(typename string_type::size_type j = 0; j < mss.size(); ++j)
{
this->m_char_map[mss[j]] = i;
{
typedef std::string string_type;
public:
- w32_regex_traits_char_layer(::boost::re_detail::lcid_type l)
+ w32_regex_traits_char_layer(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
: w32_regex_traits_base<char>(l)
{
init();
typedef std::basic_string<charT> string_type;
typedef charT char_type;
- w32_regex_traits_implementation(::boost::re_detail::lcid_type l);
+ w32_regex_traits_implementation(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l);
std::string error_string(regex_constants::error_type n) const
{
if(!m_error_strings.empty())
string_type transform_primary(const charT* p1, const charT* p2) const;
string_type transform(const charT* p1, const charT* p2) const
{
- return ::boost::re_detail::w32_transform(this->m_locale, p1, p2);
+ return ::boost::BOOST_REGEX_DETAIL_NS::w32_transform(this->m_locale, p1, p2);
}
private:
std::map<int, std::string> m_error_strings; // error messages indexed by numberic ID
}
template <class charT>
-w32_regex_traits_implementation<charT>::w32_regex_traits_implementation(::boost::re_detail::lcid_type l)
+w32_regex_traits_implementation<charT>::w32_regex_traits_implementation(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
: w32_regex_traits_char_layer<charT>(l)
{
cat_type cat;
std::string cat_name(w32_regex_traits<charT>::get_catalog_name());
if(cat_name.size())
{
- cat = ::boost::re_detail::w32_cat_open(cat_name);
+ cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name);
if(!cat)
{
std::string m("Unable to open message catalog: ");
std::runtime_error err(m + cat_name);
- boost::re_detail::raise_runtime_error(err);
+ boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
}
//
default_message.append(1, static_cast<charT>(*p));
++p;
}
- string_type s = ::boost::re_detail::w32_cat_get(cat, this->m_locale, i+200, default_message);
+ string_type s = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i+200, default_message);
std::string result;
for(std::string::size_type j = 0; j < s.size(); ++j)
{
static const string_type null_string;
for(unsigned int j = 0; j <= 13; ++j)
{
- string_type s(::boost::re_detail::w32_cat_get(cat, this->m_locale, j+300, null_string));
+ string_type s(::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, j+300, null_string));
if(s.size())
this->m_custom_class_names[s] = masks[j];
}
//
// get the collation format used by m_pcollate:
//
- m_collate_type = re_detail::find_sort_syntax(this, &m_collate_delim);
+ m_collate_type = BOOST_REGEX_DETAIL_NS::find_sort_syntax(this, &m_collate_delim);
}
template <class charT>
if(pos != m_custom_class_names.end())
return pos->second;
}
- std::size_t state_id = 1 + re_detail::get_default_class_id(p1, p2);
+ std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
if(state_id < sizeof(masks) / sizeof(masks[0]))
return masks[state_id];
return masks[0];
template <class charT>
-boost::shared_ptr<const w32_regex_traits_implementation<charT> > create_w32_regex_traits(::boost::re_detail::lcid_type l)
+boost::shared_ptr<const w32_regex_traits_implementation<charT> > create_w32_regex_traits(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
{
// TODO: create a cache for previously constructed objects.
- return boost::object_cache< ::boost::re_detail::lcid_type, w32_regex_traits_implementation<charT> >::get(l, 5);
+ return boost::object_cache< ::boost::BOOST_REGEX_DETAIL_NS::lcid_type, w32_regex_traits_implementation<charT> >::get(l, 5);
}
-} // re_detail
+} // BOOST_REGEX_DETAIL_NS
template <class charT>
class w32_regex_traits
typedef charT char_type;
typedef std::size_t size_type;
typedef std::basic_string<char_type> string_type;
- typedef ::boost::re_detail::lcid_type locale_type;
+ typedef ::boost::BOOST_REGEX_DETAIL_NS::lcid_type locale_type;
typedef boost::uint_least32_t char_class_type;
struct boost_extensions_tag{};
w32_regex_traits()
- : m_pimpl(re_detail::create_w32_regex_traits<charT>(::boost::re_detail::w32_get_default_locale()))
+ : m_pimpl(BOOST_REGEX_DETAIL_NS::create_w32_regex_traits<charT>(::boost::BOOST_REGEX_DETAIL_NS::w32_get_default_locale()))
{ }
static size_type length(const char_type* p)
{
}
charT toupper(charT c) const
{
- return ::boost::re_detail::w32_toupper(c, this->m_pimpl->m_locale);
+ return ::boost::BOOST_REGEX_DETAIL_NS::w32_toupper(c, this->m_pimpl->m_locale);
}
string_type transform(const charT* p1, const charT* p2) const
{
- return ::boost::re_detail::w32_transform(this->m_pimpl->m_locale, p1, p2);
+ return ::boost::BOOST_REGEX_DETAIL_NS::w32_transform(this->m_pimpl->m_locale, p1, p2);
}
string_type transform_primary(const charT* p1, const charT* p2) const
{
}
bool isctype(charT c, char_class_type f) const
{
- if((f & re_detail::w32_regex_traits_implementation<charT>::mask_base)
- && (this->m_pimpl->isctype(f & re_detail::w32_regex_traits_implementation<charT>::mask_base, c)))
+ if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_base)
+ && (this->m_pimpl->isctype(f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_base, c)))
return true;
- else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_unicode) && re_detail::is_extended(c))
+ else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_unicode) && BOOST_REGEX_DETAIL_NS::is_extended(c))
return true;
- else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_word) && (c == '_'))
+ else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_word) && (c == '_'))
return true;
- else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_vertical)
- && (::boost::re_detail::is_separator(c) || (c == '\v')))
+ else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_vertical)
+ && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v')))
return true;
- else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_horizontal)
- && this->isctype(c, 0x0008u) && !this->isctype(c, re_detail::w32_regex_traits_implementation<charT>::mask_vertical))
+ else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_horizontal)
+ && this->isctype(c, 0x0008u) && !this->isctype(c, BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_vertical))
return true;
return false;
}
int toi(const charT*& p1, const charT* p2, int radix)const
{
- return ::boost::re_detail::global_toi(p1, p2, radix, *this);
+ return ::boost::BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this);
}
int value(charT c, int radix)const
{
- int result = ::boost::re_detail::global_value(c);
+ int result = ::boost::BOOST_REGEX_DETAIL_NS::global_value(c);
return result < radix ? result : -1;
}
locale_type imbue(locale_type l)
{
- ::boost::re_detail::lcid_type result(getloc());
- m_pimpl = re_detail::create_w32_regex_traits<charT>(l);
+ ::boost::BOOST_REGEX_DETAIL_NS::lcid_type result(getloc());
+ m_pimpl = BOOST_REGEX_DETAIL_NS::create_w32_regex_traits<charT>(l);
return result;
}
locale_type getloc()const
static std::string get_catalog_name();
private:
- boost::shared_ptr<const re_detail::w32_regex_traits_implementation<charT> > m_pimpl;
+ boost::shared_ptr<const BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT> > m_pimpl;
//
// catalog name handler:
//
#pragma warning(pop)
#endif
+#endif // BOOST_REGEX_NO_WIN32_LOCALE
+
#endif
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
-#if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS ) && !defined( BOOST_NO_CXX11_NULLPTR )
+#if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS ) && !defined( BOOST_NO_CXX11_NULLPTR )\
+ && !(defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x5130))
explicit operator bool () const BOOST_NOEXCEPT
{
#include <boost/smart_ptr/bad_weak_ptr.hpp>
#include <boost/smart_ptr/detail/sp_counted_base.hpp>
#include <boost/smart_ptr/detail/sp_counted_impl.hpp>
+#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
#include <boost/detail/workaround.hpp>
// In order to avoid circular dependencies with Boost.TR1
// we make sure that our include of <memory> doesn't try to
#include <boost/core/addressof.hpp>
+#if defined( BOOST_SP_DISABLE_DEPRECATED )
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
namespace boost
{
} // namespace boost
+#if defined( BOOST_SP_DISABLE_DEPRECATED )
+#pragma GCC diagnostic pop
+#endif
+
#ifdef __BORLANDC__
# pragma warn .8027 // Functions containing try are not expanded inline
#endif
--- /dev/null
+#ifndef BOOST_SMART_PTR_DETAIL_SP_DISABLE_DEPRECATED_HPP_INCLUDED
+#define BOOST_SMART_PTR_DETAIL_SP_DISABLE_DEPRECATED_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// boost/smart_ptr/detail/sp_disable_deprecated.hpp
+//
+// Copyright 2015 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <boost/config.hpp>
+
+#if defined( __GNUC__ ) && ( defined( __GXX_EXPERIMENTAL_CXX0X__ ) || ( __cplusplus >= 201103L ) )
+
+# if defined( BOOST_GCC )
+
+# if BOOST_GCC >= 40600
+# define BOOST_SP_DISABLE_DEPRECATED
+# endif
+
+# elif defined( __clang__ ) && defined( __has_warning )
+
+# if __has_warning( "-Wdeprecated-declarations" )
+# define BOOST_SP_DISABLE_DEPRECATED
+# endif
+
+# endif
+
+#endif
+
+#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_DISABLE_DEPRECATED_HPP_INCLUDED
extern "C" long __cdecl _InterlockedExchange( long volatile *, long );
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long );
+# if defined( BOOST_MSVC ) && BOOST_MSVC == 1310
+//From MSDN, Visual Studio .NET 2003 spedific: To declare one of the interlocked functions
+//for use as an intrinsic, the function must be declared with the leading underscore and
+//the new function must appear in a #pragma intrinsic statement.
+# pragma intrinsic( _InterlockedIncrement )
+# pragma intrinsic( _InterlockedDecrement )
+# pragma intrinsic( _InterlockedCompareExchange )
+# pragma intrinsic( _InterlockedExchange )
+# pragma intrinsic( _InterlockedExchangeAdd )
+# endif
+
#endif
# define BOOST_SP_INTERLOCKED_INCREMENT _InterlockedIncrement
{
#if !defined( BOOST_USE_WINDOWS_H ) && !BOOST_PLAT_WINDOWS_RUNTIME
+#if !BOOST_COMP_CLANG || !defined __MINGW32__
extern "C" void __stdcall Sleep( unsigned long ms );
+#else
+#include <_mingw.h>
+#if !defined __MINGW64_VERSION_MAJOR
+ extern "C" void __stdcall Sleep( unsigned long ms );
+#else
+ extern "C" __declspec(dllimport) void __stdcall Sleep( unsigned long ms );
+#endif
+#endif
#endif
inline void yield( unsigned k )
#include <boost/assert.hpp>
#include <boost/checked_delete.hpp>
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
+#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
#include <boost/detail/workaround.hpp>
#ifndef BOOST_NO_AUTO_PTR
# include <memory> // for std::auto_ptr
#endif
+#if defined( BOOST_SP_DISABLE_DEPRECATED )
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
namespace boost
{
} // namespace boost
+#if defined( BOOST_SP_DISABLE_DEPRECATED )
+#pragma GCC diagnostic pop
+#endif
+
#endif // #ifndef BOOST_SMART_PTR_SCOPED_PTR_HPP_INCLUDED
#include <boost/detail/workaround.hpp>
#include <boost/smart_ptr/detail/sp_convertible.hpp>
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
+#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
#if !defined(BOOST_SP_NO_ATOMIC_ACCESS)
#include <boost/smart_ptr/detail/spinlock_pool.hpp>
#endif
#endif
+#if defined( BOOST_SP_DISABLE_DEPRECATED )
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
namespace boost
{
} // namespace boost
+#if defined( BOOST_SP_DISABLE_DEPRECATED )
+#pragma GCC diagnostic pop
+#endif
+
#endif // #ifndef BOOST_SMART_PTR_SHARED_PTR_HPP_INCLUDED
# ifndef BOOST_NO_CXX11_VARIADIC_MACROS
# define BOOST_STATIC_ASSERT_MSG( ... ) static_assert(__VA_ARGS__)
# else
-# define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
+# define BOOST_STATIC_ASSERT_MSG( B, Msg ) static_assert( B, Msg )
# endif
#else
# define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
# define BOOST_STATIC_ASSERT_BOOL_CAST(x) (bool)(x)
# endif
#endif
-//
-// If the compiler warns about unused typedefs then enable this:
-//
-#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
-# define BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
-#else
-# define BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE
-#endif
#ifndef BOOST_NO_CXX11_STATIC_ASSERT
# ifndef BOOST_NO_CXX11_VARIADIC_MACROS
//
#if !defined(BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS)
-#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
-// __LINE__ macro broken when -ZI is used see Q199057
-// fortunately MSVC ignores duplicate typedef's.
-#define BOOST_STATIC_ASSERT( B ) \
- typedef ::boost::static_assert_test<\
- sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)\
- > boost_static_assert_typedef_
-#elif defined(BOOST_MSVC) && defined(BOOST_NO_CXX11_VARIADIC_MACROS)
+#if defined(BOOST_MSVC) && defined(BOOST_NO_CXX11_VARIADIC_MACROS)
#define BOOST_STATIC_ASSERT( B ) \
typedef ::boost::static_assert_test<\
sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST ( B ) >)>\
# define BOOST_STATIC_ASSERT( ... ) \
typedef ::boost::static_assert_test<\
sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST( __VA_ARGS__ ) >)>\
- BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE
+ BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED
# else
# define BOOST_STATIC_ASSERT( B ) \
typedef ::boost::static_assert_test<\
sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST( B ) >)>\
- BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE
+ BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED
# endif
#endif
#include "boost/type_traits/alignment_of.hpp"
#include "boost/type_traits/common_type.hpp"
#include "boost/type_traits/conditional.hpp"
+#include "boost/type_traits/copy_cv.hpp"
#include "boost/type_traits/decay.hpp"
+#include "boost/type_traits/declval.hpp"
#include "boost/type_traits/extent.hpp"
#include "boost/type_traits/floating_point_promotion.hpp"
#include "boost/type_traits/function_traits.hpp"
+
+#include "boost/type_traits/has_bit_and.hpp"
+#include "boost/type_traits/has_bit_and_assign.hpp"
+#include "boost/type_traits/has_bit_or.hpp"
+#include "boost/type_traits/has_bit_or_assign.hpp"
+#include "boost/type_traits/has_bit_xor.hpp"
+#include "boost/type_traits/has_bit_xor_assign.hpp"
+#include "boost/type_traits/has_complement.hpp"
+#include "boost/type_traits/has_dereference.hpp"
+#include "boost/type_traits/has_divides.hpp"
+#include "boost/type_traits/has_divides_assign.hpp"
+#include "boost/type_traits/has_equal_to.hpp"
+#include "boost/type_traits/has_greater.hpp"
+#include "boost/type_traits/has_greater_equal.hpp"
+#include "boost/type_traits/has_left_shift.hpp"
+#include "boost/type_traits/has_left_shift_assign.hpp"
+#include "boost/type_traits/has_less.hpp"
+#include "boost/type_traits/has_less_equal.hpp"
+#include "boost/type_traits/has_logical_and.hpp"
+#include "boost/type_traits/has_logical_not.hpp"
+#include "boost/type_traits/has_logical_or.hpp"
+#include "boost/type_traits/has_minus.hpp"
+#include "boost/type_traits/has_minus_assign.hpp"
+#include "boost/type_traits/has_modulus.hpp"
+#include "boost/type_traits/has_modulus_assign.hpp"
+#include "boost/type_traits/has_multiplies.hpp"
+#include "boost/type_traits/has_multiplies_assign.hpp"
+#include "boost/type_traits/has_negate.hpp"
#if !defined(__BORLANDC__) && !defined(__CUDACC__)
#include "boost/type_traits/has_new_operator.hpp"
#endif
+#include "boost/type_traits/has_not_equal_to.hpp"
#include "boost/type_traits/has_nothrow_assign.hpp"
#include "boost/type_traits/has_nothrow_constructor.hpp"
#include "boost/type_traits/has_nothrow_copy.hpp"
#include "boost/type_traits/has_nothrow_destructor.hpp"
-#include <boost/type_traits/has_operator.hpp>
+#include "boost/type_traits/has_plus.hpp"
+#include "boost/type_traits/has_plus_assign.hpp"
+#include "boost/type_traits/has_post_decrement.hpp"
+#include "boost/type_traits/has_post_increment.hpp"
+#include "boost/type_traits/has_pre_decrement.hpp"
+#include "boost/type_traits/has_pre_increment.hpp"
+#include "boost/type_traits/has_right_shift.hpp"
+#include "boost/type_traits/has_right_shift_assign.hpp"
#include "boost/type_traits/has_trivial_assign.hpp"
#include "boost/type_traits/has_trivial_constructor.hpp"
#include "boost/type_traits/has_trivial_copy.hpp"
#include "boost/type_traits/has_trivial_destructor.hpp"
#include "boost/type_traits/has_trivial_move_assign.hpp"
#include "boost/type_traits/has_trivial_move_constructor.hpp"
+#include "boost/type_traits/has_unary_minus.hpp"
+#include "boost/type_traits/has_unary_plus.hpp"
#include "boost/type_traits/has_virtual_destructor.hpp"
+
+#include "boost/type_traits/integral_constant.hpp"
+
#include "boost/type_traits/is_abstract.hpp"
#include "boost/type_traits/is_arithmetic.hpp"
#include "boost/type_traits/is_array.hpp"
+#include "boost/type_traits/is_assignable.hpp"
#include "boost/type_traits/is_base_and_derived.hpp"
#include "boost/type_traits/is_base_of.hpp"
#include "boost/type_traits/is_class.hpp"
-#include <boost/type_traits/is_complex.hpp>
+#include "boost/type_traits/is_complex.hpp"
#include "boost/type_traits/is_compound.hpp"
#include "boost/type_traits/is_const.hpp"
+#include "boost/type_traits/is_constructible.hpp"
#include "boost/type_traits/is_convertible.hpp"
-#include "boost/type_traits/is_copy_constructible.hpp"
#include "boost/type_traits/is_copy_assignable.hpp"
+#include "boost/type_traits/is_copy_constructible.hpp"
+#include "boost/type_traits/is_default_constructible.hpp"
+#include "boost/type_traits/is_destructible.hpp"
#include "boost/type_traits/is_empty.hpp"
#include "boost/type_traits/is_enum.hpp"
+#include "boost/type_traits/is_final.hpp"
#include "boost/type_traits/is_float.hpp"
#include "boost/type_traits/is_floating_point.hpp"
#include "boost/type_traits/is_function.hpp"
#include "boost/type_traits/is_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_polymorphic.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_signed.hpp"
#include "boost/type_traits/is_stateless.hpp"
#include "boost/type_traits/is_union.hpp"
#include "boost/type_traits/is_unsigned.hpp"
-#include "boost/type_traits/is_void.hpp"
#include "boost/type_traits/is_virtual_base_of.hpp"
+#include "boost/type_traits/is_void.hpp"
#include "boost/type_traits/is_volatile.hpp"
-#include <boost/type_traits/make_unsigned.hpp>
-#include <boost/type_traits/make_signed.hpp>
+#include "boost/type_traits/make_signed.hpp"
+#include "boost/type_traits/make_unsigned.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_bounds.hpp"
#include "boost/type_traits/remove_const.hpp"
#include "boost/type_traits/remove_cv.hpp"
+#include "boost/type_traits/remove_extent.hpp"
#include "boost/type_traits/remove_pointer.hpp"
#include "boost/type_traits/remove_reference.hpp"
#include "boost/type_traits/remove_volatile.hpp"
+#include "boost/type_traits/type_identity.hpp"
#include "boost/type_traits/type_with_alignment.hpp"
+
#if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238))
#include "boost/type_traits/integral_promotion.hpp"
#include "boost/type_traits/promote.hpp"
#endif
-#include "boost/type_traits/ice.hpp"
-
#endif // BOOST_TYPE_TRAITS_HPP
#ifndef BOOST_TT_ADD_CONST_HPP_INCLUDED
#define BOOST_TT_ADD_CONST_HPP_INCLUDED
-#include <boost/config.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
+#include <boost/type_traits/detail/config.hpp>
namespace boost {
# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
#endif
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_const,T,T const)
+ template <class T> struct add_const
+ {
+ typedef T const type;
+ };
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_const,T&,T&)
+ template <class T> struct add_const<T&>
+ {
+ typedef T& type;
+ };
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_ADD_CONST_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>
# 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)
+template <class T> struct add_cv{ typedef T const volatile type; };
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_cv,T&,T&)
+template <class T> struct add_cv<T&>{ typedef T& type; };
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_ADD_CV_HPP_INCLUDED
#include <boost/type_traits/add_reference.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost{
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_lvalue_reference,T,typename boost::add_reference<T>::type)
+template <class T> struct add_lvalue_reference
+{
+ typedef typename boost::add_reference<T>::type type;
+};
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_lvalue_reference,T&&,T&)
+template <class T> struct add_lvalue_reference<T&&>
+{
+ typedef T& type;
+};
#endif
}
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP
#include <boost/type_traits/remove_reference.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
-namespace detail {
-
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x5A0)
//
// For some reason this implementation stops Borlands compiler
// to arrays for some reason though (shrug...) (JM 20021104)
//
template <typename T>
-struct add_pointer_impl
+struct add_pointer
{
typedef T* type;
};
template <typename T>
-struct add_pointer_impl<T&>
+struct add_pointer<T&>
{
typedef T* type;
};
template <typename T>
-struct add_pointer_impl<T&const>
+struct add_pointer<T&const>
{
typedef T* type;
};
template <typename T>
-struct add_pointer_impl<T&volatile>
+struct add_pointer<T&volatile>
{
typedef T* type;
};
template <typename T>
-struct add_pointer_impl<T&const volatile>
+struct add_pointer<T&const volatile>
{
typedef T* type;
};
#else
template <typename T>
-struct add_pointer_impl
+struct add_pointer
{
typedef typename remove_reference<T>::type no_ref_type;
typedef no_ref_type* type;
#endif
-} // namespace detail
-
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_pointer,T,typename boost::detail::add_pointer_impl<T>::type)
-
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_ADD_POINTER_HPP_INCLUDED
#ifndef BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
#define BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
-#include <boost/type_traits/is_reference.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/config.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
namespace detail {
//
template <typename T>
-struct add_reference_rvalue_layer
+struct add_reference_impl
{
typedef T& type;
};
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <typename T>
-struct add_reference_rvalue_layer<T&&>
+struct add_reference_impl<T&&>
{
typedef T&& type;
};
#endif
-template <typename T>
-struct add_reference_impl
+} // namespace detail
+
+template <class T> struct add_reference
{
- typedef typename add_reference_rvalue_layer<T>::type type;
+ typedef typename boost::detail::add_reference_impl<T>::type type;
+};
+template <class T> struct add_reference<T&>
+{
+ typedef T& type;
};
-
-BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
// these full specialisations are always required:
-BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void,void)
+template <> struct add_reference<void> { typedef void type; };
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const,void const)
-BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void volatile,void volatile)
-BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const volatile,void const volatile)
-#endif
-
-} // namespace detail
-
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename boost::detail::add_reference_impl<T>::type)
-
-// agurt, 07/mar/03: workaround Borland's ill-formed sensitivity to an additional
-// level of indirection, here
-#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
+template <> struct add_reference<const void> { typedef void type; };
+template <> struct add_reference<const volatile void> { typedef void type; };
+template <> struct add_reference<volatile void> { typedef void type; };
#endif
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/is_reference.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
//----------------------------------------------------------------------------//
// //
// C++03 implementation of //
}
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_rvalue_reference,T,typename boost::type_traits_detail::add_rvalue_reference_imp<T>::type)
+template <class T> struct add_rvalue_reference
+{
+ typedef typename boost::type_traits_detail::add_rvalue_reference_imp<T>::type type;
+};
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP
#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 volatile type - add_volatile<T>
# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
#endif
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_volatile,T,T volatile)
+template <class T> struct add_volatile{ typedef T volatile type; };
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_volatile,T&,T&)
+template <class T> struct add_volatile<T&>{ typedef T& type; };
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
+//-----------------------------------------------------------------------------
+// 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_TT_ALIGNED_STORAGE_HPP
+#define BOOST_TT_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/type_traits/conditional.hpp"
+
+namespace boost {
+
+namespace detail { namespace aligned_storage {
+
+BOOST_STATIC_CONSTANT(
+ std::size_t
+ , alignment_of_max_align = ::boost::alignment_of<boost::detail::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::type_with_alignment<alignment_>::type align_;
+ } data_;
+ void* address() const { return const_cast<aligned_storage_imp*>(this); }
+};
+template <std::size_t size>
+struct aligned_storage_imp<size, std::size_t(-1)>
+{
+ union data_t
+ {
+ char buf[size];
+ ::boost::detail::max_align 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; }
+};
-// 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).
+}} // 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):
//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+template <std::size_t size_, std::size_t alignment_>
+struct is_pod< ::boost::detail::aligned_storage::aligned_storage_imp<size_, alignment_> > : public true_type{};
-#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
+} // namespace boost
+#endif // BOOST_ALIGNED_STORAGE_HPP
#include <cstddef>
#include <boost/type_traits/intrinsics.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/size_t_trait_def.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
} // namespace detail
-BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(alignment_of,T,::boost::detail::alignment_of_impl<T>::value)
+template <class T> struct alignment_of : public integral_constant<std::size_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*>
-{
-};
+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>{};
+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)
+template<> struct alignment_of<void> : integral_constant<std::size_t, 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)
+template<> struct alignment_of<void const> : integral_constant<std::size_t, 0>{};
+template<> struct alignment_of<void const volatile> : integral_constant<std::size_t, 0>{};
+template<> struct alignment_of<void volatile> : integral_constant<std::size_t, 0>{};
#endif
} // namespace boost
# pragma warning(pop)
#endif
-#include <boost/type_traits/detail/size_t_trait_undef.hpp>
-
#endif // BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED
-// common_type.hpp ---------------------------------------------------------//
-
-// Copyright 2008 Howard Hinnant
-// Copyright 2008 Beman Dawes
+#ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP_INCLUDED
+#define BOOST_TYPE_TRAITS_COMMON_TYPE_HPP_INCLUDED
+//
+// Copyright 2015 Peter Dimov
+//
// 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
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
#include <boost/config.hpp>
+#include <boost/type_traits/decay.hpp>
+#include <boost/type_traits/declval.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
+#if defined(BOOST_NO_CXX11_DECLTYPE)
+#include <boost/type_traits/detail/common_type_impl.hpp>
#endif
-//----------------------------------------------------------------------------//
-#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_COMMON_TYPE_ARITY)
-#define BOOST_COMMON_TYPE_ARITY 3
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+#include <boost/type_traits/detail/mp_defer.hpp>
#endif
-//----------------------------------------------------------------------------//
-#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
-#include <boost/typeof/typeof.hpp> // boost wonders never cease!
-#endif
+namespace boost
+{
-//----------------------------------------------------------------------------//
-#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
+// variadic common_type
-#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
+template<class... T> struct common_type
+{
+};
+
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+
+template<class... T> using common_type_t = typename common_type<T...>::type;
+
+namespace type_traits_detail
+{
+
+template<class T1, class T2, class... T> using common_type_fold = common_type_t<common_type_t<T1, T2>, T...>;
+
+} // namespace type_traits_detail
+
+template<class T1, class T2, class... T>
+struct common_type<T1, T2, T...>: type_traits_detail::mp_defer<type_traits_detail::common_type_fold, T1, T2, T...>
+{
+};
-// 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();
+template<class T1, class T2, class... T>
+struct common_type<T1, T2, T...>: common_type<typename common_type<T1, T2>::type, T...>
+{
+};
+
+#endif // !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+
+#else
+
+template<
+ class T1 = void, class T2 = void, class T3 = void,
+ class T4 = void, class T5 = void, class T6 = void,
+ class T7 = void, class T8 = void, class T9 = void
+>
+struct common_type: common_type<typename common_type<T1, T2>::type, T3, T4, T5, T6, T7, T8, T9>
+{
+};
+
+#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+
+// one argument
+
+template<class T> struct common_type<T>: boost::decay<T>
+{
+};
+
+// two arguments
+
+namespace type_traits_detail
+{
+
+// binary common_type
#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;
+
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+
+#if !defined(BOOST_MSVC) || BOOST_MSVC > 1800
+
+// internal compiler error on msvc-12.0
+
+template<class T1, class T2> using builtin_common_type = typename boost::decay<decltype( boost::declval<bool>()? boost::declval<T1>(): boost::declval<T2>() )>::type;
+
+template<class T1, class T2> struct common_type_impl: mp_defer<builtin_common_type, T1, T2>
+{
+};
+
#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 T1, class T2> using builtin_common_type = decltype( boost::declval<bool>()? boost::declval<T1>(): boost::declval<T2>() );
- template <class T>
- struct common_type_2<T, T>
- {
- typedef T type;
- };
- }
+template<class T1, class T2> struct common_type_impl_2: mp_defer<builtin_common_type, T1, T2>
+{
+};
+
+template<class T1, class T2> using decay_common_type = typename boost::decay<typename common_type_impl_2<T1, T2>::type>::type;
+
+template<class T1, class T2> struct common_type_impl: mp_defer<decay_common_type, T1, T2>
+{
+};
+
+#endif // !defined(BOOST_MSVC) || BOOST_MSVC > 1800
-#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>
- { };
+template<class T1, class T2> struct common_type_impl: boost::decay<decltype( boost::declval<bool>()? boost::declval<T1>(): boost::declval<T2>() )>
+{
+};
-// 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 // #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+
+#endif // #if !defined(BOOST_NO_CXX11_DECLTYPE)
+
+// decay helper
+
+template<class T1, class T2, class T1d = typename boost::decay<T1>::type, class T2d = typename boost::decay<T2>::type> struct common_type_decay_helper: boost::common_type<T1d, T2d>
+{
+};
+
+template<class T1, class T2> struct common_type_decay_helper<T1, T2, T1, T2>: common_type_impl<T1, T2>
+{
+};
+
+} // type_traits_detail
+
+template<class T1, class T2> struct common_type<T1, T2>: type_traits_detail::common_type_decay_helper<T1, T2>
+{
+};
+
+} // namespace boost
-#endif // BOOST_TYPE_TRAITS_COMMON_TYPE_HPP
+#endif // #ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP_INCLUDED
-
// (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
#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>
-{
-};
+template <bool b, class T, class U> struct conditional { typedef T type; };
+template <class T, class U> struct conditional<false, T, U> { typedef U type; };
} // namespace boost
+++ /dev/null
-
-// (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_CONFIG_HPP_INCLUDED
-#define BOOST_TT_CONFIG_HPP_INCLUDED
-
-#ifndef BOOST_CONFIG_HPP
-#include <boost/config.hpp>
-#endif
-
-#include <boost/detail/workaround.hpp>
-
-//
-// whenever we have a conversion function with ellipses
-// it needs to be declared __cdecl to suppress compiler
-// warnings from MS and Borland compilers (this *must*
-// appear before we include is_same.hpp below):
-#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
-# define BOOST_TT_DECL __cdecl
-#else
-# define BOOST_TT_DECL /**/
-#endif
-
-# if (BOOST_WORKAROUND(__MWERKS__, < 0x3000) \
- || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \
- || BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) \
- || defined(__ghs) \
- || BOOST_WORKAROUND(__HP_aCC, < 60700) \
- || BOOST_WORKAROUND(MPW_CPLUS, BOOST_TESTED_AT(0x890)) \
- || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))) \
- && defined(BOOST_NO_IS_ABSTRACT)
-
-# define BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION 1
-
-#endif
-
-#ifndef BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION
-# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION 1
-#endif
-
-//
-// define BOOST_TT_TEST_MS_FUNC_SIGS
-// when we want to test __stdcall etc function types with is_function etc
-// (Note, does not work with Borland, even though it does support __stdcall etc):
-//
-#if defined(_MSC_EXTENSIONS) && !defined(__BORLANDC__)
-# define BOOST_TT_TEST_MS_FUNC_SIGS
-#endif
-
-//
-// define BOOST_TT_NO_CV_FUNC_TEST
-// if tests for cv-qualified member functions don't
-// work in is_member_function_pointer
-//
-#if BOOST_WORKAROUND(__MWERKS__, < 0x3000) || BOOST_WORKAROUND(__IBMCPP__, <= 600)
-# define BOOST_TT_NO_CV_FUNC_TEST
-#endif
-
-//
-// Macros that have been deprecated, defined here for backwards compatibility:
-//
-#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(x)
-#define BOOST_TT_BROKEN_COMPILER_SPEC(x)
-
-#endif // BOOST_TT_CONFIG_HPP_INCLUDED
-
-
--- /dev/null
+#ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED
+#define BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED
+
+//
+// Copyright 2015 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_volatile.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_volatile.hpp>
+#include <boost/type_traits/conditional.hpp>
+
+namespace boost
+{
+
+template<class T, class U> struct copy_cv
+{
+private:
+
+ typedef typename boost::conditional<boost::is_const<U>::value, typename boost::add_const<T>::type, T>::type CT;
+
+public:
+
+ typedef typename boost::conditional<boost::is_volatile<U>::value, typename boost::add_volatile<CT>::type, CT>::type type;
+};
+
+} // namespace boost
+
+#endif // #ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED
#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>
+#include <boost/type_traits/remove_cv.hpp>
namespace boost
{
+ namespace detail
+ {
+
+ template <class T, bool Array, bool Function> struct decay_imp { typedef typename remove_cv<T>::type type; };
+ template <class T> struct decay_imp<T, true, false> { typedef typename remove_bounds<T>::type* type; };
+ template <class T> struct decay_imp<T, false, true> { typedef T* type; };
+
+ }
+
template< class T >
struct decay
{
private:
- typedef BOOST_DEDUCED_TYPENAME remove_reference<T>::type Ty;
+ typedef 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;
+ typedef typename boost::detail::decay_imp<Ty, boost::is_array<Ty>::value, boost::is_function<Ty>::value>::type type;
};
} // namespace boost
--- /dev/null
+// declval.hpp -------------------------------------------------------------//
+
+// Copyright 2010 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_TYPE_TRAITS_DECLVAL_HPP_INCLUDED
+#define BOOST_TYPE_TRAITS_DECLVAL_HPP_INCLUDED
+
+#include <boost/config.hpp>
+
+//----------------------------------------------------------------------------//
+
+#include <boost/type_traits/add_rvalue_reference.hpp>
+
+//----------------------------------------------------------------------------//
+// //
+// C++03 implementation of //
+// 20.2.4 Function template declval [declval] //
+// Written by Vicente J. Botet Escriba //
+// //
+// 1 The library provides the function template declval to simplify the
+// definition of expressions which occur as unevaluated operands.
+// 2 Remarks: If this function is used, the program is ill-formed.
+// 3 Remarks: The template parameter T of declval may be an incomplete type.
+// [ Example:
+//
+// template <class To, class From>
+// decltype(static_cast<To>(declval<From>())) convert(From&&);
+//
+// declares a function template convert which only participates in overloading
+// if the type From can be explicitly converted to type To. For another example
+// see class template common_type (20.9.7.6). -end example ]
+//----------------------------------------------------------------------------//
+
+namespace boost {
+
+ template <typename T>
+ typename add_rvalue_reference<T>::type declval() BOOST_NOEXCEPT; // as unevaluated operand
+
+} // namespace boost
+
+#endif // BOOST_TYPE_TRAITS_DECLVAL_HPP_INCLUDED
+++ /dev/null
-
-// 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/bool.hpp>
-#include <boost/mpl/aux_/lambda_support.hpp>
-#include <boost/config.hpp>
-
-//
-// Unfortunately some libraries have started using this header without
-// cleaning up afterwards: so we'd better undef the macros just in case
-// they've been defined already....
-//
-#ifdef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
-#undef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
-#undef BOOST_TT_AUX_BOOL_C_BASE
-#undef BOOST_TT_AUX_BOOL_TRAIT_DEF1
-#undef BOOST_TT_AUX_BOOL_TRAIT_DEF2
-#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC1
-#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC2
-#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1
-#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2
-#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1
-#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2
-#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1
-#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2
-#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1
-#undef BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1
-#endif
-
-#if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x570)
-# define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
- typedef ::boost::integral_constant<bool,C> type; \
- enum { value = type::value }; \
- /**/
-# define BOOST_TT_AUX_BOOL_C_BASE(C)
-#endif
-
-#ifndef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
-# define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) /**/
-#endif
-
-#ifndef BOOST_TT_AUX_BOOL_C_BASE
-# define BOOST_TT_AUX_BOOL_C_BASE(C) : public ::boost::integral_constant<bool,C>
-#endif
-
-
-#define BOOST_TT_AUX_BOOL_TRAIT_DEF1(trait,T,C) \
-template< typename T > struct trait \
- BOOST_TT_AUX_BOOL_C_BASE(C) \
-{ \
-public:\
- BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
- BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \
-}; \
-\
-BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
-/**/
-
-
-#define BOOST_TT_AUX_BOOL_TRAIT_DEF2(trait,T1,T2,C) \
-template< typename T1, typename T2 > struct trait \
- BOOST_TT_AUX_BOOL_C_BASE(C) \
-{ \
-public:\
- BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
- BOOST_MPL_AUX_LAMBDA_SUPPORT(2,trait,(T1,T2)) \
-}; \
-\
-BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,trait) \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_DEF3(trait,T1,T2,T3,C) \
-template< typename T1, typename T2, typename T3 > struct trait \
- BOOST_TT_AUX_BOOL_C_BASE(C) \
-{ \
-public:\
- BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
- BOOST_MPL_AUX_LAMBDA_SUPPORT(3,trait,(T1,T2,T3)) \
-}; \
-\
-BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(3,trait) \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,C) \
-template<> struct trait< sp > \
- BOOST_TT_AUX_BOOL_C_BASE(C) \
-{ \
-public:\
- BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
- BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(sp)) \
-}; \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,sp1,sp2,C) \
-template<> struct trait< sp1,sp2 > \
- BOOST_TT_AUX_BOOL_C_BASE(C) \
-{ \
-public:\
- BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
- BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \
-}; \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(trait,sp,C) \
-template<> struct trait##_impl< sp > \
-{ \
-public:\
- BOOST_STATIC_CONSTANT(bool, value = (C)); \
-}; \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,sp1,sp2,C) \
-template<> struct trait##_impl< sp1,sp2 > \
-{ \
-public:\
- BOOST_STATIC_CONSTANT(bool, value = (C)); \
-}; \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(param,trait,sp,C) \
-template< param > struct trait< sp > \
- BOOST_TT_AUX_BOOL_C_BASE(C) \
-{ \
-public:\
- BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
-}; \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,sp,C) \
-template< param1, param2 > struct trait< sp > \
- BOOST_TT_AUX_BOOL_C_BASE(C) \
-{ \
-public:\
- BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
-}; \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \
-template< param > struct trait< sp1,sp2 > \
- BOOST_TT_AUX_BOOL_C_BASE(C) \
-{ \
-public:\
- BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
- BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \
-}; \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(param1,param2,trait,sp1,sp2,C) \
-template< param1, param2 > struct trait< sp1,sp2 > \
- BOOST_TT_AUX_BOOL_C_BASE(C) \
-{ \
-public:\
- BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
-}; \
-/**/
-
-#define BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \
-template< param > struct trait##_impl< sp1,sp2 > \
-{ \
-public:\
- BOOST_STATIC_CONSTANT(bool, value = (C)); \
-}; \
-/**/
-
-#ifndef BOOST_NO_CV_SPECIALIZATIONS
-# define BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(trait,sp,value) \
- BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \
- BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp const,value) \
- BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp volatile,value) \
- BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp const volatile,value) \
- /**/
-#else
-# define BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(trait,sp,value) \
- BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \
- /**/
-#endif
+++ /dev/null
-
-// 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_BOOL_TRAIT_VALUE_DECL
-#undef BOOST_TT_AUX_BOOL_C_BASE
-#undef BOOST_TT_AUX_BOOL_TRAIT_DEF1
-#undef BOOST_TT_AUX_BOOL_TRAIT_DEF2
-#undef BOOST_TT_AUX_BOOL_TRAIT_DEF3
-#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC1
-#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC2
-#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1
-#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2
-#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1
-#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2
-#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1
-#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2
-#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1
-#undef BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1
--- /dev/null
+#ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_ARITHMETIC_TYPE_HPP_INCLUDED
+#define BOOST_TYPE_TRAITS_DETAIL_COMMON_ARITHMETIC_TYPE_HPP_INCLUDED
+
+//
+// Copyright 2015 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/config.hpp>
+
+namespace boost
+{
+
+namespace type_traits_detail
+{
+
+template<int I> struct arithmetic_type;
+
+// Types bool, char, char16_t, char32_t, wchar_t,
+// and the signed and unsigned integer types are
+// collectively called integral types
+
+template<> struct arithmetic_type<1>
+{
+ typedef bool type;
+ typedef char (&result_type) [1];
+};
+
+template<> struct arithmetic_type<2>
+{
+ typedef char type;
+ typedef char (&result_type) [2];
+};
+
+template<> struct arithmetic_type<3>
+{
+ typedef wchar_t type;
+ typedef char (&result_type) [3];
+};
+
+// There are five standard signed integer types:
+// “signed char”, “short int”, “int”, “long int”, and “long long int”.
+
+template<> struct arithmetic_type<4>
+{
+ typedef signed char type;
+ typedef char (&result_type) [4];
+};
+
+template<> struct arithmetic_type<5>
+{
+ typedef short type;
+ typedef char (&result_type) [5];
+};
+
+template<> struct arithmetic_type<6>
+{
+ typedef int type;
+ typedef char (&result_type) [6];
+};
+
+template<> struct arithmetic_type<7>
+{
+ typedef long type;
+ typedef char (&result_type) [7];
+};
+
+template<> struct arithmetic_type<8>
+{
+ typedef boost::long_long_type type;
+ typedef char (&result_type) [8];
+};
+
+// For each of the standard signed integer types, there exists a corresponding
+// (but different) standard unsigned integer type: “unsigned char”, “unsigned short int”,
+// “unsigned int”, “unsigned long int”, and “unsigned long long int”
+
+template<> struct arithmetic_type<9>
+{
+ typedef unsigned char type;
+ typedef char (&result_type) [9];
+};
+
+template<> struct arithmetic_type<10>
+{
+ typedef unsigned short type;
+ typedef char (&result_type) [10];
+};
+
+template<> struct arithmetic_type<11>
+{
+ typedef unsigned int type;
+ typedef char (&result_type) [11];
+};
+
+template<> struct arithmetic_type<12>
+{
+ typedef unsigned long type;
+ typedef char (&result_type) [12];
+};
+
+template<> struct arithmetic_type<13>
+{
+ typedef boost::ulong_long_type type;
+ typedef char (&result_type) [13];
+};
+
+// There are three floating point types: float, double, and long double.
+
+template<> struct arithmetic_type<14>
+{
+ typedef float type;
+ typedef char (&result_type) [14];
+};
+
+template<> struct arithmetic_type<15>
+{
+ typedef double type;
+ typedef char (&result_type) [15];
+};
+
+template<> struct arithmetic_type<16>
+{
+ typedef long double type;
+ typedef char (&result_type) [16];
+};
+
+#if !defined( BOOST_NO_CXX11_CHAR16_T )
+
+template<> struct arithmetic_type<17>
+{
+ typedef char16_t type;
+ typedef char (&result_type) [17];
+};
+
+#endif
+
+#if !defined( BOOST_NO_CXX11_CHAR32_T )
+
+template<> struct arithmetic_type<18>
+{
+ typedef char32_t type;
+ typedef char (&result_type) [18];
+};
+
+#endif
+
+#if defined( BOOST_HAS_INT128 )
+
+template<> struct arithmetic_type<19>
+{
+ typedef boost::int128_type type;
+ typedef char (&result_type) [19];
+};
+
+template<> struct arithmetic_type<20>
+{
+ typedef boost::uint128_type type;
+ typedef char (&result_type) [20];
+};
+
+#endif
+
+template<class T, class U> class common_arithmetic_type
+{
+private:
+
+ static arithmetic_type<1>::result_type select( arithmetic_type<1>::type );
+ static arithmetic_type<2>::result_type select( arithmetic_type<2>::type );
+ static arithmetic_type<3>::result_type select( arithmetic_type<3>::type );
+ static arithmetic_type<4>::result_type select( arithmetic_type<4>::type );
+ static arithmetic_type<5>::result_type select( arithmetic_type<5>::type );
+ static arithmetic_type<6>::result_type select( arithmetic_type<6>::type );
+ static arithmetic_type<7>::result_type select( arithmetic_type<7>::type );
+ static arithmetic_type<8>::result_type select( arithmetic_type<8>::type );
+ static arithmetic_type<9>::result_type select( arithmetic_type<9>::type );
+ static arithmetic_type<10>::result_type select( arithmetic_type<10>::type );
+ static arithmetic_type<11>::result_type select( arithmetic_type<11>::type );
+ static arithmetic_type<12>::result_type select( arithmetic_type<12>::type );
+ static arithmetic_type<13>::result_type select( arithmetic_type<13>::type );
+ static arithmetic_type<14>::result_type select( arithmetic_type<14>::type );
+ static arithmetic_type<15>::result_type select( arithmetic_type<15>::type );
+ static arithmetic_type<16>::result_type select( arithmetic_type<16>::type );
+
+#if !defined( BOOST_NO_CXX11_CHAR16_T )
+ static arithmetic_type<17>::result_type select( arithmetic_type<17>::type );
+#endif
+
+#if !defined( BOOST_NO_CXX11_CHAR32_T )
+ static arithmetic_type<18>::result_type select( arithmetic_type<18>::type );
+#endif
+
+#if defined( BOOST_HAS_INT128 )
+ static arithmetic_type<19>::result_type select( arithmetic_type<19>::type );
+ static arithmetic_type<20>::result_type select( arithmetic_type<20>::type );
+#endif
+
+ static bool cond();
+
+public:
+
+ typedef typename arithmetic_type< sizeof(select( cond()? T(): U() )) >::type type;
+};
+
+} // namespace type_traits_detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_ARITHMETIC_TYPE_HPP_INCLUDED
+++ /dev/null
-/*******************************************************************************
- * 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
-
--- /dev/null
+#ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMPL_HPP_INCLUDED
+#define BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMPL_HPP_INCLUDED
+
+//
+// Copyright 2015 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/type_traits/detail/common_arithmetic_type.hpp>
+#include <boost/type_traits/detail/composite_pointer_type.hpp>
+#include <boost/type_traits/detail/composite_member_pointer_type.hpp>
+#include <boost/type_traits/type_identity.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/is_union.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_member_pointer.hpp>
+#include <boost/type_traits/conditional.hpp>
+
+namespace boost
+{
+
+namespace type_traits_detail
+{
+
+// the arguments to common_type_impl have already been passed through decay<>
+
+template<class T, class U> struct common_type_impl;
+
+// same type
+
+template<class T> struct common_type_impl<T, T>
+{
+ typedef T type;
+};
+
+// one of the operands is a class type, try conversions in both directions
+
+template<class T, class U> struct ct_class
+{
+ BOOST_STATIC_CONSTANT( bool, ct = boost::is_class<T>::value || boost::is_union<T>::value );
+ BOOST_STATIC_CONSTANT( bool, cu = boost::is_class<U>::value || boost::is_union<U>::value );
+
+ BOOST_STATIC_CONSTANT( bool, value = ct || cu );
+};
+
+template<class T, class U> struct common_type_impl3;
+
+template<class T, class U> struct common_type_class: public boost::conditional<
+
+ boost::is_convertible<T, U>::value && !boost::is_convertible<U, T>::value,
+ boost::type_identity<U>,
+
+ typename boost::conditional<
+
+ boost::is_convertible<U, T>::value && !boost::is_convertible<T, U>::value,
+ boost::type_identity<T>,
+
+ common_type_impl3<T, U>
+ >::type
+>::type
+{
+};
+
+template<class T, class U> struct common_type_impl: public boost::conditional<
+ ct_class<T, U>::value,
+ common_type_class<T, U>,
+ common_type_impl3<T, U> >::type
+{
+};
+
+// pointers
+
+template<class T, class U> struct common_type_impl4;
+
+template<class T, class U> struct common_type_impl3: public boost::conditional<
+ boost::is_pointer<T>::value || boost::is_pointer<U>::value,
+ composite_pointer_type<T, U>,
+ common_type_impl4<T, U> >::type
+{
+};
+
+// pointers to members
+
+template<class T, class U> struct common_type_impl5;
+
+template<class T, class U> struct common_type_impl4: public boost::conditional<
+ boost::is_member_pointer<T>::value || boost::is_member_pointer<U>::value,
+ composite_member_pointer_type<T, U>,
+ common_type_impl5<T, U> >::type
+{
+};
+
+// arithmetic types (including class types w/ conversions to arithmetic and enums)
+
+template<class T, class U> struct common_type_impl5: public common_arithmetic_type<T, U>
+{
+};
+
+} // namespace type_traits_detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMPL_HPP_INCLUDED
--- /dev/null
+#ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_MEMBER_POINTER_TYPE_HPP_INCLUDED
+#define BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_MEMBER_POINTER_TYPE_HPP_INCLUDED
+
+//
+// Copyright 2015 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/type_traits/detail/composite_pointer_type.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/type_traits/is_base_of.hpp>
+#include <boost/type_traits/conditional.hpp>
+#include <boost/config.hpp>
+#include <cstddef>
+
+namespace boost
+{
+
+namespace type_traits_detail
+{
+
+template<class T, class U> struct composite_member_pointer_type;
+
+// nullptr_t
+
+#if !defined( BOOST_NO_CXX11_NULLPTR )
+
+#if !defined( BOOST_NO_CXX11_DECLTYPE ) && ( ( defined( __clang__ ) && !defined( _LIBCPP_VERSION ) ) || defined( __INTEL_COMPILER ) )
+
+template<class C, class T> struct composite_member_pointer_type<T C::*, decltype(nullptr)>
+{
+ typedef T C::* type;
+};
+
+template<class C, class T> struct composite_member_pointer_type<decltype(nullptr), T C::*>
+{
+ typedef T C::* type;
+};
+
+template<> struct composite_member_pointer_type<decltype(nullptr), decltype(nullptr)>
+{
+ typedef decltype(nullptr) type;
+};
+
+#else
+
+template<class C, class T> struct composite_member_pointer_type<T C::*, std::nullptr_t>
+{
+ typedef T C::* type;
+};
+
+template<class C, class T> struct composite_member_pointer_type<std::nullptr_t, T C::*>
+{
+ typedef T C::* type;
+};
+
+template<> struct composite_member_pointer_type<std::nullptr_t, std::nullptr_t>
+{
+ typedef std::nullptr_t type;
+};
+
+#endif
+
+#endif // !defined( BOOST_NO_CXX11_NULLPTR )
+
+template<class C1, class C2> struct common_member_class;
+
+template<class C> struct common_member_class<C, C>
+{
+ typedef C type;
+};
+
+template<class C1, class C2> struct common_member_class
+{
+ typedef typename boost::conditional<
+
+ boost::is_base_of<C1, C2>::value,
+ C2,
+ typename boost::conditional<boost::is_base_of<C2, C1>::value, C1, void>::type
+
+ >::type type;
+};
+
+//This indirection avoids compilation errors on some older
+//compilers like MSVC 7.1
+template<class CT, class CB>
+struct common_member_class_pointer_to_member
+{
+ typedef CT CB::* type;
+};
+
+template<class C1, class T1, class C2, class T2> struct composite_member_pointer_type<T1 C1::*, T2 C2::*>
+{
+private:
+
+ typedef typename composite_pointer_type<T1*, T2*>::type CPT;
+ typedef typename boost::remove_pointer<CPT>::type CT;
+
+ typedef typename common_member_class<C1, C2>::type CB;
+
+public:
+
+ typedef typename common_member_class_pointer_to_member<CT, CB>::type type;
+};
+
+} // namespace type_traits_detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_MEMBER_POINTER_TYPE_HPP_INCLUDED
--- /dev/null
+#ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_POINTER_TYPE_HPP_INCLUDED
+#define BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_POINTER_TYPE_HPP_INCLUDED
+
+//
+// Copyright 2015 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/type_traits/copy_cv.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/is_void.hpp>
+#include <boost/type_traits/is_base_of.hpp>
+#include <boost/config.hpp>
+#include <cstddef>
+
+namespace boost
+{
+
+namespace type_traits_detail
+{
+
+template<class T, class U> struct composite_pointer_type;
+
+// same type
+
+template<class T> struct composite_pointer_type<T*, T*>
+{
+ typedef T* type;
+};
+
+// nullptr_t
+
+#if !defined( BOOST_NO_CXX11_NULLPTR )
+
+#if !defined( BOOST_NO_CXX11_DECLTYPE ) && ( ( defined( __clang__ ) && !defined( _LIBCPP_VERSION ) ) || defined( __INTEL_COMPILER ) )
+
+template<class T> struct composite_pointer_type<T*, decltype(nullptr)>
+{
+ typedef T* type;
+};
+
+template<class T> struct composite_pointer_type<decltype(nullptr), T*>
+{
+ typedef T* type;
+};
+
+template<> struct composite_pointer_type<decltype(nullptr), decltype(nullptr)>
+{
+ typedef decltype(nullptr) type;
+};
+
+#else
+
+template<class T> struct composite_pointer_type<T*, std::nullptr_t>
+{
+ typedef T* type;
+};
+
+template<class T> struct composite_pointer_type<std::nullptr_t, T*>
+{
+ typedef T* type;
+};
+
+template<> struct composite_pointer_type<std::nullptr_t, std::nullptr_t>
+{
+ typedef std::nullptr_t type;
+};
+
+#endif
+
+#endif // !defined( BOOST_NO_CXX11_NULLPTR )
+
+namespace detail
+{
+
+template<class T, class U> struct has_common_pointee
+{
+private:
+
+ typedef typename boost::remove_cv<T>::type T2;
+ typedef typename boost::remove_cv<U>::type U2;
+
+public:
+
+ BOOST_STATIC_CONSTANT( bool, value =
+ (boost::is_same<T2, U2>::value)
+ || boost::is_void<T2>::value
+ || boost::is_void<U2>::value
+ || (boost::is_base_of<T2, U2>::value)
+ || (boost::is_base_of<U2, T2>::value) );
+};
+
+template<class T, class U> struct common_pointee
+{
+private:
+
+ typedef typename boost::remove_cv<T>::type T2;
+ typedef typename boost::remove_cv<U>::type U2;
+
+public:
+
+ typedef typename boost::conditional<
+
+ boost::is_same<T2, U2>::value || boost::is_void<T2>::value || boost::is_base_of<T2, U2>::value,
+ typename boost::copy_cv<T, U>::type,
+ typename boost::copy_cv<U, T>::type
+
+ >::type type;
+};
+
+template<class T, class U> struct composite_pointer_impl
+{
+private:
+
+ typedef typename boost::remove_cv<T>::type T2;
+ typedef typename boost::remove_cv<U>::type U2;
+
+public:
+
+ typedef typename boost::copy_cv<typename boost::copy_cv<typename composite_pointer_type<T2, U2>::type const, T>::type, U>::type type;
+};
+
+//Old compilers like MSVC-7.1 have problems using boost::conditional in
+//composite_pointer_type. Partially specializing on has_common_pointee<T, U>::value
+//seems to make their life easier
+template<class T, class U, bool = has_common_pointee<T, U>::value >
+struct composite_pointer_type_dispatch
+ : common_pointee<T, U>
+{};
+
+template<class T, class U>
+struct composite_pointer_type_dispatch<T, U, false>
+ : composite_pointer_impl<T, U>
+{};
+
+
+} // detail
+
+
+template<class T, class U> struct composite_pointer_type<T*, U*>
+{
+ typedef typename detail::composite_pointer_type_dispatch<T, U>::type* type;
+};
+
+} // namespace type_traits_detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_POINTER_TYPE_HPP_INCLUDED
--- /dev/null
+
+// (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_CONFIG_HPP_INCLUDED
+#define BOOST_TT_CONFIG_HPP_INCLUDED
+
+#ifndef BOOST_CONFIG_HPP
+#include <boost/config.hpp>
+#endif
+#include <boost/version.hpp>
+#include <boost/detail/workaround.hpp>
+
+//
+// whenever we have a conversion function with ellipses
+// it needs to be declared __cdecl to suppress compiler
+// warnings from MS and Borland compilers (this *must*
+// appear before we include is_same.hpp below):
+#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
+# define BOOST_TT_DECL __cdecl
+#else
+# define BOOST_TT_DECL /**/
+#endif
+
+# if (BOOST_WORKAROUND(__MWERKS__, < 0x3000) \
+ || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \
+ || BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) \
+ || defined(__ghs) \
+ || BOOST_WORKAROUND(__HP_aCC, < 60700) \
+ || BOOST_WORKAROUND(MPW_CPLUS, BOOST_TESTED_AT(0x890)) \
+ || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))) \
+ && defined(BOOST_NO_IS_ABSTRACT)
+
+# define BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION 1
+
+#endif
+
+#ifndef BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION
+# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION 1
+#endif
+
+//
+// define BOOST_TT_TEST_MS_FUNC_SIGS
+// when we want to test __stdcall etc function types with is_function etc
+// (Note, does not work with Borland, even though it does support __stdcall etc):
+//
+#if defined(_MSC_EXTENSIONS) && !defined(__BORLANDC__)
+# define BOOST_TT_TEST_MS_FUNC_SIGS
+#endif
+
+//
+// define BOOST_TT_NO_CV_FUNC_TEST
+// if tests for cv-qualified member functions don't
+// work in is_member_function_pointer
+//
+#if BOOST_WORKAROUND(__MWERKS__, < 0x3000) || BOOST_WORKAROUND(__IBMCPP__, <= 600)
+# define BOOST_TT_NO_CV_FUNC_TEST
+#endif
+
+//
+// Macros that have been deprecated, defined here for backwards compatibility:
+//
+#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(x)
+#define BOOST_TT_BROKEN_COMPILER_SPEC(x)
+
+#endif // BOOST_TT_CONFIG_HPP_INCLUDED
+
+
+++ /dev/null
-
-// (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_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED
-#define BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED
-
-#include <cstddef>
-#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-
-
-// implementation helper:
-
-
-namespace boost {
-namespace detail {
-
-#if BOOST_WORKAROUND(BOOST_MSVC, == 1700)
-#define BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(X) X
- template <typename T>
- struct cv_traits_imp
- {
- BOOST_STATIC_CONSTANT(bool, is_const = false);
- BOOST_STATIC_CONSTANT(bool, is_volatile = false);
- typedef T unqualified_type;
- };
-
- template <typename T>
- struct cv_traits_imp<T[]>
- {
- BOOST_STATIC_CONSTANT(bool, is_const = false);
- BOOST_STATIC_CONSTANT(bool, is_volatile = false);
- typedef T unqualified_type[];
- };
-
- template <typename T>
- struct cv_traits_imp<const T[]>
- {
- BOOST_STATIC_CONSTANT(bool, is_const = true);
- BOOST_STATIC_CONSTANT(bool, is_volatile = false);
- typedef T unqualified_type[];
- };
-
- template <typename T>
- struct cv_traits_imp<volatile T[]>
- {
- BOOST_STATIC_CONSTANT(bool, is_const = false);
- BOOST_STATIC_CONSTANT(bool, is_volatile = true);
- typedef T unqualified_type[];
- };
-
- template <typename T>
- struct cv_traits_imp<const volatile T[]>
- {
- BOOST_STATIC_CONSTANT(bool, is_const = true);
- BOOST_STATIC_CONSTANT(bool, is_volatile = true);
- typedef T unqualified_type[];
- };
-
- template <typename T, std::size_t N>
- struct cv_traits_imp<T[N]>
- {
- BOOST_STATIC_CONSTANT(bool, is_const = false);
- BOOST_STATIC_CONSTANT(bool, is_volatile = false);
- typedef T unqualified_type[N];
- };
-
- template <typename T, std::size_t N>
- struct cv_traits_imp<const T[N]>
- {
- BOOST_STATIC_CONSTANT(bool, is_const = true);
- BOOST_STATIC_CONSTANT(bool, is_volatile = false);
- typedef T unqualified_type[N];
- };
-
- template <typename T, std::size_t N>
- struct cv_traits_imp<volatile T[N]>
- {
- BOOST_STATIC_CONSTANT(bool, is_const = false);
- BOOST_STATIC_CONSTANT(bool, is_volatile = true);
- typedef T unqualified_type[N];
- };
-
- template <typename T, std::size_t N>
- struct cv_traits_imp<const volatile T[N]>
- {
- BOOST_STATIC_CONSTANT(bool, is_const = true);
- BOOST_STATIC_CONSTANT(bool, is_volatile = true);
- typedef T unqualified_type[N];
- };
-
-#else
-#define BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(X) X *
-template <typename T> struct cv_traits_imp {};
-
-template <typename T>
-struct cv_traits_imp<T*>
-{
- BOOST_STATIC_CONSTANT(bool, is_const = false);
- BOOST_STATIC_CONSTANT(bool, is_volatile = false);
- typedef T unqualified_type;
-};
-#endif
-
-template <typename T>
-struct cv_traits_imp<BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(const T)>
-{
- BOOST_STATIC_CONSTANT(bool, is_const = true);
- BOOST_STATIC_CONSTANT(bool, is_volatile = false);
- typedef T unqualified_type;
-};
-
-template <typename T>
-struct cv_traits_imp<BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(volatile T)>
-{
- BOOST_STATIC_CONSTANT(bool, is_const = false);
- BOOST_STATIC_CONSTANT(bool, is_volatile = true);
- typedef T unqualified_type;
-};
-
-template <typename T>
-struct cv_traits_imp<BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(const volatile T)>
-{
- BOOST_STATIC_CONSTANT(bool, is_const = true);
- BOOST_STATIC_CONSTANT(bool, is_volatile = true);
- typedef T unqualified_type;
-};
-
-} // namespace detail
-} // namespace boost
-
-
-#endif // BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED
+++ /dev/null
-// 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_FALSE_RESULT_HPP_INCLUDED
-#define BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED
-
-#include <boost/config.hpp>
-
-namespace boost {
-namespace type_traits {
-
-// Utility class which always "returns" false
-struct false_result
-{
- template <typename T> struct result_
- {
- BOOST_STATIC_CONSTANT(bool, value = false);
- };
-};
-
-}} // namespace boost::type_traits
-
-#endif // BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED
// 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/detail/yes_no_type.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_const.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
# pragma GCC system_header
#elif defined(BOOST_MSVC)
# pragma warning ( push )
-# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 )
+# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913)
+# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
+# pragma warning ( disable : 6334)
+# endif
#endif
namespace boost {
template < typename Lhs, typename Rhs, typename Ret >
struct trait_impl1 < Lhs, Rhs, Ret, false > {
BOOST_STATIC_CONSTANT(bool,
- value = (
- ::boost::type_traits::ice_and<
- operator_exists < Lhs, Rhs >::value,
- operator_returns_Ret < Lhs, Rhs, Ret, operator_returns_void < Lhs, Rhs >::value >::value
- >::value
- )
- );
+ value = (operator_exists < Lhs, Rhs >::value && operator_returns_Ret < Lhs, Rhs, Ret, operator_returns_void < Lhs, Rhs >::value >::value));
};
// some specializations needs to be declared for the special void case
} // namespace detail
// this is the accessible definition of the trait to end user
-BOOST_TT_AUX_BOOL_TRAIT_DEF3(BOOST_TT_TRAIT_NAME, Lhs, Rhs=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, Rhs, Ret >::value))
+template <class Lhs, class Rhs=Lhs, class Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care>
+struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _impl)::trait_impl < Lhs, Rhs, Ret >::value)>{};
} // namespace boost
#if defined(BOOST_MSVC)
# pragma warning ( pop )
#endif
-
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
// 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/detail/yes_no_type.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/type_traits/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 )
+# pragma warning ( disable : 4244 4913)
+# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
+# pragma warning ( disable : 6334)
+# endif
#endif
namespace boost {
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
- )
- );
+ value = (operator_exists < Lhs >::value && operator_returns_Ret < Lhs, Ret, operator_returns_void < Lhs >::value >::value));
};
// specialization needs to be declared for the special void case
} // 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))
+template <class Lhs, class Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care>
+struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _impl)::trait_impl< Lhs, Ret >::value)>{};
} // namespace boost
#if defined(BOOST_MSVC)
# pragma warning ( pop )
#endif
-
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
// 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/detail/yes_no_type.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/type_traits/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
# pragma GCC system_header
#elif defined(BOOST_MSVC)
# pragma warning ( push )
-# pragma warning ( disable : 4146 4804 4913 4244 )
+# pragma warning ( disable : 4146 4804 4913 4244)
+# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
+# pragma warning ( disable : 6334)
+# endif
#endif
+
+
namespace boost {
namespace detail {
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
- )
- );
+ value = (operator_exists < Rhs >::value && operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::value));
};
// specialization needs to be declared for the special void case
} // 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))
+template <class Rhs, class Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care>
+struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _impl)::trait_impl < Rhs, Ret >::value)>{};
} // namespace boost
#if defined(BOOST_MSVC)
# pragma warning ( pop )
#endif
-
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
+++ /dev/null
-// (C) Copyright John Maddock and Steve Cleary 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_DETAIL_ICE_AND_HPP_INCLUDED
-#define BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED
-
-#include <boost/config.hpp>
-
-namespace boost {
-namespace type_traits {
-
-template <bool b1, bool b2, bool b3 = true, bool b4 = true, bool b5 = true, bool b6 = true, bool b7 = true>
-struct ice_and;
-
-template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
-struct ice_and
-{
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-template <>
-struct ice_and<true, true, true, true, true, true, true>
-{
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-} // namespace type_traits
-} // namespace boost
-
-#endif // BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED
+++ /dev/null
-// (C) Copyright John Maddock and Steve Cleary 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_DETAIL_ICE_EQ_HPP_INCLUDED
-#define BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED
-
-#include <boost/config.hpp>
-
-namespace boost {
-namespace type_traits {
-
-template <int b1, int b2>
-struct ice_eq
-{
- BOOST_STATIC_CONSTANT(bool, value = (b1 == b2));
-};
-
-template <int b1, int b2>
-struct ice_ne
-{
- BOOST_STATIC_CONSTANT(bool, value = (b1 != b2));
-};
-
-#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
-template <int b1, int b2> bool const ice_eq<b1,b2>::value;
-template <int b1, int b2> bool const ice_ne<b1,b2>::value;
-#endif
-
-} // namespace type_traits
-} // namespace boost
-
-#endif // BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED
+++ /dev/null
-// (C) Copyright John Maddock and Steve Cleary 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_DETAIL_ICE_NOT_HPP_INCLUDED
-#define BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED
-
-#include <boost/config.hpp>
-
-namespace boost {
-namespace type_traits {
-
-template <bool b>
-struct ice_not
-{
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template <>
-struct ice_not<true>
-{
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-} // namespace type_traits
-} // namespace boost
-
-#endif // BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED
+++ /dev/null
-// (C) Copyright John Maddock and Steve Cleary 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_DETAIL_ICE_OR_HPP_INCLUDED
-#define BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED
-
-#include <boost/config.hpp>
-
-namespace boost {
-namespace type_traits {
-
-template <bool b1, bool b2, bool b3 = false, bool b4 = false, bool b5 = false, bool b6 = false, bool b7 = false>
-struct ice_or;
-
-template <bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7>
-struct ice_or
-{
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template <>
-struct ice_or<false, false, false, false, false, false, false>
-{
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-} // namespace type_traits
-} // namespace boost
-
-#endif // BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED
#ifndef BOOST_TT_DETAIL_IS_FUNCTION_PTR_HELPER_HPP_INCLUDED
#define BOOST_TT_DETAIL_IS_FUNCTION_PTR_HELPER_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
-
#if defined(BOOST_TT_PREPROCESSING_MODE)
-# include <boost/preprocessor/iterate.hpp>
-# include <boost/preprocessor/enum_params.hpp>
-# include <boost/preprocessor/comma_if.hpp>
+//
+// Hide these #include from dependency analysers as
+// these are required in maintenance mode only:
+//
+#define PP1 <boost/preprocessor/iterate.hpp>
+#include PP1
+#undef PP1
+#define PP1 <boost/preprocessor/enum_params.hpp>
+#include PP1
+#undef PP1
+#define PP1 <boost/preprocessor/comma_if.hpp>
+#include PP1
+#undef PP1
#endif
namespace boost {
#define BOOST_TT_DETAIL_IS_FUNCTION_PTR_TESTER_HPP_INCLUDED
#include <boost/type_traits/detail/yes_no_type.hpp>
-#include <boost/type_traits/config.hpp>
#if defined(BOOST_TT_PREPROCESSING_MODE)
-# include <boost/preprocessor/iterate.hpp>
-# include <boost/preprocessor/enum_params.hpp>
-# include <boost/preprocessor/comma_if.hpp>
+//
+// Hide include dependencies from analysers since they're
+// only require in maintenance mode:
+//
+#define PP1 <boost/preprocessor/iterate.hpp>
+#define PP2 <boost/preprocessor/enum_params.hpp>
+#define PP3 <boost/preprocessor/comma_if.hpp>
+#include PP1
+#include PP2
+#include PP3
+#undef PP1
+#undef PP2
+#undef PP3
#endif
namespace boost {
#include <boost/config.hpp>
#if defined(BOOST_TT_PREPROCESSING_MODE)
-# include <boost/preprocessor/iterate.hpp>
-# include <boost/preprocessor/enum_params.hpp>
-# include <boost/preprocessor/comma_if.hpp>
+//
+// Maintenance mode, hide include dependencies
+// from trackers:
+//
+#define PPI <boost/preprocessor/iterate.hpp>
+#include PPI
+#undef PPI
+#define PPI <boost/preprocessor/enum_params.hpp>
+#include PPI
+#undef PPI
+#define PPI <boost/preprocessor/comma_if.hpp>
+#include PPI
+#undef PPI
#endif
namespace boost {
#define BOOST_TT_DETAIL_IS_MEM_FUN_POINTER_TESTER_HPP_INCLUDED
#include <boost/type_traits/detail/yes_no_type.hpp>
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#if defined(BOOST_TT_PREPROCESSING_MODE)
-# include <boost/preprocessor/iterate.hpp>
-# include <boost/preprocessor/enum_params.hpp>
-# include <boost/preprocessor/comma_if.hpp>
+//
+// Maintentance mode, hide include dependencies
+// from dependency trackers:
+//
+#define PPI <boost/preprocessor/iterate.hpp>
+#include PPI
+#undef PPI
+#define PPI <boost/preprocessor/enum_params.hpp>
+#include PPI
+#undef PPI
+#define <boost/preprocessor/comma_if.hpp>
+#include PPI
+#undef
#endif
namespace boost {
--- /dev/null
+#ifndef BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED
+#define BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED
+
+//
+// Copyright 2015 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/conditional.hpp>
+
+namespace boost
+{
+
+namespace type_traits_detail
+{
+
+// mp_valid
+// implementation by Bruno Dutra (by the name is_evaluable)
+
+template<template<class...> class F, class... T>
+struct mp_valid_impl
+{
+ template<template<class...> class G, class = G<T...>>
+ static boost::true_type check(int);
+
+ template<template<class...> class>
+ static boost::false_type check(...);
+
+ using type = decltype(check<F>(0));
+};
+
+template<template<class...> class F, class... T>
+using mp_valid = typename mp_valid_impl<F, T...>::type;
+
+// mp_defer
+
+struct mp_empty
+{
+};
+
+template<template<class...> class F, class... T> struct mp_defer_impl
+{
+ using type = F<T...>;
+};
+
+template<template<class...> class F, class... T> using mp_defer = typename boost::conditional<mp_valid<F, T...>::value, mp_defer_impl<F, T...>, mp_empty>::type;
+
+} // namespace type_traits_detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED
+++ /dev/null
-
-// 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> \
-{ \
-}; \
-/**/
+++ /dev/null
-
-// 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
+++ /dev/null
-
-// 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)
-
-#include <boost/mpl/int.hpp>
-#include <boost/mpl/aux_/template_arity_fwd.hpp>
-#include <boost/mpl/aux_/preprocessor/params.hpp>
-#include <boost/mpl/aux_/config/lambda.hpp>
-#include <boost/mpl/aux_/config/overload_resolution.hpp>
-
-#if defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) \
- && defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION)
-# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) \
-namespace mpl { namespace aux { \
-template< BOOST_MPL_PP_PARAMS(i, typename T) > \
-struct template_arity< \
- name< BOOST_MPL_PP_PARAMS(i, T) > \
- > \
- : int_<i> \
-{ \
-}; \
-}} \
-/**/
-#else
-# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) /**/
-#endif
+++ /dev/null
-
-// 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/mpl/aux_/lambda_support.hpp>
-
-#define BOOST_TT_AUX_TYPE_TRAIT_DEF1(trait,T,result) \
-template< typename T > struct trait \
-{ \
-public:\
- typedef result type; \
- BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \
-}; \
-\
-BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
-/**/
-
-#define BOOST_TT_AUX_TYPE_TRAIT_SPEC1(trait,spec,result) \
-template<> struct trait<spec> \
-{ \
-public:\
- typedef result type; \
- BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \
-}; \
-/**/
-
-#define BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(trait,spec,result) \
-template<> struct trait##_impl<spec> \
-{ \
-public:\
- typedef result type; \
-}; \
-/**/
-
-#define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,result) \
-template< param > struct trait<spec> \
-{ \
-public:\
- typedef result type; \
-}; \
-/**/
-
-#define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,spec,result) \
-template< param1, param2 > struct trait<spec> \
-{ \
-public:\
- typedef result; \
-}; \
-/**/
-
-#define BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(param,trait,spec,result) \
-template< param > struct trait##_impl<spec> \
-{ \
-public:\
- typedef result type; \
-}; \
-/**/
+++ /dev/null
-
-// 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_TYPE_TRAIT_DEF1
-#undef BOOST_TT_AUX_TYPE_TRAIT_SPEC1
-#undef BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1
-#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1
-#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2
-#undef BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1
#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>
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/detail/workaround.hpp>
namespace boost {
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
#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<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; };
-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
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< Lhs_noref >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value\
- >::value
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ (\
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< 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_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>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< Lhs_noref >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value\
- >::value
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< 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_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>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< Lhs_noref >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value\
- >::value
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< 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_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>
#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,\
+ ::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
+ (\
+ ::boost::is_fundamental< Rhs_noref >::value && \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )
#include <boost/type_traits/detail/has_prefix_operator.hpp>
#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_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>
#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< Lhs_noref >::value && \
+ ( \
+ ::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< Rhs_noref >::value && \
+ ( \
+ ::boost::is_fundamental< Lhs_nocv >::value || \
::boost::is_pointer< Lhs_noref >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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< 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< Lhs_noref >::value && \
+ ( \
+ ::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< Rhs_noref >::value && \
+ ( \
+ ::boost::is_fundamental< Lhs_nocv >::value || \
::boost::is_pointer< Lhs_noref >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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_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_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_pointer< Lhs_noref >::value && \
+ ::boost::is_pointer< Rhs_noref >::value && \
+ (! \
+ (\
+ ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
+ ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_void< Lhs_noptr >::value || \
::boost::is_void< Rhs_noptr >::value\
- >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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_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_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_pointer< Lhs_noref >::value && \
+ ::boost::is_pointer< Rhs_noref >::value && \
+ (! \
+ ( \
+ ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
+ ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_void< Lhs_noptr >::value || \
::boost::is_void< Rhs_noptr >::value\
- >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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_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_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_pointer< Lhs_noref >::value && \
+ ::boost::is_pointer< Rhs_noref >::value && \
+ (! \
+ ( \
+ ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
+ ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_void< Lhs_noptr >::value || \
::boost::is_void< Rhs_noptr >::value\
- >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< Lhs_noref >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value\
- >::value
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< 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_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>
#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_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_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_pointer< Lhs_noref >::value && \
+ ::boost::is_pointer< Rhs_noref >::value && \
+ (! \
+ ( \
+ ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
+ ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_void< Lhs_noptr >::value || \
::boost::is_void< Rhs_noptr >::value\
- >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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_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_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_pointer< Lhs_noref >::value && \
+ ::boost::is_pointer< Rhs_noref >::value && \
+ (! \
+ ( \
+ ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
+ ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_void< Lhs_noptr >::value || \
::boost::is_void< Rhs_noptr >::value\
- >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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
+ (\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ( \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ (! ::boost::is_convertible< Rhs_nocv, bool >::value )\
+ )\
+ )||\
+ (\
+ ::boost::is_pointer< Rhs_noref >::value && \
+ ( \
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ (! ::boost::is_convertible< Lhs_nocv, bool >::value )\
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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
+ (\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ (\
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ (! ::boost::is_convertible< Rhs_nocv, bool >::value )\
+ )\
+ )||\
+ (\
+ ::boost::is_pointer< Rhs_noref >::value && \
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ (! ::boost::is_convertible< Lhs_nocv, bool >::value )\
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#define BOOST_TT_TRAIT_NAME has_minus
#define BOOST_TT_TRAIT_OP -
#define BOOST_TT_FORBIDDEN_IF\
- ::boost::type_traits::ice_or<\
+ (\
/* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
- ::boost::is_fundamental< Rhs_nocv >::value,\
- ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
- >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ ) || \
/* Lhs==void* and (Rhs==fundamental or Rhs==pointer) */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
- ::boost::is_void< Lhs_noptr >::value,\
- ::boost::type_traits::ice_or<\
- ::boost::is_fundamental< Rhs_nocv >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ::boost::is_void< Lhs_noptr >::value && \
+ ( \
+ ::boost::is_fundamental< Rhs_nocv >::value || \
::boost::is_pointer< Rhs_noref >::value\
- >::value\
- >::value,\
+ )\
+ ) || \
/* Rhs==void* and (Lhs==fundamental or Lhs==pointer) */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Rhs_noref >::value,\
- ::boost::is_void< Rhs_noptr >::value,\
- ::boost::type_traits::ice_or<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::boost::is_pointer< Rhs_noref >::value && \
+ ::boost::is_void< Rhs_noptr >::value && \
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value || \
::boost::is_pointer< Lhs_noref >::value\
- >::value\
- >::value,\
+ )\
+ ) ||\
/* Lhs=fundamental and Rhs=pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value,\
+ ) ||\
/* two different pointers */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
- ::boost::is_pointer< Rhs_noref >::value,\
- ::boost::type_traits::ice_not< ::boost::is_same< Lhs_nocv, Rhs_nocv >::value >::value\
- >::value\
- >::value
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ::boost::is_pointer< Rhs_noref >::value && \
+ (! ::boost::is_same< Lhs_nocv, Rhs_nocv >::value )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#define BOOST_TT_TRAIT_NAME has_minus_assign
#define BOOST_TT_TRAIT_OP -=
#define BOOST_TT_FORBIDDEN_IF\
- ::boost::type_traits::ice_or<\
+ (\
/* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
- ::boost::is_fundamental< Rhs_nocv >::value,\
- ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
- >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ ) || \
/* Lhs==void* and Rhs==fundamental */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
- ::boost::is_void< Lhs_noptr >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ::boost::is_void< Lhs_noptr >::value && \
::boost::is_fundamental< Rhs_nocv >::value\
- >::value,\
+ ) || \
/* Rhs==void* and Lhs==fundamental */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Rhs_noref >::value,\
- ::boost::is_void< Rhs_noptr >::value,\
+ (\
+ ::boost::is_pointer< Rhs_noref >::value && \
+ ::boost::is_void< Rhs_noptr >::value && \
::boost::is_fundamental< Lhs_nocv >::value\
- >::value,\
+ ) || \
/* Lhs=fundamental and Rhs=pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value,\
+ ) || \
/* Lhs==pointer and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value,\
+ ) || \
/* (Lhs==fundamental or Lhs==pointer) and (Rhs==fundamental or Rhs==pointer) and (Lhs==const) */\
- ::boost::type_traits::ice_and<\
- ::boost::type_traits::ice_or<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value || \
::boost::is_pointer< Lhs_noref >::value\
- >::value,\
- ::boost::type_traits::ice_or<\
- ::boost::is_fundamental< Rhs_nocv >::value,\
+ ) && \
+ (\
+ ::boost::is_fundamental< Rhs_nocv >::value || \
::boost::is_pointer< Rhs_noref >::value\
- >::value,\
+ ) && \
::boost::is_const< Lhs_noref >::value\
- >::value\
- >::value
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ (\
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< Lhs_noref >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value\
- >::value
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< 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_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>
#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< Lhs_noref >::value && \
+ (\
+ ::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< Rhs_noref >::value && \
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value || \
::boost::is_pointer< Lhs_noref >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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< 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< Lhs_noref >::value && \
+ ( \
+ ::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< Rhs_noref >::value && \
+ ( \
+ ::boost::is_fundamental< Lhs_nocv >::value || \
::boost::is_pointer< Lhs_noref >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#include <new> // std::nothrow_t
#include <cstddef> // std::size_t
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/integral_constant.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>
+#include <boost/detail/workaround.hpp>
#if defined(new)
# if BOOST_WORKAROUND(BOOST_MSVC, >= 1310)
#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)),
+ (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)
+template <class T> struct has_new_operator : public integral_constant<bool, ::boost::detail::has_new_operator_impl<T>::value>{};
} // namespace boost
# pragma pop_macro("new")
#endif
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_HAS_NEW_OPERATOR_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_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_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_pointer< Lhs_noref >::value && \
+ ::boost::is_pointer< Rhs_noref >::value && \
+ (! \
+ (\
+ ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
+ ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
+ ::boost::is_void< Lhs_noptr >::value || \
::boost::is_void< Rhs_noptr >::value\
- >::value\
- >::value\
- >::value\
- >::value
+ )\
+ )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#ifndef BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED
-#include <boost/type_traits/has_trivial_assign.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/intrinsics.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#if !defined(BOOST_HAS_NOTHROW_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL)
+#include <boost/type_traits/has_trivial_assign.hpp>
+#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+#include <boost/type_traits/declval.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_volatile.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/is_assignable.hpp>
+#include <boost/type_traits/add_reference.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#endif
+#endif
+#if defined(__GNUC__) || defined(__SUNPRO_CC)
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_volatile.hpp>
+#include <boost/type_traits/is_assignable.hpp>
+#include <boost/type_traits/is_array.hpp>
+#ifdef BOOST_INTEL
+#include <boost/type_traits/is_pod.hpp>
+#endif
+#endif
namespace boost {
-namespace detail{
+#if !defined(BOOST_HAS_NOTHROW_ASSIGN) && !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+ namespace detail
+ {
+ template <class T, bool b1, bool b2> struct has_nothrow_assign_imp{ static const bool value = false; };
+ template <class T> struct has_nothrow_assign_imp<T, false, true>{ static const bool value = noexcept(boost::declval<typename add_reference<T>::type>() = boost::declval<typename add_reference<T const>::type>()); };
+ template <class T, std::size_t N> struct has_nothrow_assign_imp<T[N], false, true>{ static const bool value = has_nothrow_assign_imp<T, false, true>::value; };
+ template <class T> struct has_nothrow_assign_imp<T[], false, true>{ static const bool value = has_nothrow_assign_imp<T, false, true>::value; };
+ }
-template <class T>
-struct has_nothrow_assign_imp{
+#endif
+
+ template <class T>
+ struct has_nothrow_assign : public integral_constant < bool,
#ifndef BOOST_HAS_NOTHROW_ASSIGN
- BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_assign<T>::value);
+#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ // Portable C++11 version:
+ detail::has_nothrow_assign_imp<T,
+ (is_const<typename remove_reference<T>::type>::value || is_volatile<typename remove_reference<T>::type>::value || is_reference<T>::value),
+ is_assignable<typename add_reference<T>::type, typename add_reference<const T>::type>::value
+ >::value
#else
- BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_ASSIGN(T));
+ ::boost::has_trivial_assign<T>::value
#endif
-};
-
-}
+#else
+ 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)
+template <class T, std::size_t N> struct has_nothrow_assign <T[N]> : public has_nothrow_assign<T> {};
+template <> struct has_nothrow_assign<void> : public false_type{};
+template <class T> struct has_nothrow_assign<T volatile> : public false_type{};
+template <class T> struct has_nothrow_assign<T&> : public false_type{};
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+template <class T> struct has_nothrow_assign<T&&> : public false_type{};
+#endif
#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)
+template <> struct has_nothrow_assign<void const> : public false_type{};
+template <> struct has_nothrow_assign<void const volatile> : public false_type{};
+template <> struct has_nothrow_assign<void volatile> : public false_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED
#ifndef BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED
-#include <boost/type_traits/has_trivial_constructor.hpp>
+#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+
+#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#if defined(BOOST_MSVC) || defined(BOOST_INTEL)
+#include <boost/type_traits/has_trivial_constructor.hpp>
+#endif
+#if defined(__GNUC__ ) || defined(__SUNPRO_CC)
+#include <boost/type_traits/is_default_constructible.hpp>
+#endif
namespace boost {
-namespace detail{
+template <class T> struct has_nothrow_constructor : public integral_constant<bool, BOOST_HAS_NOTHROW_CONSTRUCTOR(T)>{};
-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);
+#elif !defined(BOOST_NO_CXX11_NOEXCEPT)
+
+#include <boost/type_traits/is_default_constructible.hpp>
+#include <boost/type_traits/remove_all_extents.hpp>
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4197) // top-level volatile in cast is ignored
#endif
-};
+namespace boost { namespace detail{
+
+ template <class T, bool b> struct has_nothrow_constructor_imp : public boost::integral_constant<bool, false>{};
+ template <class T> struct has_nothrow_constructor_imp<T, true> : public boost::integral_constant<bool, noexcept(T())>{};
+ template <class T, std::size_t N> struct has_nothrow_constructor_imp<T[N], true> : public has_nothrow_constructor_imp<T, true> {};
}
-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)
+template <class T> struct has_nothrow_constructor : public detail::has_nothrow_constructor_imp<T, is_default_constructible<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)
+#ifdef BOOST_MSVC
+#pragma warning(pop)
#endif
-BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void,false)
+#else
+
+#include <boost/type_traits/has_trivial_constructor.hpp>
+
+namespace boost {
+
+template <class T> struct has_nothrow_constructor : public ::boost::has_trivial_constructor<T> {};
+
+#endif
+
+template<> struct has_nothrow_constructor<void> : public false_type {};
#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)
+template<> struct has_nothrow_constructor<void const> : public false_type{};
+template<> struct has_nothrow_constructor<void const volatile> : public false_type{};
+template<> struct has_nothrow_constructor<void volatile> : public false_type{};
#endif
-} // namespace boost
+template <class T> struct has_nothrow_default_constructor : public has_nothrow_constructor<T>{};
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
+} // namespace boost
#endif // BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED
#ifndef BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED
-#include <boost/type_traits/has_trivial_copy.hpp>
+#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+
+#ifdef BOOST_HAS_NOTHROW_COPY
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#if defined(BOOST_CLANG) || defined(__GNUC__) || defined(__ghs__) || defined(__CODEGEARC__) || defined(__SUNPRO_CC)
+#include <boost/type_traits/is_volatile.hpp>
+#include <boost/type_traits/is_copy_constructible.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/is_array.hpp>
+#ifdef BOOST_INTEL
+#include <boost/type_traits/is_pod.hpp>
+#endif
+#elif defined(BOOST_MSVC) || defined(BOOST_INTEL)
+#include <boost/type_traits/has_trivial_copy.hpp>
+#include <boost/type_traits/is_array.hpp>
+#ifdef BOOST_INTEL
+#include <boost/type_traits/add_lvalue_reference.hpp>
+#include <boost/type_traits/add_const.hpp>
+#endif
+#endif
namespace boost {
+template <class T> struct has_nothrow_copy_constructor : public integral_constant<bool, BOOST_HAS_NOTHROW_COPY(T)>{};
+
+#elif !defined(BOOST_NO_CXX11_NOEXCEPT)
+
+#include <boost/type_traits/declval.hpp>
+#include <boost/type_traits/is_copy_constructible.hpp>
+
+namespace boost{
+
namespace detail{
+template <class T, bool b>
+struct has_nothrow_copy_constructor_imp : public boost::integral_constant<bool, false>{};
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
-};
+struct has_nothrow_copy_constructor_imp<T, true> : public boost::integral_constant<bool, noexcept(T(boost::declval<const T&>()))>{};
}
-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)
+template <class T> struct has_nothrow_copy_constructor : public detail::has_nothrow_copy_constructor_imp<T, boost::is_copy_constructible<T>::value>{};
+
+#else
+
+#include <boost/type_traits/has_trivial_copy.hpp>
+
+namespace boost{
+
+template <class T> struct has_nothrow_copy_constructor : public integral_constant<bool, ::boost::has_trivial_copy<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)
+template <> struct has_nothrow_copy_constructor<void> : public false_type{};
+template <class T> struct has_nothrow_copy_constructor<T volatile> : public false_type{};
+template <class T> struct has_nothrow_copy_constructor<T&> : public false_type{};
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+template <class T> struct has_nothrow_copy_constructor<T&&> : public false_type{};
+#endif
#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)
+template <> struct has_nothrow_copy_constructor<void const> : public false_type{};
+template <> struct has_nothrow_copy_constructor<void volatile> : public false_type{};
+template <> struct has_nothrow_copy_constructor<void const volatile> : public false_type{};
#endif
-} // namespace boost
+template <class T> struct has_nothrow_copy : public has_nothrow_copy_constructor<T>{};
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
+} // namespace boost
#endif // BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED
#include <boost/type_traits/has_trivial_destructor.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(__SUNPRO_CC) && !defined(BOOST_MSVC)
+
+#include <boost/type_traits/declval.hpp>
+#include <boost/type_traits/is_destructible.hpp>
+
+namespace boost{
+
+ namespace detail{
+
+ template <class T, bool b>
+ struct has_nothrow_destructor_imp : public boost::integral_constant<bool, false>{};
+ template <class T>
+ struct has_nothrow_destructor_imp<T, true> : public boost::integral_constant<bool, noexcept(boost::declval<T*&>()->~T())>{};
+
+ }
+
+ template <class T> struct has_nothrow_destructor : public detail::has_nothrow_destructor_imp<T, boost::is_destructible<T>::value>{};
+ template <class T, std::size_t N> struct has_nothrow_destructor<T[N]> : public has_nothrow_destructor<T>{};
+ template <class T> struct has_nothrow_destructor<T&> : public integral_constant<bool, false>{};
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ template <class T> struct has_nothrow_destructor<T&&> : public integral_constant<bool, false>{};
+#endif
+}
+#else
namespace boost {
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_destructor,T,::boost::has_trivial_destructor<T>::value)
+template <class T> struct has_nothrow_destructor : public ::boost::has_trivial_destructor<T> {};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
+#endif
#endif // BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
+++ /dev/null
-// (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
#define BOOST_TT_TRAIT_NAME has_plus
#define BOOST_TT_TRAIT_OP +
#define BOOST_TT_FORBIDDEN_IF\
- ::boost::type_traits::ice_or<\
+ (\
/* Lhs==pointer and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value,\
+ ) || \
/* Lhs==void* and Rhs==fundamental */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
- ::boost::is_void< Lhs_noptr >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ::boost::is_void< Lhs_noptr >::value && \
::boost::is_fundamental< Rhs_nocv >::value\
- >::value,\
+ ) || \
/* Rhs==void* and Lhs==fundamental */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Rhs_noref >::value,\
- ::boost::is_void< Rhs_noptr >::value,\
+ (\
+ ::boost::is_pointer< Rhs_noref >::value && \
+ ::boost::is_void< Rhs_noptr >::value && \
::boost::is_fundamental< Lhs_nocv >::value\
- >::value,\
+ ) || \
/* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
- ::boost::is_fundamental< Rhs_nocv >::value,\
- ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
- >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ ) || \
/* Rhs==pointer and Lhs==fundamental and Lhs!=integral */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Rhs_noref >::value,\
- ::boost::is_fundamental< Lhs_nocv >::value,\
- ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value\
- >::value\
- >::value
+ (\
+ ::boost::is_pointer< Rhs_noref >::value && \
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ (! ::boost::is_integral< Lhs_noref >::value )\
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#define BOOST_TT_TRAIT_NAME has_plus_assign
#define BOOST_TT_TRAIT_OP +=
#define BOOST_TT_FORBIDDEN_IF\
- ::boost::type_traits::ice_or<\
+ (\
/* Lhs==pointer and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value,\
+ ) || \
/* Lhs==void* and Rhs==fundamental */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
- ::boost::is_void< Lhs_noptr >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ::boost::is_void< Lhs_noptr >::value && \
::boost::is_fundamental< Rhs_nocv >::value\
- >::value,\
+ ) || \
/* Rhs==void* and Lhs==fundamental */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Rhs_noref >::value,\
- ::boost::is_void< Rhs_noptr >::value,\
+ (\
+ ::boost::is_pointer< Rhs_noref >::value && \
+ ::boost::is_void< Rhs_noptr >::value && \
::boost::is_fundamental< Lhs_nocv >::value\
- >::value,\
+ ) || \
/* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
- ::boost::is_fundamental< Rhs_nocv >::value,\
- ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\
- >::value,\
+ (\
+ ::boost::is_pointer< Lhs_noref >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ ) || \
/* Rhs==pointer and Lhs==fundamental and Lhs!=bool */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Rhs_noref >::value,\
- ::boost::is_fundamental< Lhs_nocv >::value,\
- ::boost::type_traits::ice_not< ::boost::is_same< Lhs_nocv, bool >::value >::value\
- >::value,\
+ (\
+ ::boost::is_pointer< Rhs_noref >::value && \
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ (! ::boost::is_same< Lhs_nocv, bool >::value )\
+ ) || \
/* (Lhs==fundamental or Lhs==pointer) and (Rhs==fundamental or Rhs==pointer) and (Lhs==const) */\
- ::boost::type_traits::ice_and<\
- ::boost::type_traits::ice_or<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value || \
::boost::is_pointer< Lhs_noref >::value\
- >::value,\
- ::boost::type_traits::ice_or<\
- ::boost::is_fundamental< Rhs_nocv >::value,\
+ ) && \
+ ( \
+ ::boost::is_fundamental< Rhs_nocv >::value || \
::boost::is_pointer< Rhs_noref >::value\
- >::value,\
+ ) && \
::boost::is_const< Lhs_noref >::value\
- >::value\
- >::value
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.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,\
+ ::boost::is_same< bool, Lhs_nocv >::value || \
/* void* */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
+ (\
+ ::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_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>
#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,\
+ ::boost::is_same< bool, Lhs_nocv >::value || \
/* void* */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Lhs_noref >::value,\
+ (\
+ ::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_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>
#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,\
+ ::boost::is_same< bool, Rhs_nocv >::value || \
/* void* */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Rhs_noref >::value,\
+ (\
+ ::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_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>
#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,\
+ ::boost::is_same< bool, Rhs_nocv >::value || \
/* void* */\
- ::boost::type_traits::ice_and<\
- ::boost::is_pointer< Rhs_noref >::value,\
+ (\
+ ::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_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>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< Lhs_noref >::value && \
::boost::is_pointer< Rhs_noref >::value\
- >::value\
- >::value
+ )\
+ )
#include <boost/type_traits/detail/has_binary_operator.hpp>
#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,\
+ (\
+ ::boost::is_fundamental< Lhs_nocv >::value && \
+ ::boost::is_fundamental< Rhs_nocv >::value && \
+ ( \
+ (! ::boost::is_integral< Lhs_noref >::value ) || \
+ (! ::boost::is_integral< Rhs_noref >::value )\
+ )\
+ )||\
/* Lhs==fundamental and Rhs==pointer */\
- ::boost::type_traits::ice_and<\
- ::boost::is_fundamental< Lhs_nocv >::value,\
+ (\
+ ::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_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< 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_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>
#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/detail/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+
+#if !defined(BOOST_HAS_TRIVIAL_ASSIGN) || defined(BOOST_MSVC) || defined(__GNUC__) || defined(BOOST_INTEL) || defined(__SUNPRO_CC) || defined(__clang)
#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>
+#include <boost/type_traits/is_assignable.hpp>
+#endif
namespace boost {
-namespace detail {
-
-template <typename T>
-struct has_trivial_assign_impl
-{
+ template <typename T>
+ struct has_trivial_assign : public integral_constant < bool,
#ifdef BOOST_HAS_TRIVIAL_ASSIGN
- BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_ASSIGN(T));
+ 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));
+ ::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::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)
+ template<> struct has_trivial_assign<void> : public false_type{};
#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)
+ template<> struct has_trivial_assign<void const> : public false_type{};
+ template<> struct has_trivial_assign<void const volatile> : public false_type{};
+ template<> struct has_trivial_assign<void volatile> : public false_type{};
+#endif
+ template <class T> struct has_trivial_assign<T volatile> : public false_type{};
+ template <class T> struct has_trivial_assign<T&> : public false_type{};
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ template <class T> struct has_trivial_assign<T&&> : public false_type{};
#endif
+ // Arrays are not explictly assignable:
+ template <typename T, std::size_t N> struct has_trivial_assign<T[N]> : public false_type{};
+ template <typename T> struct has_trivial_assign<T[]> : public false_type{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED
#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>
+#include <boost/type_traits/is_default_constructible.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR
+#ifdef BOOST_HAS_SGI_TYPE_TRAITS
+#include <boost/type_traits/is_same.hpp>
+#elif defined(__GNUC__) || defined(__SUNPRO_CC)
+#include <boost/type_traits/is_volatile.hpp>
+#ifdef BOOST_INTEL
+#include <boost/type_traits/is_pod.hpp>
+#endif
+#endif
+#endif
-namespace boost {
-namespace detail {
+#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || defined(BOOST_CLANG) || (defined(__SUNPRO_CC) && defined(BOOST_HAS_TRIVIAL_CONSTRUCTOR))
+#include <boost/type_traits/is_default_constructible.hpp>
+#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX && is_default_constructible<T>::value
+#else
+//
+// Mot all compilers, particularly older GCC versions can handle the fix above.
+#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX
+#endif
+
+namespace boost {
-template <typename T>
-struct has_trivial_ctor_impl
-{
+template <typename T> struct has_trivial_constructor
#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));
+ : public integral_constant <bool, ((::boost::is_pod<T>::value || BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)) BOOST_TT_TRIVIAL_CONSTRUCT_FIX)>{};
#else
- BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_or<
- ::boost::is_pod<T>::value,
- false
- >::value));
+ : public integral_constant <bool, ::boost::is_pod<T>::value>{};
#endif
-};
-} // namespace detail
+template <> struct has_trivial_constructor<void> : public boost::false_type{};
+template <> struct has_trivial_constructor<void const> : public boost::false_type{};
+template <> struct has_trivial_constructor<void const volatile> : public boost::false_type{};
+template <> struct has_trivial_constructor<void volatile> : public boost::false_type{};
-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)
+template <class T> struct has_trivial_default_constructor : public has_trivial_constructor<T> {};
-} // namespace boost
+#undef BOOST_TT_TRIVIAL_CONSTRUCT_FIX
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
+} // namespace boost
#endif // BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED
#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>
+#include <boost/type_traits/is_reference.hpp>
-#ifdef __clang__
+#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || defined(BOOST_CLANG) || (defined(__SUNPRO_CC) && defined(BOOST_HAS_TRIVIAL_COPY))
#include <boost/type_traits/is_copy_constructible.hpp>
+#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX && is_copy_constructible<T>::value
+#else
+#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX
#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#ifdef BOOST_INTEL
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_lvalue_reference.hpp>
+#endif
namespace boost {
-namespace detail {
-
-template <typename T>
-struct has_trivial_copy_impl
-{
+template <typename T> struct has_trivial_copy
+: public integral_constant<bool,
#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
+ BOOST_HAS_TRIVIAL_COPY(T) BOOST_TT_TRIVIAL_CONSTRUCT_FIX
#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;
-};
-
+ ::boost::is_pod<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)
+>{};
+// Arrays are not explicitly copyable:
+template <typename T, std::size_t N> struct has_trivial_copy<T[N]> : public false_type{};
+template <typename T> struct has_trivial_copy<T[]> : public false_type{};
+// Are volatile types ever trivial? We don't really know, so assume not:
+template <typename T> struct has_trivial_copy<T volatile> : public false_type{};
+
+template <> struct has_trivial_copy<void> : public false_type{};
#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)
+template <> struct has_trivial_copy<void const> : public false_type{};
+template <> struct has_trivial_copy<void volatile> : public false_type{};
+template <> struct has_trivial_copy<void const volatile> : public false_type{};
#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)
+template <class T> struct has_trivial_copy<T&> : public false_type{};
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+template <class T> struct has_trivial_copy<T&&> : public false_type{};
#endif
-} // namespace boost
+template <class T> struct has_trivial_copy_constructor : public has_trivial_copy<T>{};
+
+#undef BOOST_TT_TRIVIAL_CONSTRUCT_FIX
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
+} // namespace boost
#endif // BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED
#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/integral_constant.hpp>
+
+#ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR
+
+#if defined(BOOST_INTEL) || defined(BOOST_MSVC)
#include <boost/type_traits/is_pod.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
+#endif
+#ifdef BOOST_HAS_SGI_TYPE_TRAITS
+#include <boost/type_traits/is_same.hpp>
+#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#if defined(__GNUC__) || defined(__clang) || defined(__SUNPRO_CC)
+#include <boost/type_traits/is_destructible.hpp>
+#endif
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));
+template <typename T> struct has_trivial_destructor : public integral_constant<bool, BOOST_HAS_TRIVIAL_DESTRUCTOR(T)>{};
#else
- BOOST_STATIC_CONSTANT(bool, value = ::boost::is_pod<T>::value);
-#endif
-};
+#include <boost/type_traits/is_pod.hpp>
-} // namespace detail
+namespace boost{
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_destructor,T,::boost::detail::has_trivial_dtor_impl<T>::value)
+template <typename T> struct has_trivial_destructor : public integral_constant<bool, ::boost::is_pod<T>::value>{};
+#endif
-BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void,false)
+template <> struct has_trivial_destructor<void> : public false_type{};
#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)
+template <> struct has_trivial_destructor<void const> : public false_type{};
+template <> struct has_trivial_destructor<void const volatile> : public false_type{};
+template <> struct has_trivial_destructor<void volatile> : public false_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED
#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/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+
+#if !defined(BOOST_HAS_TRIVIAL_MOVE_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL)
#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>
+#ifdef BOOST_MSVC
+#include <boost/type_traits/is_reference.hpp>
+#endif
+#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#if defined(__GNUC__) || defined(__clang)
+#include <boost/type_traits/is_assignable.hpp>
+#include <boost/type_traits/is_volatile.hpp>
+#endif
-namespace boost {
+#ifdef __SUNPRO_CC
+#include <boost/type_traits/is_assignable.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#if __cplusplus >= 201103
+#define SOLARIS_EXTRA_CHECK && is_assignable<typename remove_const<T>::type&, typename remove_const<T>::type&&>::value
+#endif
+#endif
+
+#ifndef SOLARIS_EXTRA_CHECK
+#define SOLARIS_EXTRA_CHECK
+#endif
-namespace detail {
+namespace boost{
template <typename T>
-struct has_trivial_move_assign_impl
-{
+struct has_trivial_move_assign : public integral_constant<bool,
#ifdef BOOST_HAS_TRIVIAL_MOVE_ASSIGN
- BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)));
+ 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));
+ ::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::value SOLARIS_EXTRA_CHECK
#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)
+template <> struct has_trivial_move_assign<void> : public false_type{};
#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)
+template <> struct has_trivial_move_assign<void const> : public false_type{};
+template <> struct has_trivial_move_assign<void const volatile> : public false_type{};
+template <> struct has_trivial_move_assign<void volatile> : public false_type{};
+#endif
+template <class T> struct has_trivial_move_assign<T&> : public false_type{};
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+template <class T> struct has_trivial_move_assign<T&&> : public false_type{};
#endif
+// Array types are not assignable:
+template <class T, std::size_t N> struct has_trivial_move_assign<T[N]> : public false_type{};
+template <class T> struct has_trivial_move_assign<T[]> : public false_type{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
+#undef SOLARIS_EXTRA_CHECK
#endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
#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/integral_constant.hpp>
+
+#ifdef BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR
+
+#if defined(BOOST_MSVC) || defined(BOOST_INTEL)
#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>
+#endif
+
+#if defined(__GNUC__) || defined(__clang)
+#include <boost/type_traits/is_constructible.hpp>
+#include <boost/type_traits/is_volatile.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_move_constructor : public integral_constant<bool, BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)>{};
-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));
+
+#ifdef __SUNPRO_CC
+#include <boost/type_traits/is_constructible.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#if __cplusplus >= 201103
+#define SOLARIS_EXTRA_CHECK && is_constructible<typename remove_const<T>::type, typename remove_const<T>::type&&>::value
+#endif
#endif
-};
-} // namespace detail
+#ifndef SOLARIS_EXTRA_CHECK
+#define SOLARIS_EXTRA_CHECK
+#endif
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_constructor,T,::boost::detail::has_trivial_move_ctor_impl<T>::value)
+#include <boost/type_traits/is_pod.hpp>
+#include <boost/type_traits/is_volatile.hpp>
+
+namespace boost {
+
+template <typename T> struct has_trivial_move_constructor
+ : public integral_constant<bool, ::boost::is_pod<T>::value && !::boost::is_volatile<T>::value SOLARIS_EXTRA_CHECK>{};
-BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void,false)
+#undef SOLARIS_EXTRA_CHECK
+
+#endif
+
+template <> struct has_trivial_move_constructor<void> : public false_type{};
#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)
+template <> struct has_trivial_move_constructor<void const> : public false_type{};
+template <> struct has_trivial_move_constructor<void volatile> : public false_type{};
+template <> struct has_trivial_move_constructor<void const volatile> : public false_type{};
#endif
+// What should we do with reference types??? The standard seems to suggest these are trivial, even if the thing they reference is not:
+template <class T> struct has_trivial_move_constructor<T&> : public true_type{};
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+template <class T> struct has_trivial_move_constructor<T&&> : public true_type{};
+#endif
+// Arrays can not be explicitly copied:
+template <class T, std::size_t N> struct has_trivial_move_constructor<T[N]> : public false_type{};
+template <class T> struct has_trivial_move_constructor<T[]> : public false_type{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_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>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
#ifdef BOOST_HAS_VIRTUAL_DESTRUCTOR
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,BOOST_HAS_VIRTUAL_DESTRUCTOR(T))
+ template <class T> struct has_virtual_destructor : public integral_constant<bool, BOOST_HAS_VIRTUAL_DESTRUCTOR(T)>{};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,false)
+ template <class T> struct has_virtual_destructor : public integral_constant<bool, false>{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
+++ /dev/null
-
-// (C) Copyright John Maddock and Steve Cleary 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.
-//
-// macros and helpers for working with integral-constant-expressions.
-
-#ifndef BOOST_TT_ICE_HPP_INCLUDED
-#define BOOST_TT_ICE_HPP_INCLUDED
-
-#include <boost/type_traits/detail/yes_no_type.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
-#include <boost/type_traits/detail/ice_and.hpp>
-#include <boost/type_traits/detail/ice_not.hpp>
-#include <boost/type_traits/detail/ice_eq.hpp>
-
-#endif // BOOST_TT_ICE_HPP_INCLUDED
-// (C) Copyright John Maddock 2005.
+// (C) Copyright John Maddock 2015.
// 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)
#define BOOST_TYPE_TRAITS_INTEGRAL_CONSTANT_HPP
#include <boost/config.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/integral_c.hpp>
+#include <boost/detail/workaround.hpp>
+
+#if (BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
+ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) \
+ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
+ || BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, BOOST_TESTED_AT(810)) )
+
namespace boost{
+ namespace mpl
+ {
+ template <bool B> struct bool_;
+ template <class I, I val> struct integral_c;
+ struct integral_c_tag;
+ }
+}
-#if defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) || defined(__BORLANDC__)
-template <class T, int val>
#else
-template <class T, T val>
-#endif
-struct integral_constant : public mpl::integral_c<T, val>
-{
- typedef integral_constant<T,val> type;
-};
-template<> struct integral_constant<bool,true> : public mpl::true_
-{
- typedef integral_constant<bool,true> type;
-};
-template<> struct integral_constant<bool,false> : public mpl::false_
+namespace mpl_{
+
+ template <bool B> struct bool_;
+ template <class I, I val> struct integral_c;
+ struct integral_c_tag;
+}
+
+namespace boost
{
- typedef integral_constant<bool,false> type;
-};
+ namespace mpl
+ {
+ using ::mpl_::bool_;
+ using ::mpl_::integral_c;
+ using ::mpl_::integral_c_tag;
+ }
+}
+
+#endif
+
+namespace boost{
+
+ template <class T, T val>
+ struct integral_constant
+ {
+ typedef mpl::integral_c_tag tag;
+ typedef T value_type;
+ typedef integral_constant<T, val> type;
+ static const T value = val;
+ //
+ // This helper function is just to disable type-punning
+ // warnings from GCC:
+ //
+ template <class U>
+ static U& dereference(U* p) { return *p; }
+
+ operator const mpl::integral_c<T, val>& ()const
+ {
+ static const char data[sizeof(long)] = { 0 };
+ return dereference(reinterpret_cast<const mpl::integral_c<T, val>*>(&data));
+ }
+ BOOST_CONSTEXPR operator T()const { return val; }
+ };
+
+ template <class T, T val>
+ T const integral_constant<T, val>::value;
+
+ template <bool val>
+ struct integral_constant<bool, val>
+ {
+ typedef mpl::integral_c_tag tag;
+ typedef bool value_type;
+ typedef integral_constant<bool, val> type;
+ static const bool value = val;
+ //
+ // This helper function is just to disable type-punning
+ // warnings from GCC:
+ //
+ template <class T>
+ static T& dereference(T* p) { return *p; }
+
+ operator const mpl::bool_<val>& ()const
+ {
+ static const char data = 0;
+ return dereference(reinterpret_cast<const mpl::bool_<val>*>(&data));
+ }
+ BOOST_CONSTEXPR operator bool()const { return val; }
+ };
+
+ template <bool val>
+ bool const integral_constant<bool, val>::value;
-typedef integral_constant<bool,true> true_type;
-typedef integral_constant<bool,false> false_type;
+ typedef integral_constant<bool, true> true_type;
+ typedef integral_constant<bool, false> false_type;
}
#define FILE_boost_type_traits_integral_promotion_hpp_INCLUDED
#include <boost/config.hpp>
-
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/identity.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/remove_cv.hpp>
-// Should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
namespace type_traits { namespace detail {
>::type type;
};
-template<class T>
-struct integral_promotion
- : public boost::mpl::eval_if<
- need_promotion<BOOST_DEDUCED_TYPENAME remove_cv<T>::type>
- , integral_promotion_impl<T>
- , boost::mpl::identity<T>
- >
-{
-};
+template<class T, bool b> struct integral_promotion { typedef T type; };
+template<class T> struct integral_promotion<T, true> : public integral_promotion_impl<T>{};
} }
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(
- integral_promotion
- , T
- , BOOST_DEDUCED_TYPENAME
- boost::type_traits::detail::integral_promotion<T>::type
- )
-}
+template <class T> struct integral_promotion
+{
+private:
+ typedef boost::type_traits::detail::need_promotion<typename remove_cv<T>::type> tag_type;
+public:
+ typedef typename boost::type_traits::detail::integral_promotion<T, tag_type::value>::type type;
+};
-#include <boost/type_traits/detail/type_trait_undef.hpp>
+}
#endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED
#ifndef BOOST_TT_INTRINSICS_HPP_INCLUDED
#define BOOST_TT_INTRINSICS_HPP_INCLUDED
+#ifndef BOOST_TT_DISABLE_INTRINSICS
+
+#include <boost/config.hpp>
+
#ifndef BOOST_TT_CONFIG_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#endif
//
// BOOST_IS_ENUM(T) true is T is an enum
// BOOST_IS_POLYMORPHIC(T) true if T is a polymorphic type
// BOOST_ALIGNMENT_OF(T) should evaluate to the alignment requirements of type T.
+//
+// define BOOST_TT_DISABLE_INTRINSICS to prevent any intrinsics being used (mostly used when testing)
+//
#ifdef BOOST_HAS_SGI_TYPE_TRAITS
// Hook into SGI's __type_traits class, this will pick up user supplied
#if (defined(BOOST_MSVC) && defined(BOOST_MSVC_FULL_VER) && (BOOST_MSVC_FULL_VER >=140050215))\
|| (defined(BOOST_INTEL) && defined(_MSC_VER) && (_MSC_VER >= 1500))
-# include <boost/type_traits/is_same.hpp>
-# include <boost/type_traits/is_function.hpp>
-
+//
+// Note that even though these intrinsics rely on other type traits classes
+// we do not #include those here as it produces cyclic dependencies and
+// can cause the intrinsics to not even be used at all!
+//
# define BOOST_IS_UNION(T) __is_union(T)
# define BOOST_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(T))
# define BOOST_IS_EMPTY(T) __is_empty(T)
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
-# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T)|| ( ::boost::is_pod<T>::value && !::boost::is_volatile<T>::value))
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ( ::boost::is_pod<T>::value && ! ::boost::is_const<T>::value && !::boost::is_volatile<T>::value))
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::is_pod<T>::value)
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::has_trivial_constructor<T>::value)
-# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) || ::boost::has_trivial_copy<T>::value)
+#if !defined(BOOST_INTEL)
+# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) || ::boost::has_trivial_copy<T>::value) && !is_array<T>::value)
+# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) || ::boost::is_pod<T>::value)
+#elif (_MSC_VER >= 1900)
+# define BOOST_HAS_NOTHROW_COPY(T) ((__is_nothrow_constructible(T, typename add_lvalue_reference<typename add_const<T>::type>::type)) && !is_array<T>::value)
+# define BOOST_HAS_TRIVIAL_COPY(T) (__is_trivially_constructible(T, typename add_lvalue_reference<typename add_const<T>::type>::type))
+#endif
# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::has_trivial_assign<T>::value)
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
# define BOOST_IS_CLASS(T) __is_class(T)
# define BOOST_IS_CONVERTIBLE(T,U) ((__is_convertible_to(T,U) || (is_same<T,U>::value && !is_function<U>::value)) && !__is_abstract(U))
# define BOOST_IS_ENUM(T) __is_enum(T)
-// This one doesn't quite always do the right thing:
-// # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
// This one fails if the default alignment has been changed with /Zp:
// # define BOOST_ALIGNMENT_OF(T) __alignof(T)
# if defined(_MSC_VER) && (_MSC_VER >= 1700)
-# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) ((__has_trivial_move_constructor(T) || __is_pod(T)) && !::boost::is_volatile<T>::value && !::boost::is_reference<T>::value)
-# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) ((__has_trivial_move_assign(T) || __is_pod(T)) && ! ::boost::is_const<T>::value && !::boost::is_volatile<T>::value && !::boost::is_reference<T>::value)
+# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) ((__has_trivial_move_constructor(T) || boost::is_pod<T>::value) && ! ::boost::is_volatile<T>::value && ! ::boost::is_reference<T>::value)
+# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) ((__has_trivial_move_assign(T) || boost::is_pod<T>::value) && ! ::boost::is_const<T>::value && !::boost::is_volatile<T>::value && ! ::boost::is_reference<T>::value)
# endif
+#ifndef BOOST_NO_CXX11_FINAL
+// This one doesn't quite always do the right thing on older VC++ versions
+// we really need it when the final keyword is supporyted though:
+# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
+#endif
#if _MSC_FULL_VER >= 180020827
# define BOOST_IS_NOTHROW_MOVE_ASSIGN(T) (__is_nothrow_assignable(T&, T&&))
# define BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T) (__is_nothrow_constructible(T, T&&))
// This is a rubbish fix as it basically stops type traits from working correctly,
// but maybe the best we can do for now. See https://svn.boost.org/trac/boost/ticket/10694
//
+//
+// Note that even though these intrinsics rely on other type traits classes
+// we do not #include those here as it produces cyclic dependencies and
+// can cause the intrinsics to not even be used at all!
+//
# include <cstddef>
-# include <boost/type_traits/is_same.hpp>
-# include <boost/type_traits/is_reference.hpp>
-# include <boost/type_traits/is_volatile.hpp>
# if __has_feature(is_union)
# define BOOST_IS_UNION(T) __is_union(T)
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
# endif
# if __has_feature(has_trivial_copy)
-# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value && !is_volatile<T>::value)
+# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
# endif
# if __has_feature(has_trivial_assign)
-# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
+# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
# endif
# if __has_feature(has_trivial_destructor)
-# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
+# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) && is_destructible<T>::value)
# endif
# if __has_feature(has_nothrow_constructor)
-# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
+# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value)
# endif
# if __has_feature(has_nothrow_copy)
-# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
+# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
# endif
# if __has_feature(has_nothrow_assign)
-# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
+# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
# endif
# if __has_feature(has_virtual_destructor)
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
# endif
# if __has_feature(has_trivial_move_constructor)
-# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) __has_trivial_move_constructor(T)
+# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__has_trivial_move_constructor(T) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
# endif
# if __has_feature(has_trivial_move_assign)
-# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) __has_trivial_move_assign(T)
+# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__has_trivial_move_assign(T) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
+# endif
+# if (!defined(unix) && !defined(__unix__)) || defined(__LP64__) || !defined(__GNUC__)
+// GCC sometimes lies about alignment requirements
+// of type double on 32-bit unix platforms, use the
+// old implementation instead in that case:
+# define BOOST_ALIGNMENT_OF(T) __alignof(T)
# endif
-# define BOOST_ALIGNMENT_OF(T) __alignof(T)
# if __has_feature(is_final)
# define BOOST_IS_FINAL(T) __is_final(T)
# endif
#endif
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) && !defined(BOOST_CLANG)
-# include <boost/type_traits/is_same.hpp>
-# include <boost/type_traits/is_reference.hpp>
-# include <boost/type_traits/is_volatile.hpp>
+//
+// Note that even though these intrinsics rely on other type traits classes
+// we do not #include those here as it produces cyclic dependencies and
+// can cause the intrinsics to not even be used at all!
+//
#ifdef BOOST_INTEL
# define BOOST_INTEL_TT_OPTS || is_pod<T>::value
# define BOOST_IS_POD(T) __is_pod(T)
# define BOOST_IS_EMPTY(T) __is_empty(T)
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ((__has_trivial_constructor(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value)
-# define BOOST_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_INTEL_TT_OPTS) && !is_reference<T>::value && ! ::boost::is_volatile<T>::value)
+# define BOOST_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_INTEL_TT_OPTS) && !is_reference<T>::value)
+#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409
+# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value && is_assignable<T&, const T&>::value)
+# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS && is_destructible<T>::value)
+# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value BOOST_INTEL_TT_OPTS)
+# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
+# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_const<T>::value && is_assignable<T&, const T&>::value)
+#else
# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value)
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS)
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) BOOST_INTEL_TT_OPTS)
-# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_reference<T>::value)
-# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_const<T>::value)
+# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_reference<T>::value && !is_array<T>::value)
+# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_const<T>::value && !is_array<T>::value)
+#endif
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
# define BOOST_IS_FINAL(T) __is_final(T)
# endif
+# if (__GNUC__ >= 5) && (__cplusplus >= 201103)
+# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_trivially_assignable(T&, T&&) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
+# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__is_trivially_constructible(T, T&&) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
+# endif
+
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
#endif
#if defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)
-# include <boost/type_traits/is_same.hpp>
-# include <boost/type_traits/is_reference.hpp>
-# include <boost/type_traits/is_volatile.hpp>
-
# define BOOST_IS_UNION(T) __oracle_is_union(T)
-# define BOOST_IS_POD(T) __oracle_is_pod(T)
+# define BOOST_IS_POD(T) (__oracle_is_pod(T) && !is_function<T>::value)
# define BOOST_IS_EMPTY(T) __oracle_is_empty(T)
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__oracle_has_trivial_constructor(T) && ! ::boost::is_volatile<T>::value)
-# define BOOST_HAS_TRIVIAL_COPY(T) (__oracle_has_trivial_copy(T) && !is_reference<T>::value && ! ::boost::is_volatile<T>::value)
-# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value)
-# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __oracle_has_trivial_destructor(T)
-# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__oracle_has_nothrow_constructor(T) || __oracle_has_trivial_constructor(T) || __oracle_is_trivial(T))
-# define BOOST_HAS_NOTHROW_COPY(T) ((__oracle_has_nothrow_copy(T) || __oracle_has_trivial_copy(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_reference<T>::value)
-# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__oracle_has_nothrow_assign(T) || __oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_const<T>::value)
+# define BOOST_HAS_TRIVIAL_COPY(T) (__oracle_has_trivial_copy(T) && !is_reference<T>::value)
+# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value && is_assignable<T&, const T&>::value)
+# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__oracle_has_trivial_destructor(T) && is_destructible<T>::value)
+# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) ((__oracle_has_nothrow_constructor(T) || __oracle_has_trivial_constructor(T) || __oracle_is_trivial(T)) && is_default_constructible<T>::value)
+// __oracle_has_nothrow_copy appears to behave the same as __oracle_has_nothrow_assign, disabled for now:
+//# define BOOST_HAS_NOTHROW_COPY(T) ((__oracle_has_nothrow_copy(T) || __oracle_has_trivial_copy(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
+# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__oracle_has_nothrow_assign(T) || __oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_const<T>::value && is_assignable<T&, const T&>::value)
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __oracle_has_virtual_destructor(T)
# define BOOST_IS_ABSTRACT(T) __oracle_is_abstract(T)
# define BOOST_IS_POD(T) __is_pod(T)
# define BOOST_IS_EMPTY(T) __is_empty(T)
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
-# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value && !is_volatile<T>::value)
+# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
# define BOOST_IS_POD(T) __is_pod(T)
# define BOOST_IS_EMPTY(T) __is_empty(T)
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T))
-# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value)
+# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_reference<T>::value)
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T))
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T))
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
#endif
-#endif // BOOST_TT_INTRINSICS_HPP_INCLUDED
-
-
-
-
-
+#endif // BOOST_TT_DISABLE_INTRINSICS
+#endif // BOOST_TT_INTRINSICS_HPP_INCLUDED
//
#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#ifndef BOOST_IS_ABSTRACT
#include <boost/static_assert.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/detail/ice_and.hpp>
#ifdef BOOST_NO_IS_ABSTRACT
#include <boost/type_traits/is_polymorphic.hpp>
#endif
#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
-
namespace boost {
+
namespace detail{
#ifdef BOOST_IS_ABSTRACT
}
#ifndef BOOST_NO_IS_ABSTRACT
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_abstract,T,::boost::detail::is_abstract_imp<T>::value)
+template <class T> struct is_abstract : public integral_constant<bool, ::boost::detail::is_abstract_imp<T>::value> {};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_abstract,T,::boost::detail::is_polymorphic_imp<T>::value)
+template <class T> struct is_abstract : public integral_constant<bool, ::boost::detail::is_polymorphic_imp<T>::value> {};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif //BOOST_TT_IS_ABSTRACT_CLASS_HPP
#ifndef BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED
#define BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED
-#if !defined( __CODEGEARC__ )
#include <boost/type_traits/is_integral.hpp>
-#include <boost/type_traits/is_float.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
-#include <boost/config.hpp>
-#endif
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/is_floating_point.hpp>
namespace boost {
-#if !defined(__CODEGEARC__)
-namespace detail {
-
-template< typename T >
-struct is_arithmetic_impl
-{
- BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_or<
- ::boost::is_integral<T>::value,
- ::boost::is_float<T>::value
- >::value));
-};
-
-} // namespace detail
-#endif
-
-//* is a type T an arithmetic type described in the standard (3.9.1p8)
-#if defined(__CODEGEARC__)
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,__is_arithmetic(T))
-#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,::boost::detail::is_arithmetic_impl<T>::value)
-#endif
+template <class T>
+struct is_arithmetic : public integral_constant<bool, is_integral<T>::value || is_floating_point<T>::value> {};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED
#ifndef BOOST_TT_IS_ARRAY_HPP_INCLUDED
#define BOOST_TT_IS_ARRAY_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
-
-
+#include <boost/type_traits/integral_constant.hpp>
#include <cstddef>
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
-
namespace boost {
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,__is_array(T))
+ template <class T> struct is_array : public integral_constant<bool, __is_array(T)> {};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,false)
+ template <class T> struct is_array : public false_type {};
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T[N],true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const[N],true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T volatile[N],true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const volatile[N],true)
+ template <class T, std::size_t N> struct is_array<T[N]> : public true_type {};
+ template <class T, std::size_t N> struct is_array<T const[N]> : public true_type{};
+ template <class T, std::size_t N> struct is_array<T volatile[N]> : public true_type{};
+ template <class T, std::size_t N> struct is_array<T const volatile[N]> : public true_type{};
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T[],true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const[],true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T volatile[],true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const volatile[],true)
+ template <class T> struct is_array<T[]> : public true_type{};
+ template <class T> struct is_array<T const[]> : public true_type{};
+ template <class T> struct is_array<T const volatile[]> : public true_type{};
+ template <class T> struct is_array<T volatile[]> : public true_type{};
#endif
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_ARRAY_HPP_INCLUDED
--- /dev/null
+
+// (C) Copyright John Maddock 2015.
+// 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_ASSIGNABLE_HPP_INCLUDED
+#define BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/detail/workaround.hpp>
+
+namespace boost{
+
+ template <class T, class U = T> struct is_assignable;
+
+}
+
+#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
+
+#include <boost/type_traits/detail/yes_no_type.hpp>
+#include <boost/type_traits/declval.hpp>
+
+namespace boost{
+
+ namespace detail{
+
+ struct is_assignable_imp
+ {
+ template<typename T, typename U, typename = decltype(boost::declval<T>() = boost::declval<U>())>
+ static boost::type_traits::yes_type test(int);
+
+ template<typename, typename>
+ static boost::type_traits::no_type test(...);
+ };
+
+ }
+
+ template <class T, class U> struct is_assignable : public integral_constant<bool, sizeof(detail::is_assignable_imp::test<T, U>(0)) == sizeof(boost::type_traits::yes_type)>{};
+ template <class T, std::size_t N, class U> struct is_assignable<T[N], U> : public is_assignable<T, U>{};
+ template <class T, std::size_t N, class U> struct is_assignable<T(&)[N], U> : public is_assignable<T&, U>{};
+ template <class T, class U> struct is_assignable<T[], U> : public is_assignable<T, U>{};
+ template <class T, class U> struct is_assignable<T(&)[], U> : public is_assignable<T&, U>{};
+ template <class U> struct is_assignable<void, U> : public integral_constant<bool, false>{};
+ template <class U> struct is_assignable<void const, U> : public integral_constant<bool, false>{};
+ template <class U> struct is_assignable<void volatile, U> : public integral_constant<bool, false>{};
+ template <class U> struct is_assignable<void const volatile, U> : public integral_constant<bool, false>{};
+
+#else
+
+#include <boost/type_traits/has_trivial_assign.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+
+namespace boost{
+
+ // We don't know how to implement this:
+ template <class T, class U> struct is_assignable : public integral_constant<bool, false>{};
+ template <class T, class U> struct is_assignable<T&, U> : public integral_constant<bool, is_pod<T>::value && is_pod<typename remove_reference<U>::type>::value>{};
+ template <class T, class U> struct is_assignable<const T&, U> : public integral_constant<bool, false>{};
+ template <class U> struct is_assignable<void, U> : public integral_constant<bool, false>{};
+ template <class U> struct is_assignable<void const, U> : public integral_constant<bool, false>{};
+ template <class U> struct is_assignable<void volatile, U> : public integral_constant<bool, false>{};
+ template <class U> struct is_assignable<void const volatile, U> : public integral_constant<bool, false>{};
+ /*
+ template <> struct is_assignable<void, void> : public integral_constant<bool, false>{};
+ template <> struct is_assignable<void const, void const> : public integral_constant<bool, false>{};
+ template <> struct is_assignable<void volatile, void volatile> : public integral_constant<bool, false>{};
+ template <> struct is_assignable<void const volatile, void const volatile> : public integral_constant<bool, false>{};
+ */
+#endif
+
+} // namespace boost
+
+#endif // BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED
#define BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED
#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#ifndef BOOST_IS_BASE_OF
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_convertible.hpp>
-#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#endif
#include <boost/type_traits/remove_cv.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/is_same.hpp>
namespace boost {
#endif
} // namespace detail
-BOOST_TT_AUX_BOOL_TRAIT_DEF2(
- is_base_and_derived
- , Base
- , Derived
- , (::boost::detail::is_base_and_derived_impl<Base,Derived>::value)
- )
+template <class Base, class Derived> struct is_base_and_derived
+ : public integral_constant<bool, (::boost::detail::is_base_and_derived_impl<Base, Derived>::value)> {};
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base&,Derived,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base,Derived&,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base&,Derived&,false)
+template <class Base, class Derived> struct is_base_and_derived<Base&, Derived> : public false_type{};
+template <class Base, class Derived> struct is_base_and_derived<Base, Derived&> : public false_type{};
+template <class Base, class Derived> struct is_base_and_derived<Base&, Derived&> : public false_type{};
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename Base,is_base_and_derived,Base,Base,false)
+template <class Base> struct is_base_and_derived<Base, Base> : public true_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_BASE_AND_DERIVED_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>
-#include <boost/type_traits/detail/ice_and.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
{
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::type_traits::ice_and< ::boost::is_same<ncvB,ncvD>::value, ::boost::is_class<ncvB>::value>::value)>::value));
+ BOOST_STATIC_CONSTANT(bool, value = (
+ (::boost::detail::is_base_and_derived_impl<ncvB,ncvD>::value) ||
+ (::boost::is_same<ncvB,ncvD>::value && ::boost::is_class<ncvB>::value)));
};
}
-BOOST_TT_AUX_BOOL_TRAIT_DEF2(
- is_base_of
- , Base
- , Derived
- , (::boost::detail::is_base_of_imp<Base, Derived>::value))
+ template <class Base, class Derived> struct is_base_of
+ : public integral_constant<bool, (::boost::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)
+ template <class Base, class Derived> struct is_base_of<Base, Derived&> : false_type{};
+ template <class Base, class Derived> struct is_base_of<Base&, Derived&> : false_type{};
+ template <class Base, class Derived> struct is_base_of<Base&, Derived> : false_type{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED
#ifndef BOOST_TT_IS_CLASS_HPP_INCLUDED
#define BOOST_TT_IS_CLASS_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#ifndef BOOST_IS_CLASS
# include <boost/type_traits/is_union.hpp>
-# include <boost/type_traits/detail/ice_and.hpp>
-# include <boost/type_traits/detail/ice_not.hpp>
#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
# include <boost/type_traits/detail/yes_no_type.hpp>
#endif // BOOST_IS_CLASS
-#ifdef __EDG_VERSION__
-# include <boost/type_traits/remove_cv.hpp>
-#endif
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
-
namespace boost {
namespace detail {
{
BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_and<
- sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type),
- ::boost::type_traits::ice_not< ::boost::is_union<T>::value >::value
- >::value)
+ sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type)
+ && ! ::boost::is_union<T>::value
);
};
template <class U> static ::boost::type_traits::no_type is_class_tester(...);
BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_and<
- sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type),
- ::boost::type_traits::ice_not< ::boost::is_union<T>::value >::value
- >::value)
+ sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type)
+ && ! ::boost::is_union<T>::value
);
};
struct is_class_impl
{
BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_and<
- ::boost::type_traits::ice_not< ::boost::is_union<T>::value >::value,
- ::boost::type_traits::ice_not< ::boost::is_scalar<T>::value >::value,
- ::boost::type_traits::ice_not< ::boost::is_array<T>::value >::value,
- ::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));
+ ! ::boost::is_union<T>::value >::value
+ && ! ::boost::is_scalar<T>::value
+ && ! ::boost::is_array<T>::value
+ && ! ::boost::is_reference<T>::value
+ && ! ::boost::is_void<T>::value
+ && ! ::boost::is_function<T>::value
+ );
};
# endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
} // namespace detail
+template <class T> struct is_class : public integral_constant<bool, ::boost::detail::is_class_impl<T>::value> {};
# ifdef __EDG_VERSION__
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(
- is_class,T, boost::detail::is_class_impl<typename boost::remove_cv<T>::type>::value)
-# else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_class,T,::boost::detail::is_class_impl<T>::value)
+template <class T> struct is_class<const T> : public is_class<T>{};
+template <class T> struct is_class<const volatile T> : public is_class<T>{};
+template <class T> struct is_class<volatile T> : public is_class<T>{};
# endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_CLASS_HPP_INCLUDED
#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>
-
+#include <boost/type_traits/integral_constant.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))
+ template <class T> struct is_complex : public false_type {};
+ template <class T> struct is_complex<const T > : public is_complex<T>{};
+ template <class T> struct is_complex<volatile const T > : public is_complex<T>{};
+ template <class T> struct is_complex<volatile T > : public is_complex<T>{};
+ template <class T> struct is_complex<std::complex<T> > : public true_type{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif //BOOST_TT_IS_COMPLEX_HPP
#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))
+ template <class T> struct is_compound : public integral_constant<bool, __is_compound(T)> {};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,::boost::detail::is_compound_impl<T>::value)
+ template <class T> struct is_compound : public integral_constant<bool, ! ::boost::is_fundamental<T>::value> {};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_COMPOUND_HPP_INCLUDED
#ifndef BOOST_TT_IS_CONST_HPP_INCLUDED
#define BOOST_TT_IS_CONST_HPP_INCLUDED
-#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-
-# include <boost/type_traits/detail/cv_traits_impl.hpp>
-# ifdef __GNUC__
-# include <boost/type_traits/is_reference.hpp>
-# endif
-# if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
-# include <boost/type_traits/remove_bounds.hpp>
-# endif
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,__is_const(T))
+ template <class T>
+ struct is_const : public integral_constant<bool, __is_const(T)> {};
#else
-namespace detail{
-//
-// We can't filter out rvalue_references at the same level as
-// references or we get ambiguities from msvc:
-//
-template <class T>
-struct is_const_rvalue_filter
-{
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
- BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_const);
-#else
- BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(T)>::is_const);
-#endif
-};
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-template <class T>
-struct is_const_rvalue_filter<T&&>
-{
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-#endif
-}
-
-//* is a type T declared const - is_const<T>
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::is_const_rvalue_filter<T>::value)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T&,false)
-
-#if defined(BOOST_ILLEGAL_CV_REFERENCES)
-// these are illegal specialisations; cv-qualifies applied to
-// references have no effect according to [8.3.2p1],
-// C++ Builder requires them though as it treats cv-qualified
-// references as distinct types...
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& const,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& volatile,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& const volatile,false)
-#endif
+ template <class T>
+ struct is_const : public false_type {};
+ template <class T> struct is_const<T const> : public true_type{};
+ template <class T, size_t N> struct is_const<T const[N]> : public true_type{};
+ template <class T> struct is_const<T const[]> : public true_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_CONST_HPP_INCLUDED
--- /dev/null
+
+// (C) Copyright John Maddock 2015.
+// 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_CONSTRUCTIBLE_HPP_INCLUDED
+#define BOOST_TT_IS_CONSTRUCTIBLE_HPP_INCLUDED
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/detail/workaround.hpp>
+
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500)
+
+#include <boost/type_traits/is_destructible.hpp>
+#include <boost/type_traits/is_default_constructible.hpp>
+#include <boost/type_traits/detail/yes_no_type.hpp>
+#include <boost/type_traits/declval.hpp>
+
+namespace boost{
+
+ namespace detail{
+
+ struct is_constructible_imp
+ {
+ template<typename T, typename ...TheArgs, typename = decltype(T(boost::declval<TheArgs>()...))>
+ static boost::type_traits::yes_type test(int);
+ template<typename, typename...>
+ static boost::type_traits::no_type test(...);
+
+ template<typename T, typename Arg, typename = decltype(::new T(boost::declval<Arg>()))>
+ static boost::type_traits::yes_type test1(int);
+ template<typename, typename>
+ static boost::type_traits::no_type test1(...);
+
+ template <typename T>
+ static boost::type_traits::yes_type ref_test(T);
+ template <typename T>
+ static boost::type_traits::no_type ref_test(...);
+ };
+
+ }
+
+ template <class T, class ...Args> struct is_constructible : public integral_constant<bool, sizeof(detail::is_constructible_imp::test<T, Args...>(0)) == sizeof(boost::type_traits::yes_type)>{};
+ template <class T, class Arg> struct is_constructible<T, Arg> : public integral_constant<bool, is_destructible<T>::value && sizeof(detail::is_constructible_imp::test1<T, Arg>(0)) == sizeof(boost::type_traits::yes_type)>{};
+ template <class Ref, class Arg> struct is_constructible<Ref&, Arg> : public integral_constant<bool, sizeof(detail::is_constructible_imp::ref_test<Ref&>(boost::declval<Arg>())) == sizeof(boost::type_traits::yes_type)>{};
+ template <class Ref, class Arg> struct is_constructible<Ref&&, Arg> : public integral_constant<bool, sizeof(detail::is_constructible_imp::ref_test<Ref&&>(boost::declval<Arg>())) == sizeof(boost::type_traits::yes_type)>{};
+
+ template <> struct is_constructible<void> : public false_type{};
+ template <> struct is_constructible<void const> : public false_type{};
+ template <> struct is_constructible<void const volatile> : public false_type{};
+ template <> struct is_constructible<void volatile> : public false_type{};
+
+ template <class T> struct is_constructible<T> : public is_default_constructible<T>{};
+
+#else
+
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_default_constructible.hpp>
+
+namespace boost{
+
+ // We don't know how to implement this:
+ template <class T, class U = void> struct is_constructible : public is_convertible<U, T>{};
+ template <class T> struct is_constructible<T, void> : public is_default_constructible<T>{};
+ template <> struct is_constructible<void, void> : public false_type{};
+ template <> struct is_constructible<void const, void> : public false_type{};
+ template <> struct is_constructible<void const volatile, void> : public false_type{};
+ template <> struct is_constructible<void volatile, void> : public false_type{};
+ template <class Ref> struct is_constructible<Ref&, void> : public false_type{};
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ template <class Ref> struct is_constructible<Ref&&, void> : public false_type{};
+#endif
+#endif
+
+} // namespace boost
+
+#endif // BOOST_TT_IS_CONSTRUCTIBLE_HPP_INCLUDED
#define BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED
#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#ifndef BOOST_IS_CONVERTIBLE
#include <boost/type_traits/detail/yes_no_type.hpp>
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#include <boost/type_traits/is_array.hpp>
-#include <boost/type_traits/ice.hpp>
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/type_traits/is_void.hpp>
-#ifndef BOOST_NO_IS_ABSTRACT
+#if !defined(BOOST_NO_IS_ABSTRACT)
#include <boost/type_traits/is_abstract.hpp>
#endif
#include <boost/type_traits/add_lvalue_reference.hpp>
#include <boost/type_traits/remove_reference.hpp>
#endif
#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
-# include <boost/utility/declval.hpp>
+# include <boost/type_traits/declval.hpp>
#endif
+#elif defined(BOOST_MSVC) || defined(BOOST_INTEL)
+#include <boost/type_traits/is_function.hpp>
+#include <boost/type_traits/is_same.hpp>
#endif // BOOST_IS_CONVERTIBLE
-// should be always the last #include directive
-#include <boost/type_traits/detail/bool_trait_def.hpp>
-
namespace boost {
#ifndef BOOST_IS_CONVERTIBLE
namespace detail {
-#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !(defined(BOOST_GCC) && (BOOST_GCC < 40700))
// This is a C++11 conforming version, place this first and use it wherever possible:
// This version seems to work pretty well for a wide spectrum of compilers,
// however it does rely on undefined behaviour by passing UDT's through (...).
//
+
+//Workaround for old compilers like MSVC 7.1 to avoid
+//forming a reference to an array of unknown bound
+template <typename From>
+struct is_convertible_basic_impl_add_lvalue_reference
+ : add_lvalue_reference<From>
+{};
+
+template <typename From>
+struct is_convertible_basic_impl_add_lvalue_reference<From[]>
+{
+ typedef From type [];
+};
+
template <typename From, typename To>
struct is_convertible_basic_impl
{
static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(...);
static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To);
- typedef typename add_lvalue_reference<From>::type lvalue_type;
- typedef typename add_rvalue_reference<From>::type rvalue_type;
+ typedef typename is_convertible_basic_impl_add_lvalue_reference<From>::type lvalue_type;
static lvalue_type _m_from;
#ifdef BOOST_MSVC
#pragma warning(push)
#endif
#endif
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ typedef typename add_rvalue_reference<From>::type rvalue_type;
BOOST_STATIC_CONSTANT(bool, value =
sizeof( _m_check(static_cast<rvalue_type>(_m_from)) ) == sizeof(::boost::type_traits::yes_type)
);
template <typename From, typename To>
struct is_convertible_impl
{
- enum { value =
- (::boost::type_traits::ice_and<
- ::boost::type_traits::ice_or<
- ::boost::detail::is_convertible_basic_impl<From,To>::value,
- ::boost::is_void<To>::value
- >::value,
- ::boost::type_traits::ice_not<
- ::boost::is_array<To>::value
- >::value,
- ::boost::type_traits::ice_not<
- ::boost::is_function<To>::value
- >::value
- >::value) };
+ enum {
+ value = ( ::boost::detail::is_convertible_basic_impl<From,To>::value && ! ::boost::is_array<To>::value && ! ::boost::is_function<To>::value)
+ };
};
#elif !defined(__BORLANDC__) || __BORLANDC__ > 0x551
template <typename From, typename To>
struct is_convertible_impl
{
- BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_and<
- ::boost::type_traits::ice_or<
- ::boost::detail::is_convertible_basic_impl<From,To>::value,
- ::boost::is_void<To>::value
- >::value,
- ::boost::type_traits::ice_not<
- ::boost::is_array<To>::value
- >::value,
- ::boost::type_traits::ice_not<
- ::boost::is_function<To>::value
- >::value
- >::value)
- );
+ BOOST_STATIC_CONSTANT(bool, value = ( ::boost::detail::is_convertible_basic_impl<From, To>::value && !::boost::is_array<To>::value && !::boost::is_function<To>::value));
};
#endif
// implementation above:
//
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-# define TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1,spec2,value) \
- BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2,value) \
- BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2 const,value) \
- BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2 volatile,value) \
- BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2 const volatile,value) \
- /**/
-# define TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2(trait,spec1,spec2,value) \
- TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1,spec2,value) \
- TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1 const,spec2,value) \
- TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1 volatile,spec2,value) \
- TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1 const volatile,spec2,value) \
- /**/
+template <> struct is_convertible_impl_dispatch<void, void> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void, void const> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void, void const volatile> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void, void volatile> : public true_type{};
+
+template <> struct is_convertible_impl_dispatch<void const, void> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void const, void const> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void const, void const volatile> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void const, void volatile> : public true_type{};
- TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2(is_convertible,void,void,true)
+template <> struct is_convertible_impl_dispatch<void const volatile, void> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void const volatile, void const> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void const volatile, void const volatile> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void const volatile, void volatile> : public true_type{};
-# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2
-# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1
+template <> struct is_convertible_impl_dispatch<void volatile, void> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void volatile, void const> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void volatile, void const volatile> : public true_type{};
+template <> struct is_convertible_impl_dispatch<void volatile, void volatile> : public true_type{};
#else
- BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(is_convertible,void,void,true)
+template <> struct is_convertible_impl_dispatch<void, void> : public true_type{};
#endif // BOOST_NO_CV_VOID_SPECIALIZATIONS
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void,To,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void,false)
+template <class To> struct is_convertible_impl_dispatch<void, To> : public false_type{};
+template <class From> struct is_convertible_impl_dispatch<From, void> : public false_type{};
+
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void const,To,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void volatile,To,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void const volatile,To,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void volatile,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const volatile,false)
+template <class To> struct is_convertible_impl_dispatch<void const, To> : public false_type{};
+template <class From> struct is_convertible_impl_dispatch<From, void const> : public false_type{};
+template <class To> struct is_convertible_impl_dispatch<void const volatile, To> : public false_type{};
+template <class From> struct is_convertible_impl_dispatch<From, void const volatile> : public false_type{};
+template <class To> struct is_convertible_impl_dispatch<void volatile, To> : public false_type{};
+template <class From> struct is_convertible_impl_dispatch<From, void volatile> : public false_type{};
#endif
} // namespace detail
-BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,(::boost::detail::is_convertible_impl_dispatch<From,To>::value))
+template <class From, class To>
+struct is_convertible : public integral_constant<bool, ::boost::detail::is_convertible_impl_dispatch<From, To>::value> {};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,BOOST_IS_CONVERTIBLE(From,To))
+template <class From, class To>
+struct is_convertible : public integral_constant<bool, BOOST_IS_CONVERTIBLE(From, To)> {};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED
&& !defined(BOOST_INTEL_CXX_VERSION) && \
!(defined(BOOST_MSVC) && _MSC_VER == 1800)
#define BOOST_TT_CXX11_IS_COPY_ASSIGNABLE
-#include <boost/utility/declval.hpp>
+#include <boost/type_traits/declval.hpp>
#else
//For compilers without decltype
#include <boost/type_traits/is_const.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{
} // 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)
+template <class T> struct is_copy_assignable : public integral_constant<bool, ::boost::detail::is_copy_assignable_impl<T>::value>{};
+template <> struct is_copy_assignable<void> : public false_type{};
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-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)
+template <> struct is_copy_assignable<void const> : public false_type{};
+template <> struct is_copy_assignable<void const volatile> : public false_type{};
+template <> struct is_copy_assignable<void volatile> : public false_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
#define BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED
#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40900)
+
+#include <boost/type_traits/is_constructible.hpp>
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1800)
+
+namespace boost {
+
+template <class T> struct is_copy_constructible : public boost::is_constructible<T, const T&>{};
+
+template <> struct is_copy_constructible<void> : public false_type{};
+template <> struct is_copy_constructible<void const> : public false_type{};
+template <> struct is_copy_constructible<void const volatile> : public false_type{};
+template <> struct is_copy_constructible<void volatile> : public false_type{};
+
+} // namespace boost
+
+#else
+//
+// Special version for VC12 which has a problem when a base class (such as non_copyable) has a deleted
+// copy constructor. In this case the compiler thinks there really is a copy-constructor and tries to
+// instantiate the deleted member. std::is_copy_constructible has the same issue (or at least returns
+// an incorrect value, which just defers the issue into the users code) as well. We can at least fix
+// boost::non_copyable as a base class as a special case:
+//
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/noncopyable.hpp>
+
+namespace boost {
+
+ namespace detail
+ {
+
+ template <class T, bool b> struct is_copy_constructible_imp : public boost::is_constructible<T, const T&>{};
+ template <class T> struct is_copy_constructible_imp<T, true> : public false_type{};
+
+ }
+
+ template <class T> struct is_copy_constructible : public detail::is_copy_constructible_imp<T, is_base_and_derived<boost::noncopyable, T>::value>{};
+
+ template <> struct is_copy_constructible<void> : public false_type{};
+ template <> struct is_copy_constructible<void const> : public false_type{};
+ template <> struct is_copy_constructible<void const volatile> : public false_type{};
+ template <> struct is_copy_constructible<void volatile> : public false_type{};
+
+} // namespace boost
+
+#endif
+
+#else
+
#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/type_traits/declval.hpp>
+#include <boost/type_traits/is_array.hpp>
+#include <boost/type_traits/declval.hpp>
#include <boost/noncopyable.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4181)
+#endif
namespace boost {
-namespace detail{
+ namespace detail{
-template <bool DerivedFromNoncopyable, class T>
-struct is_copy_constructible_impl2 {
+ 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
+ // 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);
+ template <class T1>
+ static boost::type_traits::yes_type test(const T1&, boost::mpl::int_<sizeof(T1(boost::declval<const T1&>()))>* = 0);
#else
- template <class T1>
- static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval<T1&>()))* = 0);
+ template <class T1>
+ static boost::type_traits::yes_type test(const T1&, decltype(T1(boost::declval<const T1&>()))* = 0);
#endif
- static boost::type_traits::no_type test(...);
+ 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(...);
+ template <class T1>
+ static boost::type_traits::no_type test(const 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 = (
+ // 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>()
+ boost::declval<BOOST_DEDUCED_TYPENAME boost::add_reference<T const>::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_rvalue_reference<T>::value
+ && !boost::is_array<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
- ));
-};
+ >::value
+ ));
+ };
-} // namespace detail
+ } // 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)
+ template <class T> struct is_copy_constructible : public integral_constant<bool, ::boost::detail::is_copy_constructible_impl<T>::value>{};
+ template <> struct is_copy_constructible<void> : public false_type{};
#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)
+ template <> struct is_copy_constructible<void const> : public false_type{};
+ template <> struct is_copy_constructible<void volatile> : public false_type{};
+ template <> struct is_copy_constructible<void const volatile> : public false_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+#endif
#endif // BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED
--- /dev/null
+
+// (C) Copyright John Maddock 2015.
+// 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_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED
+#define BOOST_TT_IS_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/detail/workaround.hpp>
+
+#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500)
+
+#include <boost/type_traits/detail/yes_no_type.hpp>
+
+namespace boost{
+
+ namespace detail{
+
+ struct is_default_constructible_imp
+ {
+ template<typename _Tp, typename = decltype(_Tp())>
+ static boost::type_traits::yes_type test(int);
+
+ template<typename>
+ static boost::type_traits::no_type test(...);
+ };
+
+ }
+
+ template <class T> struct is_default_constructible : public integral_constant<bool, sizeof(detail::is_default_constructible_imp::test<T>(0)) == sizeof(boost::type_traits::yes_type)>{};
+ template <class T, std::size_t N> struct is_default_constructible<T[N]> : public is_default_constructible<T>{};
+ template <class T> struct is_default_constructible<T[]> : public is_default_constructible<T>{};
+ template <class T> struct is_default_constructible<T&> : public integral_constant<bool, false>{};
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ template <class T> struct is_default_constructible<T&&> : public integral_constant<bool, false>{};
+#endif
+ template <> struct is_default_constructible<void> : public integral_constant<bool, false>{};
+ template <> struct is_default_constructible<void const> : public integral_constant<bool, false>{};
+ template <> struct is_default_constructible<void volatile> : public integral_constant<bool, false>{};
+ template <> struct is_default_constructible<void const volatile> : public integral_constant<bool, false>{};
+
+#else
+
+#include <boost/type_traits/is_pod.hpp>
+
+namespace boost{
+
+ // We don't know how to implement this, note we can not use has_trivial_constructor here
+ // because the correct implementation of that trait requires this one:
+ template <class T> struct is_default_constructible : public is_pod<T>{};
+ template <> struct is_default_constructible<void> : public integral_constant<bool, false>{};
+ template <> struct is_default_constructible<void const> : public integral_constant<bool, false>{};
+ template <> struct is_default_constructible<void volatile> : public integral_constant<bool, false>{};
+ template <> struct is_default_constructible<void const volatile> : public integral_constant<bool, false>{};
+
+#endif
+
+} // namespace boost
+
+#endif // BOOST_TT_IS_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED
--- /dev/null
+
+// (C) Copyright John Maddock 2015.
+// 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_DESTRUCTIBLE_HPP_INCLUDED
+#define BOOST_TT_IS_DESTRUCTIBLE_HPP_INCLUDED
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/detail/workaround.hpp>
+
+#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
+
+#include <boost/type_traits/detail/yes_no_type.hpp>
+#include <boost/type_traits/declval.hpp>
+
+namespace boost{
+
+ namespace detail{
+
+ struct is_destructible_imp
+ {
+ template<typename T, typename = decltype(boost::declval<T&>().~T())>
+ static boost::type_traits::yes_type test(int);
+ template<typename>
+ static boost::type_traits::no_type test(...);
+ };
+
+ }
+
+ template <class T> struct is_destructible : public integral_constant<bool, sizeof(detail::is_destructible_imp::test<T>(0)) == sizeof(boost::type_traits::yes_type)>{};
+
+#else
+
+#include <boost/type_traits/is_pod.hpp>
+#include <boost/type_traits/is_class.hpp>
+
+namespace boost{
+
+ // We don't know how to implement this:
+ template <class T> struct is_destructible : public integral_constant<bool, is_pod<T>::value || is_class<T>::value>{};
+#endif
+
+ template <> struct is_destructible<void> : public false_type{};
+ template <> struct is_destructible<void const> : public false_type{};
+ template <> struct is_destructible<void volatile> : public false_type{};
+ template <> struct is_destructible<void const volatile> : public false_type{};
+ template <class T> struct is_destructible<T&> : public is_destructible<T>{};
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ template <class T> struct is_destructible<T&&> : public is_destructible<T>{};
+#endif
+ template <class T, std::size_t N> struct is_destructible<T[N]> : public is_destructible<T>{};
+ template <class T> struct is_destructible<T[]> : public is_destructible<T>{};
+
+} // namespace boost
+
+#endif // BOOST_TT_IS_DESTRUCTIBLE_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/detail/config.hpp>
#include <boost/type_traits/intrinsics.hpp>
-# include <boost/type_traits/remove_cv.hpp>
-# include <boost/type_traits/is_class.hpp>
-# include <boost/type_traits/add_reference.hpp>
-
-// should be always the last #include directive
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/add_reference.hpp>
#ifndef BOOST_INTERNAL_IS_EMPTY
#define BOOST_INTERNAL_IS_EMPTY(T) false
{
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
- ));
+ bool,
+ value = ( ::boost::detail::empty_helper<cvt,::boost::is_class<T>::value>::value || BOOST_INTERNAL_IS_EMPTY(cvt)));
};
#else // __BORLANDC__
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));
+ >::value || BOOST_INTERNAL_IS_EMPTY(cvt));
};
#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)
+template <class T> struct is_empty : integral_constant<bool, ::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
#define BOOST_TT_IS_ENUM_HPP_INCLUDED
#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#ifndef BOOST_IS_ENUM
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/is_arithmetic.hpp>
#ifdef __GNUC__
#include <boost/type_traits/is_function.hpp>
#endif
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#if defined(BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION)
# include <boost/type_traits/is_class.hpp>
# include <boost/type_traits/is_union.hpp>
#endif
#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
-
namespace boost {
#ifndef BOOST_IS_ENUM
template <typename T>
struct is_class_or_union
{
- BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_or<
- ::boost::is_class<T>::value
- , ::boost::is_union<T>::value
- >::value));
+ BOOST_STATIC_CONSTANT(bool, value = ::boost::is_class<T>::value || ::boost::is_union<T>::value);
};
#else
struct is_enum_helper<false>
{
template <typename T> struct type
- : public ::boost::is_convertible<typename boost::add_reference<T>::type,::boost::detail::int_convertible>
{
+ static const bool value = ::boost::is_convertible<typename boost::add_reference<T>::type, ::boost::detail::int_convertible>::value;
};
};
// order to correctly deduce that noncopyable types are not enums
// (dwa 2002/04/15)...
BOOST_STATIC_CONSTANT(bool, selector =
- (::boost::type_traits::ice_or<
::boost::is_arithmetic<T>::value
- , ::boost::is_reference<T>::value
- , ::boost::is_function<T>::value
- , is_class_or_union<T>::value
- , is_array<T>::value
- >::value));
+ || ::boost::is_reference<T>::value
+ || ::boost::is_function<T>::value
+ || is_class_or_union<T>::value
+ || is_array<T>::value);
#else
// ...however, not checking is_class_or_union on non-conforming
// compilers prevents a dependency recursion.
BOOST_STATIC_CONSTANT(bool, selector =
- (::boost::type_traits::ice_or<
::boost::is_arithmetic<T>::value
- , ::boost::is_reference<T>::value
- , ::boost::is_function<T>::value
- , is_array<T>::value
- >::value));
+ || ::boost::is_reference<T>::value
+ || ::boost::is_function<T>::value
+ || is_array<T>::value);
#endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
#else // !defined(__GNUC__):
BOOST_STATIC_CONSTANT(bool, selector =
- (::boost::type_traits::ice_or<
::boost::is_arithmetic<T>::value
- , ::boost::is_reference<T>::value
- , is_class_or_union<T>::value
- , is_array<T>::value
- >::value));
+ || ::boost::is_reference<T>::value
+ || is_class_or_union<T>::value
+ || is_array<T>::value);
#endif
BOOST_STATIC_CONSTANT(bool, value = helper::value);
};
-// these help on compilers with no partial specialization support:
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void,false)
-#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void const,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void volatile,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void const volatile,false)
-#endif
-
} // namespace detail
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,::boost::detail::is_enum_impl<T>::value)
+template <class T> struct is_enum : public integral_constant<bool, ::boost::detail::is_enum_impl<T>::value> {};
#else // __BORLANDC__
//
// buggy is_convertible prevents working
// implementation of is_enum:
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,false)
+template <class T> struct is_enum : public integral_constant<bool, false> {};
#endif
#else // BOOST_IS_ENUM
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,BOOST_IS_ENUM(T))
+template <class T> struct is_enum : public integral_constant<bool, BOOST_IS_ENUM(T)> {};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_ENUM_HPP_INCLUDED
--- /dev/null
+
+// Copyright (c) 2014 Agustin Berge
+//
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+
+#ifndef BOOST_TT_IS_FINAL_HPP_INCLUDED
+#define BOOST_TT_IS_FINAL_HPP_INCLUDED
+
+#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+#ifdef BOOST_IS_FINAL
+#include <boost/type_traits/remove_cv.hpp>
+#endif
+
+namespace boost {
+
+#ifdef BOOST_IS_FINAL
+template <class T> struct is_final : public integral_constant<bool, BOOST_IS_FINAL(typename remove_cv<T>::type)> {};
+#else
+template <class T> struct is_final : public integral_constant<bool, false> {};
+#endif
+
+} // namespace boost
+
+#endif // BOOST_TT_IS_FINAL_HPP_INCLUDED
-
// (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
#define BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED
// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/is_floating_point.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_float,T,false)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_float,float,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_float,double,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_float,long double,true)
-
+ template <class T> struct is_float : public is_floating_point<T> {};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED
-
// (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
#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>
+#include <boost/type_traits/integral_constant.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)
+ template <class T> struct is_floating_point : public false_type{};
+ template <class T> struct is_floating_point<const T> : public is_floating_point<T>{};
+ template <class T> struct is_floating_point<volatile const T> : public is_floating_point<T>{};
+ template <class T> struct is_floating_point<volatile T> : public is_floating_point<T>{};
+ template<> struct is_floating_point<float> : public true_type{};
+ template<> struct is_floating_point<double> : public true_type{};
+ template<> struct is_floating_point<long double> : public true_type{};
+
+#if defined(BOOST_HAS_FLOAT128)
+ template<> struct is_floating_point<__float128> : public true_type{};
+#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED
#define BOOST_TT_IS_FUNCTION_HPP_INCLUDED
#include <boost/type_traits/is_reference.hpp>
-#include <boost/type_traits/detail/false_result.hpp>
-#include <boost/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#if !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
# include <boost/type_traits/detail/is_function_ptr_helper.hpp>
# include <boost/type_traits/detail/yes_no_type.hpp>
#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
-
// is a type a function?
// Please note that this implementation is unnecessarily complex:
// we could just use !is_convertible<T*, const volatile void*>::value,
#if !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
template<bool is_ref = true>
struct is_function_chooser
- : public ::boost::type_traits::false_result
{
+ template< typename T > struct result_
+ : public false_type {};
};
template <>
struct is_function_chooser<false>
{
template< typename T > struct result_
- : public ::boost::type_traits::is_function_ptr_helper<T*>
- {
- };
+ : public ::boost::type_traits::is_function_ptr_helper<T*> {};
};
template <typename T>
#endif // !defined( __CODEGEARC__ )
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,__is_function(T))
+template <class T> struct is_function : integral_constant<bool, __is_function(T)> {};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl<T>::value)
+template <class T> struct is_function : integral_constant<bool, ::boost::detail::is_function_impl<T>::value> {};
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_function,T&&,false)
+template <class T> struct is_function<T&&> : public false_type {};
#endif
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_FUNCTION_HPP_INCLUDED
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/type_traits/is_void.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 is_fundamental_impl
- : public ::boost::type_traits::ice_or<
- ::boost::is_arithmetic<T>::value
- , ::boost::is_void<T>::value
- >
-{
-};
-
-} // namespace detail
-
//* is a type T a fundamental type described in the standard (3.9.1)
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,__is_fundamental(T))
+template <class T> struct is_fundamental : public integral_constant<bool, __is_fundamental(T)> {};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,::boost::detail::is_fundamental_impl<T>::value)
+template <class T> struct is_fundamental : public integral_constant<bool, ::boost::is_arithmetic<T>::value || ::boost::is_void<T>::value> {};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_FUNDAMENTAL_HPP_INCLUDED
#define BOOST_TT_IS_INTEGRAL_HPP_INCLUDED
#include <boost/config.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
-//* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3)
-// as an extension we include long long, as this is likely to be added to the
-// standard at a later date
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,__is_integral(T))
+ template <class T>
+ struct is_integral : public integral_constant<bool, __is_integral(T)> {};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,false)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned char,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned short,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned int,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned long,true)
+template <class T> struct is_integral : public false_type {};
+template <class T> struct is_integral<const T> : public is_integral<T> {};
+template <class T> struct is_integral<volatile const T> : public is_integral<T>{};
+template <class T> struct is_integral<volatile T> : public is_integral<T>{};
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed char,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed short,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed int,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed long,true)
+//* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3)
+// as an extension we include long long, as this is likely to be added to the
+// standard at a later date
+template<> struct is_integral<unsigned char> : public true_type {};
+template<> struct is_integral<unsigned short> : public true_type{};
+template<> struct is_integral<unsigned int> : public true_type{};
+template<> struct is_integral<unsigned long> : public true_type{};
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,bool,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true)
+template<> struct is_integral<signed char> : public true_type{};
+template<> struct is_integral<short> : public true_type{};
+template<> struct is_integral<int> : public true_type{};
+template<> struct is_integral<long> : public true_type{};
+
+template<> struct is_integral<char> : public true_type{};
+template<> struct is_integral<bool> : public true_type{};
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
// If the following line fails to compile and you're using the Intel
// compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php,
// and define BOOST_NO_INTRINSIC_WCHAR_T on the command line.
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
+template<> struct is_integral<wchar_t> : public true_type{};
#endif
// Same set of integral types as in boost/type_traits/integral_promotion.hpp.
// Please, keep in sync. -- Alexander Nasonov
#if (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \
|| (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300))
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int8,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int8,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int16,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int16,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int32,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int32,true)
+template<> struct is_integral<unsigned __int8> : public true_type{};
+template<> struct is_integral<unsigned __int16> : public true_type{};
+template<> struct is_integral<unsigned __int32> : public true_type{};
+template<> struct is_integral<__int8> : public true_type{};
+template<> struct is_integral<__int16> : public true_type{};
+template<> struct is_integral<__int32> : public true_type{};
#ifdef __BORLANDC__
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true)
+template<> struct is_integral<unsigned __int64> : public true_type{};
+template<> struct is_integral<__int64> : public true_type{};
#endif
#endif
# if defined(BOOST_HAS_LONG_LONG)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::ulong_long_type,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::long_long_type,true)
+template<> struct is_integral< ::boost::ulong_long_type> : public true_type{};
+template<> struct is_integral< ::boost::long_long_type> : public true_type{};
#elif defined(BOOST_HAS_MS_INT64)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true)
+template<> struct is_integral<unsigned __int64> : public true_type{};
+template<> struct is_integral<__int64> : public true_type{};
#endif
#ifdef BOOST_HAS_INT128
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::int128_type,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::uint128_type,true)
+template<> struct is_integral<boost::int128_type> : public true_type{};
+template<> struct is_integral<boost::uint128_type> : public true_type{};
#endif
#ifndef BOOST_NO_CXX11_CHAR16_T
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char16_t,true)
+template<> struct is_integral<char16_t> : public true_type{};
#endif
#ifndef BOOST_NO_CXX11_CHAR32_T
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char32_t,true)
+template<> struct is_integral<char32_t> : public true_type{};
#endif
#endif // non-CodeGear implementation
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_INTEGRAL_HPP_INCLUDED
#ifndef BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
-
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,__is_reference(T))
+ template <class T> struct is_lvalue_reference : public integral_constant<bool, __is_reference(T)>{};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T&,true)
+ template <class T> struct is_lvalue_reference : public false_type{};
+ template <class T> struct is_lvalue_reference<T&> : public true_type{};
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
// references as distinct types...
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const,true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& volatile,true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const volatile,true)
+ template <class T> struct is_lvalue_reference<T&const> : public true_type{};
+ template <class T> struct is_lvalue_reference<T&volatile> : public true_type{};
+ template <class T> struct is_lvalue_reference<T&const volatile> : public true_type{};
#endif
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED
#ifndef BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#include <boost/detail/workaround.hpp>
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
//
# include <boost/type_traits/detail/is_mem_fun_pointer_impl.hpp>
# include <boost/type_traits/remove_cv.hpp>
+# include <boost/type_traits/integral_constant.hpp>
#else
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_array.hpp>
# include <boost/type_traits/detail/yes_no_type.hpp>
-# include <boost/type_traits/detail/false_result.hpp>
-# include <boost/type_traits/detail/ice_or.hpp>
# include <boost/type_traits/detail/is_mem_fun_pointer_tester.hpp>
#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
-
namespace boost {
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,__is_member_function_pointer( T ))
+template <class T> struct is_member_function_pointer : public integral_constant<bool, __is_member_function_pointer( T )> {};
#elif !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(
- is_member_function_pointer
- , T
- , ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value
- )
+template <class T> struct is_member_function_pointer
+ : public ::boost::integral_constant<bool, ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value>{};
#else
template <bool>
struct is_mem_fun_pointer_select
- : public ::boost::type_traits::false_result
{
+ template <class T> struct result_ : public false_type{};
};
template <>
template <typename T>
struct is_member_function_pointer_impl
- : public is_mem_fun_pointer_select<
- ::boost::type_traits::ice_or<
- ::boost::is_reference<T>::value
- , ::boost::is_array<T>::value
- >::value
- >::template result_<T>
-{
-};
+ : public is_mem_fun_pointer_select<
+ ::boost::is_reference<T>::value || ::boost::is_array<T>::value>::template result_<T>{};
template <typename T>
struct is_member_function_pointer_impl<T&> : public false_type{};
#endif
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void,false)
+template<> struct is_member_function_pointer_impl<void> : public false_type{};
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void volatile,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const volatile,false)
+template<> struct is_member_function_pointer_impl<void const> : public false_type{};
+template<> struct is_member_function_pointer_impl<void const volatile> : public false_type{};
+template<> struct is_member_function_pointer_impl<void volatile> : public false_type{};
#endif
} // namespace detail
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,::boost::detail::is_member_function_pointer_impl<T>::value)
+template <class T>
+struct is_member_function_pointer
+ : public integral_constant<bool, ::boost::detail::is_member_function_pointer_impl<T>::value>{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#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)
+template <class T> struct is_member_object_pointer
+ : public integral_constant<bool,
+ ::boost::is_member_pointer<T>::value && !::boost::is_member_function_pointer<T>::value>{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#ifndef BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED
#define BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
#include <boost/detail/workaround.hpp>
-
-#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
-# include <boost/type_traits/is_member_function_pointer.hpp>
-#else
-# include <boost/type_traits/is_reference.hpp>
-# include <boost/type_traits/is_array.hpp>
-# include <boost/type_traits/detail/is_mem_fun_pointer_tester.hpp>
-# include <boost/type_traits/detail/yes_no_type.hpp>
-# include <boost/type_traits/detail/false_result.hpp>
-# include <boost/type_traits/detail/ice_or.hpp>
-#endif
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/is_member_function_pointer.hpp>
namespace boost {
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,__is_member_pointer(T))
-#elif BOOST_WORKAROUND(__BORLANDC__, < 0x600)
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)
-
+template <class T> struct is_member_pointer : public integral_constant<bool, __is_member_pointer(T)>{};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer<T>::value)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)
+template <class T> struct is_member_pointer : public integral_constant<bool, ::boost::is_member_function_pointer<T>::value>{};
+template <class T, class U> struct is_member_pointer<U T::* > : public true_type{};
#if !BOOST_WORKAROUND(__MWERKS__,<=0x3003) && !BOOST_WORKAROUND(__IBMCPP__, <=600)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const,true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*volatile,true)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const volatile,true)
+template <class T, class U> struct is_member_pointer<U T::*const> : public true_type{};
+template <class T, class U> struct is_member_pointer<U T::*const volatile> : public true_type{};
+template <class T, class U> struct is_member_pointer<U T::*volatile> : public true_type{};
#endif
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED
#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>
+#include <boost/type_traits/declval.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); };
-
+struct is_nothrow_move_assignable : public integral_constant<bool, BOOST_IS_NOTHROW_MOVE_ASSIGN(T)>{};
+template <class T> struct is_nothrow_move_assignable<T const> : public false_type{};
+template <class T> struct is_nothrow_move_assignable<T volatile> : public false_type{};
+template <class T> struct is_nothrow_move_assignable<T const volatile> : public false_type{};
+template <class T> struct is_nothrow_move_assignable<T&> : public false_type{};
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+template <class T> struct is_nothrow_move_assignable<T&&> : public false_type{};
+#endif
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
+namespace detail{
+
template <class T, class Enable = void>
struct false_or_cpp11_noexcept_move_assignable: public ::boost::false_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{};
+struct is_nothrow_move_assignable : public integral_constant<bool, ::boost::detail::false_or_cpp11_noexcept_move_assignable<T>::value>{};
+
+template <class T> struct is_nothrow_move_assignable<T const> : public ::boost::false_type {};
+template <class T> struct is_nothrow_move_assignable<T const volatile> : public ::boost::false_type{};
+template <class T> struct is_nothrow_move_assignable<T volatile> : public ::boost::false_type{};
+template <class T> struct is_nothrow_move_assignable<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{};
+template <class T> struct is_nothrow_move_assignable<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));
-};
+struct is_nothrow_move_assignable : public integral_constant<bool,
+ (::boost::has_trivial_move_assign<T>::value || ::boost::has_nothrow_assign<T>::value) && ! ::boost::is_array<T>::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)
+template <> struct is_nothrow_move_assignable<void> : public false_type{};
#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)
+template <> struct is_nothrow_move_assignable<void const> : public false_type{};
+template <> struct is_nothrow_move_assignable<void const volatile> : public false_type{};
+template <> struct is_nothrow_move_assignable<void volatile> : public false_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_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>
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/detail/workaround.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#ifdef BOOST_IS_NOTHROW_MOVE_CONSTRUCT
namespace boost {
-namespace detail{
+template <class T>
+struct is_nothrow_move_constructible : public integral_constant<bool, BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T)>{};
-#ifdef BOOST_IS_NOTHROW_MOVE_CONSTRUCT
+template <class T> struct is_nothrow_move_constructible<volatile T> : public ::boost::false_type {};
+template <class T> struct is_nothrow_move_constructible<const volatile T> : public ::boost::false_type{};
-template <class T>
-struct is_nothrow_move_constructible_imp{
- BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T));
-};
+#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
-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
+#include <boost/type_traits/declval.hpp>
+#include <boost/utility/enable_if.hpp>
-#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
+namespace boost{ namespace detail{
template <class T, class Enable = void>
struct false_or_cpp11_noexcept_move_constructible: public ::boost::false_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
+template <class T> struct is_nothrow_move_constructible
+ : public integral_constant<bool, ::boost::detail::false_or_cpp11_noexcept_move_constructible<T>::value>{};
+
+template <class T> struct is_nothrow_move_constructible<volatile T> : public ::boost::false_type {};
+template <class T> struct is_nothrow_move_constructible<const volatile T> : public ::boost::false_type{};
+template <class T, std::size_t N> struct is_nothrow_move_constructible<T[N]> : public ::boost::false_type{};
+template <class T> struct is_nothrow_move_constructible<T[]> : public ::boost::false_type{};
#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));
-};
+#include <boost/type_traits/has_trivial_move_constructor.hpp>
+#include <boost/type_traits/has_nothrow_copy.hpp>
+#include <boost/type_traits/is_array.hpp>
-#endif
+namespace boost{
-}
+template <class T>
+struct is_nothrow_move_constructible
+ : public integral_constant<bool,
+ (::boost::has_trivial_move_constructor<T>::value || ::boost::has_nothrow_copy<T>::value) && !::boost::is_array<T>::value>
+{};
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_nothrow_move_constructible,T,::boost::detail::is_nothrow_move_constructible_imp<T>::value)
+#endif
-BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void,false)
+template <> struct is_nothrow_move_constructible<void> : false_type{};
#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)
+template <> struct is_nothrow_move_constructible<void const> : false_type{};
+template <> struct is_nothrow_move_constructible<void volatile> : false_type{};
+template <> struct is_nothrow_move_constructible<void const volatile> : false_type{};
+#endif
+// References are always trivially constructible, even if the thing they reference is not:
+template <class T> struct is_nothrow_move_constructible<T&> : public ::boost::true_type{};
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+template <class T> struct is_nothrow_move_constructible<T&&> : public ::boost::true_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED
#ifndef BOOST_TT_IS_OBJECT_HPP_INCLUDED
#define BOOST_TT_IS_OBJECT_HPP_INCLUDED
+#include <boost/config.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/is_function.hpp>
-#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)
+template <class T> struct is_object
+ : public
+ integral_constant<
+ bool,
+ ! ::boost::is_reference<T>::value && ! ::boost::is_void<T>::value && ! ::boost::is_function<T>::value >
+{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_OBJECT_HPP_INCLUDED
#ifndef BOOST_TT_IS_POD_HPP_INCLUDED
#define BOOST_TT_IS_POD_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/detail/config.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/is_scalar.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
#include <boost/type_traits/intrinsics.hpp>
-#include <cstddef>
+#ifdef __SUNPRO_CC
+#include <boost/type_traits/is_function.hpp>
+#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <cstddef>
#ifndef BOOST_IS_POD
#define BOOST_INTERNAL_IS_POD(T) false
// forward declaration, needed by 'is_pod_array_helper' template below
template< typename T > struct is_POD;
-namespace detail {
-
-
-template <typename T> struct is_pod_impl
-{
- BOOST_STATIC_CONSTANT(
- bool, value =
- (::boost::type_traits::ice_or<
- ::boost::is_scalar<T>::value,
- ::boost::is_void<T>::value,
- BOOST_INTERNAL_IS_POD(T)
- >::value));
-};
+template <typename T> struct is_pod
+: public integral_constant<bool, ::boost::is_scalar<T>::value || ::boost::is_void<T>::value || BOOST_INTERNAL_IS_POD(T)>
+{};
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-template <typename T, std::size_t sz>
-struct is_pod_impl<T[sz]>
- : public is_pod_impl<T>
-{
-};
+template <typename T, std::size_t sz> struct is_pod<T[sz]> : public is_pod<T>{};
#endif
// the following help compilers without partial specialization support:
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void,true)
+template<> struct is_pod<void> : public true_type{};
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void const,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void volatile,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void const volatile,true)
+template<> struct is_pod<void const> : public true_type{};
+template<> struct is_pod<void const volatile> : public true_type{};
+template<> struct is_pod<void volatile> : public true_type{};
#endif
-} // namespace detail
-
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pod,T,::boost::detail::is_pod_impl<T>::value)
-// is_POD is the old depricated name for this trait, do not use this as it may
-// be removed in future without warning!!
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_POD,T,::boost::is_pod<T>::value)
+template<class T> struct is_POD : public is_pod<T>{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#undef BOOST_INTERNAL_IS_POD
#endif // BOOST_TT_IS_POD_HPP_INCLUDED
#ifndef BOOST_TT_IS_POINTER_HPP_INCLUDED
#define BOOST_TT_IS_POINTER_HPP_INCLUDED
-#include <boost/type_traits/is_member_pointer.hpp>
-#include <boost/type_traits/detail/ice_and.hpp>
-#include <boost/type_traits/detail/ice_not.hpp>
-#include <boost/type_traits/config.hpp>
-#include <boost/type_traits/remove_cv.hpp>
-
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,__is_pointer(T))
+template <class T> struct is_pointer : public integral_constant<bool, __is_pointer(T)>{};
#else
-
-namespace detail {
-
-template< typename T > struct is_pointer_helper
-{
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-# define TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(helper,sp,result) \
-template< typename T > struct helper<sp> \
-{ \
- BOOST_STATIC_CONSTANT(bool, value = result); \
-}; \
-/**/
-
-TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T*,true)
-
-# undef TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC
-
-template< typename T >
-struct is_pointer_impl
-{
- BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_and<
- ::boost::detail::is_pointer_helper<typename remove_cv<T>::type>::value
- , ::boost::type_traits::ice_not<
- ::boost::is_member_pointer<T>::value
- >::value
- >::value)
- );
-};
-
-} // namespace detail
-
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,::boost::detail::is_pointer_impl<T>::value)
-
-#if defined(__BORLANDC__) && !defined(__COMO__) && (__BORLANDC__ < 0x600)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T&,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& volatile,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const volatile,false)
+template <class T> struct is_pointer : public false_type{};
+template <class T> struct is_pointer<T*> : public true_type{};
+template <class T> struct is_pointer<T*const> : public true_type{};
+template <class T> struct is_pointer<T*const volatile> : public true_type{};
+template <class T> struct is_pointer<T*volatile> : public true_type{};
+
+#ifdef BOOST_MSVC
+template <class T> struct is_pointer<T const> : public is_pointer<T>{};
+template <class T> struct is_pointer<T const volatile> : public is_pointer<T>{};
+template <class T> struct is_pointer<T volatile> : public is_pointer<T>{};
#endif
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_POINTER_HPP_INCLUDED
#define BOOST_TT_IS_POLYMORPHIC_HPP
#include <boost/type_traits/intrinsics.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#ifndef BOOST_IS_POLYMORPHIC
#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/remove_cv.hpp>
#endif
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
#include <boost/detail/workaround.hpp>
#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1700)
# if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) // CWPro7 should return false always.
typedef char d1, (&d2)[2];
# else
- typedef typename remove_cv<T>::type ncvT;
- struct d1 : public ncvT
+ struct d1 : public T
{
d1();
# if !defined(__GNUC__) // this raises warnings with some classes, and buys nothing with GCC
d1(const d1&);
d1& operator=(const d1&);
};
- struct d2 : public ncvT
+ struct d2 : public T
{
d2();
virtual ~d2()throw();
BOOST_STATIC_CONSTANT(bool, value = (sizeof(d2) == sizeof(d1)));
};
+template <class T> struct is_polymorphic_imp1<T const> : public is_polymorphic_imp1<T>{};
+template <class T> struct is_polymorphic_imp1<T const volatile> : public is_polymorphic_imp1<T>{};
+template <class T> struct is_polymorphic_imp1<T volatile> : public is_polymorphic_imp1<T>{};
+
template <class T>
struct is_polymorphic_imp2
{
} // namespace detail
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_polymorphic,T,::boost::detail::is_polymorphic_imp<T>::value)
+template <class T> struct is_polymorphic : public integral_constant<bool, ::boost::detail::is_polymorphic_imp<T>::value> {};
#else // BOOST_IS_POLYMORPHIC
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_polymorphic,T,BOOST_IS_POLYMORPHIC(T))
+template <class T> struct is_polymorphic : public integral_constant<bool, BOOST_IS_POLYMORPHIC(T)> {};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1700)
#pragma warning(pop)
#endif
#ifndef BOOST_TT_IS_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_REFERENCE_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
#include <boost/type_traits/is_lvalue_reference.hpp>
#include <boost/type_traits/is_rvalue_reference.hpp>
-#include <boost/type_traits/ice.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
-namespace detail {
-
-template <typename T>
-struct is_reference_impl
-{
- BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_or<
- ::boost::is_lvalue_reference<T>::value, ::boost::is_rvalue_reference<T>::value
- >::value));
-};
-
-} // namespace detail
-
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,::boost::detail::is_reference_impl<T>::value)
+template <class T> struct is_reference
+ : public
+ integral_constant<
+ bool,
+ ::boost::is_lvalue_reference<T>::value || ::boost::is_rvalue_reference<T>::value>
+{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED
#ifndef BOOST_TT_IS_RVALUE_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_RVALUE_REFERENCE_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/config.hpp>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_rvalue_reference,T,false)
+template <class T> struct is_rvalue_reference : public false_type {};
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_rvalue_reference,T&&,true)
+template <class T> struct is_rvalue_reference<T&&> : public true_type {};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED
#ifndef BOOST_TT_IS_SAME_HPP_INCLUDED
#define BOOST_TT_IS_SAME_HPP_INCLUDED
-#include <boost/type_traits/config.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
-BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T,T,true)
+ template <class T, class U> struct is_same : public false_type {};
+ template <class T> struct is_same<T,T> : public true_type {};
#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
// without this, Borland's compiler gives the wrong answer for
// references to arrays:
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T&,T&,true)
+ template <class T> struct is_same<T&, T&> : public true_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_SAME_HPP_INCLUDED
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/type_traits/is_member_pointer.hpp>
-#include <boost/type_traits/detail/ice_or.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_scalar_impl
-{
- BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_or<
- ::boost::is_arithmetic<T>::value,
- ::boost::is_enum<T>::value,
- ::boost::is_pointer<T>::value,
- ::boost::is_member_pointer<T>::value
- >::value));
-};
-
-// these specializations are only really needed for compilers
-// without partial specialization support:
-template <> struct is_scalar_impl<void>{ BOOST_STATIC_CONSTANT(bool, value = false ); };
-#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-template <> struct is_scalar_impl<void const>{ BOOST_STATIC_CONSTANT(bool, value = false ); };
-template <> struct is_scalar_impl<void volatile>{ BOOST_STATIC_CONSTANT(bool, value = false ); };
-template <> struct is_scalar_impl<void const volatile>{ BOOST_STATIC_CONSTANT(bool, value = false ); };
-#endif
-
-} // namespace detail
-
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_scalar,T,::boost::detail::is_scalar_impl<T>::value)
+struct is_scalar
+ : public integral_constant<bool, ::boost::is_arithmetic<T>::value || ::boost::is_enum<T>::value || ::boost::is_pointer<T>::value || ::boost::is_member_pointer<T>::value>
+{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_SCALAR_HPP_INCLUDED
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/is_enum.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <climits>
namespace boost {
#if !defined( __CODEGEARC__ )
-namespace detail{
+#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1310) && \
+ !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) &&\
+ !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
-#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
+namespace detail{
template <class T>
struct is_signed_values
};
template <class T>
-struct is_signed_imp
+struct is_signed_impl
{
- typedef is_signed_select_helper<
- ::boost::type_traits::ice_or<
- ::boost::is_integral<T>::value,
- ::boost::is_enum<T>::value>::value
- > selector;
+ typedef ::boost::detail::is_signed_select_helper< ::boost::is_integral<T>::value || ::boost::is_enum<T>::value> selector;
typedef typename selector::template rebind<T> binder;
typedef typename binder::type type;
BOOST_STATIC_CONSTANT(bool, value = type::value);
};
+}
+
+template <class T> struct is_signed : public integral_constant<bool, boost::detail::is_signed_impl<T>::value> {};
+
#else
-template <class T> struct is_signed_imp : public false_type{};
-template <> struct is_signed_imp<signed char> : public true_type{};
-template <> struct is_signed_imp<const signed char> : public true_type{};
-template <> struct is_signed_imp<volatile signed char> : public true_type{};
-template <> struct is_signed_imp<const volatile signed char> : public true_type{};
-template <> struct is_signed_imp<short> : public true_type{};
-template <> struct is_signed_imp<const short> : public true_type{};
-template <> struct is_signed_imp<volatile short> : public true_type{};
-template <> struct is_signed_imp<const volatile short> : public true_type{};
-template <> struct is_signed_imp<int> : public true_type{};
-template <> struct is_signed_imp<const int> : public true_type{};
-template <> struct is_signed_imp<volatile int> : public true_type{};
-template <> struct is_signed_imp<const volatile int> : public true_type{};
-template <> struct is_signed_imp<long> : public true_type{};
-template <> struct is_signed_imp<const long> : public true_type{};
-template <> struct is_signed_imp<volatile long> : public true_type{};
-template <> struct is_signed_imp<const volatile long> : public true_type{};
-#ifdef BOOST_HAS_LONG_LONG
-template <> struct is_signed_imp<long long> : public true_type{};
-template <> struct is_signed_imp<const long long> : public true_type{};
-template <> struct is_signed_imp<volatile long long> : public true_type{};
-template <> struct is_signed_imp<const volatile long long> : public true_type{};
-#endif
-#if defined(CHAR_MIN) && (CHAR_MIN != 0)
-template <> struct is_signed_imp<char> : public true_type{};
-template <> struct is_signed_imp<const char> : public true_type{};
-template <> struct is_signed_imp<volatile char> : public true_type{};
-template <> struct is_signed_imp<const volatile char> : public true_type{};
-#endif
-#if defined(WCHAR_MIN) && (WCHAR_MIN != 0)
-template <> struct is_signed_imp<wchar_t> : public true_type{};
-template <> struct is_signed_imp<const wchar_t> : public true_type{};
-template <> struct is_signed_imp<volatile wchar_t> : public true_type{};
-template <> struct is_signed_imp<const volatile wchar_t> : public true_type{};
-#endif
+template <class T> struct is_signed : public false_type{};
#endif
-}
-
-#endif // !defined( __CODEGEARC__ )
+#else //defined( __CODEGEARC__ )
+ template <class T> struct is_signed : public integral_constant<bool, __is_signed(T)>{};
+#endif
-#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_signed,T,__is_signed(T))
+template <> struct is_signed<signed char> : public true_type{};
+template <> struct is_signed<const signed char> : public true_type{};
+template <> struct is_signed<volatile signed char> : public true_type{};
+template <> struct is_signed<const volatile signed char> : public true_type{};
+template <> struct is_signed<short> : public true_type{};
+template <> struct is_signed<const short> : public true_type{};
+template <> struct is_signed<volatile short> : public true_type{};
+template <> struct is_signed<const volatile short> : public true_type{};
+template <> struct is_signed<int> : public true_type{};
+template <> struct is_signed<const int> : public true_type{};
+template <> struct is_signed<volatile int> : public true_type{};
+template <> struct is_signed<const volatile int> : public true_type{};
+template <> struct is_signed<long> : public true_type{};
+template <> struct is_signed<const long> : public true_type{};
+template <> struct is_signed<volatile long> : public true_type{};
+template <> struct is_signed<const volatile long> : public true_type{};
+
+template <> struct is_signed<unsigned char> : public false_type{};
+template <> struct is_signed<const unsigned char> : public false_type{};
+template <> struct is_signed<volatile unsigned char> : public false_type{};
+template <> struct is_signed<const volatile unsigned char> : public false_type{};
+template <> struct is_signed<unsigned short> : public false_type{};
+template <> struct is_signed<const unsigned short> : public false_type{};
+template <> struct is_signed<volatile unsigned short> : public false_type{};
+template <> struct is_signed<const volatile unsigned short> : public false_type{};
+template <> struct is_signed<unsigned int> : public false_type{};
+template <> struct is_signed<const unsigned int> : public false_type{};
+template <> struct is_signed<volatile unsigned int> : public false_type{};
+template <> struct is_signed<const volatile unsigned int> : public false_type{};
+template <> struct is_signed<unsigned long> : public false_type{};
+template <> struct is_signed<const unsigned long> : public false_type{};
+template <> struct is_signed<volatile unsigned long> : public false_type{};
+template <> struct is_signed<const volatile unsigned long> : public false_type{};
+#ifdef BOOST_HAS_LONG_LONG
+template <> struct is_signed< ::boost::long_long_type> : public true_type{};
+template <> struct is_signed<const ::boost::long_long_type> : public true_type{};
+template <> struct is_signed<volatile ::boost::long_long_type> : public true_type{};
+template <> struct is_signed<const volatile ::boost::long_long_type> : public true_type{};
+
+template <> struct is_signed< ::boost::ulong_long_type> : public false_type{};
+template <> struct is_signed<const ::boost::ulong_long_type> : public false_type{};
+template <> struct is_signed<volatile ::boost::ulong_long_type> : public false_type{};
+template <> struct is_signed<const volatile ::boost::ulong_long_type> : public false_type{};
+#endif
+#if defined(CHAR_MIN)
+#if CHAR_MIN != 0
+template <> struct is_signed<char> : public true_type{};
+template <> struct is_signed<const char> : public true_type{};
+template <> struct is_signed<volatile char> : public true_type{};
+template <> struct is_signed<const volatile char> : public true_type{};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_signed,T,::boost::detail::is_signed_imp<T>::value)
+template <> struct is_signed<char> : public false_type{};
+template <> struct is_signed<const char> : public false_type{};
+template <> struct is_signed<volatile char> : public false_type{};
+template <> struct is_signed<const volatile char> : public false_type{};
+#endif
+#endif
+#if defined(WCHAR_MIN) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
+#if WCHAR_MIN != 0
+template <> struct is_signed<wchar_t> : public true_type{};
+template <> struct is_signed<const wchar_t> : public true_type{};
+template <> struct is_signed<volatile wchar_t> : public true_type{};
+template <> struct is_signed<const volatile wchar_t> : public true_type{};
+#else
+template <> struct is_signed<wchar_t> : public false_type{};
+template <> struct is_signed<const wchar_t> : public false_type{};
+template <> struct is_signed<volatile wchar_t> : public false_type{};
+template <> struct is_signed<const volatile wchar_t> : public false_type{};
+#endif
#endif
-
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#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)
+struct is_stateless
+ : public integral_constant<bool,
+ (::boost::has_trivial_constructor<T>::value
+ && ::boost::has_trivial_copy<T>::value
+ && ::boost::has_trivial_destructor<T>::value
+ && ::boost::is_class<T>::value
+ && ::boost::is_empty<T>::value)>
+{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_STATELESS_HPP_INCLUDED
#ifndef BOOST_TT_IS_UNION_HPP_INCLUDED
#define BOOST_TT_IS_UNION_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>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
-namespace detail {
-#ifndef __GNUC__
-template <typename T> struct is_union_impl
-{
- typedef typename remove_cv<T>::type cvt;
#ifdef BOOST_IS_UNION
- BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt));
+template <class T> struct is_union : public integral_constant<bool, BOOST_IS_UNION(T)> {};
#else
- BOOST_STATIC_CONSTANT(bool, value = false);
+template <class T> struct is_union : public integral_constant<bool, false> {};
#endif
-};
-#else
-//
-// using remove_cv here generates a whole load of needless
-// warnings with gcc, since it doesn't do any good with gcc
-// in any case (at least at present), just remove it:
-//
-template <typename T> struct is_union_impl
-{
-#ifdef BOOST_IS_UNION
- BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(T));
-#else
- BOOST_STATIC_CONSTANT(bool, value = false);
-#endif
-};
-#endif
-} // namespace detail
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_union,T,::boost::detail::is_union_impl<T>::value)
+template <class T> struct is_union<T const> : public is_union<T>{};
+template <class T> struct is_union<T volatile const> : public is_union<T>{};
+template <class T> struct is_union<T volatile> : public is_union<T>{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_UNION_HPP_INCLUDED
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/remove_cv.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <climits>
namespace boost {
#if !defined( __CODEGEARC__ )
-namespace detail{
+#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1310) &&\
+ !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) &&\
+ !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
-#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
+namespace detail{
template <class T>
struct is_unsigned_values
};
template <bool integral_type>
-struct is_ununsigned_select_helper
+struct is_unsigned_select_helper
{
template <class T>
struct rebind
};
template <>
-struct is_ununsigned_select_helper<false>
+struct is_unsigned_select_helper<false>
{
template <class T>
struct rebind
};
template <class T>
-struct is_unsigned_imp
+struct is_unsigned
{
- typedef is_ununsigned_select_helper<
- ::boost::type_traits::ice_or<
- ::boost::is_integral<T>::value,
- ::boost::is_enum<T>::value>::value
- > selector;
+ typedef ::boost::detail::is_unsigned_select_helper< ::boost::is_integral<T>::value || ::boost::is_enum<T>::value > selector;
typedef typename selector::template rebind<T> binder;
typedef typename binder::type type;
BOOST_STATIC_CONSTANT(bool, value = type::value);
};
+} // namespace detail
+
+template <class T> struct is_unsigned : public integral_constant<bool, boost::detail::is_unsigned<T>::value> {};
+
#else
-template <class T> struct is_unsigned_imp : public false_type{};
-template <> struct is_unsigned_imp<unsigned char> : public true_type{};
-template <> struct is_unsigned_imp<const unsigned char> : public true_type{};
-template <> struct is_unsigned_imp<volatile unsigned char> : public true_type{};
-template <> struct is_unsigned_imp<const volatile unsigned char> : public true_type{};
-template <> struct is_unsigned_imp<unsigned short> : public true_type{};
-template <> struct is_unsigned_imp<const unsigned short> : public true_type{};
-template <> struct is_unsigned_imp<volatile unsigned short> : public true_type{};
-template <> struct is_unsigned_imp<const volatile unsigned short> : public true_type{};
-template <> struct is_unsigned_imp<unsigned int> : public true_type{};
-template <> struct is_unsigned_imp<const unsigned int> : public true_type{};
-template <> struct is_unsigned_imp<volatile unsigned int> : public true_type{};
-template <> struct is_unsigned_imp<const volatile unsigned int> : public true_type{};
-template <> struct is_unsigned_imp<unsigned long> : public true_type{};
-template <> struct is_unsigned_imp<const unsigned long> : public true_type{};
-template <> struct is_unsigned_imp<volatile unsigned long> : public true_type{};
-template <> struct is_unsigned_imp<const volatile unsigned long> : public true_type{};
-#ifdef BOOST_HAS_LONG_LONG
-template <> struct is_unsigned_imp<unsigned long long> : public true_type{};
-template <> struct is_unsigned_imp<const unsigned long long> : public true_type{};
-template <> struct is_unsigned_imp<volatile unsigned long long> : public true_type{};
-template <> struct is_unsigned_imp<const volatile unsigned long long> : public true_type{};
-#endif
-#if defined(CHAR_MIN) && (CHAR_MIN == 0)
-template <> struct is_unsigned_imp<char> : public true_type{};
-template <> struct is_unsigned_imp<const char> : public true_type{};
-template <> struct is_unsigned_imp<volatile char> : public true_type{};
-template <> struct is_unsigned_imp<const volatile char> : public true_type{};
-#endif
-#if defined(WCHAR_MIN) && (WCHAR_MIN == 0) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
-template <> struct is_unsigned_imp<wchar_t> : public true_type{};
-template <> struct is_unsigned_imp<const wchar_t> : public true_type{};
-template <> struct is_unsigned_imp<volatile wchar_t> : public true_type{};
-template <> struct is_unsigned_imp<const volatile wchar_t> : public true_type{};
-#endif
+template <class T> struct is_unsigned : public false_type{};
#endif
-}
-
-#endif // !defined( __CODEGEARC__ )
+#else // defined( __CODEGEARC__ )
+template <class T> struct is_unsigned : public integral_constant<bool, __is_unsigned(T)> {};
+#endif
-#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,__is_unsigned(T))
+template <> struct is_unsigned<unsigned char> : public true_type{};
+template <> struct is_unsigned<const unsigned char> : public true_type{};
+template <> struct is_unsigned<volatile unsigned char> : public true_type{};
+template <> struct is_unsigned<const volatile unsigned char> : public true_type{};
+template <> struct is_unsigned<unsigned short> : public true_type{};
+template <> struct is_unsigned<const unsigned short> : public true_type{};
+template <> struct is_unsigned<volatile unsigned short> : public true_type{};
+template <> struct is_unsigned<const volatile unsigned short> : public true_type{};
+template <> struct is_unsigned<unsigned int> : public true_type{};
+template <> struct is_unsigned<const unsigned int> : public true_type{};
+template <> struct is_unsigned<volatile unsigned int> : public true_type{};
+template <> struct is_unsigned<const volatile unsigned int> : public true_type{};
+template <> struct is_unsigned<unsigned long> : public true_type{};
+template <> struct is_unsigned<const unsigned long> : public true_type{};
+template <> struct is_unsigned<volatile unsigned long> : public true_type{};
+template <> struct is_unsigned<const volatile unsigned long> : public true_type{};
+
+template <> struct is_unsigned<signed char> : public false_type{};
+template <> struct is_unsigned<const signed char> : public false_type{};
+template <> struct is_unsigned<volatile signed char> : public false_type{};
+template <> struct is_unsigned<const volatile signed char> : public false_type{};
+template <> struct is_unsigned< short> : public false_type{};
+template <> struct is_unsigned<const short> : public false_type{};
+template <> struct is_unsigned<volatile short> : public false_type{};
+template <> struct is_unsigned<const volatile short> : public false_type{};
+template <> struct is_unsigned< int> : public false_type{};
+template <> struct is_unsigned<const int> : public false_type{};
+template <> struct is_unsigned<volatile int> : public false_type{};
+template <> struct is_unsigned<const volatile int> : public false_type{};
+template <> struct is_unsigned< long> : public false_type{};
+template <> struct is_unsigned<const long> : public false_type{};
+template <> struct is_unsigned<volatile long> : public false_type{};
+template <> struct is_unsigned<const volatile long> : public false_type{};
+#ifdef BOOST_HAS_LONG_LONG
+template <> struct is_unsigned< ::boost::ulong_long_type> : public true_type{};
+template <> struct is_unsigned<const ::boost::ulong_long_type> : public true_type{};
+template <> struct is_unsigned<volatile ::boost::ulong_long_type> : public true_type{};
+template <> struct is_unsigned<const volatile ::boost::ulong_long_type> : public true_type{};
+
+template <> struct is_unsigned< ::boost::long_long_type> : public false_type{};
+template <> struct is_unsigned<const ::boost::long_long_type> : public false_type{};
+template <> struct is_unsigned<volatile ::boost::long_long_type> : public false_type{};
+template <> struct is_unsigned<const volatile ::boost::long_long_type> : public false_type{};
+#endif
+#if defined(CHAR_MIN)
+#if CHAR_MIN == 0
+template <> struct is_unsigned<char> : public true_type{};
+template <> struct is_unsigned<const char> : public true_type{};
+template <> struct is_unsigned<volatile char> : public true_type{};
+template <> struct is_unsigned<const volatile char> : public true_type{};
#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,::boost::detail::is_unsigned_imp<T>::value)
+template <> struct is_unsigned<char> : public false_type{};
+template <> struct is_unsigned<const char> : public false_type{};
+template <> struct is_unsigned<volatile char> : public false_type{};
+template <> struct is_unsigned<const volatile char> : public false_type{};
+#endif
+#endif
+#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(WCHAR_MIN)
+#if WCHAR_MIN == 0
+template <> struct is_unsigned<wchar_t> : public true_type{};
+template <> struct is_unsigned<const wchar_t> : public true_type{};
+template <> struct is_unsigned<volatile wchar_t> : public true_type{};
+template <> struct is_unsigned<const volatile wchar_t> : public true_type{};
+#else
+template <> struct is_unsigned<wchar_t> : public false_type{};
+template <> struct is_unsigned<const wchar_t> : public false_type{};
+template <> struct is_unsigned<volatile wchar_t> : public false_type{};
+template <> struct is_unsigned<const volatile wchar_t> : public false_type{};
+#endif
#endif
-
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_same.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/not.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
namespace detail {
};
template<typename Base, typename Derived>
-struct is_virtual_base_of_impl<Base, Derived, mpl::true_>
+struct is_virtual_base_of_impl<Base, Derived, true_type>
{
union max_align
{
template<typename Base, typename Derived>
struct is_virtual_base_of_impl2
{
- typedef typename mpl::and_<is_base_of<Base, Derived>, mpl::not_<is_same<Base, Derived> > >::type tag_type;
+ typedef boost::integral_constant<bool, (boost::is_base_of<Base, Derived>::value && ! boost::is_same<Base, Derived>::value)> tag_type;
typedef is_virtual_base_of_impl<Base, Derived, tag_type> imp;
BOOST_STATIC_CONSTANT(bool, value = imp::value);
};
} // namespace detail
-BOOST_TT_AUX_BOOL_TRAIT_DEF2(
- is_virtual_base_of
- , Base
- , Derived
- , (::boost::detail::is_virtual_base_of_impl2<Base,Derived>::value)
-)
+template <class Base, class Derived> struct is_virtual_base_of : public integral_constant<bool, (::boost::detail::is_virtual_base_of_impl2<Base, Derived>::value)>{};
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base,Derived&,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived&,false)
+template <class Base, class Derived> struct is_virtual_base_of<Base&, Derived> : public false_type{};
+template <class Base, class Derived> struct is_virtual_base_of<Base, Derived&> : public false_type{};
+template <class Base, class Derived> struct is_virtual_base_of<Base&, Derived&> : public false_type{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif
#ifndef BOOST_TT_IS_VOID_HPP_INCLUDED
#define BOOST_TT_IS_VOID_HPP_INCLUDED
-#include <boost/config.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
-//* is a type T void - is_void<T>
-#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,__is_void(T))
-#else
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,false)
-BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void,true)
-
-#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void const,true)
-BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void volatile,true)
-BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void const volatile,true)
-#endif
+template <class T>
+struct is_void : public false_type {};
-#endif // non-CodeGear implementation
+template<> struct is_void<void> : public true_type {};
+template<> struct is_void<const void> : public true_type{};
+template<> struct is_void<const volatile void> : public true_type{};
+template<> struct is_void<volatile void> : public true_type{};
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_VOID_HPP_INCLUDED
#ifndef BOOST_TT_IS_VOLATILE_HPP_INCLUDED
#define BOOST_TT_IS_VOLATILE_HPP_INCLUDED
-#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-
-# include <boost/type_traits/detail/cv_traits_impl.hpp>
-# if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
-# include <boost/type_traits/remove_bounds.hpp>
-# endif
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
-namespace detail{
-template <class T>
-struct is_volatile_rval_filter
-{
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
- BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_volatile);
-#else
- BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(T)>::is_volatile);
-#endif
-};
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-//
-// We can't filter out rvalue_references at the same level as
-// references or we get ambiguities from msvc:
-//
-template <class T>
-struct is_volatile_rval_filter<T&&>
-{
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-#endif
-}
-
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,__is_volatile(T))
-#else
-//* is a type T declared volatile - is_volatile<T>
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::is_volatile_rval_filter<T>::value)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T&,false)
+ template <class T>
+ struct is_volatile : public integral_constant<bool, __is_volatile(T)> {};
-#if defined(BOOST_ILLEGAL_CV_REFERENCES)
-// these are illegal specialisations; cv-qualifies applied to
-// references have no effect according to [8.3.2p1],
-// C++ Builder requires them though as it treats cv-qualified
-// references as distinct types...
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& const,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& volatile,false)
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& const volatile,false)
-#endif
+#else
+
+ template <class T>
+ struct is_volatile : public false_type {};
+ template <class T> struct is_volatile<T volatile> : public true_type{};
+ template <class T, size_t N> struct is_volatile<T volatile[N]> : public true_type{};
+ template <class T> struct is_volatile<T volatile[]> : public true_type{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_IS_VOLATILE_HPP_INCLUDED
#ifndef BOOST_TT_MAKE_SIGNED_HPP_INCLUDED
#define BOOST_TT_MAKE_SIGNED_HPP_INCLUDED
-#include <boost/mpl/if.hpp>
+#include <boost/type_traits/conditional.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_signed.hpp>
#include <boost/type_traits/is_unsigned.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_volatile.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
-#include <boost/type_traits/detail/ice_and.hpp>
-#include <boost/type_traits/detail/ice_not.hpp>
#include <boost/static_assert.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
-namespace detail {
-
template <class T>
-struct make_signed_imp
+struct make_signed
{
- BOOST_STATIC_ASSERT(
- (::boost::type_traits::ice_or< ::boost::is_integral<T>::value, ::boost::is_enum<T>::value>::value));
- BOOST_STATIC_ASSERT(
- (::boost::type_traits::ice_not< ::boost::is_same<
- typename remove_cv<T>::type, bool>::value>::value));
+private:
+ BOOST_STATIC_ASSERT_MSG(( ::boost::is_integral<T>::value || ::boost::is_enum<T>::value), "The template argument to make_signed must be an integer or enum type.");
+ BOOST_STATIC_ASSERT_MSG(!(::boost::is_same<typename remove_cv<T>::type, bool>::value), "The template argument to make_signed must not be the type bool.");
typedef typename remove_cv<T>::type t_no_cv;
- typedef typename mpl::if_c<
- (::boost::type_traits::ice_and<
- ::boost::is_signed<T>::value,
- ::boost::is_integral<T>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value >::value),
+ typedef typename conditional<
+ (::boost::is_signed<T>::value
+ && ::boost::is_integral<T>::value
+ && ! ::boost::is_same<t_no_cv, char>::value
+ && ! ::boost::is_same<t_no_cv, wchar_t>::value
+ && ! ::boost::is_same<t_no_cv, bool>::value),
T,
- typename mpl::if_c<
- (::boost::type_traits::ice_and<
- ::boost::is_integral<T>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value>
- ::value),
- typename mpl::if_<
- is_same<t_no_cv, unsigned char>,
+ typename conditional<
+ (::boost::is_integral<T>::value
+ && ! ::boost::is_same<t_no_cv, char>::value
+ && ! ::boost::is_same<t_no_cv, wchar_t>::value
+ && ! ::boost::is_same<t_no_cv, bool>::value),
+ typename conditional<
+ is_same<t_no_cv, unsigned char>::value,
signed char,
- typename mpl::if_<
- is_same<t_no_cv, unsigned short>,
+ typename conditional<
+ is_same<t_no_cv, unsigned short>::value,
signed short,
- typename mpl::if_<
- is_same<t_no_cv, unsigned int>,
+ typename conditional<
+ is_same<t_no_cv, unsigned int>::value,
int,
- typename mpl::if_<
- is_same<t_no_cv, unsigned long>,
+ typename conditional<
+ is_same<t_no_cv, unsigned long>::value,
long,
#if defined(BOOST_HAS_LONG_LONG)
#ifdef BOOST_HAS_INT128
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(boost::long_long_type),
boost::long_long_type,
boost::int128_type
>::type
>::type,
// Not a regular integer type:
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(unsigned char),
signed char,
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(unsigned short),
signed short,
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(unsigned int),
int,
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(unsigned long),
long,
#if defined(BOOST_HAS_LONG_LONG)
#ifdef BOOST_HAS_INT128
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(boost::long_long_type),
boost::long_long_type,
boost::int128_type
>::type base_integer_type;
// Add back any const qualifier:
- typedef typename mpl::if_<
- is_const<T>,
+ typedef typename conditional<
+ is_const<T>::value,
typename add_const<base_integer_type>::type,
base_integer_type
>::type const_base_integer_type;
-
+public:
// Add back any volatile qualifier:
- typedef typename mpl::if_<
- is_volatile<T>,
+ typedef typename conditional<
+ is_volatile<T>::value,
typename add_volatile<const_base_integer_type>::type,
const_base_integer_type
>::type type;
};
-
-} // namespace detail
-
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_signed,T,typename boost::detail::make_signed_imp<T>::type)
-
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
#ifndef BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED
#define BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED
-#include <boost/mpl/if.hpp>
+#include <boost/type_traits/conditional.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_signed.hpp>
#include <boost/type_traits/is_unsigned.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_volatile.hpp>
-#include <boost/type_traits/detail/ice_or.hpp>
-#include <boost/type_traits/detail/ice_and.hpp>
-#include <boost/type_traits/detail/ice_not.hpp>
#include <boost/static_assert.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
-namespace detail {
-
template <class T>
-struct make_unsigned_imp
+struct make_unsigned
{
- BOOST_STATIC_ASSERT(
- (::boost::type_traits::ice_or< ::boost::is_integral<T>::value, ::boost::is_enum<T>::value>::value));
- BOOST_STATIC_ASSERT(
- (::boost::type_traits::ice_not< ::boost::is_same<
- typename remove_cv<T>::type, bool>::value>::value));
+private:
+ BOOST_STATIC_ASSERT_MSG((::boost::is_integral<T>::value || ::boost::is_enum<T>::value), "The template argument to make_unsigned must be an integer or enum type.");
+ BOOST_STATIC_ASSERT_MSG((! ::boost::is_same<typename remove_cv<T>::type, bool>::value), "The template argument to make_unsigned must not be the type bool");
typedef typename remove_cv<T>::type t_no_cv;
- typedef typename mpl::if_c<
- (::boost::type_traits::ice_and<
- ::boost::is_unsigned<T>::value,
- ::boost::is_integral<T>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value >::value),
+ typedef typename conditional<
+ (::boost::is_unsigned<T>::value && ::boost::is_integral<T>::value
+ && ! ::boost::is_same<t_no_cv, char>::value
+ && ! ::boost::is_same<t_no_cv, wchar_t>::value
+ && ! ::boost::is_same<t_no_cv, bool>::value),
T,
- typename mpl::if_c<
- (::boost::type_traits::ice_and<
- ::boost::is_integral<T>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
- ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value>
- ::value),
- typename mpl::if_<
- is_same<t_no_cv, signed char>,
+ typename conditional<
+ (::boost::is_integral<T>::value
+ && ! ::boost::is_same<t_no_cv, char>::value
+ && ! ::boost::is_same<t_no_cv, wchar_t>::value
+ && ! ::boost::is_same<t_no_cv, bool>::value),
+ typename conditional<
+ is_same<t_no_cv, signed char>::value,
unsigned char,
- typename mpl::if_<
- is_same<t_no_cv, short>,
+ typename conditional<
+ is_same<t_no_cv, short>::value,
unsigned short,
- typename mpl::if_<
- is_same<t_no_cv, int>,
+ typename conditional<
+ is_same<t_no_cv, int>::value,
unsigned int,
- typename mpl::if_<
- is_same<t_no_cv, long>,
+ typename conditional<
+ is_same<t_no_cv, long>::value,
unsigned long,
#if defined(BOOST_HAS_LONG_LONG)
#ifdef BOOST_HAS_INT128
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(boost::ulong_long_type),
boost::ulong_long_type,
boost::uint128_type
>::type
>::type,
// Not a regular integer type:
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(unsigned char),
unsigned char,
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(unsigned short),
unsigned short,
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(unsigned int),
unsigned int,
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(unsigned long),
unsigned long,
#if defined(BOOST_HAS_LONG_LONG)
#ifdef BOOST_HAS_INT128
- typename mpl::if_c<
+ typename conditional<
sizeof(t_no_cv) == sizeof(boost::ulong_long_type),
boost::ulong_long_type,
boost::uint128_type
>::type base_integer_type;
// Add back any const qualifier:
- typedef typename mpl::if_<
- is_const<T>,
+ typedef typename conditional<
+ is_const<T>::value,
typename add_const<base_integer_type>::type,
base_integer_type
>::type const_base_integer_type;
-
+public:
// Add back any volatile qualifier:
- typedef typename mpl::if_<
- is_volatile<T>,
+ typedef typename conditional<
+ is_volatile<T>::value,
typename add_volatile<const_base_integer_type>::type,
const_base_integer_type
>::type type;
};
-
-} // namespace detail
-
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_unsigned,T,typename boost::detail::make_unsigned_imp<T>::type)
-
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
#include <boost/type_traits/integral_promotion.hpp>
#include <boost/type_traits/floating_point_promotion.hpp>
-// Should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
-namespace detail {
-
-template<class T>
-struct promote_impl
- : public integral_promotion<
- BOOST_DEDUCED_TYPENAME floating_point_promotion<T>::type
- >
-{
-};
+template<class T> struct promote : public integral_promotion<typename floating_point_promotion<T>::type>{};
}
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(
- promote
- , T
- , BOOST_DEDUCED_TYPENAME boost::detail::promote_impl<T>::type
- )
-}
-
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // #ifndef FILE_boost_type_traits_promote_hpp_INCLUDED
#ifndef BOOST_TT_RANK_HPP_INCLUDED
#define BOOST_TT_RANK_HPP_INCLUDED
-// should be the last #include
-#include <boost/type_traits/detail/size_t_trait_def.hpp>
+#include <boost/type_traits/integral_constant.hpp>
namespace boost {
#endif // !defined( __CODEGEARC__ )
#if defined( __CODEGEARC__ )
-BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,__array_rank(T))
+template <class T> struct rank : public integral_constant<std::size_t, __array_rank(T)>{};
#else
-BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,(::boost::detail::rank_imp<T,0>::value))
+template <class T> struct rank : public integral_constant<std::size_t, (::boost::detail::rank_imp<T, 0>::value)>{};
#endif
} // namespace boost
-#include <boost/type_traits/detail/size_t_trait_undef.hpp>
-
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#include <cstddef>
#include <boost/detail/workaround.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_all_extents,T,T)
+template <class T> struct remove_all_extents{ typedef T type; };
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T[N],typename boost::remove_all_extents<T>::type type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T const[N],typename boost::remove_all_extents<T const>::type type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T volatile[N],typename boost::remove_all_extents<T volatile>::type type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T const volatile[N],typename boost::remove_all_extents<T const volatile>::type type)
+template <class T, std::size_t N> struct remove_all_extents<T[N]> : public remove_all_extents<T>{};
+template <class T, std::size_t N> struct remove_all_extents<T const[N]> : public remove_all_extents<T const>{};
+template <class T, std::size_t N> struct remove_all_extents<T volatile[N]> : public remove_all_extents<T volatile>{};
+template <class T, std::size_t N> struct remove_all_extents<T const volatile[N]> : public remove_all_extents<T const volatile>{};
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T[],typename boost::remove_all_extents<T>::type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T const[],typename boost::remove_all_extents<T const>::type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T volatile[],typename boost::remove_all_extents<T volatile>::type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T const volatile[],typename boost::remove_all_extents<T const volatile>::type)
+template <class T> struct remove_all_extents<T[]> : public remove_all_extents<T>{};
+template <class T> struct remove_all_extents<T const[]> : public remove_all_extents<T const>{};
+template <class T> struct remove_all_extents<T volatile[]> : public remove_all_extents<T volatile>{};
+template <class T> struct remove_all_extents<T const volatile[]> : public remove_all_extents<T const volatile>{};
#endif
#endif
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
#ifndef BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
#define BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
-#include <boost/config.hpp>
-#include <cstddef>
-#include <boost/detail/workaround.hpp>
+#include <boost/type_traits/remove_extent.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
+namespace boost
+{
-namespace boost {
-
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_bounds,T,T)
-
-#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T[N],T type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const[N],T const type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T volatile[N],T volatile type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const volatile[N],T const volatile type)
-#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T[],T)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const[],T const)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T volatile[],T volatile)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const volatile[],T const volatile)
-#endif
-#endif
+template <class T> struct remove_bounds : public remove_extent<T> {};
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
#ifndef BOOST_TT_REMOVE_CONST_HPP_INCLUDED
#define BOOST_TT_REMOVE_CONST_HPP_INCLUDED
-#include <boost/type_traits/is_volatile.hpp>
-#include <boost/type_traits/detail/cv_traits_impl.hpp>
#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-
#include <cstddef>
-
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
+#include <boost/detail/workaround.hpp>
namespace boost {
+ // convert a type T to a non-cv-qualified type - remove_const<T>
+ template <class T> struct remove_const{ typedef T type; };
+ template <class T> struct remove_const<T const>{ typedef T type; };
-namespace detail {
-
-template <typename T, bool is_vol>
-struct remove_const_helper
-{
- typedef T type;
-};
-
-template <typename T>
-struct remove_const_helper<T, true>
-{
- typedef T volatile type;
-};
-
-
-template <typename T>
-struct remove_const_impl
-{
- typedef typename remove_const_helper<
- typename cv_traits_imp<BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(T)>::unqualified_type
- , ::boost::is_volatile<T>::value
- >::type type;
-};
-
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-//
-// We can't filter out rvalue_references at the same level as
-// references or we get ambiguities from msvc:
-//
-template <typename T>
-struct remove_const_impl<T&&>
-{
- typedef T&& type;
-};
-#endif
-
-} // namespace detail
-
-// * convert a type T to non-const type - remove_const<T>
-
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename boost::detail::remove_const_impl<T>::type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_const,T&,T&)
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T const[N],T type[N])
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T const volatile[N],T volatile type[N])
+ template <class T, std::size_t N> struct remove_const<T const[N]>{ typedef T type[N]; };
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+ template <class T> struct remove_const<T const[]>{ typedef T type[]; };
+#endif
#endif
-
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_REMOVE_CONST_HPP_INCLUDED
#ifndef BOOST_TT_REMOVE_CV_HPP_INCLUDED
#define BOOST_TT_REMOVE_CV_HPP_INCLUDED
-#include <boost/type_traits/detail/cv_traits_impl.hpp>
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
-
#include <cstddef>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
+ // convert a type T to a non-cv-qualified type - remove_cv<T>
+template <class T> struct remove_cv{ typedef T type; };
+template <class T> struct remove_cv<T const>{ typedef T type; };
+template <class T> struct remove_cv<T volatile>{ typedef T type; };
+template <class T> struct remove_cv<T const volatile>{ typedef T type; };
-namespace detail{
-
-template <class T>
-struct rvalue_ref_filter_rem_cv
-{
- typedef typename boost::detail::cv_traits_imp<BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(T)>::unqualified_type type;
-};
-
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-//
-// We can't filter out rvalue_references at the same level as
-// references or we get ambiguities from msvc:
-//
-template <class T>
-struct rvalue_ref_filter_rem_cv<T&&>
-{
- typedef T&& type;
-};
-#endif
-
-}
-
-
-// convert a type T to a non-cv-qualified type - remove_cv<T>
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,typename boost::detail::rvalue_ref_filter_rem_cv<T>::type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_cv,T&,T&)
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T const[N],T type[N])
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T volatile[N],T type[N])
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T const volatile[N],T type[N])
+template <class T, std::size_t N> struct remove_cv<T const[N]>{ typedef T type[N]; };
+template <class T, std::size_t N> struct remove_cv<T const volatile[N]>{ typedef T type[N]; };
+template <class T, std::size_t N> struct remove_cv<T volatile[N]>{ typedef T type[N]; };
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+template <class T> struct remove_cv<T const[]>{ typedef T type[]; };
+template <class T> struct remove_cv<T const volatile[]>{ typedef T type[]; };
+template <class T> struct remove_cv<T volatile[]>{ typedef T type[]; };
+#endif
#endif
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_REMOVE_CV_HPP_INCLUDED
#include <boost/detail/workaround.hpp>
#include <cstddef>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_extent,T,T)
+template <class T> struct remove_extent{ typedef T type; };
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T[N],T type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T const[N],T const type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T volatile[N],T volatile type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T const volatile[N],T const volatile type)
+template <typename T, std::size_t N> struct remove_extent<T[N]> { typedef T type; };
+template <typename T, std::size_t N> struct remove_extent<T const[N]> { typedef T const type; };
+template <typename T, std::size_t N> struct remove_extent<T volatile [N]> { typedef T volatile type; };
+template <typename T, std::size_t N> struct remove_extent<T const volatile [N]> { typedef T const volatile type; };
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T[],T)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T const[],T const)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T volatile[],T volatile)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T const volatile[],T const volatile)
+template <typename T> struct remove_extent<T[]> { typedef T type; };
+template <typename T> struct remove_extent<T const[]> { typedef T const type; };
+template <typename T> struct remove_extent<T volatile[]> { typedef T volatile type; };
+template <typename T> struct remove_extent<T const volatile[]> { typedef T const volatile type; };
#endif
#endif
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
#define BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
#if defined(BOOST_MSVC)
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/is_pointer.hpp>
#endif
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
#ifdef BOOST_MSVC
};
}
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,typename boost::detail::remove_pointer_imp2<T>::type)
+template <class T> struct remove_pointer{ typedef typename boost::detail::remove_pointer_imp2<T>::type type; };
#else
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,T)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T*,T)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* const,T)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* volatile,T)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* const volatile,T)
+template <class T> struct remove_pointer{ typedef T type; };
+template <class T> struct remove_pointer<T*>{ typedef T type; };
+template <class T> struct remove_pointer<T*const>{ typedef T type; };
+template <class T> struct remove_pointer<T*volatile>{ typedef T type; };
+template <class T> struct remove_pointer<T*const volatile>{ typedef T type; };
#endif
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
} // namespace detail
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,typename boost::detail::remove_rvalue_ref<T>::type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T&,T)
+template <class T> struct remove_reference{ typedef typename boost::detail::remove_rvalue_ref<T>::type type; };
+template <class T> struct remove_reference<T&>{ typedef T type; };
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
// references as distinct types...
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const,T)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& volatile,T)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const volatile,T)
+template <class T> struct remove_reference<T&const>{ typedef T type; };
+template <class T> struct remove_reference<T&volatile>{ typedef T type; };
+template <class T> struct remove_reference<T&const volatile>{ typedef T type; };
#endif
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED
#ifndef BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED
#define BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED
-#include <boost/type_traits/is_const.hpp>
-#include <boost/type_traits/detail/cv_traits_impl.hpp>
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
-
#include <cstddef>
-// should be the last #include
-#include <boost/type_traits/detail/type_trait_def.hpp>
-
namespace boost {
+ // convert a type T to a non-cv-qualified type - remove_volatile<T>
+ template <class T> struct remove_volatile{ typedef T type; };
+ template <class T> struct remove_volatile<T volatile>{ typedef T type; };
-namespace detail {
-
-template <typename T, bool is_const>
-struct remove_volatile_helper
-{
- typedef T type;
-};
-
-template <typename T>
-struct remove_volatile_helper<T,true>
-{
- typedef T const type;
-};
-
-template <typename T>
-struct remove_volatile_impl
-{
- typedef typename remove_volatile_helper<
- typename cv_traits_imp<BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(T)>::unqualified_type
- , ::boost::is_const<T>::value
- >::type type;
-};
-
-//
-// We can't filter out rvalue_references at the same level as
-// references or we get ambiguities from msvc:
-//
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-template <typename T>
-struct remove_volatile_impl<T&&>
-{
- typedef T&& type;
-};
-#endif
-} // namespace detail
-
-// * convert a type T to a non-volatile type - remove_volatile<T>
-
-BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename boost::detail::remove_volatile_impl<T>::type)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_volatile,T&,T&)
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile,T volatile[N],T type[N])
-BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile,T const volatile[N],T const type[N])
+ template <class T, std::size_t N> struct remove_volatile<T volatile[N]>{ typedef T type[N]; };
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+ template <class T> struct remove_volatile<T volatile[]>{ typedef T type[]; };
+#endif
#endif
} // namespace boost
-#include <boost/type_traits/detail/type_trait_undef.hpp>
-
#endif // BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED
--- /dev/null
+#ifndef BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED
+#define BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED
+
+//
+// Copyright 2015 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+namespace boost
+{
+
+template<class T> struct type_identity
+{
+ typedef T type;
+};
+
+} // namespace boost
+
+#endif // #ifndef BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED
#ifndef BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED
#define BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED
-#include <boost/mpl/if.hpp>
-#include <boost/preprocessor/list/for_each_i.hpp>
-#include <boost/preprocessor/tuple/to_list.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/list/transform.hpp>
-#include <boost/preprocessor/list/append.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/static_assert.hpp>
#include <boost/config.hpp>
-
-// should be the last #include
-#include <boost/type_traits/detail/bool_trait_def.hpp>
-
#include <cstddef>
+#include <boost/detail/workaround.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4121) // alignment is sensitive to packing
#endif
+#ifdef _MSC_VER
+#include <boost/type_traits/conditional.hpp>
+#endif
+
namespace boost {
+ namespace detail{
#ifndef __BORLANDC__
-namespace detail {
-
-class alignment_dummy;
-typedef void (*function_ptr)();
-typedef int (alignment_dummy::*member_ptr);
-typedef int (alignment_dummy::*member_function_ptr)();
-
-#ifdef BOOST_HAS_LONG_LONG
-#define BOOST_TT_ALIGNMENT_BASE_TYPES BOOST_PP_TUPLE_TO_LIST( \
- 12, ( \
- char, short, int, long, ::boost::long_long_type, float, double, long double \
- , void*, function_ptr, member_ptr, member_function_ptr))
-#else
-#define BOOST_TT_ALIGNMENT_BASE_TYPES BOOST_PP_TUPLE_TO_LIST( \
- 11, ( \
- char, short, int, long, float, double, long double \
- , void*, function_ptr, member_ptr, member_function_ptr))
+ union max_align
+ {
+ char c;
+ short s;
+ int i;
+ long l;
+#ifndef BOOST_NO_LONG_LONG
+ boost::long_long_type ll;
#endif
+#ifdef BOOST_HAS_INT128
+ boost::int128_type i128;
+#endif
+ float f;
+ double d;
+ long double ld;
+#ifdef BOOST_HAS_FLOAT128
+ __float128 f128;
+#endif
+ };
-#define BOOST_TT_HAS_ONE_T(D,Data,T) boost::detail::has_one_T< T >
-
-#define BOOST_TT_ALIGNMENT_STRUCT_TYPES \
- BOOST_PP_LIST_TRANSFORM(BOOST_TT_HAS_ONE_T, \
- X, \
- BOOST_TT_ALIGNMENT_BASE_TYPES)
-
-#define BOOST_TT_ALIGNMENT_TYPES \
- BOOST_PP_LIST_APPEND(BOOST_TT_ALIGNMENT_BASE_TYPES, \
- BOOST_TT_ALIGNMENT_STRUCT_TYPES)
-
-//
-// lower_alignment_helper --
-//
-// This template gets instantiated a lot, so use partial
-// specialization when available to reduce the compiler burden.
-//
-template <bool found, std::size_t target, class TestType>
-struct lower_alignment_helper
-{
- typedef char type;
- enum { value = true };
-};
-
-template <std::size_t target, class TestType>
-struct lower_alignment_helper<false,target,TestType>
-{
- enum { value = (alignment_of<TestType>::value == target) };
- typedef typename mpl::if_c<value, TestType, char>::type type;
-};
-
-#define BOOST_TT_CHOOSE_MIN_ALIGNMENT(R,P,I,T) \
- typename lower_alignment_helper< \
- BOOST_PP_CAT(found,I),target,T \
- >::type BOOST_PP_CAT(t,I); \
- enum { \
- BOOST_PP_CAT(found,BOOST_PP_INC(I)) \
- = lower_alignment_helper<BOOST_PP_CAT(found,I),target,T >::value \
- };
-
-#define BOOST_TT_CHOOSE_T(R,P,I,T) T BOOST_PP_CAT(t,I);
-
-template <typename T>
-struct has_one_T
-{
- T data;
-};
-
-template <std::size_t target>
-union lower_alignment
-{
- enum { found0 = false };
-
- BOOST_PP_LIST_FOR_EACH_I(
- BOOST_TT_CHOOSE_MIN_ALIGNMENT
- , ignored
- , BOOST_TT_ALIGNMENT_TYPES
- )
-};
-
-union max_align
-{
- BOOST_PP_LIST_FOR_EACH_I(
- BOOST_TT_CHOOSE_T
- , ignored
- , BOOST_TT_ALIGNMENT_TYPES
- )
-};
-
-#undef BOOST_TT_ALIGNMENT_BASE_TYPES
-#undef BOOST_TT_HAS_ONE_T
-#undef BOOST_TT_ALIGNMENT_STRUCT_TYPES
-#undef BOOST_TT_ALIGNMENT_TYPES
-#undef BOOST_TT_CHOOSE_MIN_ALIGNMENT
-#undef BOOST_TT_CHOOSE_T
-
-template<std::size_t TAlign, std::size_t Align>
-struct is_aligned
-{
- BOOST_STATIC_CONSTANT(bool,
- value = (TAlign >= Align) & (TAlign % Align == 0)
- );
-};
-
+template <std::size_t Target, bool check> struct long_double_alignment{ typedef long double type; };
+template <std::size_t Target> struct long_double_alignment<Target, false>{ typedef boost::detail::max_align type; };
-} // namespace detail
+template <std::size_t Target, bool check> struct double_alignment{ typedef double type; };
+template <std::size_t Target> struct double_alignment<Target, false>{ typedef typename long_double_alignment<Target, boost::alignment_of<long double>::value >= Target>::type type; };
-template<std::size_t Align>
-struct is_pod< ::boost::detail::lower_alignment<Align> >
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = true);
-};
-
-// This alignment method originally due to Brian Parker, implemented by David
-// Abrahams, and then ported here by Doug Gregor.
-namespace detail{
+#ifndef BOOST_NO_LONG_LONG
+template <std::size_t Target, bool check> struct long_long_alignment{ typedef boost::long_long_type type; };
+template <std::size_t Target> struct long_long_alignment<Target, false>{ typedef typename double_alignment<Target, boost::alignment_of<double>::value >= Target>::type type; };
+#endif
-template <std::size_t Align>
-class type_with_alignment_imp
-{
- typedef ::boost::detail::lower_alignment<Align> t1;
- typedef typename mpl::if_c<
- ::boost::detail::is_aligned< ::boost::alignment_of<t1>::value,Align >::value
- , t1
- , ::boost::detail::max_align
- >::type align_t;
+template <std::size_t Target, bool check> struct long_alignment{ typedef long type; };
+#ifndef BOOST_NO_LONG_LONG
+template <std::size_t Target> struct long_alignment<Target, false>{ typedef typename long_long_alignment<Target, boost::alignment_of<boost::long_long_type>::value >= Target>::type type; };
+#else
+template <std::size_t Target> struct long_alignment<Target, false>{ typedef typename double_alignment<Target, boost::alignment_of<double>::value >= Target>::type type; };
+#endif
- BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of<align_t>::value);
+template <std::size_t Target, bool check> struct int_alignment{ typedef int type; };
+template <std::size_t Target> struct int_alignment<Target, false>{ typedef typename long_alignment<Target, boost::alignment_of<long>::value >= Target>::type type; };
- BOOST_STATIC_ASSERT(found >= Align);
- BOOST_STATIC_ASSERT(found % Align == 0);
+template <std::size_t Target, bool check> struct short_alignment{ typedef short type; };
+template <std::size_t Target> struct short_alignment<Target, false>{ typedef typename int_alignment<Target, boost::alignment_of<int>::value >= Target>::type type; };
- public:
- typedef align_t type;
-};
+template <std::size_t Target, bool check> struct char_alignment{ typedef char type; };
+template <std::size_t Target> struct char_alignment<Target, false>{ typedef typename short_alignment<Target, boost::alignment_of<short>::value >= Target>::type type; };
}
template <std::size_t Align>
-class type_with_alignment
- : public ::boost::detail::type_with_alignment_imp<Align>
+struct type_with_alignment
{
+ typedef typename boost::detail::char_alignment<Align, boost::alignment_of<char>::value >= Align>::type type;
};
-#if defined(__GNUC__) || (defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130))
+#if (defined(__GNUC__) || (defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)) || defined(__clang__)) && !defined(BOOST_TT_DISABLE_INTRINSICS)
namespace tt_align_ns {
struct __attribute__((__aligned__(2))) a2 {};
struct __attribute__((__aligned__(4))) a4 {};
struct __attribute__((__aligned__(128))) a128 {};
}
-template<> class type_with_alignment<1> { public: typedef char type; };
-template<> class type_with_alignment<2> { public: typedef tt_align_ns::a2 type; };
-template<> class type_with_alignment<4> { public: typedef tt_align_ns::a4 type; };
-template<> class type_with_alignment<8> { public: typedef tt_align_ns::a8 type; };
-template<> class type_with_alignment<16> { public: typedef tt_align_ns::a16 type; };
-template<> class type_with_alignment<32> { public: typedef tt_align_ns::a32 type; };
-template<> class type_with_alignment<64> { public: typedef tt_align_ns::a64 type; };
-template<> class type_with_alignment<128> { public: typedef tt_align_ns::a128 type; };
+template<> struct type_with_alignment<1> { public: typedef char type; };
+template<> struct type_with_alignment<2> { public: typedef tt_align_ns::a2 type; };
+template<> struct type_with_alignment<4> { public: typedef tt_align_ns::a4 type; };
+template<> struct type_with_alignment<8> { public: typedef tt_align_ns::a8 type; };
+template<> struct type_with_alignment<16> { public: typedef tt_align_ns::a16 type; };
+template<> struct type_with_alignment<32> { public: typedef tt_align_ns::a32 type; };
+template<> struct type_with_alignment<64> { public: typedef tt_align_ns::a64 type; };
+template<> struct type_with_alignment<128> { public: typedef tt_align_ns::a128 type; };
+
+template<> struct is_pod< ::boost::tt_align_ns::a2> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a4> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a8> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a16> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a32> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a64> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a128> : public true_type{};
-namespace detail {
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a2,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a4,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a32,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a64,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a128,true)
-}
#endif
-#if defined(BOOST_MSVC) || (defined(BOOST_INTEL) && defined(_MSC_VER))
+#if (defined(BOOST_MSVC) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && !defined(BOOST_TT_DISABLE_INTRINSICS)
//
// MSVC supports types which have alignments greater than the normal
// maximum: these are used for example in the types __m64 and __m128
};
}
-template<> class type_with_alignment<8>
+template<> struct type_with_alignment<8>
{
- typedef mpl::if_c<
+ typedef boost::conditional<
::boost::alignment_of<boost::detail::max_align>::value < 8,
tt_align_ns::a8,
- boost::detail::type_with_alignment_imp<8> >::type t1;
+ boost::detail::char_alignment<8, false> >::type t1;
public:
typedef t1::type type;
};
-template<> class type_with_alignment<16>
+template<> struct type_with_alignment<16>
{
- typedef mpl::if_c<
+ typedef boost::conditional<
::boost::alignment_of<boost::detail::max_align>::value < 16,
tt_align_ns::a16,
- boost::detail::type_with_alignment_imp<16> >::type t1;
+ boost::detail::char_alignment<16, false> >::type t1;
public:
typedef t1::type type;
};
-template<> class type_with_alignment<32>
+template<> struct type_with_alignment<32>
{
- typedef mpl::if_c<
+ typedef boost::conditional<
::boost::alignment_of<boost::detail::max_align>::value < 32,
tt_align_ns::a32,
- boost::detail::type_with_alignment_imp<32> >::type t1;
+ boost::detail::char_alignment<32, false> >::type t1;
public:
typedef t1::type type;
};
-template<> class type_with_alignment<64> {
- typedef mpl::if_c<
+template<> struct type_with_alignment<64> {
+ typedef boost::conditional<
::boost::alignment_of<boost::detail::max_align>::value < 64,
tt_align_ns::a64,
- boost::detail::type_with_alignment_imp<64> >::type t1;
+ boost::detail::char_alignment<64, false> >::type t1;
public:
typedef t1::type type;
};
-template<> class type_with_alignment<128> {
- typedef mpl::if_c<
+template<> struct type_with_alignment<128> {
+ typedef boost::conditional<
::boost::alignment_of<boost::detail::max_align>::value < 128,
tt_align_ns::a128,
- boost::detail::type_with_alignment_imp<128> >::type t1;
+ boost::detail::char_alignment<128, false> >::type t1;
public:
typedef t1::type type;
};
-namespace detail {
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a32,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a64,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a128,true)
-}
+template<> struct is_pod< ::boost::tt_align_ns::a8> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a16> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a32> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a64> : public true_type{};
+template<> struct is_pod< ::boost::tt_align_ns::a128> : public true_type{};
+
#endif
#else
typedef ::boost::tt_align_ns::a16 max_align;
+}
//#if ! BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a2,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a4,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true)
+template <> struct is_pod< ::boost::tt_align_ns::a2> : public true_type{};
+template <> struct is_pod< ::boost::tt_align_ns::a4> : public true_type{};
+template <> struct is_pod< ::boost::tt_align_ns::a8> : public true_type{};
+template <> struct is_pod< ::boost::tt_align_ns::a16> : public true_type{};
//#endif
-}
template <std::size_t N> struct type_with_alignment
{
# pragma warning(pop)
#endif
-#include <boost/type_traits/detail/bool_trait_undef.hpp>
-
#endif // BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED
+++ /dev/null
-// declval.hpp -------------------------------------------------------------//
-
-// Copyright 2010 Vicente J. Botet Escriba
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-#ifndef BOOST_UTILITY_DECLVAL_HPP
-#define BOOST_UTILITY_DECLVAL_HPP
-
-#include <boost/config.hpp>
-
-//----------------------------------------------------------------------------//
-
-#include <boost/type_traits/add_rvalue_reference.hpp>
-
-//----------------------------------------------------------------------------//
-// //
-// C++03 implementation of //
-// 20.2.4 Function template declval [declval] //
-// Written by Vicente J. Botet Escriba //
-// //
-// 1 The library provides the function template declval to simplify the
-// definition of expressions which occur as unevaluated operands.
-// 2 Remarks: If this function is used, the program is ill-formed.
-// 3 Remarks: The template parameter T of declval may be an incomplete type.
-// [ Example:
-//
-// template <class To, class From>
-// decltype(static_cast<To>(declval<From>())) convert(From&&);
-//
-// declares a function template convert which only participates in overloading
-// if the type From can be explicitly converted to type To. For another example
-// see class template common_type (20.9.7.6). -end example ]
-//----------------------------------------------------------------------------//
-
-namespace boost {
-
- template <typename T>
- typename add_rvalue_reference<T>::type declval() BOOST_NOEXCEPT; // as unevaluated operand
-
-} // namespace boost
-
-#endif // BOOST_UTILITY_DECLVAL_HPP
+++ /dev/null
-// (C) Copyright 2002-2008, Fernando Luis Cacciola Carballal.
-//
-// 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)
-//
-// 21 Ago 2002 (Created) Fernando Cacciola
-// 24 Dec 2007 (Refactored and worked around various compiler bugs) Fernando Cacciola, Niels Dekker
-// 23 May 2008 (Fixed operator= const issue, added initialized_value) Niels Dekker, Fernando Cacciola
-// 21 Ago 2008 (Added swap) Niels Dekker, Fernando Cacciola
-// 20 Feb 2009 (Fixed logical const-ness issues) Niels Dekker, Fernando Cacciola
-// 03 Apr 2010 (Added initialized<T>, suggested by Jeffrey Hellrung, fixing #3472) Niels Dekker
-// 30 May 2010 (Made memset call conditional, fixing #3869) Niels Dekker
-//
-#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
-#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
-
-// Note: The implementation of boost::value_initialized had to deal with the
-// fact that various compilers haven't fully implemented value-initialization.
-// The constructor of boost::value_initialized<T> works around these compiler
-// issues, by clearing the bytes of T, before constructing the T object it
-// contains. More details on these issues are at libs/utility/value_init.htm
-
-#include <boost/aligned_storage.hpp>
-#include <boost/config.hpp> // For BOOST_NO_COMPLETE_VALUE_INITIALIZATION.
-#include <boost/detail/workaround.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/cv_traits.hpp>
-#include <boost/type_traits/alignment_of.hpp>
-#include <boost/swap.hpp>
-#include <cstring>
-#include <new>
-
-#ifdef BOOST_MSVC
-#pragma warning(push)
-// It is safe to ignore the following warning from MSVC 7.1 or higher:
-// "warning C4351: new behavior: elements of array will be default initialized"
-#pragma warning(disable: 4351)
-// It is safe to ignore the following MSVC warning, which may pop up when T is
-// a const type: "warning C4512: assignment operator could not be generated".
-#pragma warning(disable: 4512)
-#endif
-
-#ifdef BOOST_NO_COMPLETE_VALUE_INITIALIZATION
- // Implementation detail: The macro BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED
- // suggests that a workaround should be applied, because of compiler issues
- // regarding value-initialization.
- #define BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED
-#endif
-
-// Implementation detail: The macro BOOST_DETAIL_VALUE_INIT_WORKAROUND
-// switches the value-initialization workaround either on or off.
-#ifndef BOOST_DETAIL_VALUE_INIT_WORKAROUND
- #ifdef BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED
- #define BOOST_DETAIL_VALUE_INIT_WORKAROUND 1
- #else
- #define BOOST_DETAIL_VALUE_INIT_WORKAROUND 0
- #endif
-#endif
-
-namespace boost {
-
-template<class T>
-class initialized
-{
- private :
- struct wrapper
- {
-#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
- typename
-#endif
- remove_const<T>::type data;
-
- BOOST_GPU_ENABLED
- wrapper()
- :
- data()
- {
- }
-
- BOOST_GPU_ENABLED
- wrapper(T const & arg)
- :
- data(arg)
- {
- }
- };
-
- mutable
-#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
- typename
-#endif
- aligned_storage<sizeof(wrapper), alignment_of<wrapper>::value>::type x;
-
- BOOST_GPU_ENABLED
- wrapper * wrapper_address() const
- {
- return static_cast<wrapper *>( static_cast<void*>(&x));
- }
-
- public :
-
- BOOST_GPU_ENABLED
- initialized()
- {
-#if BOOST_DETAIL_VALUE_INIT_WORKAROUND
- std::memset(&x, 0, sizeof(x));
-#endif
- new (wrapper_address()) wrapper();
- }
-
- BOOST_GPU_ENABLED
- initialized(initialized const & arg)
- {
- new (wrapper_address()) wrapper( static_cast<wrapper const &>(*(arg.wrapper_address())));
- }
-
- BOOST_GPU_ENABLED
- explicit initialized(T const & arg)
- {
- new (wrapper_address()) wrapper(arg);
- }
-
- BOOST_GPU_ENABLED
- initialized & operator=(initialized const & arg)
- {
- // Assignment is only allowed when T is non-const.
- BOOST_STATIC_ASSERT( ! is_const<T>::value );
- *wrapper_address() = static_cast<wrapper const &>(*(arg.wrapper_address()));
- return *this;
- }
-
- BOOST_GPU_ENABLED
- ~initialized()
- {
- wrapper_address()->wrapper::~wrapper();
- }
-
- BOOST_GPU_ENABLED
- T const & data() const
- {
- return wrapper_address()->data;
- }
-
- BOOST_GPU_ENABLED
- T& data()
- {
- return wrapper_address()->data;
- }
-
- BOOST_GPU_ENABLED
- void swap(initialized & arg)
- {
- ::boost::swap( this->data(), arg.data() );
- }
-
- BOOST_GPU_ENABLED
- operator T const &() const
- {
- return wrapper_address()->data;
- }
-
- BOOST_GPU_ENABLED
- operator T&()
- {
- return wrapper_address()->data;
- }
-
-} ;
-
-template<class T>
-BOOST_GPU_ENABLED
-T const& get ( initialized<T> const& x )
-{
- return x.data() ;
-}
-
-template<class T>
-BOOST_GPU_ENABLED
-T& get ( initialized<T>& x )
-{
- return x.data() ;
-}
-
-template<class T>
-BOOST_GPU_ENABLED
-void swap ( initialized<T> & lhs, initialized<T> & rhs )
-{
- lhs.swap(rhs) ;
-}
-
-template<class T>
-class value_initialized
-{
- private :
-
- // initialized<T> does value-initialization by default.
- initialized<T> m_data;
-
- public :
-
- BOOST_GPU_ENABLED
- value_initialized()
- :
- m_data()
- { }
-
- BOOST_GPU_ENABLED
- T const & data() const
- {
- return m_data.data();
- }
-
- BOOST_GPU_ENABLED
- T& data()
- {
- return m_data.data();
- }
-
- BOOST_GPU_ENABLED
- void swap(value_initialized & arg)
- {
- m_data.swap(arg.m_data);
- }
-
- BOOST_GPU_ENABLED
- operator T const &() const
- {
- return m_data;
- }
-
- BOOST_GPU_ENABLED
- operator T&()
- {
- return m_data;
- }
-} ;
-
-
-template<class T>
-BOOST_GPU_ENABLED
-T const& get ( value_initialized<T> const& x )
-{
- return x.data() ;
-}
-
-template<class T>
-BOOST_GPU_ENABLED
-T& get ( value_initialized<T>& x )
-{
- return x.data() ;
-}
-
-template<class T>
-BOOST_GPU_ENABLED
-void swap ( value_initialized<T> & lhs, value_initialized<T> & rhs )
-{
- lhs.swap(rhs) ;
-}
-
-
-class initialized_value_t
-{
- public :
-
- template <class T> BOOST_GPU_ENABLED operator T() const
- {
- return initialized<T>().data();
- }
-};
-
-initialized_value_t const initialized_value = {} ;
-
-
-} // namespace boost
-
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
-#endif
// BOOST_VERSION / 100 % 1000 is the minor version
// BOOST_VERSION / 100000 is the major version
-#define BOOST_VERSION 105900
+#define BOOST_VERSION 106000
//
// BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
// number, y is the minor version number, and z is the patch level if not 0.
// This is used by <config/auto_link.hpp> to select which library version to link to.
-#define BOOST_LIB_VERSION "1_59"
+#define BOOST_LIB_VERSION "1_60"
#endif
c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::transform_primary(const char* p1, const char* p2)
{
static char s_delim;
- static const int s_collate_type = ::boost::re_detail::find_sort_syntax(static_cast<c_regex_traits<char>*>(0), &s_delim);
+ static const int s_collate_type = ::boost::BOOST_REGEX_DETAIL_NS::find_sort_syntax(static_cast<c_regex_traits<char>*>(0), &s_delim);
std::string result;
//
// What we do here depends upon the format of the sort key returned by
//
switch(s_collate_type)
{
- case ::boost::re_detail::sort_C:
- case ::boost::re_detail::sort_unknown:
+ case ::boost::BOOST_REGEX_DETAIL_NS::sort_C:
+ case ::boost::BOOST_REGEX_DETAIL_NS::sort_unknown:
// the best we can do is translate to lower case, then get a regular sort key:
{
result.assign(p1, p2);
result = transform(&*result.begin(), &*result.begin() + result.size());
break;
}
- case ::boost::re_detail::sort_fixed:
+ case ::boost::BOOST_REGEX_DETAIL_NS::sort_fixed:
{
// get a regular sort key, and then truncate it:
result = transform(p1, p2);
result.erase(s_delim);
break;
}
- case ::boost::re_detail::sort_delim:
+ case ::boost::BOOST_REGEX_DETAIL_NS::sort_delim:
// get a regular sort key, and then truncate everything after the delim:
result = transform(p1, p2);
if(result.size() && (result[0] == s_delim))
char_class_xdigit,
};
- int idx = ::boost::re_detail::get_default_class_id(p1, p2);
+ int idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
if(idx < 0)
{
std::string s(p1, p2);
for(std::string::size_type i = 0; i < s.size(); ++i)
s[i] = static_cast<char>((std::tolower)(static_cast<unsigned char>(s[i])));
- idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
+ idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
}
BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0]));
return masks[idx+1];
|| ((mask & char_class_digit) && (std::isdigit)(static_cast<unsigned char>(c)))
|| ((mask & char_class_punct) && (std::ispunct)(static_cast<unsigned char>(c)))
|| ((mask & char_class_xdigit) && (std::isxdigit)(static_cast<unsigned char>(c)))
- || ((mask & char_class_blank) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::re_detail::is_separator(c))
+ || ((mask & char_class_blank) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c))
|| ((mask & char_class_word) && (c == '_'))
- || ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == '\v')))
- || ((mask & char_class_horizontal) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::re_detail::is_separator(c) && (c != '\v'));
+ || ((mask & char_class_vertical) && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v')))
+ || ((mask & char_class_horizontal) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) && (c != '\v'));
}
c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::lookup_collatename(const char* p1, const char* p2)
{
std::string s(p1, p2);
- s = ::boost::re_detail::lookup_default_collate_name(s);
+ s = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(s);
if(s.empty() && (p2-p1 == 1))
s.append(1, *p1);
return s;
}
#endif
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
void cpp_regex_traits_char_layer<char>::init()
{
{
std::string m("Unable to open message catalog: ");
std::runtime_error err(m + cat_name);
- boost::re_detail::raise_runtime_error(err);
+ boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
}
//
}while(0xFF != i++);
}
-} // re_detail
+} // BOOST_REGEX_DETAIL_NS
} // boost
#endif
}
}
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
class RegExData
{
RegEx::RegEx()
{
- pdata = new re_detail::RegExData();
+ pdata = new BOOST_REGEX_DETAIL_NS::RegExData();
}
RegEx::RegEx(const RegEx& o)
{
- pdata = new re_detail::RegExData(*(o.pdata));
+ pdata = new BOOST_REGEX_DETAIL_NS::RegExData(*(o.pdata));
}
RegEx::~RegEx()
RegEx::RegEx(const char* c, bool icase)
{
- pdata = new re_detail::RegExData();
+ pdata = new BOOST_REGEX_DETAIL_NS::RegExData();
SetExpression(c, icase);
}
RegEx::RegEx(const std::string& s, bool icase)
{
- pdata = new re_detail::RegExData();
+ pdata = new BOOST_REGEX_DETAIL_NS::RegExData();
SetExpression(s.c_str(), icase);
}
//
bool RegEx::Match(const char* p, match_flag_type flags)
{
- pdata->t = re_detail::RegExData::type_pc;
+ pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
bool RegEx::Search(const char* p, match_flag_type flags)
{
- pdata->t = re_detail::RegExData::type_pc;
+ pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
}
return false;
}
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
struct pred1
{
GrepCallback cb;
}
unsigned int RegEx::Grep(GrepCallback cb, const char* p, match_flag_type flags)
{
- pdata->t = re_detail::RegExData::type_pc;
+ pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
- unsigned int result = regex_grep(re_detail::pred1(cb, this), p, end, pdata->e, flags);
+ unsigned int result = regex_grep(BOOST_REGEX_DETAIL_NS::pred1(cb, this), p, end, pdata->e, flags);
if(result)
pdata->update();
return result;
}
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
struct pred2
{
std::vector<std::string>& v;
unsigned int RegEx::Grep(std::vector<std::string>& v, const char* p, match_flag_type flags)
{
- pdata->t = re_detail::RegExData::type_pc;
+ pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
- unsigned int result = regex_grep(re_detail::pred2(v, this), p, end, pdata->e, flags);
+ unsigned int result = regex_grep(BOOST_REGEX_DETAIL_NS::pred2(v, this), p, end, pdata->e, flags);
if(result)
pdata->update();
return result;
}
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
struct pred3
{
std::vector<std::size_t>& v;
}
unsigned int RegEx::Grep(std::vector<std::size_t>& v, const char* p, match_flag_type flags)
{
- pdata->t = re_detail::RegExData::type_pc;
+ pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
- unsigned int result = regex_grep(re_detail::pred3(v, p, this), p, end, pdata->e, flags);
+ unsigned int result = regex_grep(BOOST_REGEX_DETAIL_NS::pred3(v, p, this), p, end, pdata->e, flags);
if(result)
pdata->update();
return result;
}
#ifndef BOOST_REGEX_NO_FILEITER
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
struct pred4
{
GrepFileCallback cb;
{
// go through sub directories:
char buf[MAX_PATH];
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(buf, MAX_PATH, start.root()));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(buf, MAX_PATH, start.root()));
if(*buf == 0)
{
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(buf, MAX_PATH, "."));
- re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, directory_iterator::separator()));
- re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, "*"));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(buf, MAX_PATH, "."));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, directory_iterator::separator()));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, "*"));
}
else
{
- re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, directory_iterator::separator()));
- re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, "*"));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, directory_iterator::separator()));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, "*"));
}
directory_iterator dstart(buf);
directory_iterator dend;
while(start != end)
{
mapfile map((*start).c_str());
- pdata->t = re_detail::RegExData::type_pf;
+ pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pf;
pdata->fbase = map.begin();
- re_detail::pred4 pred(cb, this, (*start).c_str());
+ BOOST_REGEX_DETAIL_NS::pred4 pred(cb, this, (*start).c_str());
int r = regex_grep(pred, map.begin(), map.end(), pdata->e, flags);
result += r;
++start;
while(start != end)
{
mapfile map((*start).c_str());
- pdata->t = re_detail::RegExData::type_pf;
+ pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pf;
pdata->fbase = map.begin();
if(regex_search(map.begin(), map.end(), pdata->fm, pdata->e, flags))
bool copy, match_flag_type flags)
{
std::string result;
- re_detail::string_out_iterator<std::string> i(result);
+ BOOST_REGEX_DETAIL_NS::string_out_iterator<std::string> i(result);
if(!copy) flags |= format_no_copy;
regex_replace(i, in.begin(), in.end(), pdata->e, fmt.c_str(), flags);
return result;
{
std::string result;
if(!copy) flags |= format_no_copy;
- re_detail::string_out_iterator<std::string> i(result);
+ BOOST_REGEX_DETAIL_NS::string_out_iterator<std::string> i(result);
regex_replace(i, in, in + std::strlen(in), pdata->e, fmt, flags);
return result;
}
{
switch(pdata->t)
{
- case re_detail::RegExData::type_pc:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_pc:
return pdata->m[i].matched ? pdata->m[i].first - pdata->pbase : RegEx::npos;
#ifndef BOOST_REGEX_NO_FILEITER
- case re_detail::RegExData::type_pf:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_pf:
return pdata->fm[i].matched ? pdata->fm[i].first - pdata->fbase : RegEx::npos;
#endif
- case re_detail::RegExData::type_copy:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_copy:
{
std::map<int, std::ptrdiff_t, std::less<int> >::iterator pos = pdata->positions.find(i);
if(pos == pdata->positions.end())
{
switch(pdata->t)
{
- case re_detail::RegExData::type_pc:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_pc:
return pdata->m[i].matched ? pdata->m[i].second - pdata->m[i].first : RegEx::npos;
#ifndef BOOST_REGEX_NO_FILEITER
- case re_detail::RegExData::type_pf:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_pf:
return pdata->fm[i].matched ? pdata->fm[i].second - pdata->fm[i].first : RegEx::npos;
#endif
- case re_detail::RegExData::type_copy:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_copy:
{
std::map<int, std::string, std::less<int> >::iterator pos = pdata->strings.find(i);
if(pos == pdata->strings.end())
{
switch(pdata->t)
{
- case re_detail::RegExData::type_pc:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_pc:
return pdata->m[i].matched;
#ifndef BOOST_REGEX_NO_FILEITER
- case re_detail::RegExData::type_pf:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_pf:
return pdata->fm[i].matched;
#endif
- case re_detail::RegExData::type_copy:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_copy:
{
std::map<int, std::string, std::less<int> >::iterator pos = pdata->strings.find(i);
if(pos == pdata->strings.end())
std::string result;
switch(pdata->t)
{
- case re_detail::RegExData::type_pc:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_pc:
if(pdata->m[i].matched)
result.assign(pdata->m[i].first, pdata->m[i].second);
break;
- case re_detail::RegExData::type_pf:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_pf:
if(pdata->m[i].matched)
result.assign(to_string(pdata->m[i].first, pdata->m[i].second));
break;
- case re_detail::RegExData::type_copy:
+ case BOOST_REGEX_DETAIL_NS::RegExData::type_copy:
{
std::map<int, std::string, std::less<int> >::iterator pos = pdata->strings.find(i);
if(pos != pdata->strings.end())
#endif
namespace boost{
- namespace re_detail{
+ namespace BOOST_REGEX_DETAIL_NS{
// start with the operating system specific stuff:
#if (defined(__BORLANDC__) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32)
hmap = 0;
hfile = 0;
std::runtime_error err("Unable to create file mapping.");
- boost::re_detail::raise_runtime_error(err);
+ boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
_first = static_cast<const char*>(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0));
if(_first == 0)
{
#ifdef BOOST_NO_ANSI_APIS
if (::WideCharToMultiByte(CP_ACP, 0, data.cFileName, -1, path, max_size, NULL, NULL) == 0)
- re_detail::overflow_error_if_not_zero(1);
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(1);
#else
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(path, max_size, data.cFileName));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(path, max_size, data.cFileName));
#endif
}
BOOST_REGEX_NOEH_ASSERT(_root)
_path = new char[MAX_PATH];
BOOST_REGEX_NOEH_ASSERT(_path)
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, wild));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, wild));
ptr = _root;
while(*ptr)++ptr;
while((ptr > _root) && (*ptr != *_fi_sep) && (*ptr != *_fi_sep_alt))--ptr;
if((ptr == _root) && ( (*ptr== *_fi_sep) || (*ptr==*_fi_sep_alt) ) )
{
_root[1]='\0';
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root));
}
else
{
*ptr = 0;
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root));
if(*_path == 0)
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, "."));
- re_detail::overflow_error_if_not_zero(re_detail::strcat_s(_path, MAX_PATH, _fi_sep));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, "."));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(_path, MAX_PATH, _fi_sep));
}
ptr = _path + std::strlen(_path);
BOOST_REGEX_NOEH_ASSERT(_root)
_path = new char[MAX_PATH];
BOOST_REGEX_NOEH_ASSERT(_path)
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root));
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path));
ptr = _path + (other.ptr - other._path);
ref = other.ref;
#ifndef BOOST_NO_EXCEPTIONS
file_iterator& file_iterator::operator=(const file_iterator& other)
{
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root));
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path));
ptr = _path + (other.ptr - other._path);
if(--(ref->count) == 0)
{
BOOST_REGEX_NOEH_ASSERT(_root)
_path = new char[MAX_PATH];
BOOST_REGEX_NOEH_ASSERT(_path)
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, wild));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, wild));
ptr = _root;
while(*ptr)++ptr;
while((ptr > _root) && (*ptr != *_fi_sep) && (*ptr != *_fi_sep_alt))--ptr;
if((ptr == _root) && ( (*ptr== *_fi_sep) || (*ptr==*_fi_sep_alt) ) )
{
_root[1]='\0';
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root));
}
else
{
*ptr = 0;
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root));
if(*_path == 0)
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, "."));
- re_detail::overflow_error_if_not_zero(re_detail::strcat_s(_path, MAX_PATH, _fi_sep));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, "."));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(_path, MAX_PATH, _fi_sep));
}
ptr = _path + std::strlen(_path);
BOOST_REGEX_NOEH_ASSERT(_root)
_path = new char[MAX_PATH];
BOOST_REGEX_NOEH_ASSERT(_path)
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root));
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path));
ptr = _path + (other.ptr - other._path);
ref = other.ref;
#ifndef BOOST_NO_EXCEPTIONS
directory_iterator& directory_iterator::operator=(const directory_iterator& other)
{
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root));
- re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root));
+ BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path));
ptr = _path + (other.ptr - other._path);
if(--(ref->count) == 0)
{
#endif
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
} // namspace boost
#endif // BOOST_REGEX_NO_FILEITER
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
icu_regex_traits_implementation::string_type icu_regex_traits_implementation::do_transform(const char_type* p1, const char_type* p2, const U_NAMESPACE_QUALIFIER Collator* pcoll) const
{
/* zs */ 'z', 's',
};
- static const re_detail::character_pointer_range< ::UChar32> range_data[] = {
+ static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> range_data[] = {
{ prop_name_table+0, prop_name_table+3, }, // any
{ prop_name_table+3, prop_name_table+8, }, // ascii
{ prop_name_table+8, prop_name_table+16, }, // assigned
};
- static const re_detail::character_pointer_range< ::UChar32>* ranges_begin = range_data;
- static const re_detail::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
+ static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data;
+ static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
- re_detail::character_pointer_range< ::UChar32> t = { p1, p2, };
- const re_detail::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t);
+ BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> t = { p1, p2, };
+ const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t);
if((p != ranges_end) && (t == *p))
return icu_class_map[p - ranges_begin];
return 0;
char_class_type(U_GC_ND_MASK) | mask_xdigit,
};
- int idx = ::boost::re_detail::get_default_class_id(p1, p2);
+ int idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
if(idx >= 0)
return masks[idx+1];
char_class_type result = lookup_icu_mask(p1, p2);
}
}
if(s.size())
- idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
+ idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
if(idx >= 0)
return masks[idx+1];
if(s.size())
return result;
}
// try POSIX name:
- s = ::boost::re_detail::lookup_default_collate_name(s);
+ s = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(s);
#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
result.assign(s.begin(), s.end());
#else
return true;
if(((f & mask_ascii) != 0) && (c <= 0x7F))
return true;
- if(((f & mask_vertical) != 0) && (::boost::re_detail::is_separator(c) || (c == static_cast<char_type>('\v')) || (m == U_GC_ZL_MASK) || (m == U_GC_ZP_MASK)))
+ if(((f & mask_vertical) != 0) && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == static_cast<char_type>('\v')) || (m == U_GC_ZL_MASK) || (m == U_GC_ZP_MASK)))
return true;
- if(((f & mask_horizontal) != 0) && !::boost::re_detail::is_separator(c) && u_isspace(c) && (c != static_cast<char_type>('\v')))
+ if(((f & mask_horizontal) != 0) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) && u_isspace(c) && (c != static_cast<char_type>('\v')))
return true;
return false;
}
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char* ptr, int f)
{
- if(expression->re_magic != magic_value)
- {
- expression->guts = 0;
#ifndef BOOST_NO_EXCEPTIONS
- try{
+ try{
#endif
expression->guts = new c_regex_type();
#ifndef BOOST_NO_EXCEPTIONS
- } catch(...)
- {
- return REG_ESPACE;
- }
+ } catch(...)
+ {
+ expression->guts = 0;
+ return REG_ESPACE;
+ }
#else
- if(0 == expression->guts)
- return REG_E_MEMORY;
+ if(0 == expression->guts)
+ return REG_E_MEMORY;
#endif
- }
// set default flags:
boost::uint_fast32_t flags = (f & REG_PERLEX) ? 0 : ((f & REG_EXTENDED) ? regex::extended : regex::basic);
expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : match_default;
{
result = std::strlen(names[code]) + 1;
if(buf_size >= result)
- re_detail::strcpy_s(buf, buf_size, names[code]);
+ BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, names[code]);
return result;
}
return result;
if(r < 0)
return 0; // sprintf failed
if(std::strlen(localbuf) < buf_size)
- re_detail::strcpy_s(buf, buf_size, localbuf);
+ BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, localbuf);
return std::strlen(localbuf) + 1;
}
}
(std::sprintf)(localbuf, "%d", 0);
#endif
if(std::strlen(localbuf) < buf_size)
- re_detail::strcpy_s(buf, buf_size, localbuf);
+ BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, localbuf);
return std::strlen(localbuf) + 1;
}
if(code <= (int)REG_E_UNKNOWN)
p = static_cast<c_regex_type*>(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code));
else
{
- p = re_detail::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
+ p = BOOST_REGEX_DETAIL_NS::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
}
std::size_t len = p.size();
if(len < buf_size)
{
- re_detail::strcpy_s(buf, buf_size, p.c_str());
+ BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, p.c_str());
}
return len + 1;
}
}
regex_error::regex_error(regex_constants::error_type err)
- : std::runtime_error(::boost::re_detail::get_default_error_string(err))
+ : std::runtime_error(::boost::BOOST_REGEX_DETAIL_NS::get_default_error_string(err))
, m_error_code(err)
, m_position(0)
{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex)
{
#endif
-} // namespace re_detail
+} // namespace BOOST_REGEX_DETAIL_NS
#endif
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
void BOOST_REGEX_CALL raw_storage::resize(size_type n)
{
- register size_type newsize = start ? last - start : 1024;
+ size_type newsize = start ? last - start : 1024;
while(newsize < n)
newsize *= 2;
- register size_type datasize = end - start;
+ size_type datasize = end - start;
// extend newsize to WORD/DWORD boundary:
newsize = (newsize + padding_mask) & ~(padding_mask);
// allocate and copy data:
- register pointer ptr = static_cast<pointer>(::operator new(newsize));
+ pointer ptr = static_cast<pointer>(::operator new(newsize));
BOOST_REGEX_NOEH_ASSERT(ptr)
if(start)
std::memcpy(ptr, start, datasize);
BOOST_ASSERT(pos <= size_type(end - start));
if(size_type(last - end) < n)
resize(n + (end - start));
- register void* result = start + pos;
+ void* result = start + pos;
std::memmove(start + pos + n, start + pos, (end - start) - pos);
end += n;
return result;
#endif
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_syntax(regex_constants::syntax_type n)
{
}
-} // re_detail
+} // BOOST_REGEX_DETAIL_NS
} // boost
#define BOOST_REGEX_SOURCE
#include <boost/regex/config.hpp>
-#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_NO_WIN32_LOCALE)
#include <boost/regex/regex_traits.hpp>
#include <boost/regex/pattern_except.hpp>
}
#endif
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_NO_ANSI_APIS
UINT get_code_page_for_locale_id(lcid_type idx)
std::string cat_name(w32_regex_traits<char>::get_catalog_name());
if(cat_name.size())
{
- cat = ::boost::re_detail::w32_cat_open(cat_name);
+ cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name);
if(!cat)
{
std::string m("Unable to open message catalog: ");
std::runtime_error err(m + cat_name);
- ::boost::re_detail::raise_runtime_error(err);
+ ::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
}
//
{
for(regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i)
{
- string_type mss = ::boost::re_detail::w32_cat_get(cat, this->m_locale, i, get_default_syntax(i));
+ string_type mss = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i, get_default_syntax(i));
for(string_type::size_type j = 0; j < mss.size(); ++j)
{
m_char_map[static_cast<unsigned char>(mss[j])] = i;
{
if(m_char_map[i] == 0)
{
- if(::boost::re_detail::w32_is(this->m_locale, 0x0002u, (char)i))
+ if(::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, 0x0002u, (char)i))
m_char_map[i] = regex_constants::escape_type_class;
- else if(::boost::re_detail::w32_is(this->m_locale, 0x0001u, (char)i))
+ else if(::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, 0x0001u, (char)i))
m_char_map[i] = regex_constants::escape_type_not_class;
}
}while(0xFF != i++);
#endif
#endif
-} // re_detail
+} // BOOST_REGEX_DETAIL_NS
} // boost
#endif
c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::transform_primary(const wchar_t* p1, const wchar_t* p2)
{
static wchar_t s_delim;
- static const int s_collate_type = ::boost::re_detail::find_sort_syntax(static_cast<const c_regex_traits<wchar_t>*>(0), &s_delim);
+ static const int s_collate_type = ::boost::BOOST_REGEX_DETAIL_NS::find_sort_syntax(static_cast<const c_regex_traits<wchar_t>*>(0), &s_delim);
std::wstring result;
//
// What we do here depends upon the format of the sort key returned by
//
switch(s_collate_type)
{
- case ::boost::re_detail::sort_C:
- case ::boost::re_detail::sort_unknown:
+ case ::boost::BOOST_REGEX_DETAIL_NS::sort_C:
+ case ::boost::BOOST_REGEX_DETAIL_NS::sort_unknown:
// the best we can do is translate to lower case, then get a regular sort key:
{
result.assign(p1, p2);
result = c_regex_traits<wchar_t>::transform(&*result.begin(), &*result.begin() + result.size());
break;
}
- case ::boost::re_detail::sort_fixed:
+ case ::boost::BOOST_REGEX_DETAIL_NS::sort_fixed:
{
// get a regular sort key, and then truncate it:
result = c_regex_traits<wchar_t>::transform(&*result.begin(), &*result.begin() + result.size());
result.erase(s_delim);
break;
}
- case ::boost::re_detail::sort_delim:
+ case ::boost::BOOST_REGEX_DETAIL_NS::sort_delim:
// get a regular sort key, and then truncate everything after the delim:
result = c_regex_traits<wchar_t>::transform(&*result.begin(), &*result.begin() + result.size());
if(result.size() && (result[0] == s_delim))
char_class_xdigit,
};
- int idx = ::boost::re_detail::get_default_class_id(p1, p2);
+ int idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
if(idx < 0)
{
std::wstring s(p1, p2);
for(std::wstring::size_type i = 0; i < s.size(); ++i)
s[i] = (std::towlower)(s[i]);
- idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
+ idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
}
BOOST_ASSERT(idx+1 < static_cast<int>(sizeof(masks) / sizeof(masks[0])));
return masks[idx+1];
|| ((mask & char_class_digit) && (std::iswdigit)(c))
|| ((mask & char_class_punct) && (std::iswpunct)(c))
|| ((mask & char_class_xdigit) && (std::iswxdigit)(c))
- || ((mask & char_class_blank) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c))
+ || ((mask & char_class_blank) && (std::iswspace)(c) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c))
|| ((mask & char_class_word) && (c == '_'))
|| ((mask & char_class_unicode) && (c & ~static_cast<wchar_t>(0xff)))
- || ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == L'\v')))
- || ((mask & char_class_horizontal) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c) && (c != L'\v'));
+ || ((mask & char_class_vertical) && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == L'\v')))
+ || ((mask & char_class_horizontal) && (std::iswspace)(c) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) && (c != L'\v'));
}
c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_collatename(const wchar_t* p1, const wchar_t* p2)
while(p0 != p2)
name.append(1, char(*p0++));
#endif
- name = ::boost::re_detail::lookup_default_collate_name(name);
+ name = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(name);
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wchar_t* ptr, int f)
{
- if(expression->re_magic != wmagic_value)
- {
- expression->guts = 0;
#ifndef BOOST_NO_EXCEPTIONS
- try{
+ try{
#endif
expression->guts = new wc_regex_type();
#ifndef BOOST_NO_EXCEPTIONS
- } catch(...)
- {
- return REG_ESPACE;
- }
+ } catch(...)
+ {
+ expression->guts = 0;
+ return REG_ESPACE;
+ }
#else
- if(0 == expression->guts)
- return REG_E_MEMORY;
+ if(0 == expression->guts)
+ return REG_E_MEMORY;
#endif
- }
// set default flags:
boost::uint_fast32_t flags = (f & REG_PERLEX) ? 0 : ((f & REG_EXTENDED) ? wregex::extended : wregex::basic);
expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : match_default;
p = static_cast<wc_regex_type*>(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code));
else
{
- p = re_detail::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
+ p = BOOST_REGEX_DETAIL_NS::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
}
std::size_t len = p.size();
if(len < buf_size)
{
- re_detail::copy(p.c_str(), p.c_str() + p.size() + 1, buf);
+ BOOST_REGEX_DETAIL_NS::copy(p.c_str(), p.c_str() + p.size() + 1, buf);
}
return len + 1;
}