Boost.Signals is deprecated. This fixes bug #9943.
The only thing left to do is to rewrite (or get rid of) the boost -mt test
in config/lyxinclude.m4 not to use signals anymore.
LICENSE_1_0.txt \
libs/CMakeLists.txt \
libs/regex/CMakeLists.txt \
- libs/regex/src/CMakeLists.txt \
- libs/signals/CMakeLists.txt \
- libs/signals/src/CMakeLists.txt
+ libs/regex/src/CMakeLists.txt
AM_CPPFLAGS += -DBOOST_USER_CONFIG="<config.h>"
AM_CPPFLAGS += $(BOOST_INCLUDES)
-# This version is more than three times faster than the one below
-
-if MONOLITHIC_BOOST
-
if LYX_USE_STD_REGEX
-liblyxboost_a_SOURCES = \
- lyxboostsignals.cpp
-
else
+# This version is more than three times faster than the one below
+
+if MONOLITHIC_BOOST
+
liblyxboost_a_SOURCES = \
lyxboost.cpp \
libs/regex/src/instances.cpp \
libs/regex/src/cpp_regex_traits.cpp \
libs/regex/src/c_regex_traits.cpp
-endif #LYX_USE_STD_REGEX
-
-else
-
-if LYX_USE_STD_REGEX
-
-liblyxboost_a_SOURCES = \
- libs/signals/src/connection.cpp \
- libs/signals/src/named_slot_map.cpp \
- libs/signals/src/signal_base.cpp \
- libs/signals/src/slot.cpp \
- libs/signals/src/trackable.cpp
else
libs/regex/src/w32_regex_traits.cpp \
libs/regex/src/wide_posix_api.cpp \
libs/regex/src/winstances.cpp \
- libs/regex/src/static_mutex.cpp \
- libs/signals/src/connection.cpp \
- libs/signals/src/named_slot_map.cpp \
- libs/signals/src/signal_base.cpp \
- libs/signals/src/slot.cpp \
- libs/signals/src/trackable.cpp
-
-endif #LYX_USE_STD_REGEX
-
+ libs/regex/src/static_mutex.cpp
endif #MONOLITHIC_BOOST
+
+endif #LYX_USE_STD_REGEX
+++ /dev/null
-/*
-(c) 2014-2015 Glen Joseph Fernandes
-<glenjofe -at- gmail.com>
-
-Distributed under the Boost Software
-License, Version 1.0.
-http://boost.org/LICENSE_1_0.txt
-*/
-#ifndef BOOST_ALIGN_ALIGN_HPP
-#define BOOST_ALIGN_ALIGN_HPP
-
-#include <boost/config.hpp>
-
-#if !defined(BOOST_NO_CXX11_STD_ALIGN)
-#include <boost/align/detail/align_cxx11.hpp>
-#else
-#include <boost/align/detail/align.hpp>
-#endif
-
-#endif
+++ /dev/null
-/*
-(c) 2014 Glen Joseph Fernandes
-<glenjofe -at- gmail.com>
-
-Distributed under the Boost Software
-License, Version 1.0.
-http://boost.org/LICENSE_1_0.txt
-*/
-#ifndef BOOST_ALIGN_DETAIL_ALIGN_HPP
-#define BOOST_ALIGN_DETAIL_ALIGN_HPP
-
-#include <boost/align/detail/is_alignment.hpp>
-#include <boost/assert.hpp>
-
-namespace boost {
-namespace alignment {
-
-inline void* align(std::size_t alignment, std::size_t size,
- void*& ptr, std::size_t& space)
-{
- BOOST_ASSERT(detail::is_alignment(alignment));
- if (size <= space) {
- char* p = reinterpret_cast<char*>((reinterpret_cast<std::
- size_t>(ptr) + alignment - 1) & ~(alignment - 1));
- std::ptrdiff_t n = p - static_cast<char*>(ptr);
- if (size <= space - n) {
- ptr = p;
- space -= n;
- return p;
- }
- }
- return 0;
-}
-
-} /* .alignment */
-} /* .boost */
-
-#endif
+++ /dev/null
-/*
-(c) 2014 Glen Joseph Fernandes
-<glenjofe -at- gmail.com>
-
-Distributed under the Boost Software
-License, Version 1.0.
-http://boost.org/LICENSE_1_0.txt
-*/
-#ifndef BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP
-#define BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP
-
-#include <memory>
-
-namespace boost {
-namespace alignment {
-
-using std::align;
-
-} /* .alignment */
-} /* .boost */
-
-#endif
+++ /dev/null
-/*
-(c) 2014 Glen Joseph Fernandes
-<glenjofe -at- gmail.com>
-
-Distributed under the Boost Software
-License, Version 1.0.
-http://boost.org/LICENSE_1_0.txt
-*/
-#ifndef BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP
-#define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP
-
-#include <boost/config.hpp>
-#include <cstddef>
-
-namespace boost {
-namespace alignment {
-namespace detail {
-
-BOOST_CONSTEXPR inline bool is_alignment(std::size_t value)
- BOOST_NOEXCEPT
-{
- return (value > 0) && ((value & (value - 1)) == 0);
-}
-
-} /* .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 <boost/type_traits/aligned_storage.hpp>
+
+#endif // BOOST_ALIGNED_STORAGE_HPP
--- /dev/null
+#ifndef BOOST_BIND_HPP_INCLUDED
+#define BOOST_BIND_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// bind.hpp - binds function objects to arguments
+//
+// 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
+// http://www.boost.org/LICENSE_1_0.txt
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#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
--- /dev/null
+#ifndef BOOST_BIND_ARG_HPP_INCLUDED
+#define BOOST_BIND_ARG_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// bind/arg.hpp
+//
+// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <boost/config.hpp>
+#include <boost/is_placeholder.hpp>
+#include <boost/static_assert.hpp>
+
+namespace boost
+{
+
+template< int I > struct arg
+{
+ BOOST_CONSTEXPR arg()
+ {
+ }
+
+ template< class T > BOOST_CONSTEXPR arg( T const & /* t */ )
+ {
+ BOOST_STATIC_ASSERT( I == is_placeholder<T>::value );
+ }
+};
+
+template< int I > BOOST_CONSTEXPR bool operator==( arg<I> const &, arg<I> const & )
+{
+ return true;
+}
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template< int I > struct is_placeholder< arg<I> >
+{
+ enum _vt { value = I };
+};
+
+template< int I > struct is_placeholder< arg<I> (*) () >
+{
+ enum _vt { value = I };
+};
+
+#endif
+
+} // namespace boost
+
+#endif // #ifndef BOOST_BIND_ARG_HPP_INCLUDED
--- /dev/null
+#ifndef BOOST_BIND_BIND_HPP_INCLUDED
+#define BOOST_BIND_BIND_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// bind.hpp - binds function objects to arguments
+//
+// Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2001 David Abrahams
+// Copyright (c) 2005 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)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <boost/config.hpp>
+#include <boost/ref.hpp>
+#include <boost/mem_fn.hpp>
+#include <boost/type.hpp>
+#include <boost/is_placeholder.hpp>
+#include <boost/bind/arg.hpp>
+#include <boost/detail/workaround.hpp>
+#include <boost/visit_each.hpp>
+#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__)
+# define BOOST_BIND_VISIT_EACH boost::visit_each
+#else
+# define BOOST_BIND_VISIT_EACH visit_each
+#endif
+
+#include <boost/bind/storage.hpp>
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable: 4512) // assignment operator could not be generated
+#endif
+
+namespace boost
+{
+
+template<class T> class weak_ptr;
+
+namespace _bi // implementation details
+{
+
+// result_traits
+
+template<class R, class F> struct result_traits
+{
+ typedef R type;
+};
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+struct unspecified {};
+
+template<class F> struct result_traits<unspecified, F>
+{
+ typedef typename F::result_type type;
+};
+
+template<class F> struct result_traits< unspecified, reference_wrapper<F> >
+{
+ typedef typename F::result_type type;
+};
+
+#endif
+
+// ref_compare
+
+template<class T> bool ref_compare( T const & a, T const & b, long )
+{
+ return a == b;
+}
+
+template<int I> bool ref_compare( arg<I> const &, arg<I> const &, int )
+{
+ return true;
+}
+
+template<int I> bool ref_compare( arg<I> (*) (), arg<I> (*) (), int )
+{
+ return true;
+}
+
+template<class T> bool ref_compare( reference_wrapper<T> const & a, reference_wrapper<T> const & b, int )
+{
+ return a.get_pointer() == b.get_pointer();
+}
+
+// bind_t forward declaration for listN
+
+template<class R, class F, class L> class bind_t;
+
+template<class R, class F, class L> bool ref_compare( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
+{
+ return a.compare( b );
+}
+
+// value
+
+template<class T> class value
+{
+public:
+
+ value(T const & t): t_(t) {}
+
+ T & get() { return t_; }
+ T const & get() const { return t_; }
+
+ bool operator==(value const & rhs) const
+ {
+ return t_ == rhs.t_;
+ }
+
+private:
+
+ T t_;
+};
+
+// ref_compare for weak_ptr
+
+template<class T> bool ref_compare( value< weak_ptr<T> > const & a, value< weak_ptr<T> > const & b, int )
+{
+ return !(a.get() < b.get()) && !(b.get() < a.get());
+}
+
+// type
+
+template<class T> class type {};
+
+// unwrap
+
+template<class F> struct unwrapper
+{
+ static inline F & unwrap( F & f, long )
+ {
+ return f;
+ }
+
+ template<class F2> static inline F2 & unwrap( reference_wrapper<F2> rf, int )
+ {
+ return rf.get();
+ }
+
+ template<class R, class T> static inline _mfi::dm<R, T> unwrap( R T::* pm, int )
+ {
+ return _mfi::dm<R, T>( pm );
+ }
+};
+
+// listN
+
+class list0
+{
+public:
+
+ list0() {}
+
+ 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 A> R operator()(type<R>, F & f, A &, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)();
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)();
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A &, int)
+ {
+ unwrapper<F>::unwrap(f, 0)();
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)();
+ }
+
+ template<class V> void accept(V &) const
+ {
+ }
+
+ bool operator==(list0 const &) const
+ {
+ return true;
+ }
+};
+
+#ifdef BOOST_MSVC
+// MSVC is bright enough to realise that the parameter rhs
+// in operator==may be unused for some template argument types:
+#pragma warning(push)
+#pragma warning(disable:4100)
+#endif
+
+template< class A1 > class list1: private storage1< A1 >
+{
+private:
+
+ typedef storage1< A1 > base_type;
+
+public:
+
+ explicit list1( A1 a1 ): base_type( a1 ) {}
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+
+ A1 operator[] (boost::arg<1> (*) ()) const { return base_type::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 R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list1 const & rhs) const
+ {
+ return ref_compare(base_type::a1_, rhs.a1_, 0);
+ }
+};
+
+struct logical_and;
+struct logical_or;
+
+template< class A1, class A2 > class list2: private storage2< A1, A2 >
+{
+private:
+
+ typedef storage2< A1, A2 > base_type;
+
+public:
+
+ list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {}
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
+
+ A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2> (*) ()) const { return base_type::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 R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+ template<class A> bool operator()( type<bool>, logical_and & /*f*/, A & a, int )
+ {
+ return a[ base_type::a1_ ] && a[ base_type::a2_ ];
+ }
+
+ template<class A> bool operator()( type<bool>, logical_and const & /*f*/, A & a, int ) const
+ {
+ return a[ base_type::a1_ ] && a[ base_type::a2_ ];
+ }
+
+ template<class A> bool operator()( type<bool>, logical_or & /*f*/, A & a, int )
+ {
+ return a[ base_type::a1_ ] || a[ base_type::a2_ ];
+ }
+
+ template<class A> bool operator()( type<bool>, logical_or const & /*f*/, A & a, int ) const
+ {
+ return a[ base_type::a1_ ] || a[ base_type::a2_ ];
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list2 const & rhs) const
+ {
+ return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0);
+ }
+};
+
+template< class A1, class A2, class A3 > class list3: private storage3< A1, A2, A3 >
+{
+private:
+
+ typedef storage3< A1, A2, A3 > base_type;
+
+public:
+
+ list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {}
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
+
+ A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3> (*) ()) const { return base_type::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 R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list3 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 );
+ }
+};
+
+template< class A1, class A2, class A3, class A4 > class list4: private storage4< A1, A2, A3, A4 >
+{
+private:
+
+ typedef storage4< A1, A2, A3, A4 > base_type;
+
+public:
+
+ list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {}
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
+
+ A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4> (*) ()) const { return base_type::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 R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list4 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 );
+ }
+};
+
+template< class A1, class A2, class A3, class A4, class A5 > class list5: private storage5< A1, A2, A3, A4, A5 >
+{
+private:
+
+ typedef storage5< A1, A2, A3, A4, A5 > base_type;
+
+public:
+
+ list5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): base_type( a1, a2, a3, a4, a5 ) {}
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
+
+ A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5> (*) ()) const { return base_type::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 R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list5 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 );
+ }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6> class list6: private storage6< A1, A2, A3, A4, A5, A6 >
+{
+private:
+
+ typedef storage6< A1, A2, A3, A4, A5, A6 > base_type;
+
+public:
+
+ list6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): base_type( a1, a2, a3, a4, a5, a6 ) {}
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
+ A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
+
+ A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
+ A6 operator[] (boost::arg<6> (*) ()) const { return base_type::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 R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list6 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
+ ref_compare( base_type::a6_, rhs.a6_, 0 );
+ }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7: private storage7< A1, A2, A3, A4, A5, A6, A7 >
+{
+private:
+
+ typedef storage7< A1, A2, A3, A4, A5, A6, A7 > base_type;
+
+public:
+
+ list7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): base_type( a1, a2, a3, a4, a5, a6, a7 ) {}
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
+ A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
+ A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
+
+ A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
+ A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
+ A7 operator[] (boost::arg<7> (*) ()) const { return base_type::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 R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list7 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
+ ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
+ ref_compare( base_type::a7_, rhs.a7_, 0 );
+ }
+};
+
+template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class list8: private storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
+{
+private:
+
+ typedef storage8< A1, A2, A3, A4, A5, A6, A7, A8 > base_type;
+
+public:
+
+ list8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
+ A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
+ A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
+ A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
+
+ A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
+ A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
+ A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
+ A8 operator[] (boost::arg<8> (*) ()) const { return base_type::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 R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list8 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
+ ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
+ ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
+ ref_compare( base_type::a8_, rhs.a8_, 0 );
+ }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9: private storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 >
+{
+private:
+
+ typedef storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > base_type;
+
+public:
+
+ list9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8, a9 ) {}
+
+ A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
+ A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
+ A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
+ A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
+ A9 operator[] (boost::arg<9>) const { return base_type::a9_; }
+
+ A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
+ A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
+ A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
+ A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
+ A9 operator[] (boost::arg<9> (*) ()) const { return base_type::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 A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list9 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
+ ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
+ ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
+ ref_compare( base_type::a8_, rhs.a8_, 0 ) &&
+ ref_compare( base_type::a9_, rhs.a9_, 0 );
+ }
+};
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+// bind_t
+
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+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
+{
+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 A1, class A2, class A3, class A4 > class rrlist4
+{
+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
+{
+private:
+
+ F f_;
+ L l_;
+
+public:
+
+ typedef typename result_traits<R, F>::type result_type;
+ typedef bind_t this_type;
+
+ bind_t( F f, L const & l ): f_( f ), l_( l ) {}
+
+ //
+
+ result_type operator()()
+ {
+ list0 a;
+ return l_( type<result_type>(), f_, a, 0 );
+ }
+
+ result_type operator()() const
+ {
+ list0 a;
+ return l_( type<result_type>(), f_, a, 0 );
+ }
+
+ template<class A1> result_type operator()( A1 && a1 )
+ {
+ rrlist1< A1 > a( a1 );
+ return l_( type<result_type>(), f_, a, 0 );
+ }
+
+ template<class A1> result_type operator()( A1 && a1 ) const
+ {
+ rrlist1< A1 > a( a1 );
+ return l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2> result_type operator()( A1 && a1, A2 && 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
+ {
+ 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 )
+ {
+ 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
+ {
+ 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 )
+ {
+ 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
+ {
+ 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 )
+ {
+ 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
+ {
+ 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 )
+ {
+ 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
+ {
+ 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 )
+ {
+ 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
+ {
+ 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 )
+ {
+ 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
+ {
+ 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 )
+ {
+ 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
+ {
+ 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 A> result_type eval( A & a )
+ {
+ return l_( type<result_type>(), f_, a, 0 );
+ }
+
+ template<class A> result_type eval( A & a ) const
+ {
+ return l_( type<result_type>(), f_, a, 0 );
+ }
+
+ template<class V> void accept( V & v ) const
+ {
+#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ )
+ using boost::visit_each;
+#endif
+
+ BOOST_BIND_VISIT_EACH( v, f_, 0 );
+ l_.accept( v );
+ }
+
+ bool compare( this_type const & rhs ) const
+ {
+ return ref_compare( f_, rhs.f_, 0 ) && l_ == rhs.l_;
+ }
+};
+
+#elif !defined( BOOST_NO_VOID_RETURNS )
+
+template<class R, class F, class L> class bind_t
+{
+public:
+
+ typedef bind_t this_type;
+
+ bind_t(F f, L const & l): f_(f), l_(l) {}
+
+#define BOOST_BIND_RETURN return
+#include <boost/bind/bind_template.hpp>
+#undef BOOST_BIND_RETURN
+
+};
+
+#else // no void returns
+
+template<class R> struct bind_t_generator
+{
+
+template<class F, class L> class implementation
+{
+public:
+
+ typedef implementation this_type;
+
+ implementation(F f, L const & l): f_(f), l_(l) {}
+
+#define BOOST_BIND_RETURN return
+#include <boost/bind/bind_template.hpp>
+#undef BOOST_BIND_RETURN
+
+};
+
+};
+
+template<> struct bind_t_generator<void>
+{
+
+template<class F, class L> class implementation
+{
+private:
+
+ typedef void R;
+
+public:
+
+ typedef implementation this_type;
+
+ implementation(F f, L const & l): f_(f), l_(l) {}
+
+#define BOOST_BIND_RETURN
+#include <boost/bind/bind_template.hpp>
+#undef BOOST_BIND_RETURN
+
+};
+
+};
+
+template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
+{
+public:
+
+ bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
+
+};
+
+#endif
+
+// function_equal
+
+#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+
+// put overloads in _bi, rely on ADL
+
+# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
+{
+ return a.compare(b);
+}
+
+# else
+
+template<class R, class F, class L> bool function_equal_impl( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
+{
+ return a.compare(b);
+}
+
+# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+#else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+
+// put overloads in boost
+
+} // namespace _bi
+
+# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+template<class R, class F, class L> bool function_equal( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b )
+{
+ return a.compare(b);
+}
+
+# else
+
+template<class R, class F, class L> bool function_equal_impl( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b, int )
+{
+ return a.compare(b);
+}
+
+# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+namespace _bi
+{
+
+#endif // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+
+// add_value
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
+
+#if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x582) )
+
+template<class T> struct add_value
+{
+ typedef _bi::value<T> type;
+};
+
+#else
+
+template< class T, int I > struct add_value_2
+{
+ typedef boost::arg<I> type;
+};
+
+template< class T > struct add_value_2< T, 0 >
+{
+ typedef _bi::value< T > type;
+};
+
+template<class T> struct add_value
+{
+ typedef typename add_value_2< T, boost::is_placeholder< T >::value >::type type;
+};
+
+#endif
+
+template<class T> struct add_value< value<T> >
+{
+ typedef _bi::value<T> type;
+};
+
+template<class T> struct add_value< reference_wrapper<T> >
+{
+ typedef reference_wrapper<T> type;
+};
+
+template<int I> struct add_value< arg<I> >
+{
+ typedef boost::arg<I> type;
+};
+
+template<int I> struct add_value< arg<I> (*) () >
+{
+ typedef boost::arg<I> (*type) ();
+};
+
+template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
+{
+ typedef bind_t<R, F, L> type;
+};
+
+#else
+
+template<int I> struct _avt_0;
+
+template<> struct _avt_0<1>
+{
+ template<class T> struct inner
+ {
+ typedef T type;
+ };
+};
+
+template<> struct _avt_0<2>
+{
+ template<class T> struct inner
+ {
+ typedef value<T> type;
+ };
+};
+
+typedef char (&_avt_r1) [1];
+typedef char (&_avt_r2) [2];
+
+template<class T> _avt_r1 _avt_f(value<T>);
+template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
+template<int I> _avt_r1 _avt_f(arg<I>);
+template<int I> _avt_r1 _avt_f(arg<I> (*) ());
+template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
+
+_avt_r2 _avt_f(...);
+
+template<class T> struct add_value
+{
+ static T t();
+ typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
+};
+
+#endif
+
+// list_av_N
+
+template<class A1> struct list_av_1
+{
+ typedef typename add_value<A1>::type B1;
+ typedef list1<B1> type;
+};
+
+template<class A1, class A2> struct list_av_2
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef list2<B1, B2> type;
+};
+
+template<class A1, class A2, class A3> struct list_av_3
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef list3<B1, B2, B3> type;
+};
+
+template<class A1, class A2, class A3, class A4> struct list_av_4
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef list4<B1, B2, B3, B4> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef list5<B1, B2, B3, B4, B5> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef typename add_value<A6>::type B6;
+ typedef list6<B1, B2, B3, B4, B5, B6> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef typename add_value<A6>::type B6;
+ typedef typename add_value<A7>::type B7;
+ typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef typename add_value<A6>::type B6;
+ typedef typename add_value<A7>::type B7;
+ typedef typename add_value<A8>::type B8;
+ typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef typename add_value<A6>::type B6;
+ typedef typename add_value<A7>::type B7;
+ typedef typename add_value<A8>::type B8;
+ typedef typename add_value<A9>::type B9;
+ typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
+};
+
+// operator!
+
+struct logical_not
+{
+ template<class V> bool operator()(V const & v) const { return !v; }
+};
+
+template<class R, class F, class L>
+ bind_t< bool, logical_not, list1< bind_t<R, F, L> > >
+ operator! (bind_t<R, F, L> const & f)
+{
+ typedef list1< bind_t<R, F, L> > list_type;
+ return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
+}
+
+// relational operators
+
+#define BOOST_BIND_OPERATOR( op, name ) \
+\
+struct name \
+{ \
+ template<class V, class W> bool operator()(V const & v, W const & w) const { return v op w; } \
+}; \
+ \
+template<class R, class F, class L, class A2> \
+ bind_t< bool, name, list2< bind_t<R, F, L>, typename add_value<A2>::type > > \
+ operator op (bind_t<R, F, L> const & f, A2 a2) \
+{ \
+ typedef typename add_value<A2>::type B2; \
+ typedef list2< bind_t<R, F, L>, B2> list_type; \
+ return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
+}
+
+BOOST_BIND_OPERATOR( ==, equal )
+BOOST_BIND_OPERATOR( !=, not_equal )
+
+BOOST_BIND_OPERATOR( <, less )
+BOOST_BIND_OPERATOR( <=, less_equal )
+
+BOOST_BIND_OPERATOR( >, greater )
+BOOST_BIND_OPERATOR( >=, greater_equal )
+
+BOOST_BIND_OPERATOR( &&, logical_and )
+BOOST_BIND_OPERATOR( ||, logical_or )
+
+#undef BOOST_BIND_OPERATOR
+
+#if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3)
+
+// resolve ambiguity with rel_ops
+
+#define BOOST_BIND_OPERATOR( op, name ) \
+\
+template<class R, class F, class L> \
+ bind_t< bool, name, list2< bind_t<R, F, L>, bind_t<R, F, L> > > \
+ operator op (bind_t<R, F, L> const & f, bind_t<R, F, L> const & g) \
+{ \
+ typedef list2< bind_t<R, F, L>, bind_t<R, F, L> > list_type; \
+ return bind_t<bool, name, list_type> ( name(), list_type(f, g) ); \
+}
+
+BOOST_BIND_OPERATOR( !=, not_equal )
+BOOST_BIND_OPERATOR( <=, less_equal )
+BOOST_BIND_OPERATOR( >, greater )
+BOOST_BIND_OPERATOR( >=, greater_equal )
+
+#endif
+
+// visit_each, ADL
+
+#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ ) \
+ && !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
+
+template<class V, class T> void visit_each( V & v, value<T> const & t, int )
+{
+ using boost::visit_each;
+ BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
+}
+
+template<class V, class R, class F, class L> void visit_each( V & v, bind_t<R, F, L> const & t, int )
+{
+ t.accept( v );
+}
+
+#endif
+
+} // namespace _bi
+
+// visit_each, no ADL
+
+#if defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) || defined( __BORLANDC__ ) \
+ || (defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
+
+template<class V, class T> void visit_each( V & v, _bi::value<T> const & t, int )
+{
+ BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
+}
+
+template<class V, class R, class F, class L> void visit_each( V & v, _bi::bind_t<R, F, L> const & t, int )
+{
+ t.accept( v );
+}
+
+#endif
+
+// is_bind_expression
+
+template< class T > struct is_bind_expression
+{
+ enum _vt { value = 0 };
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, F, L > >
+{
+ enum _vt { value = 1 };
+};
+
+#endif
+
+// bind
+
+#ifndef BOOST_BIND
+#define BOOST_BIND bind
+#endif
+
+// generic function objects
+
+template<class R, class F>
+ _bi::bind_t<R, F, _bi::list0>
+ BOOST_BIND(F f)
+{
+ typedef _bi::list0 list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type());
+}
+
+template<class R, class F, class A1>
+ _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(F f, A1 a1)
+{
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1));
+}
+
+template<class R, class F, class A1, class A2>
+ _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2)
+{
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class R, class F, class A1, class A2, class A3>
+ _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
+{
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+// generic function objects, alternative syntax
+
+template<class R, class F>
+ _bi::bind_t<R, F, _bi::list0>
+ BOOST_BIND(boost::type<R>, F f)
+{
+ typedef _bi::list0 list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type());
+}
+
+template<class R, class F, class A1>
+ _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(boost::type<R>, F f, A1 a1)
+{
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1));
+}
+
+template<class R, class F, class A1, class A2>
+ _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
+{
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class R, class F, class A1, class A2, class A3>
+ _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
+{
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+// adaptable function objects
+
+template<class F>
+ _bi::bind_t<_bi::unspecified, F, _bi::list0>
+ BOOST_BIND(F f)
+{
+ typedef _bi::list0 list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
+}
+
+template<class F, class A1>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(F f, A1 a1)
+{
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
+}
+
+template<class F, class A1, class A2>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2)
+{
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class F, class A1, class A2, class A3>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
+{
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class F, class A1, class A2, class A3, class A4>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+// function pointers
+
+#define BOOST_BIND_CC
+#define BOOST_BIND_ST
+
+#include <boost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_CC
+#undef BOOST_BIND_ST
+
+#ifdef BOOST_BIND_ENABLE_STDCALL
+
+#define BOOST_BIND_CC __stdcall
+#define BOOST_BIND_ST
+
+#include <boost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_CC
+#undef BOOST_BIND_ST
+
+#endif
+
+#ifdef BOOST_BIND_ENABLE_FASTCALL
+
+#define BOOST_BIND_CC __fastcall
+#define BOOST_BIND_ST
+
+#include <boost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_CC
+#undef BOOST_BIND_ST
+
+#endif
+
+#ifdef BOOST_BIND_ENABLE_PASCAL
+
+#define BOOST_BIND_ST pascal
+#define BOOST_BIND_CC
+
+#include <boost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_ST
+#undef BOOST_BIND_CC
+
+#endif
+
+// member function pointers
+
+#define BOOST_BIND_MF_NAME(X) X
+#define BOOST_BIND_MF_CC
+
+#include <boost/bind/bind_mf_cc.hpp>
+#include <boost/bind/bind_mf2_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_BIND_MF_NAME(X) X##_cdecl
+#define BOOST_BIND_MF_CC __cdecl
+
+#include <boost/bind/bind_mf_cc.hpp>
+#include <boost/bind/bind_mf2_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_BIND_MF_NAME(X) X##_stdcall
+#define BOOST_BIND_MF_CC __stdcall
+
+#include <boost/bind/bind_mf_cc.hpp>
+#include <boost/bind/bind_mf2_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_BIND_MF_NAME(X) X##_fastcall
+#define BOOST_BIND_MF_CC __fastcall
+
+#include <boost/bind/bind_mf_cc.hpp>
+#include <boost/bind/bind_mf2_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#endif
+
+// data member pointers
+
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ || ( defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x620 ) ) )
+
+template<class R, class T, class A1>
+_bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
+ BOOST_BIND(R T::*f, A1 a1)
+{
+ typedef _mfi::dm<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
+}
+
+#else
+
+namespace _bi
+{
+
+template< class Pm, int I > struct add_cref;
+
+template< class M, class T > struct add_cref< M T::*, 0 >
+{
+ typedef M type;
+};
+
+template< class M, class T > struct add_cref< M T::*, 1 >
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4180)
+#endif
+ typedef M const & type;
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+};
+
+template< class R, class T > struct add_cref< R (T::*) (), 1 >
+{
+ typedef void type;
+};
+
+#if !defined(__IBMCPP__) || __IBMCPP_FUNC_CV_TMPL_ARG_DEDUCTION
+
+template< class R, class T > struct add_cref< R (T::*) () const, 1 >
+{
+ typedef void type;
+};
+
+#endif // __IBMCPP__
+
+template<class R> struct isref
+{
+ enum value_type { value = 0 };
+};
+
+template<class R> struct isref< R& >
+{
+ enum value_type { value = 1 };
+};
+
+template<class R> struct isref< R* >
+{
+ enum value_type { value = 1 };
+};
+
+template<class Pm, class A1> struct dm_result
+{
+ typedef typename add_cref< Pm, 1 >::type type;
+};
+
+template<class Pm, class R, class F, class L> struct dm_result< Pm, bind_t<R, F, L> >
+{
+ typedef typename bind_t<R, F, L>::result_type result_type;
+ typedef typename add_cref< Pm, isref< result_type >::value >::type type;
+};
+
+} // namespace _bi
+
+template< class A1, class M, class T >
+
+_bi::bind_t<
+ typename _bi::dm_result< M T::*, A1 >::type,
+ _mfi::dm<M, T>,
+ typename _bi::list_av_1<A1>::type
+>
+
+BOOST_BIND( M T::*f, A1 a1 )
+{
+ typedef typename _bi::dm_result< M T::*, A1 >::type result_type;
+ typedef _mfi::dm<M, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) );
+}
+
+#endif
+
+} // namespace boost
+
+#ifndef BOOST_BIND_NO_PLACEHOLDERS
+
+# include <boost/bind/placeholders.hpp>
+
+#endif
+
+#ifdef BOOST_MSVC
+# pragma warning(default: 4512) // assignment operator could not be generated
+# pragma warning(pop)
+#endif
+
+#endif // #ifndef BOOST_BIND_BIND_HPP_INCLUDED
--- /dev/null
+//
+// bind/bind_cc.hpp - support for different calling conventions
+//
+// Do not include this header directly.
+//
+// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+template<class R>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (), _bi::list0>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) ())
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) ();
+ typedef _bi::list0 list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type());
+}
+
+template<class R, class B1, class A1>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1), typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1), A1 a1)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1);
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1));
+}
+
+template<class R, class B1, class B2, class A1, class A2>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2), typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2), A1 a1, A2 a2)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2);
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class R,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3), typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3), A1 a1, A2 a2, A3 a3)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3);
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4), typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4);
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5), typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5);
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6), typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6);
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7), typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7);
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8), typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8);
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8, class B9,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8, B9), typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8, B9), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8, B9);
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
--- /dev/null
+//
+// bind/bind_mf2_cc.hpp - member functions, type<> syntax
+//
+// Do not include this header directly.
+//
+// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2008 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
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+// 0
+
+template<class Rt2, class R, class T,
+ class A1>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
+}
+
+template<class Rt2, class R, class T,
+ class A1>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
+}
+
+// 1
+
+template<class Rt2, class R, class T,
+ class B1,
+ class A1, class A2>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
+}
+
+template<class Rt2, class R, class T,
+ class B1,
+ class A1, class A2>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
+}
+
+// 2
+
+template<class Rt2, class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+// 3
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+// 4
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+// 5
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+// 6
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+// 7
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+// 8
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
--- /dev/null
+//
+// bind/bind_mf_cc.hpp - support for different calling conventions
+//
+// Do not include this header directly.
+//
+// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+// 0
+
+template<class R, class T,
+ class A1>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
+}
+
+template<class R, class T,
+ class A1>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
+}
+
+template<class Rt2, class R, class T,
+ class A1>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
+}
+
+template<class Rt2, class R, class T,
+ class A1>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
+}
+
+// 1
+
+template<class R, class T,
+ class B1,
+ class A1, class A2>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2));
+}
+
+template<class R, class T,
+ class B1,
+ class A1, class A2>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2));
+}
+
+template<class Rt2, class R, class T,
+ class B1,
+ class A1, class A2>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
+}
+
+template<class Rt2, class R, class T,
+ class B1,
+ class A1, class A2>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
+}
+
+// 2
+
+template<class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+template<class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+// 3
+
+template<class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+// 4
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+// 5
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+// 6
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+// 7
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+// 8
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
--- /dev/null
+//
+// bind/bind_template.hpp
+//
+// Do not include this header directly.
+//
+// Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+ typedef typename result_traits<R, F>::type result_type;
+
+ result_type operator()()
+ {
+ list0 a;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ result_type operator()() const
+ {
+ list0 a;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1> result_type operator()(A1 & a1)
+ {
+ list1<A1 &> a(a1);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1> result_type operator()(A1 & a1) const
+ {
+ list1<A1 &> a(a1);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1> result_type operator()(A1 const & a1)
+ {
+ list1<A1 const &> a(a1);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1> result_type operator()(A1 const & a1) const
+ {
+ list1<A1 const &> a(a1);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
+ {
+ list2<A1 &, A2 &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2) const
+ {
+ list2<A1 &, A2 &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2)
+ {
+ list2<A1 const &, A2 &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2) const
+ {
+ list2<A1 const &, A2 &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2)
+ {
+ list2<A1 &, A2 const &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2) const
+ {
+ list2<A1 &, A2 const &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2)
+ {
+ list2<A1 const &, A2 const &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2) const
+ {
+ list2<A1 const &, A2 const &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
+ {
+ list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
+ BOOST_BIND_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<A1 &, A2 &, A3 &> a(a1, a2, a3);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3)
+ {
+ list3<A1 const &, A2 const &, A3 const &> a(a1, a2, a3);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) const
+ {
+ list3<A1 const &, A2 const &, A3 const &> a(a1, a2, a3);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
+ {
+ list4<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
+ BOOST_BIND_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<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4)
+ {
+ list4<A1 const &, A2 const &, A3 const &, A4 const &> a(a1, a2, a3, a4);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) const
+ {
+ list4<A1 const &, A2 const &, A3 const &, A4 const &> a(a1, a2, a3, a4);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ 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<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
+ BOOST_BIND_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<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5)
+ {
+ list5<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &> a(a1, a2, a3, a4, a5);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) const
+ {
+ list5<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &> a(a1, a2, a3, a4, a5);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ 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<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
+ BOOST_BIND_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<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6)
+ {
+ list6<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &> a(a1, a2, a3, a4, a5, a6);
+ BOOST_BIND_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 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) const
+ {
+ list6<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &> a(a1, a2, a3, a4, a5, a6);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ 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<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
+ BOOST_BIND_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<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7)
+ {
+ list7<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &> a(a1, a2, a3, a4, a5, a6, a7);
+ BOOST_BIND_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 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) const
+ {
+ list7<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &> a(a1, a2, a3, a4, a5, a6, a7);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ 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<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+ BOOST_BIND_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<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8)
+ {
+ list8<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+ BOOST_BIND_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 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) const
+ {
+ list8<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ 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<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ BOOST_BIND_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<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9)
+ {
+ list9<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &, A9 const &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ BOOST_BIND_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 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) const
+ {
+ list9<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &, A9 const &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A> result_type eval(A & a)
+ {
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A> result_type eval(A & a) const
+ {
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ )
+
+ using boost::visit_each;
+
+#endif
+ BOOST_BIND_VISIT_EACH(v, f_, 0);
+ l_.accept(v);
+ }
+
+ bool compare(this_type const & rhs) const
+ {
+ return ref_compare(f_, rhs.f_, 0) && l_ == rhs.l_;
+ }
+
+private:
+
+ F f_;
+ L l_;
--- /dev/null
+#ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
+#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// 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
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <boost/bind/arg.hpp>
+#include <boost/config.hpp>
+
+namespace boost
+{
+
+namespace placeholders
+{
+
+#if defined(__BORLANDC__) || defined(__GNUC__) && (__GNUC__ < 4)
+
+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_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
+
+} // namespace placeholders
+
+} // namespace boost
+
+#endif // #ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
--- /dev/null
+#ifndef BOOST_BIND_STORAGE_HPP_INCLUDED
+#define BOOST_BIND_STORAGE_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// bind/storage.hpp
+//
+// boost/bind.hpp support header, optimized storage
+//
+// Copyright (c) 2006 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
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <boost/config.hpp>
+#include <boost/bind/arg.hpp>
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable: 4512) // assignment operator could not be generated
+#endif
+
+namespace boost
+{
+
+namespace _bi
+{
+
+// 1
+
+template<class A1> struct storage1
+{
+ explicit storage1( A1 a1 ): a1_( a1 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ BOOST_BIND_VISIT_EACH(v, a1_, 0);
+ }
+
+ A1 a1_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( __BORLANDC__ )
+
+template<int I> struct storage1< boost::arg<I> >
+{
+ explicit storage1( boost::arg<I> ) {}
+
+ template<class V> void accept(V &) const { }
+
+ static boost::arg<I> a1_() { return boost::arg<I>(); }
+};
+
+template<int I> struct storage1< boost::arg<I> (*) () >
+{
+ explicit storage1( boost::arg<I> (*) () ) {}
+
+ template<class V> void accept(V &) const { }
+
+ static boost::arg<I> a1_() { return boost::arg<I>(); }
+};
+
+#endif
+
+// 2
+
+template<class A1, class A2> struct storage2: public storage1<A1>
+{
+ typedef storage1<A1> inherited;
+
+ storage2( A1 a1, A2 a2 ): storage1<A1>( a1 ), a2_( a2 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a2_, 0);
+ }
+
+ A2 a2_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, int I> struct storage2< A1, boost::arg<I> >: public storage1<A1>
+{
+ typedef storage1<A1> inherited;
+
+ storage2( A1 a1, boost::arg<I> ): storage1<A1>( a1 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a2_() { return boost::arg<I>(); }
+};
+
+template<class A1, int I> struct storage2< A1, boost::arg<I> (*) () >: public storage1<A1>
+{
+ typedef storage1<A1> inherited;
+
+ storage2( A1 a1, boost::arg<I> (*) () ): storage1<A1>( a1 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a2_() { return boost::arg<I>(); }
+};
+
+#endif
+
+// 3
+
+template<class A1, class A2, class A3> struct storage3: public storage2< A1, A2 >
+{
+ typedef storage2<A1, A2> inherited;
+
+ storage3( A1 a1, A2 a2, A3 a3 ): storage2<A1, A2>( a1, a2 ), a3_( a3 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a3_, 0);
+ }
+
+ A3 a3_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, int I> struct storage3< A1, A2, boost::arg<I> >: public storage2< A1, A2 >
+{
+ typedef storage2<A1, A2> inherited;
+
+ storage3( A1 a1, A2 a2, boost::arg<I> ): storage2<A1, A2>( a1, a2 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a3_() { return boost::arg<I>(); }
+};
+
+template<class A1, class A2, int I> struct storage3< A1, A2, boost::arg<I> (*) () >: public storage2< A1, A2 >
+{
+ typedef storage2<A1, A2> inherited;
+
+ storage3( A1 a1, A2 a2, boost::arg<I> (*) () ): storage2<A1, A2>( a1, a2 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a3_() { return boost::arg<I>(); }
+};
+
+#endif
+
+// 4
+
+template<class A1, class A2, class A3, class A4> struct storage4: public storage3< A1, A2, A3 >
+{
+ typedef storage3<A1, A2, A3> inherited;
+
+ storage4( A1 a1, A2 a2, A3 a3, A4 a4 ): storage3<A1, A2, A3>( a1, a2, a3 ), a4_( a4 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a4_, 0);
+ }
+
+ A4 a4_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, int I> struct storage4< A1, A2, A3, boost::arg<I> >: public storage3< A1, A2, A3 >
+{
+ typedef storage3<A1, A2, A3> inherited;
+
+ storage4( A1 a1, A2 a2, A3 a3, boost::arg<I> ): storage3<A1, A2, A3>( a1, a2, a3 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a4_() { return boost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, int I> struct storage4< A1, A2, A3, boost::arg<I> (*) () >: public storage3< A1, A2, A3 >
+{
+ typedef storage3<A1, A2, A3> inherited;
+
+ storage4( A1 a1, A2 a2, A3 a3, boost::arg<I> (*) () ): storage3<A1, A2, A3>( a1, a2, a3 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a4_() { return boost::arg<I>(); }
+};
+
+#endif
+
+// 5
+
+template<class A1, class A2, class A3, class A4, class A5> struct storage5: public storage4< A1, A2, A3, A4 >
+{
+ typedef storage4<A1, A2, A3, A4> inherited;
+
+ storage5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ), a5_( a5 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a5_, 0);
+ }
+
+ A5 a5_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, int I> struct storage5< A1, A2, A3, A4, boost::arg<I> >: public storage4< A1, A2, A3, A4 >
+{
+ typedef storage4<A1, A2, A3, A4> inherited;
+
+ storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg<I> ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a5_() { return boost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, int I> struct storage5< A1, A2, A3, A4, boost::arg<I> (*) () >: public storage4< A1, A2, A3, A4 >
+{
+ typedef storage4<A1, A2, A3, A4> inherited;
+
+ storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg<I> (*) () ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a5_() { return boost::arg<I>(); }
+};
+
+#endif
+
+// 6
+
+template<class A1, class A2, class A3, class A4, class A5, class A6> struct storage6: public storage5< A1, A2, A3, A4, A5 >
+{
+ typedef storage5<A1, A2, A3, A4, A5> inherited;
+
+ storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ), a6_( a6 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a6_, 0);
+ }
+
+ A6 a6_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, class A5, int I> struct storage6< A1, A2, A3, A4, A5, boost::arg<I> >: public storage5< A1, A2, A3, A4, A5 >
+{
+ typedef storage5<A1, A2, A3, A4, A5> inherited;
+
+ storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg<I> ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a6_() { return boost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, int I> struct storage6< A1, A2, A3, A4, A5, boost::arg<I> (*) () >: public storage5< A1, A2, A3, A4, A5 >
+{
+ typedef storage5<A1, A2, A3, A4, A5> inherited;
+
+ storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg<I> (*) () ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a6_() { return boost::arg<I>(); }
+};
+
+#endif
+
+// 7
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct storage7: public storage6< A1, A2, A3, A4, A5, A6 >
+{
+ typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
+
+ storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ), a7_( a7 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a7_, 0);
+ }
+
+ A7 a7_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, int I> struct storage7< A1, A2, A3, A4, A5, A6, boost::arg<I> >: public storage6< A1, A2, A3, A4, A5, A6 >
+{
+ typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
+
+ storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg<I> ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a7_() { return boost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, int I> struct storage7< A1, A2, A3, A4, A5, A6, boost::arg<I> (*) () >: public storage6< A1, A2, A3, A4, A5, A6 >
+{
+ typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
+
+ storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg<I> (*) () ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a7_() { return boost::arg<I>(); }
+};
+
+#endif
+
+// 8
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct storage8: public storage7< A1, A2, A3, A4, A5, A6, A7 >
+{
+ typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
+
+ storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ), a8_( a8 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a8_, 0);
+ }
+
+ A8 a8_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, int I> struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg<I> >: public storage7< A1, A2, A3, A4, A5, A6, A7 >
+{
+ typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
+
+ storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg<I> ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a8_() { return boost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, int I> struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg<I> (*) () >: public storage7< A1, A2, A3, A4, A5, A6, A7 >
+{
+ typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
+
+ storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg<I> (*) () ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a8_() { return boost::arg<I>(); }
+};
+
+#endif
+
+// 9
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct storage9: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
+{
+ typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
+
+ storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ), a9_( a9 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a9_, 0);
+ }
+
+ A9 a9_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, int I> struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg<I> >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
+{
+ typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
+
+ storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg<I> ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a9_() { return boost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, int I> struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg<I> (*) () >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
+{
+ typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
+
+ storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg<I> (*) () ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static boost::arg<I> a9_() { return boost::arg<I>(); }
+};
+
+#endif
+
+} // namespace _bi
+
+} // namespace boost
+
+#ifdef BOOST_MSVC
+# pragma warning(default: 4512) // assignment operator could not be generated
+# pragma warning(pop)
+#endif
+
+#endif // #ifndef BOOST_BIND_STORAGE_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost blank.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_BLANK_HPP
+#define BOOST_BLANK_HPP
+
+#include "boost/blank_fwd.hpp"
+
+#if !defined(BOOST_NO_IOSTREAM)
+#include <iosfwd> // for std::basic_ostream forward declare
+#include "boost/detail/templated_streams.hpp"
+#endif // BOOST_NO_IOSTREAM
+
+#include "boost/mpl/bool.hpp"
+#include "boost/type_traits/is_empty.hpp"
+#include "boost/type_traits/is_pod.hpp"
+#include "boost/type_traits/is_stateless.hpp"
+
+namespace boost {
+
+struct blank
+{
+};
+
+// type traits specializations
+//
+
+template <>
+struct is_pod< blank >
+ : mpl::true_
+{
+};
+
+template <>
+struct is_empty< blank >
+ : mpl::true_
+{
+};
+
+template <>
+struct is_stateless< blank >
+ : mpl::true_
+{
+};
+
+// relational operators
+//
+
+inline bool operator==(const blank&, const blank&)
+{
+ return true;
+}
+
+inline bool operator<=(const blank&, const blank&)
+{
+ return true;
+}
+
+inline bool operator>=(const blank&, const blank&)
+{
+ return true;
+}
+
+inline bool operator!=(const blank&, const blank&)
+{
+ return false;
+}
+
+inline bool operator<(const blank&, const blank&)
+{
+ return false;
+}
+
+inline bool operator>(const blank&, const blank&)
+{
+ return false;
+}
+
+// streaming support
+//
+#if !defined(BOOST_NO_IOSTREAM)
+
+BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
+inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
+ BOOST_TEMPLATED_STREAM(ostream, E,T)& out
+ , const blank&
+ )
+{
+ // (output nothing)
+ return out;
+}
+
+#endif // BOOST_NO_IOSTREAM
+
+} // namespace boost
+
+#endif // BOOST_BLANK_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost blank_fwd.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_BLANK_FWD_HPP
+#define BOOST_BLANK_FWD_HPP
+
+namespace boost {
+
+struct blank;
+
+} // namespace boost
+
+#endif // BOOST_BLANK_FWD_HPP
--- /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/utility for most recent version including documentation.
+
+// See boost/detail/call_traits.hpp
+// for full copyright notices.
+
+#ifndef BOOST_CALL_TRAITS_HPP
+#define BOOST_CALL_TRAITS_HPP
+
+#ifndef BOOST_CONFIG_HPP
+#include <boost/config.hpp>
+#endif
+
+#include <boost/detail/call_traits.hpp>
+
+#endif // BOOST_CALL_TRAITS_HPP
--- /dev/null
+#ifndef BOOST_CORE_IS_SAME_HPP_INCLUDED
+#define BOOST_CORE_IS_SAME_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+// is_same<T1,T2>::value is true when T1 == T2
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/config.hpp>
+
+namespace boost
+{
+
+namespace core
+{
+
+template< class T1, class T2 > struct is_same
+{
+ BOOST_STATIC_CONSTANT( bool, value = false );
+};
+
+template< class T > struct is_same< T, T >
+{
+ BOOST_STATIC_CONSTANT( bool, value = true );
+};
+
+} // namespace core
+
+} // namespace boost
+
+#endif // #ifndef BOOST_CORE_IS_SAME_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/utility for most recent version including documentation.
+
+// call_traits: defines typedefs for function usage
+// (see libs/utility/call_traits.htm)
+
+/* Release notes:
+ 23rd July 2000:
+ Fixed array specialization. (JM)
+ Added Borland specific fixes for reference types
+ (issue raised by Steve Cleary).
+*/
+
+#ifndef BOOST_DETAIL_CALL_TRAITS_HPP
+#define BOOST_DETAIL_CALL_TRAITS_HPP
+
+#ifndef BOOST_CONFIG_HPP
+#include <boost/config.hpp>
+#endif
+#include <cstddef>
+
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/type_traits/is_enum.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/detail/workaround.hpp>
+
+namespace boost{
+
+namespace detail{
+
+template <typename T, bool small_>
+struct ct_imp2
+{
+ typedef const T& param_type;
+};
+
+template <typename T>
+struct ct_imp2<T, true>
+{
+ typedef const T param_type;
+};
+
+template <typename T, bool isp, bool b1, bool b2>
+struct ct_imp
+{
+ typedef const T& param_type;
+};
+
+template <typename T, bool isp, bool b2>
+struct ct_imp<T, isp, true, b2>
+{
+ typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
+};
+
+template <typename T, bool isp, bool b1>
+struct ct_imp<T, isp, b1, true>
+{
+ typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
+};
+
+template <typename T, bool b1, bool b2>
+struct ct_imp<T, true, b1, b2>
+{
+ typedef const T param_type;
+};
+
+}
+
+template <typename T>
+struct call_traits
+{
+public:
+ typedef T value_type;
+ typedef T& reference;
+ typedef const T& const_reference;
+ //
+ // C++ Builder workaround: we should be able to define a compile time
+ // constant and pass that as a single template parameter to ct_imp<T,bool>,
+ // however compiler bugs prevent this - instead pass three bool's to
+ // ct_imp<T,bool,bool,bool> and add an extra partial specialisation
+ // of ct_imp to handle the logic. (JM)
+ typedef typename boost::detail::ct_imp<
+ T,
+ ::boost::is_pointer<T>::value,
+ ::boost::is_arithmetic<T>::value,
+ ::boost::is_enum<T>::value
+ >::param_type param_type;
+};
+
+template <typename T>
+struct call_traits<T&>
+{
+ typedef T& value_type;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef T& param_type; // hh removed const
+};
+
+#if BOOST_WORKAROUND( __BORLANDC__, < 0x5A0 )
+// 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...
+template <typename T>
+struct call_traits<T&const>
+{
+ typedef T& value_type;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef T& param_type; // hh removed const
+};
+template <typename T>
+struct call_traits<T&volatile>
+{
+ typedef T& value_type;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef T& param_type; // hh removed const
+};
+template <typename T>
+struct call_traits<T&const volatile>
+{
+ typedef T& value_type;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef T& param_type; // hh removed const
+};
+
+template <typename T>
+struct call_traits< T * >
+{
+ typedef T * value_type;
+ typedef T * & reference;
+ typedef T * const & const_reference;
+ typedef T * const param_type; // hh removed const
+};
+#endif
+#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
+template <typename T, std::size_t N>
+struct call_traits<T [N]>
+{
+private:
+ typedef T array_type[N];
+public:
+ // degrades array to pointer:
+ typedef const T* value_type;
+ typedef array_type& reference;
+ typedef const array_type& const_reference;
+ typedef const T* const param_type;
+};
+
+template <typename T, std::size_t N>
+struct call_traits<const T [N]>
+{
+private:
+ typedef const T array_type[N];
+public:
+ // degrades array to pointer:
+ typedef const T* value_type;
+ typedef array_type& reference;
+ typedef const array_type& const_reference;
+ typedef const T* const param_type;
+};
+#endif
+
+}
+
+#endif // BOOST_DETAIL_CALL_TRAITS_HPP
--- /dev/null
+// Copyright David Abrahams 2005. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#ifndef BOOST_DETAIL_IS_XXX_DWA20051011_HPP
+# define BOOST_DETAIL_IS_XXX_DWA20051011_HPP
+
+# include <boost/config.hpp>
+# include <boost/mpl/bool.hpp>
+# include <boost/preprocessor/enum_params.hpp>
+
+
+# define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs) \
+template <class T> \
+struct is_##name : mpl::false_ \
+{ \
+}; \
+ \
+template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \
+struct is_##name< \
+ qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \
+> \
+ : mpl::true_ \
+{ \
+};
+
+
+#endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost detail/templated_streams.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_DETAIL_TEMPLATED_STREAMS_HPP
+#define BOOST_DETAIL_TEMPLATED_STREAMS_HPP
+
+#include "boost/config.hpp"
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) BOOST_TEMPLATED_STREAM_* macros
+//
+// Provides workaround platforms without stream class templates.
+//
+
+#if !defined(BOOST_NO_STD_LOCALE)
+
+#define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) \
+ template < typename E , typename T >
+
+#define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) \
+ template < typename E , typename T , typename A >
+
+#define BOOST_TEMPLATED_STREAM_ARGS(E,T) \
+ typename E , typename T
+
+#define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) \
+ typename E , typename T , typename A
+
+#define BOOST_TEMPLATED_STREAM_COMMA ,
+
+#define BOOST_TEMPLATED_STREAM_ELEM(E) E
+#define BOOST_TEMPLATED_STREAM_TRAITS(T) T
+#define BOOST_TEMPLATED_STREAM_ALLOC(A) A
+
+#define BOOST_TEMPLATED_STREAM(X,E,T) \
+ BOOST_JOIN(std::basic_,X)< E , T >
+
+#define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
+ BOOST_JOIN(std::basic_,X)< E , T , A >
+
+#else // defined(BOOST_NO_STD_LOCALE)
+
+#define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) /**/
+
+#define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) /**/
+
+#define BOOST_TEMPLATED_STREAM_ARGS(E,T) /**/
+
+#define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) /**/
+
+#define BOOST_TEMPLATED_STREAM_COMMA /**/
+
+#define BOOST_TEMPLATED_STREAM_ELEM(E) char
+#define BOOST_TEMPLATED_STREAM_TRAITS(T) std::char_traits<char>
+#define BOOST_TEMPLATED_STREAM_ALLOC(A) std::allocator<char>
+
+#define BOOST_TEMPLATED_STREAM(X,E,T) \
+ std::X
+
+#define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
+ std::X
+
+#endif // BOOST_NO_STD_LOCALE
+
+#endif // BOOST_DETAIL_TEMPLATED_STREAMS_HPP
+++ /dev/null
-#ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
-#define BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
-
-//
-// enable_shared_from_this.hpp
-//
-// Copyright (c) 2002 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
-//
-// http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
-//
-
-#include <boost/smart_ptr/enable_shared_from_this.hpp>
-
-#endif // #ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
+++ /dev/null
-// Boost.Function library - Typeof support
-// Copyright (C) Douglas Gregor 2008
-//
-// Use, modification and distribution is subject to the Boost
-// Software License, Version 1.0. (See accompanying file
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// For more information, see http://www.boost.org
-#ifndef BOOST_FUNCTION_TYPEOF_HPP
-#define BOOST_FUNCTION_TYPEOF_HPP
-#include <boost/function/function_fwd.hpp>
-#include <boost/typeof/typeof.hpp>
-
-#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-
-BOOST_TYPEOF_REGISTER_TYPE(boost::bad_function_call)
-
-#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function, (typename))
-#endif
-
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function0, (typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function1, (typename)(typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function2, (typename)(typename)(typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function3,
- (typename)(typename)(typename)(typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function4,
- (typename)(typename)(typename)(typename)(typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function5,
- (typename)(typename)(typename)(typename)(typename)(typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function6,
- (typename)(typename)(typename)(typename)(typename)(typename)(typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function7,
- (typename)(typename)(typename)(typename)(typename)(typename)(typename)
- (typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function8,
- (typename)(typename)(typename)(typename)(typename)(typename)(typename)
- (typename)(typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function9,
- (typename)(typename)(typename)(typename)(typename)(typename)(typename)
- (typename)(typename)(typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function10,
- (typename)(typename)(typename)(typename)(typename)(typename)(typename)
- (typename)(typename)(typename)(typename))
-#endif
--- /dev/null
+// (C) Copyright Jeremy Siek 2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Revision History:
+
+// 27 Feb 2001 Jeremy Siek
+// Initial checkin.
+
+#ifndef BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
+#define BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
+
+#include <iterator>
+
+namespace boost {
+namespace iterators {
+
+ template <class UnaryFunction>
+ class function_output_iterator {
+ typedef function_output_iterator self;
+ public:
+ typedef std::output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ explicit function_output_iterator() {}
+
+ explicit function_output_iterator(const UnaryFunction& f)
+ : m_f(f) {}
+
+ struct output_proxy {
+ output_proxy(UnaryFunction& f) : m_f(f) { }
+ template <class T> output_proxy& operator=(const T& value) {
+ m_f(value);
+ return *this;
+ }
+ UnaryFunction& m_f;
+ };
+ output_proxy operator*() { return output_proxy(m_f); }
+ self& operator++() { return *this; }
+ self& operator++(int) { return *this; }
+ private:
+ UnaryFunction m_f;
+ };
+
+ template <class UnaryFunction>
+ inline function_output_iterator<UnaryFunction>
+ make_function_output_iterator(const UnaryFunction& f = UnaryFunction()) {
+ return function_output_iterator<UnaryFunction>(f);
+ }
+
+} // namespace iterators
+
+using iterators::function_output_iterator;
+using iterators::make_function_output_iterator;
+
+} // namespace boost
+
+#endif // BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
+++ /dev/null
-#ifndef BOOST_INTRUSIVE_PTR_HPP_INCLUDED
-#define BOOST_INTRUSIVE_PTR_HPP_INCLUDED
-
-//
-// intrusive_ptr.hpp
-//
-// Copyright (c) 2001, 2002 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
-//
-// See http://www.boost.org/libs/smart_ptr/intrusive_ptr.html for documentation.
-//
-
-#include <boost/smart_ptr/intrusive_ptr.hpp>
-
-#endif // #ifndef BOOST_INTRUSIVE_PTR_HPP_INCLUDED
--- /dev/null
+#ifndef BOOST_IS_PLACEHOLDER_HPP_INCLUDED
+#define BOOST_IS_PLACEHOLDER_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined( _MSC_VER ) && ( _MSC_VER >= 1020 )
+# pragma once
+#endif
+
+
+// is_placeholder.hpp - TR1 is_placeholder metafunction
+//
+// Copyright (c) 2006 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 is_placeholder
+{
+ enum _vt { value = 0 };
+};
+
+} // namespace boost
+
+#endif // #ifndef BOOST_IS_PLACEHOLDER_HPP_INCLUDED
+++ /dev/null
-// last_value function object (documented as part of Boost.Signals)
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org/libs/signals
-
-#ifndef BOOST_LAST_VALUE_HPP
-#define BOOST_LAST_VALUE_HPP
-
-#include <cassert>
-#include <boost/config.hpp>
-
-namespace boost {
- template<typename T>
- struct last_value {
- typedef T result_type;
-
- template<typename InputIterator>
- T operator()(InputIterator first, InputIterator last) const
- {
- assert(first != last);
- T value = *first++;
- while (first != last)
- value = *first++;
- return value;
- }
- };
-
- template<>
- struct last_value<void> {
-#ifdef BOOST_NO_VOID_RETURNS
- struct unusable {};
-
- public:
- typedef unusable result_type;
-#else
- public:
- typedef void result_type;
-#endif // BOOST_NO_VOID_RETURNS
-
- template<typename InputIterator>
- result_type
- operator()(InputIterator first, InputIterator last) const
- {
- while (first != last)
- *first++;
- return result_type();
- }
- };
-}
-#endif // BOOST_SIGNALS_LAST_VALUE_HPP
+++ /dev/null
-#ifndef BOOST_MAKE_SHARED_HPP_INCLUDED
-#define BOOST_MAKE_SHARED_HPP_INCLUDED
-
-// make_shared.hpp
-//
-// Copyright (c) 2007, 2008 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
-//
-// See http://www.boost.org/libs/smart_ptr/make_shared.html
-// for documentation.
-
-#include <boost/smart_ptr/make_shared.hpp>
-
-#endif // #ifndef BOOST_MAKE_SHARED_HPP_INCLUDED
--- /dev/null
+// Boost common_factor_ct.hpp header file ----------------------------------//
+
+// (C) Copyright Daryle Walker and Stephen Cleary 2001-2002.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_MATH_COMMON_FACTOR_CT_HPP
+#define BOOST_MATH_COMMON_FACTOR_CT_HPP
+
+#include <boost/math_fwd.hpp> // self include
+#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT, etc.
+#include <boost/mpl/integral_c.hpp>
+
+namespace boost
+{
+namespace math
+{
+
+// Implementation details --------------------------------------------------//
+
+namespace detail
+{
+ // Build GCD with Euclid's recursive algorithm
+ template < static_gcd_type Value1, static_gcd_type Value2 >
+ struct static_gcd_helper_t
+ {
+ private:
+ BOOST_STATIC_CONSTANT( static_gcd_type, new_value1 = Value2 );
+ BOOST_STATIC_CONSTANT( static_gcd_type, new_value2 = Value1 % Value2 );
+
+ #ifndef __BORLANDC__
+ #define BOOST_DETAIL_GCD_HELPER_VAL(Value) static_cast<static_gcd_type>(Value)
+ #else
+ typedef static_gcd_helper_t self_type;
+ #define BOOST_DETAIL_GCD_HELPER_VAL(Value) (self_type:: Value )
+ #endif
+
+ typedef static_gcd_helper_t< BOOST_DETAIL_GCD_HELPER_VAL(new_value1),
+ BOOST_DETAIL_GCD_HELPER_VAL(new_value2) > next_step_type;
+
+ #undef BOOST_DETAIL_GCD_HELPER_VAL
+
+ public:
+ BOOST_STATIC_CONSTANT( static_gcd_type, value = next_step_type::value );
+ };
+
+ // Non-recursive case
+ template < static_gcd_type Value1 >
+ struct static_gcd_helper_t< Value1, 0UL >
+ {
+ BOOST_STATIC_CONSTANT( static_gcd_type, value = Value1 );
+ };
+
+ // Build the LCM from the GCD
+ template < static_gcd_type Value1, static_gcd_type Value2 >
+ struct static_lcm_helper_t
+ {
+ typedef static_gcd_helper_t<Value1, Value2> gcd_type;
+
+ BOOST_STATIC_CONSTANT( static_gcd_type, value = Value1 / gcd_type::value
+ * Value2 );
+ };
+
+ // Special case for zero-GCD values
+ template < >
+ struct static_lcm_helper_t< 0UL, 0UL >
+ {
+ BOOST_STATIC_CONSTANT( static_gcd_type, value = 0UL );
+ };
+
+} // namespace detail
+
+
+// Compile-time greatest common divisor evaluator class declaration --------//
+
+template < static_gcd_type Value1, static_gcd_type Value2 >
+struct static_gcd : public mpl::integral_c<static_gcd_type, (detail::static_gcd_helper_t<Value1, Value2>::value) >
+{
+}; // boost::math::static_gcd
+
+
+// Compile-time least common multiple evaluator class declaration ----------//
+
+template < static_gcd_type Value1, static_gcd_type Value2 >
+struct static_lcm : public mpl::integral_c<static_gcd_type, (detail::static_lcm_helper_t<Value1, Value2>::value) >
+{
+}; // boost::math::static_lcm
+
+
+} // namespace math
+} // namespace boost
+
+
+#endif // BOOST_MATH_COMMON_FACTOR_CT_HPP
--- /dev/null
+// Boost math_fwd.hpp header file ------------------------------------------//
+
+// (C) Copyright Hubert Holin and Daryle Walker 2001-2002. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/math for documentation.
+
+#ifndef BOOST_MATH_FWD_HPP
+#define BOOST_MATH_FWD_HPP
+
+#include <boost/cstdint.hpp>
+
+namespace boost
+{
+namespace math
+{
+
+
+// From <boost/math/quaternion.hpp> ----------------------------------------//
+
+template < typename T >
+ class quaternion;
+
+template < >
+ class quaternion< float >;
+template < >
+ class quaternion< double >;
+template < >
+ class quaternion< long double >;
+
+// Also has many function templates (including operators)
+
+
+// From <boost/math/octonion.hpp> ------------------------------------------//
+
+template < typename T >
+ class octonion;
+
+template < >
+ class octonion< float >;
+template < >
+ class octonion< double >;
+template < >
+ class octonion< long double >;
+
+// Also has many function templates (including operators)
+
+
+// From <boost/math/special_functions/acosh.hpp> ---------------------------//
+
+// Only has function template
+
+
+// From <boost/math/special_functions/asinh.hpp> ---------------------------//
+
+// Only has function template
+
+
+// From <boost/math/special_functions/atanh.hpp> ---------------------------//
+
+// Only has function template
+
+
+// From <boost/math/special_functions/sinc.hpp> ----------------------------//
+
+// Only has function templates
+
+
+// From <boost/math/special_functions/sinhc.hpp> ---------------------------//
+
+// Only has function templates
+
+
+// From <boost/math/common_factor.hpp> -------------------------------------//
+
+// Only #includes other headers
+
+
+// From <boost/math/common_factor_ct.hpp> ----------------------------------//
+
+#ifdef BOOST_NO_INTEGRAL_INT64_T
+ typedef unsigned long static_gcd_type;
+#else
+ typedef boost::uintmax_t static_gcd_type;
+#endif
+
+template < static_gcd_type Value1, static_gcd_type Value2 >
+ struct static_gcd;
+template < static_gcd_type Value1, static_gcd_type Value2 >
+ struct static_lcm;
+
+
+// From <boost/math/common_factor_rt.hpp> ----------------------------------//
+
+template < typename IntegerType >
+ class gcd_evaluator;
+template < typename IntegerType >
+ class lcm_evaluator;
+
+// Also has a couple of function templates
+
+
+} // namespace math
+} // namespace boost
+
+
+#endif // BOOST_MATH_FWD_HPP
--- /dev/null
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright 2007, 2008 Steven Watanabe, Joseph Gauterin, Niels Dekker
+// (C) Copyright Ion Gaztanaga 2005-2013. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_MOVE_ADL_MOVE_SWAP_HPP
+#define BOOST_MOVE_ADL_MOVE_SWAP_HPP
+
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+#
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+# pragma once
+#endif
+
+//Based on Boost.Core's swap.
+//Many thanks to Steven Watanabe, Joseph Gauterin and Niels Dekker.
+#include <cstddef> //for std::size_t
+#include <boost/move/detail/workaround.hpp> //forceinline
+
+//Try to avoid including <algorithm>, as it's quite big
+#if defined(_MSC_VER) && defined(BOOST_DINKUMWARE_STDLIB)
+ #include <utility> //Dinkum libraries define std::swap in utility which is lighter than algorithm
+#elif defined(BOOST_GNU_STDLIB)
+ //For non-GCC compilers, where GNUC version is not very reliable, or old GCC versions
+ //use the good old stl_algobase header, which is quite lightweight
+ #if !defined(BOOST_GCC) || ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 3)))
+ #include <bits/stl_algobase.h>
+ #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
+ //In GCC 4.3 a tiny stl_move.h was created with swap and move utilities
+ #include <bits/stl_move.h>
+ #else
+ //In GCC 4.4 stl_move.h was renamed to move.h
+ #include <bits/move.h>
+ #endif
+#elif defined(_LIBCPP_VERSION)
+ #include <type_traits> //The initial import of libc++ defines std::swap and still there
+#elif __cplusplus >= 201103L
+ #include <utility> //Fallback for C++ >= 2011
+#else
+ #include <algorithm> //Fallback for C++98/03
+#endif
+
+#include <boost/move/utility_core.hpp> //for boost::move
+
+#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
+
+#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+namespace boost_move_member_swap {
+
+struct dont_care
+{
+ dont_care(...);
+};
+
+struct private_type
+{
+ static private_type p;
+ private_type const &operator,(int) const;
+};
+
+typedef char yes_type;
+struct no_type{ char dummy[2]; };
+
+template<typename T>
+no_type is_private_type(T const &);
+
+yes_type is_private_type(private_type const &);
+
+template <typename Type>
+class has_member_function_named_swap
+{
+ struct BaseMixin
+ {
+ void swap();
+ };
+
+ struct Base : public Type, public BaseMixin { Base(); };
+ template <typename T, T t> class Helper{};
+
+ template <typename U>
+ static no_type deduce(U*, Helper<void (BaseMixin::*)(), &U::swap>* = 0);
+ static yes_type deduce(...);
+
+ public:
+ static const bool value = sizeof(yes_type) == sizeof(deduce((Base*)(0)));
+};
+
+template<typename Fun, bool HasFunc>
+struct has_member_swap_impl
+{
+ static const bool value = false;
+};
+
+template<typename Fun>
+struct has_member_swap_impl<Fun, true>
+{
+ struct FunWrap : Fun
+ {
+ FunWrap();
+
+ using Fun::swap;
+ private_type swap(dont_care) const;
+ };
+
+ static Fun &declval_fun();
+ static FunWrap declval_wrap();
+
+ static bool const value =
+ sizeof(no_type) == sizeof(is_private_type( (declval_wrap().swap(declval_fun()), 0)) );
+};
+
+template<typename Fun>
+struct has_member_swap : public has_member_swap_impl
+ <Fun, has_member_function_named_swap<Fun>::value>
+{};
+
+} //namespace boost_move_member_swap
+
+namespace boost_move_adl_swap{
+
+template<class P1, class P2, bool = P1::value>
+struct and_op_impl
+{ static const bool value = false; };
+
+template<class P1, class P2>
+struct and_op_impl<P1, P2, true>
+{ static const bool value = P2::value; };
+
+template<class P1, class P2>
+struct and_op
+ : and_op_impl<P1, P2>
+{};
+
+//////
+
+template<class P1, class P2, bool = P1::value>
+struct and_op_not_impl
+{ static const bool value = false; };
+
+template<class P1, class P2>
+struct and_op_not_impl<P1, P2, true>
+{ static const bool value = !P2::value; };
+
+template<class P1, class P2>
+struct and_op_not
+ : and_op_not_impl<P1, P2>
+{};
+
+template<class T>
+BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y, typename boost::move_detail::enable_if_c<!boost::move_detail::has_move_emulation_enabled_impl<T>::value>::type* = 0)
+{
+ //use std::swap if argument dependent lookup fails
+ //Use using directive ("using namespace xxx;") instead as some older compilers
+ //don't do ADL with using declarations ("using ns::func;").
+ using namespace std;
+ swap(x, y);
+}
+
+template<class T>
+BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y
+ , typename boost::move_detail::enable_if< and_op_not_impl<boost::move_detail::has_move_emulation_enabled_impl<T>
+ , boost_move_member_swap::has_member_swap<T> >
+ >::type* = 0)
+{ T t(::boost::move(x)); x = ::boost::move(y); y = ::boost::move(t); }
+
+template<class T>
+BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y
+ , typename boost::move_detail::enable_if< and_op_impl< boost::move_detail::has_move_emulation_enabled_impl<T>
+ , boost_move_member_swap::has_member_swap<T> >
+ >::type* = 0)
+{ x.swap(y); }
+
+} //namespace boost_move_adl_swap{
+
+#else
+
+namespace boost_move_adl_swap{
+
+template<class T>
+BOOST_MOVE_FORCEINLINE void swap_proxy(T& x, T& y)
+{
+ using std::swap;
+ swap(x, y);
+}
+
+} //namespace boost_move_adl_swap{
+
+#endif //#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+namespace boost_move_adl_swap{
+
+template<class T, std::size_t N>
+void swap_proxy(T (& x)[N], T (& y)[N])
+{
+ for (std::size_t i = 0; i < N; ++i){
+ ::boost_move_adl_swap::swap_proxy(x[i], y[i]);
+ }
+}
+
+} //namespace boost_move_adl_swap {
+
+#endif //!defined(BOOST_MOVE_DOXYGEN_INVOKED)
+
+namespace boost{
+
+//! Exchanges the values of a and b, using Argument Dependent Lookup (ADL) to select a
+//! specialized swap function if available. If no specialized swap function is available,
+//! std::swap is used.
+//!
+//! <b>Exception</b>: If T uses Boost.Move's move emulation and the compiler has
+//! no rvalue references then:
+//!
+//! - If T has a <code>T::swap(T&)</code> member, that member is called.
+//! - Otherwise a move-based swap is called, equivalent to:
+//! <code>T t(::boost::move(x)); x = ::boost::move(y); y = ::boost::move(t);</code>.
+template<class T>
+BOOST_MOVE_FORCEINLINE void adl_move_swap(T& x, T& y)
+{
+ ::boost_move_adl_swap::swap_proxy(x, y);
+}
+
+//! Exchanges elements between range [first1, last1) and another range starting at first2
+//! using boost::adl_move_swap.
+//!
+//! Parameters:
+//! first1, last1 - the first range of elements to swap
+//! first2 - beginning of the second range of elements to swap
+//!
+//! Type requirements:
+//! - ForwardIt1, ForwardIt2 must meet the requirements of ForwardIterator.
+//! - The types of dereferenced ForwardIt1 and ForwardIt2 must meet the
+//! requirements of Swappable
+//!
+//! Return value: Iterator to the element past the last element exchanged in the range
+//! beginning with first2.
+template<class ForwardIt1, class ForwardIt2>
+ForwardIt2 adl_move_swap_ranges(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2)
+{
+ while (first1 != last1) {
+ ::boost::adl_move_swap(*first1, *first2);
+ ++first1;
+ ++first2;
+ }
+ return first2;
+}
+
+template<class BidirIt1, class BidirIt2>
+BidirIt2 adl_move_swap_ranges_backward(BidirIt1 first1, BidirIt1 last1, BidirIt2 last2)
+{
+ while (first1 != last1) {
+ ::boost::adl_move_swap(*(--last1), *(--last2));
+ }
+ return last2;
+}
+
+} //namespace boost{
+
+#endif //#ifndef BOOST_MOVE_ADL_MOVE_SWAP_HPP
--- /dev/null
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2016.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+
+#ifndef BOOST_MOVE_ALGO_MOVE_HPP
+#define BOOST_MOVE_ALGO_MOVE_HPP
+
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+#
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+# pragma once
+#endif
+
+#include <boost/move/detail/config_begin.hpp>
+
+#include <boost/move/utility_core.hpp>
+#include <boost/move/detail/iterator_traits.hpp>
+#include <boost/detail/no_exceptions_support.hpp>
+
+namespace boost {
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// move
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#if !defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
+
+ //! <b>Effects</b>: Moves elements in the range [first,last) into the range [result,result + (last -
+ //! first)) starting from first and proceeding to last. For each non-negative integer n < (last-first),
+ //! performs *(result + n) = ::boost::move (*(first + n)).
+ //!
+ //! <b>Effects</b>: result + (last - first).
+ //!
+ //! <b>Requires</b>: result shall not be in the range [first,last).
+ //!
+ //! <b>Complexity</b>: Exactly last - first move assignments.
+ template <typename I, // I models InputIterator
+ typename O> // O models OutputIterator
+ O move(I f, I l, O result)
+ {
+ while (f != l) {
+ *result = ::boost::move(*f);
+ ++f; ++result;
+ }
+ return result;
+ }
+
+ //////////////////////////////////////////////////////////////////////////////
+ //
+ // move_backward
+ //
+ //////////////////////////////////////////////////////////////////////////////
+
+ //! <b>Effects</b>: Moves elements in the range [first,last) into the range
+ //! [result - (last-first),result) starting from last - 1 and proceeding to
+ //! first. For each positive integer n <= (last - first),
+ //! performs *(result - n) = ::boost::move(*(last - n)).
+ //!
+ //! <b>Requires</b>: result shall not be in the range [first,last).
+ //!
+ //! <b>Returns</b>: result - (last - first).
+ //!
+ //! <b>Complexity</b>: Exactly last - first assignments.
+ template <typename I, // I models BidirectionalIterator
+ typename O> // O models BidirectionalIterator
+ O move_backward(I f, I l, O result)
+ {
+ while (f != l) {
+ --l; --result;
+ *result = ::boost::move(*l);
+ }
+ return result;
+ }
+
+#else
+
+ using ::std::move_backward;
+
+#endif //!defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// uninitialized_move
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! <b>Effects</b>:
+//! \code
+//! for (; first != last; ++result, ++first)
+//! new (static_cast<void*>(&*result))
+//! typename iterator_traits<ForwardIterator>::value_type(boost::move(*first));
+//! \endcode
+//!
+//! <b>Returns</b>: result
+template
+ <typename I, // I models InputIterator
+ typename F> // F models ForwardIterator
+F uninitialized_move(I f, I l, F r
+ /// @cond
+// ,typename ::boost::move_detail::enable_if<has_move_emulation_enabled<typename boost::movelib::iterator_traits<I>::value_type> >::type* = 0
+ /// @endcond
+ )
+{
+ typedef typename boost::movelib::iterator_traits<I>::value_type input_value_type;
+
+ F back = r;
+ BOOST_TRY{
+ while (f != l) {
+ void * const addr = static_cast<void*>(::boost::move_detail::addressof(*r));
+ ::new(addr) input_value_type(::boost::move(*f));
+ ++f; ++r;
+ }
+ }
+ BOOST_CATCH(...){
+ for (; back != r; ++back){
+ back->~input_value_type();
+ }
+ BOOST_RETHROW;
+ }
+ BOOST_CATCH_END
+ return r;
+}
+
+/// @cond
+/*
+template
+ <typename I, // I models InputIterator
+ typename F> // F models ForwardIterator
+F uninitialized_move(I f, I l, F r,
+ typename ::boost::move_detail::disable_if<has_move_emulation_enabled<typename boost::movelib::iterator_traits<I>::value_type> >::type* = 0)
+{
+ return std::uninitialized_copy(f, l, r);
+}
+*/
+
+/// @endcond
+
+} //namespace boost {
+
+#include <boost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_ALGO_MOVE_HPP
--- /dev/null
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+
+#ifndef BOOST_MOVE_ALGORITHM_HPP
+#define BOOST_MOVE_ALGORITHM_HPP
+
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+#
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+# pragma once
+#endif
+
+#include <boost/move/detail/config_begin.hpp>
+
+#include <boost/move/utility_core.hpp>
+#include <boost/move/iterator.hpp>
+#include <boost/move/algo/move.hpp>
+#include <boost/detail/no_exceptions_support.hpp>
+
+#include <algorithm> //copy, copy_backward
+#include <memory> //uninitialized_copy
+
+namespace boost {
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// uninitialized_copy_or_move
+//
+//////////////////////////////////////////////////////////////////////////////
+
+namespace move_detail {
+
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+inline F uninitialized_move_move_iterator(I f, I l, F r
+// ,typename ::boost::move_detail::enable_if< has_move_emulation_enabled<typename I::value_type> >::type* = 0
+)
+{
+ return ::boost::uninitialized_move(f, l, r);
+}
+/*
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+F uninitialized_move_move_iterator(I f, I l, F r,
+ typename ::boost::move_detail::disable_if< has_move_emulation_enabled<typename I::value_type> >::type* = 0)
+{
+ return std::uninitialized_copy(f.base(), l.base(), r);
+}
+*/
+} //namespace move_detail {
+
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+inline F uninitialized_copy_or_move(I f, I l, F r,
+ typename ::boost::move_detail::enable_if< move_detail::is_move_iterator<I> >::type* = 0)
+{
+ return ::boost::move_detail::uninitialized_move_move_iterator(f, l, r);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// copy_or_move
+//
+//////////////////////////////////////////////////////////////////////////////
+
+namespace move_detail {
+
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+inline F move_move_iterator(I f, I l, F r
+// ,typename ::boost::move_detail::enable_if< has_move_emulation_enabled<typename I::value_type> >::type* = 0
+)
+{
+ return ::boost::move(f, l, r);
+}
+/*
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+F move_move_iterator(I f, I l, F r,
+ typename ::boost::move_detail::disable_if< has_move_emulation_enabled<typename I::value_type> >::type* = 0)
+{
+ return std::copy(f.base(), l.base(), r);
+}
+*/
+
+} //namespace move_detail {
+
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+inline F copy_or_move(I f, I l, F r,
+ typename ::boost::move_detail::enable_if< move_detail::is_move_iterator<I> >::type* = 0)
+{
+ return ::boost::move_detail::move_move_iterator(f, l, r);
+}
+
+/// @endcond
+
+//! <b>Effects</b>:
+//! \code
+//! for (; first != last; ++result, ++first)
+//! new (static_cast<void*>(&*result))
+//! typename iterator_traits<ForwardIterator>::value_type(*first);
+//! \endcode
+//!
+//! <b>Returns</b>: result
+//!
+//! <b>Note</b>: This function is provided because
+//! <i>std::uninitialized_copy</i> from some STL implementations
+//! is not compatible with <i>move_iterator</i>
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+inline F uninitialized_copy_or_move(I f, I l, F r
+ /// @cond
+ ,typename ::boost::move_detail::disable_if< move_detail::is_move_iterator<I> >::type* = 0
+ /// @endcond
+ )
+{
+ return std::uninitialized_copy(f, l, r);
+}
+
+//! <b>Effects</b>:
+//! \code
+//! for (; first != last; ++result, ++first)
+//! *result = *first;
+//! \endcode
+//!
+//! <b>Returns</b>: result
+//!
+//! <b>Note</b>: This function is provided because
+//! <i>std::uninitialized_copy</i> from some STL implementations
+//! is not compatible with <i>move_iterator</i>
+template
+<typename I, // I models InputIterator
+typename F> // F models ForwardIterator
+inline F copy_or_move(I f, I l, F r
+ /// @cond
+ ,typename ::boost::move_detail::disable_if< move_detail::is_move_iterator<I> >::type* = 0
+ /// @endcond
+ )
+{
+ return std::copy(f, l, r);
+}
+
+} //namespace boost {
+
+#include <boost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_ALGORITHM_HPP
--- /dev/null
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2014-2014.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+
+#ifndef BOOST_MOVE_DETAIL_ITERATOR_TRAITS_HPP
+#define BOOST_MOVE_DETAIL_ITERATOR_TRAITS_HPP
+
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+#
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+# pragma once
+#endif
+
+#include <cstddef>
+#include <boost/move/detail/type_traits.hpp>
+
+#include <boost/move/detail/std_ns_begin.hpp>
+BOOST_MOVE_STD_NS_BEG
+
+struct input_iterator_tag;
+struct forward_iterator_tag;
+struct bidirectional_iterator_tag;
+struct random_access_iterator_tag;
+struct output_iterator_tag;
+
+BOOST_MOVE_STD_NS_END
+#include <boost/move/detail/std_ns_end.hpp>
+
+namespace boost{ namespace movelib{
+
+template<class Iterator>
+struct iterator_traits
+{
+ typedef typename Iterator::difference_type difference_type;
+ typedef typename Iterator::value_type value_type;
+ typedef typename Iterator::pointer pointer;
+ typedef typename Iterator::reference reference;
+ typedef typename Iterator::iterator_category iterator_category;
+ typedef typename boost::move_detail::make_unsigned<difference_type>::type size_type;
+};
+
+template<class T>
+struct iterator_traits<T*>
+{
+ typedef std::ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef T* pointer;
+ typedef T& reference;
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef typename boost::move_detail::make_unsigned<difference_type>::type size_type;
+};
+
+template<class T>
+struct iterator_traits<const T*>
+{
+ typedef std::ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T* pointer;
+ typedef const T& reference;
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef typename boost::move_detail::make_unsigned<difference_type>::type size_type;
+};
+
+}} //namespace boost { namespace movelib{
+
+#endif //#ifndef BOOST_MOVE_DETAIL_ITERATOR_TRAITS_HPP
--- /dev/null
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2012-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+
+#ifndef BOOST_MOVE_ITERATOR_HPP
+#define BOOST_MOVE_ITERATOR_HPP
+
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+#
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+# pragma once
+#endif
+
+#include <boost/move/detail/config_begin.hpp>
+#include <boost/move/detail/workaround.hpp> //forceinline
+#include <boost/move/detail/iterator_traits.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost {
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// move_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! Class template move_iterator is an iterator adaptor with the same behavior
+//! as the underlying iterator except that its dereference operator implicitly
+//! converts the value returned by the underlying iterator's dereference operator
+//! to an rvalue reference. Some generic algorithms can be called with move
+//! iterators to replace copying with moving.
+template <class It>
+class move_iterator
+{
+ public:
+ typedef It iterator_type;
+ typedef typename boost::movelib::iterator_traits<iterator_type>::value_type value_type;
+ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
+ typedef value_type && reference;
+ #else
+ typedef typename ::boost::move_detail::if_
+ < ::boost::has_move_emulation_enabled<value_type>
+ , ::boost::rv<value_type>&
+ , value_type & >::type reference;
+ #endif
+ typedef It pointer;
+ typedef typename boost::movelib::iterator_traits<iterator_type>::difference_type difference_type;
+ typedef typename boost::movelib::iterator_traits<iterator_type>::iterator_category iterator_category;
+
+ BOOST_MOVE_FORCEINLINE move_iterator()
+ : m_it()
+ {}
+
+ BOOST_MOVE_FORCEINLINE explicit move_iterator(const It &i)
+ : m_it(i)
+ {}
+
+ template <class U>
+ BOOST_MOVE_FORCEINLINE move_iterator(const move_iterator<U>& u)
+ : m_it(u.m_it)
+ {}
+
+ BOOST_MOVE_FORCEINLINE reference operator*() const
+ {
+ #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
+ return *m_it;
+ #else
+ return ::boost::move(*m_it);
+ #endif
+ }
+
+ BOOST_MOVE_FORCEINLINE pointer operator->() const
+ { return m_it; }
+
+ BOOST_MOVE_FORCEINLINE move_iterator& operator++()
+ { ++m_it; return *this; }
+
+ BOOST_MOVE_FORCEINLINE move_iterator<iterator_type> operator++(int)
+ { move_iterator<iterator_type> tmp(*this); ++(*this); return tmp; }
+
+ BOOST_MOVE_FORCEINLINE move_iterator& operator--()
+ { --m_it; return *this; }
+
+ BOOST_MOVE_FORCEINLINE move_iterator<iterator_type> operator--(int)
+ { move_iterator<iterator_type> tmp(*this); --(*this); return tmp; }
+
+ move_iterator<iterator_type> operator+ (difference_type n) const
+ { return move_iterator<iterator_type>(m_it + n); }
+
+ BOOST_MOVE_FORCEINLINE move_iterator& operator+=(difference_type n)
+ { m_it += n; return *this; }
+
+ BOOST_MOVE_FORCEINLINE move_iterator<iterator_type> operator- (difference_type n) const
+ { return move_iterator<iterator_type>(m_it - n); }
+
+ BOOST_MOVE_FORCEINLINE move_iterator& operator-=(difference_type n)
+ { m_it -= n; return *this; }
+
+ BOOST_MOVE_FORCEINLINE reference operator[](difference_type n) const
+ {
+ #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
+ return m_it[n];
+ #else
+ return ::boost::move(m_it[n]);
+ #endif
+ }
+
+ BOOST_MOVE_FORCEINLINE friend bool operator==(const move_iterator& x, const move_iterator& y)
+ { return x.m_it == y.m_it; }
+
+ BOOST_MOVE_FORCEINLINE friend bool operator!=(const move_iterator& x, const move_iterator& y)
+ { return x.m_it != y.m_it; }
+
+ BOOST_MOVE_FORCEINLINE friend bool operator< (const move_iterator& x, const move_iterator& y)
+ { return x.m_it < y.m_it; }
+
+ BOOST_MOVE_FORCEINLINE friend bool operator<=(const move_iterator& x, const move_iterator& y)
+ { return x.m_it <= y.m_it; }
+
+ BOOST_MOVE_FORCEINLINE friend bool operator> (const move_iterator& x, const move_iterator& y)
+ { return x.m_it > y.m_it; }
+
+ BOOST_MOVE_FORCEINLINE friend bool operator>=(const move_iterator& x, const move_iterator& y)
+ { return x.m_it >= y.m_it; }
+
+ BOOST_MOVE_FORCEINLINE friend difference_type operator-(const move_iterator& x, const move_iterator& y)
+ { return x.m_it - y.m_it; }
+
+ BOOST_MOVE_FORCEINLINE friend move_iterator operator+(difference_type n, const move_iterator& x)
+ { return move_iterator(x.m_it + n); }
+
+ private:
+ It m_it;
+};
+
+//is_move_iterator
+namespace move_detail {
+
+template <class I>
+struct is_move_iterator
+{
+ static const bool value = false;
+};
+
+template <class I>
+struct is_move_iterator< ::boost::move_iterator<I> >
+{
+ static const bool value = true;
+};
+
+} //namespace move_detail {
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// move_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//!
+//! <b>Returns</b>: move_iterator<It>(i).
+template<class It>
+inline move_iterator<It> make_move_iterator(const It &it)
+{ return move_iterator<It>(it); }
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// back_move_insert_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+//! A move insert iterator that move constructs elements at the
+//! back of a container
+template <typename C> // C models Container
+class back_move_insert_iterator
+{
+ C* container_m;
+
+ public:
+ typedef C container_type;
+ typedef typename C::value_type value_type;
+ typedef typename C::reference reference;
+ typedef typename C::pointer pointer;
+ typedef typename C::difference_type difference_type;
+ typedef std::output_iterator_tag iterator_category;
+
+ explicit back_move_insert_iterator(C& x) : container_m(&x) { }
+
+ back_move_insert_iterator& operator=(reference x)
+ { container_m->push_back(boost::move(x)); return *this; }
+
+ back_move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
+ { reference rx = x; return this->operator=(rx); }
+
+ back_move_insert_iterator& operator*() { return *this; }
+ back_move_insert_iterator& operator++() { return *this; }
+ back_move_insert_iterator& operator++(int) { return *this; }
+};
+
+//!
+//! <b>Returns</b>: back_move_insert_iterator<C>(x).
+template <typename C> // C models Container
+inline back_move_insert_iterator<C> back_move_inserter(C& x)
+{
+ return back_move_insert_iterator<C>(x);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// front_move_insert_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! A move insert iterator that move constructs elements int the
+//! front of a container
+template <typename C> // C models Container
+class front_move_insert_iterator
+{
+ C* container_m;
+
+public:
+ typedef C container_type;
+ typedef typename C::value_type value_type;
+ typedef typename C::reference reference;
+ typedef typename C::pointer pointer;
+ typedef typename C::difference_type difference_type;
+ typedef std::output_iterator_tag iterator_category;
+
+ explicit front_move_insert_iterator(C& x) : container_m(&x) { }
+
+ front_move_insert_iterator& operator=(reference x)
+ { container_m->push_front(boost::move(x)); return *this; }
+
+ front_move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
+ { reference rx = x; return this->operator=(rx); }
+
+ front_move_insert_iterator& operator*() { return *this; }
+ front_move_insert_iterator& operator++() { return *this; }
+ front_move_insert_iterator& operator++(int) { return *this; }
+};
+
+//!
+//! <b>Returns</b>: front_move_insert_iterator<C>(x).
+template <typename C> // C models Container
+inline front_move_insert_iterator<C> front_move_inserter(C& x)
+{
+ return front_move_insert_iterator<C>(x);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// insert_move_iterator
+//
+//////////////////////////////////////////////////////////////////////////////
+template <typename C> // C models Container
+class move_insert_iterator
+{
+ C* container_m;
+ typename C::iterator pos_;
+
+ public:
+ typedef C container_type;
+ typedef typename C::value_type value_type;
+ typedef typename C::reference reference;
+ typedef typename C::pointer pointer;
+ typedef typename C::difference_type difference_type;
+ typedef std::output_iterator_tag iterator_category;
+
+ explicit move_insert_iterator(C& x, typename C::iterator pos)
+ : container_m(&x), pos_(pos)
+ {}
+
+ move_insert_iterator& operator=(reference x)
+ {
+ pos_ = container_m->insert(pos_, ::boost::move(x));
+ ++pos_;
+ return *this;
+ }
+
+ move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
+ { reference rx = x; return this->operator=(rx); }
+
+ move_insert_iterator& operator*() { return *this; }
+ move_insert_iterator& operator++() { return *this; }
+ move_insert_iterator& operator++(int) { return *this; }
+};
+
+//!
+//! <b>Returns</b>: move_insert_iterator<C>(x, it).
+template <typename C> // C models Container
+inline move_insert_iterator<C> move_inserter(C& x, typename C::iterator it)
+{
+ return move_insert_iterator<C>(x, it);
+}
+
+} //namespace boost {
+
+#include <boost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_ITERATOR_HPP
--- /dev/null
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright David Abrahams, Vicente Botet 2009.
+// (C) Copyright Ion Gaztanaga 2009-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/move for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//! \file
+//! A general library header that includes
+//! the rest of top-level headers.
+
+#ifndef BOOST_MOVE_MOVE_HPP
+#define BOOST_MOVE_MOVE_HPP
+
+#ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+#endif
+#
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+# pragma once
+#endif
+
+#include <boost/move/detail/config_begin.hpp>
+#include <boost/move/utility.hpp>
+#include <boost/move/iterator.hpp>
+#include <boost/move/traits.hpp>
+#include <boost/move/algorithm.hpp>
+#include <boost/move/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_MOVE_MOVE_HPP
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_CONFIG_OPERATORS_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_OPERATORS_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/aux_/config/gcc.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#if !defined(BOOST_MPL_CFG_USE_OPERATORS_OVERLOADING) \
+ && ( BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
+ || BOOST_WORKAROUND(__EDG_VERSION__, <= 245) \
+ || BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, <= 0x0295) \
+ || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) \
+ || BOOST_WORKAROUND(__NVCC__, BOOST_TESTED_AT(1)) \
+ )
+
+# define BOOST_MPL_CFG_USE_OPERATORS_OVERLOADING
+
+#endif
+
+#endif // BOOST_MPL_AUX_CONFIG_OPERATORS_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_EMPTY_IMPL_HPP_INCLUDED
+#define BOOST_MPL_AUX_EMPTY_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/empty_fwd.hpp>
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/aux_/traits_lambda_spec.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace mpl {
+
+// default implementation; conrete sequences might override it by
+// specializing either the 'empty_impl' or the primary 'empty' template
+
+template< typename Tag >
+struct empty_impl
+{
+ template< typename Sequence > struct apply
+ : is_same<
+ typename begin<Sequence>::type
+ , typename end<Sequence>::type
+ >
+ {
+ };
+};
+
+BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1,empty_impl)
+
+}}
+
+#endif // BOOST_MPL_AUX_EMPTY_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_FRONT_IMPL_HPP_INCLUDED
+#define BOOST_MPL_AUX_FRONT_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/front_fwd.hpp>
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/aux_/traits_lambda_spec.hpp>
+
+namespace boost { namespace mpl {
+
+// default implementation; conrete sequences might override it by
+// specializing either the 'front_impl' or the primary 'front' template
+
+template< typename Tag >
+struct front_impl
+{
+ template< typename Sequence > struct apply
+ {
+ typedef typename begin<Sequence>::type iter_;
+ typedef typename deref<iter_>::type type;
+ };
+};
+
+BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1,front_impl)
+
+}}
+
+#endif // BOOST_MPL_AUX_FRONT_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_HAS_KEY_IMPL_HPP_INCLUDED
+#define BOOST_MPL_AUX_HAS_KEY_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2002-2004
+// Copyright David Abrahams 2003
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/has_key_fwd.hpp>
+#include <boost/mpl/aux_/traits_lambda_spec.hpp>
+
+namespace boost { namespace mpl {
+
+// no default implementation; the definition is needed to make MSVC happy
+
+template< typename Tag > struct has_key_impl
+{
+ template< typename AssociativeSequence, typename Key > struct apply;
+};
+
+BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2,has_key_impl)
+
+}}
+
+#endif // BOOST_MPL_AUX_HAS_KEY_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_INSERT_IMPL_HPP_INCLUDED
+#define BOOST_MPL_INSERT_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/reverse_fold.hpp>
+#include <boost/mpl/iterator_range.hpp>
+#include <boost/mpl/clear.hpp>
+#include <boost/mpl/push_front.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/traits_lambda_spec.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace mpl {
+
+// default implementation; conrete sequences might override it by
+// specializing either the 'insert_impl' or the primary 'insert' template
+
+template< typename Tag >
+struct insert_impl
+{
+ template<
+ typename Sequence
+ , typename Pos
+ , typename T
+ >
+ struct apply
+ {
+ typedef iterator_range<
+ typename begin<Sequence>::type
+ , Pos
+ > first_half_;
+
+ typedef iterator_range<
+ Pos
+ , typename end<Sequence>::type
+ > second_half_;
+
+ typedef typename reverse_fold<
+ second_half_
+ , typename clear<Sequence>::type
+ , push_front<_,_>
+ >::type half_sequence_;
+
+ typedef typename reverse_fold<
+ first_half_
+ , typename push_front<half_sequence_,T>::type
+ , push_front<_,_>
+ >::type type;
+ };
+};
+
+BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(3,insert_impl)
+
+}}
+
+#endif // BOOST_MPL_INSERT_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_OVERLOAD_NAMES_HPP_INCLUDED
+#define BOOST_MPL_AUX_OVERLOAD_NAMES_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/aux_/ptr_to_ref.hpp>
+#include <boost/mpl/aux_/config/operators.hpp>
+
+#if defined(BOOST_MPL_CFG_USE_OPERATORS_OVERLOADING)
+
+# include <boost/mpl/aux_/static_cast.hpp>
+
+# define BOOST_MPL_AUX_OVERLOAD_VALUE_BY_KEY operator/
+# define BOOST_MPL_AUX_OVERLOAD_ITEM_BY_ORDER operator|
+# define BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY operator||
+# define BOOST_MPL_AUX_OVERLOAD_IS_MASKED operator%
+
+# define BOOST_MPL_AUX_OVERLOAD_CALL_VALUE_BY_KEY(T, x) BOOST_MPL_AUX_PTR_TO_REF(T) / x
+# define BOOST_MPL_AUX_OVERLOAD_CALL_ITEM_BY_ORDER(T, x) BOOST_MPL_AUX_PTR_TO_REF(T) | x
+# define BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(T, x) BOOST_MPL_AUX_PTR_TO_REF(T) || x
+# define BOOST_MPL_AUX_OVERLOAD_CALL_IS_MASKED(T, x) BOOST_MPL_AUX_PTR_TO_REF(T) % x
+
+#else
+
+# define BOOST_MPL_AUX_OVERLOAD_VALUE_BY_KEY value_by_key_
+# define BOOST_MPL_AUX_OVERLOAD_ITEM_BY_ORDER item_by_order_
+# define BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY order_by_key_
+# define BOOST_MPL_AUX_OVERLOAD_IS_MASKED is_masked_
+
+# define BOOST_MPL_AUX_OVERLOAD_CALL_VALUE_BY_KEY(T, x) T::BOOST_MPL_AUX_OVERLOAD_VALUE_BY_KEY( BOOST_MPL_AUX_PTR_TO_REF(T), x )
+# define BOOST_MPL_AUX_OVERLOAD_CALL_ITEM_BY_ORDER(T, x) T::BOOST_MPL_AUX_OVERLOAD_ITEM_BY_ORDER( BOOST_MPL_AUX_PTR_TO_REF(T), x )
+# define BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(T, x) T::BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY( BOOST_MPL_AUX_PTR_TO_REF(T), x )
+# define BOOST_MPL_AUX_OVERLOAD_CALL_IS_MASKED(T, x) T::BOOST_MPL_AUX_OVERLOAD_IS_MASKED( BOOST_MPL_AUX_PTR_TO_REF(T), x )
+
+#endif
+
+#endif // BOOST_MPL_AUX_OVERLOAD_NAMES_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_PTR_TO_REF_HPP_INCLUDED
+#define BOOST_MPL_AUX_PTR_TO_REF_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/aux_/static_cast.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
+ || ( BOOST_WORKAROUND(__EDG_VERSION__, <= 245) \
+ && !(defined(__STD_STRICT_ANSI) \
+ || defined(__STD_STRICT_ANSI_ERRORS)) )
+
+# define BOOST_MPL_AUX_PTR_TO_REF(X) \
+ *BOOST_MPL_AUX_STATIC_CAST(X*, 0) \
+/**/
+
+#else
+
+# define BOOST_MPL_AUX_PTR_TO_REF(X) \
+ aux::ptr_to_ref(BOOST_MPL_AUX_STATIC_CAST(X*, 0)) \
+/**/
+
+#endif
+
+
+namespace boost { namespace mpl { namespace aux {
+
+template< typename T > static T const& ptr_to_ref(T*);
+
+}}}
+
+#endif // BOOST_MPL_AUX_PTR_TO_REF_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_BASE_HPP_INCLUDED
+#define BOOST_MPL_BASE_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(T)
+ >
+struct base
+{
+ typedef typename T::base type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,base,(T))
+};
+
+BOOST_MPL_AUX_NA_SPEC(1, base)
+
+}}
+
+#endif // BOOST_MPL_BASE_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_BEGIN_HPP_INCLUDED
+#define BOOST_MPL_BEGIN_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/begin_end.hpp>
+
+#endif // BOOST_MPL_BEGIN_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_EMPTY_HPP_INCLUDED
+#define BOOST_MPL_EMPTY_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/empty_fwd.hpp>
+#include <boost/mpl/sequence_tag.hpp>
+#include <boost/mpl/aux_/empty_impl.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(Sequence)
+ >
+struct empty
+ : empty_impl< typename sequence_tag<Sequence>::type >
+ ::template apply< Sequence >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,empty,(Sequence))
+};
+
+BOOST_MPL_AUX_NA_SPEC(1, empty)
+
+}}
+
+#endif // BOOST_MPL_EMPTY_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_END_HPP_INCLUDED
+#define BOOST_MPL_END_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/begin_end.hpp>
+
+#endif // BOOST_MPL_END_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_ERASE_FWD_HPP_INCLUDED
+#define BOOST_MPL_ERASE_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+namespace boost { namespace mpl {
+
+template< typename Tag > struct erase_impl;
+template< typename Sequence, typename First, typename Last > struct erase;
+
+}}
+
+#endif // BOOST_MPL_ERASE_FWD_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_ERASE_KEY_FWD_HPP_INCLUDED
+#define BOOST_MPL_ERASE_KEY_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+namespace boost { namespace mpl {
+
+template< typename Tag > struct erase_key_impl;
+template< typename Sequence, typename Key > struct erase_key;
+
+}}
+
+#endif // BOOST_MPL_ERASE_KEY_FWD_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_FRONT_HPP_INCLUDED
+#define BOOST_MPL_FRONT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/front_fwd.hpp>
+#include <boost/mpl/aux_/front_impl.hpp>
+#include <boost/mpl/sequence_tag.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(Sequence)
+ >
+struct front
+ : front_impl< typename sequence_tag<Sequence>::type >
+ ::template apply< Sequence >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,front,(Sequence))
+};
+
+BOOST_MPL_AUX_NA_SPEC(1, front)
+
+}}
+
+#endif // BOOST_MPL_FRONT_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_HAS_KEY_HPP_INCLUDED
+#define BOOST_MPL_HAS_KEY_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/has_key_fwd.hpp>
+#include <boost/mpl/sequence_tag.hpp>
+#include <boost/mpl/aux_/has_key_impl.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(AssociativeSequence)
+ , typename BOOST_MPL_AUX_NA_PARAM(Key)
+ >
+struct has_key
+ : has_key_impl< typename sequence_tag<AssociativeSequence>::type >
+ ::template apply<AssociativeSequence,Key>
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(2,has_key,(AssociativeSequence,Key))
+};
+
+BOOST_MPL_AUX_NA_SPEC(2, has_key)
+
+}}
+
+#endif // BOOST_MPL_HAS_KEY_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_HAS_KEY_FWD_HPP_INCLUDED
+#define BOOST_MPL_HAS_KEY_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+namespace boost { namespace mpl {
+
+template< typename Tag > struct has_key_impl;
+template< typename AssociativeSequence, typename Key > struct has_key;
+
+}}
+
+#endif // BOOST_MPL_HAS_KEY_FWD_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_INSERT_HPP_INCLUDED
+#define BOOST_MPL_INSERT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/insert_fwd.hpp>
+#include <boost/mpl/sequence_tag.hpp>
+#include <boost/mpl/aux_/insert_impl.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(Sequence)
+ , typename BOOST_MPL_AUX_NA_PARAM(Pos_or_T)
+ , typename BOOST_MPL_AUX_NA_PARAM(T)
+ >
+struct insert
+ : insert_impl< typename sequence_tag<Sequence>::type >
+ ::template apply< Sequence,Pos_or_T,T >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(3,insert,(Sequence,Pos_or_T,T))
+};
+
+BOOST_MPL_AUX_NA_SPEC(3, insert)
+
+}}
+
+#endif // BOOST_MPL_INSERT_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_INSERT_FWD_HPP_INCLUDED
+#define BOOST_MPL_INSERT_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+namespace boost { namespace mpl {
+
+template< typename Tag > struct insert_impl;
+template< typename Sequence, typename Pos_or_T, typename T > struct insert;
+
+}}
+
+#endif // BOOST_MPL_INSERT_FWD_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_INSERT_RANGE_FWD_HPP_INCLUDED
+#define BOOST_MPL_INSERT_RANGE_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+namespace boost { namespace mpl {
+
+template< typename Tag > struct insert_range_impl;
+template< typename Sequence, typename Pos, typename Range > struct insert_range;
+
+}}
+
+#endif // BOOST_MPL_INSERT_RANGE_FWD_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
+#define BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
+
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/sequence_tag_fwd.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/mpl/aux_/has_tag.hpp>
+#include <boost/mpl/aux_/has_begin.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+#include <boost/mpl/aux_/config/eti.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+# include <boost/mpl/aux_/msvc_is_class.hpp>
+#elif BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+# include <boost/type_traits/is_class.hpp>
+#endif
+
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace mpl {
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+
+namespace aux {
+
+// agurt, 11/jun/03:
+// MSVC 6.5/7.0 fails if 'has_begin' is instantiated on a class type that has a
+// 'begin' member that doesn't name a type; e.g. 'has_begin< std::vector<int> >'
+// would fail; requiring 'T' to have _both_ 'tag' and 'begin' members workarounds
+// the issue for most real-world cases
+template< typename T > struct is_sequence_impl
+ : and_<
+ identity< aux::has_tag<T> >
+ , identity< aux::has_begin<T> >
+ >
+{
+};
+
+} // namespace aux
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(T)
+ >
+struct is_sequence
+ : if_<
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ aux::msvc_is_class<T>
+#else
+ boost::is_class<T>
+#endif
+ , aux::is_sequence_impl<T>
+ , bool_<false>
+ >::type
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
+};
+
+#elif defined(BOOST_MPL_CFG_NO_HAS_XXX)
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(T)
+ >
+struct is_sequence
+ : bool_<false>
+{
+};
+
+#else
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(T)
+ >
+struct is_sequence
+ : not_< is_same< typename begin<T>::type, void_ > >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
+};
+
+#endif // BOOST_MSVC
+
+#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
+template<> struct is_sequence<int>
+ : bool_<false>
+{
+};
+#endif
+
+BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, is_sequence)
+
+}}
+
+#endif // BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_ITERATOR_CATEGORY_HPP_INCLUDED
+#define BOOST_MPL_ITERATOR_CATEGORY_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(Iterator)
+ >
+struct iterator_category
+{
+ typedef typename Iterator::category type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,iterator_category,(Iterator))
+};
+
+BOOST_MPL_AUX_NA_SPEC(1, iterator_category)
+
+}}
+
+#endif // BOOST_MPL_ITERATOR_CATEGORY_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_KEY_TYPE_FWD_HPP_INCLUDED
+#define BOOST_MPL_KEY_TYPE_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+namespace boost { namespace mpl {
+
+template< typename Tag > struct key_type_impl;
+template< typename AssociativeSequence, typename T > struct key_type;
+
+}}
+
+#endif // BOOST_MPL_KEY_TYPE_FWD_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_MAX_ELEMENT_HPP_INCLUDED
+#define BOOST_MPL_MAX_ELEMENT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/iter_fold.hpp>
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/aux_/common_name_wknd.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_COMMON_NAME_WKND(max_element)
+
+namespace aux {
+
+template< typename Predicate >
+struct select_max
+{
+ template< typename OldIterator, typename Iterator >
+ struct apply
+ {
+ typedef typename apply2<
+ Predicate
+ , typename deref<OldIterator>::type
+ , typename deref<Iterator>::type
+ >::type condition_;
+
+ typedef typename if_<
+ condition_
+ , Iterator
+ , OldIterator
+ >::type type;
+ };
+};
+
+} // namespace aux
+
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(Sequence)
+ , typename Predicate = less<_,_>
+ >
+struct max_element
+ : iter_fold<
+ Sequence
+ , typename begin<Sequence>::type
+ , protect< aux::select_max<Predicate> >
+ >
+{
+};
+
+BOOST_MPL_AUX_NA_SPEC(1, max_element)
+
+}}
+
+#endif // BOOST_MPL_MAX_ELEMENT_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_MIN_MAX_HPP_INCLUDED
+#define BOOST_MPL_MIN_MAX_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2008
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(N1)
+ , typename BOOST_MPL_AUX_NA_PARAM(N2)
+ >
+struct min
+ : if_< less<N1,N2>,N1,N2 >
+{
+};
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(N1)
+ , typename BOOST_MPL_AUX_NA_PARAM(N2)
+ >
+struct max
+ : if_< less<N1,N2>,N2,N1 >
+{
+};
+
+BOOST_MPL_AUX_NA_SPEC(2, min)
+BOOST_MPL_AUX_NA_SPEC(2, max)
+
+}}
+
+#endif // BOOST_MPL_MIN_MAX_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_PAIR_VIEW_HPP_INCLUDED
+#define BOOST_MPL_PAIR_VIEW_HPP_INCLUDED
+
+// Copyright David Abrahams 2003-2004
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/iterator_category.hpp>
+#include <boost/mpl/advance.hpp>
+#include <boost/mpl/distance.hpp>
+#include <boost/mpl/next_prior.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/min_max.hpp>
+#include <boost/mpl/pair.hpp>
+#include <boost/mpl/iterator_tags.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+
+namespace boost { namespace mpl {
+
+namespace aux {
+struct pair_iter_tag;
+
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template< typename Iter1, typename Iter2, typename Category >
+struct pair_iter;
+
+template< typename Category > struct prior_pair_iter
+{
+ template< typename Iter1, typename Iter2 > struct apply
+ {
+ typedef typename mpl::prior<Iter1>::type i1_;
+ typedef typename mpl::prior<Iter2>::type i2_;
+ typedef pair_iter<i1_,i2_,Category> type;
+ };
+};
+
+template<> struct prior_pair_iter<forward_iterator_tag>
+{
+ template< typename Iter1, typename Iter2 > struct apply
+ {
+ typedef pair_iter<Iter1,Iter2,forward_iterator_tag> type;
+ };
+};
+
+#endif
+}
+
+template<
+ typename Iter1
+ , typename Iter2
+ , typename Category
+ >
+struct pair_iter
+{
+ typedef aux::pair_iter_tag tag;
+ typedef Category category;
+ typedef Iter1 first;
+ typedef Iter2 second;
+
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ typedef pair<
+ typename deref<Iter1>::type
+ , typename deref<Iter2>::type
+ > type;
+
+ typedef typename mpl::next<Iter1>::type i1_;
+ typedef typename mpl::next<Iter2>::type i2_;
+ typedef pair_iter<i1_,i2_,Category> next;
+
+ typedef apply_wrap2< aux::prior_pair_iter<Category>,Iter1,Iter2 >::type prior;
+#endif
+};
+
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template< typename Iter1, typename Iter2, typename C >
+struct deref< pair_iter<Iter1,Iter2,C> >
+{
+ typedef pair<
+ typename deref<Iter1>::type
+ , typename deref<Iter2>::type
+ > type;
+};
+
+template< typename Iter1, typename Iter2, typename C >
+struct next< pair_iter<Iter1,Iter2,C> >
+{
+ typedef typename mpl::next<Iter1>::type i1_;
+ typedef typename mpl::next<Iter2>::type i2_;
+ typedef pair_iter<i1_,i2_,C> type;
+};
+
+template< typename Iter1, typename Iter2, typename C >
+struct prior< pair_iter<Iter1,Iter2,C> >
+{
+ typedef typename mpl::prior<Iter1>::type i1_;
+ typedef typename mpl::prior<Iter2>::type i2_;
+ typedef pair_iter<i1_,i2_,C> type;
+};
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+
+template<> struct advance_impl<aux::pair_iter_tag>
+{
+ template< typename Iter, typename D > struct apply
+ {
+ typedef typename mpl::advance< typename Iter::first,D >::type i1_;
+ typedef typename mpl::advance< typename Iter::second,D >::type i2_;
+ typedef pair_iter<i1_,i2_,typename Iter::category> type;
+ };
+};
+
+template<> struct distance_impl<aux::pair_iter_tag>
+{
+ template< typename Iter1, typename Iter2 > struct apply
+ {
+ // agurt, 10/nov/04: MSVC 6.5 ICE-s on forwarding
+ typedef typename mpl::distance<
+ typename first<Iter1>::type
+ , typename first<Iter2>::type
+ >::type type;
+ };
+};
+
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(Sequence1)
+ , typename BOOST_MPL_AUX_NA_PARAM(Sequence2)
+ >
+struct pair_view
+{
+ typedef nested_begin_end_tag tag;
+
+ typedef typename begin<Sequence1>::type iter1_;
+ typedef typename begin<Sequence2>::type iter2_;
+ typedef typename min<
+ typename iterator_category<iter1_>::type
+ , typename iterator_category<iter2_>::type
+ >::type category_;
+
+ typedef pair_iter<iter1_,iter2_,category_> begin;
+
+ typedef pair_iter<
+ typename end<Sequence1>::type
+ , typename end<Sequence2>::type
+ , category_
+ > end;
+};
+
+BOOST_MPL_AUX_NA_SPEC(2, pair_view)
+
+}}
+
+#endif // BOOST_MPL_PAIR_VIEW_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_AT_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_AT_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/at_fwd.hpp>
+#include <boost/mpl/set/aux_/has_key_impl.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/void.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct at_impl< aux::set_tag >
+{
+ template< typename Set, typename T > struct apply
+ {
+ typedef typename if_<
+ has_key_impl<aux::set_tag>::apply<Set,T>
+ , T
+ , void_
+ >::type type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_AT_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2007
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/begin_end_fwd.hpp>
+#include <boost/mpl/set/aux_/iterator.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct begin_impl< aux::set_tag >
+{
+ template< typename Set > struct apply
+ : s_iter_get<Set,typename Set::item_>
+ {
+ };
+};
+
+template<>
+struct end_impl< aux::set_tag >
+{
+ template< typename Set > struct apply
+ {
+ typedef s_iter< Set,set0<> > type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_CLEAR_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_CLEAR_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/clear_fwd.hpp>
+#include <boost/mpl/set/aux_/set0.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct clear_impl< aux::set_tag >
+{
+ template< typename Set > struct apply
+ {
+ typedef set0<> type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_CLEAR_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_EMPTY_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_EMPTY_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/empty_fwd.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct empty_impl< aux::set_tag >
+{
+ template< typename Set > struct apply
+ : not_< typename Set::size >
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_EMPTY_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_ERASE_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_ERASE_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/erase_fwd.hpp>
+#include <boost/mpl/set/aux_/erase_key_impl.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct erase_impl< aux::set_tag >
+{
+ template<
+ typename Set
+ , typename Pos
+ , typename unused_
+ >
+ struct apply
+ : erase_key_impl<aux::set_tag>
+ ::apply<Set,typename Pos::type>
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_ERASE_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2007
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/erase_key_fwd.hpp>
+#include <boost/mpl/set/aux_/has_key_impl.hpp>
+#include <boost/mpl/set/aux_/item.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/base.hpp>
+#include <boost/mpl/eval_if.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct erase_key_impl< aux::set_tag >
+{
+ template<
+ typename Set
+ , typename T
+ >
+ struct apply
+ : eval_if<
+ has_key_impl<aux::set_tag>::apply<Set,T>
+ , eval_if<
+ is_same< T,typename Set::item_type_ >
+ , base<Set>
+ , identity< s_mask<T,typename Set::item_> >
+ >
+ , identity<Set>
+ >
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_HAS_KEY_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_HAS_KEY_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/set/aux_/tag.hpp>
+#include <boost/mpl/has_key_fwd.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/aux_/overload_names.hpp>
+#include <boost/mpl/aux_/static_cast.hpp>
+#include <boost/mpl/aux_/yes_no.hpp>
+#include <boost/mpl/aux_/type_wrapper.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+#include <boost/mpl/aux_/config/static_constant.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct has_key_impl< aux::set_tag >
+{
+ template< typename Set, typename T > struct apply
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
+ || BOOST_WORKAROUND(__EDG_VERSION__, <= 245)
+ {
+ BOOST_STATIC_CONSTANT(bool, value =
+ ( sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_IS_MASKED(
+ Set
+ , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<T>*, 0)
+ ) ) == sizeof(aux::no_tag) )
+ );
+
+ typedef bool_<value> type;
+
+#else // ISO98 C++
+ : bool_<
+ ( sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_IS_MASKED(
+ Set
+ , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<T>*, 0)
+ ) ) == sizeof(aux::no_tag) )
+ >
+ {
+#endif
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_HAS_KEY_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2007
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/insert_fwd.hpp>
+#include <boost/mpl/set/aux_/has_key_impl.hpp>
+#include <boost/mpl/set/aux_/item.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/base.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/aux_/na.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace mpl {
+
+namespace aux {
+template< typename Set, typename T > struct set_insert_impl
+ : eval_if<
+ has_key_impl<aux::set_tag>::apply<Set,T>
+ , identity<Set>
+ , eval_if<
+ is_same< T,typename Set::last_masked_ >
+ , base<Set>
+ , identity< s_item<T,typename Set::item_> >
+ >
+ >
+{
+};
+}
+
+template<>
+struct insert_impl< aux::set_tag >
+{
+ template<
+ typename Set
+ , typename PosOrKey
+ , typename KeyOrNA
+ >
+ struct apply
+ : aux::set_insert_impl<
+ Set
+ , typename if_na<KeyOrNA,PosOrKey>::type
+ >
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
+
+// Copyright Bruno Dutra 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/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/insert_range_fwd.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/fold.hpp>
+#include <boost/mpl/insert.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct insert_range_impl< aux::set_tag >
+{
+ template<
+ typename Sequence
+ , typename /*Pos*/
+ , typename Range
+ >
+ struct apply
+ : fold<Range, Sequence, insert<_1, _2> >
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_ITEM_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_ITEM_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2007
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/long.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/prior.hpp>
+#include <boost/mpl/set/aux_/set0.hpp>
+#include <boost/mpl/aux_/type_wrapper.hpp>
+#include <boost/mpl/aux_/config/arrays.hpp>
+
+namespace boost { namespace mpl {
+
+template< typename T, typename Base >
+struct s_item
+ : Base
+{
+ typedef s_item<T,Base> item_;
+ typedef void_ last_masked_;
+ typedef T item_type_;
+ typedef typename Base::item_ base;
+ typedef s_item type;
+
+ typedef typename next< typename Base::size >::type size;
+ typedef typename next< typename Base::order >::type order;
+
+#if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES)
+ typedef typename aux::weighted_tag<BOOST_MPL_AUX_MSVC_VALUE_WKND(order)::value>::type order_tag_;
+#else
+ typedef char (&order_tag_)[BOOST_MPL_AUX_MSVC_VALUE_WKND(order)::value];
+#endif
+
+ BOOST_MPL_AUX_SET_OVERLOAD( order_tag_, ORDER_BY_KEY, s_item, aux::type_wrapper<T>* );
+ BOOST_MPL_AUX_SET_OVERLOAD( aux::no_tag, IS_MASKED, s_item, aux::type_wrapper<T>* );
+};
+
+
+template< typename T, typename Base >
+struct s_mask
+ : Base
+{
+ typedef s_mask<T,Base> item_;
+ typedef T last_masked_;
+ typedef void_ item_type_;
+ typedef typename Base::item_ base;
+ typedef typename prior< typename Base::size >::type size;
+ typedef s_mask type;
+
+ BOOST_MPL_AUX_SET_OVERLOAD( aux::yes_tag, IS_MASKED, s_mask, aux::type_wrapper<T>* );
+};
+
+
+template< typename T, typename Base >
+struct s_unmask
+ : Base
+{
+ typedef s_unmask<T,Base> item_;
+ typedef void_ last_masked_;
+ typedef T item_type_;
+ typedef typename Base::item_ base;
+ typedef typename next< typename Base::size >::type size;
+
+ BOOST_MPL_AUX_SET_OVERLOAD( aux::no_tag, IS_MASKED, s_unmask, aux::type_wrapper<T>* );
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_ITEM_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2007
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/set/aux_/set0.hpp>
+#include <boost/mpl/has_key.hpp>
+#include <boost/mpl/iterator_tags.hpp>
+#include <boost/mpl/next.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
+
+namespace boost { namespace mpl {
+
+// used by 's_iter_get'
+template< typename Set, typename Tail > struct s_iter;
+
+template< typename Set, typename Tail > struct s_iter_get
+ : eval_if<
+ has_key< Set,typename Tail::item_type_ >
+ , identity< s_iter<Set,Tail> >
+ , next< s_iter<Set,Tail> >
+ >
+{
+};
+
+template< typename Set, typename Tail > struct s_iter_impl
+{
+ typedef Tail tail_;
+ typedef forward_iterator_tag category;
+ typedef typename Tail::item_type_ type;
+
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ typedef typename s_iter_get< Set,typename Tail::base >::type next;
+#endif
+};
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template< typename Set, typename Tail >
+struct next< s_iter<Set,Tail> >
+ : s_iter_get< Set,typename Tail::base >
+{
+};
+
+template< typename Set >
+struct next< s_iter<Set,set0<> > >
+{
+ typedef s_iter<Set,set0<> > type;
+};
+
+template< typename Set, typename Tail > struct s_iter
+ : s_iter_impl<Set,Tail>
+{
+};
+
+template< typename Set > struct s_iter<Set, set0<> >
+{
+ typedef forward_iterator_tag category;
+};
+
+#else
+
+template< typename Set >
+struct s_end_iter
+{
+ typedef forward_iterator_tag category;
+ typedef s_iter<Set,set0<> > next;
+};
+
+template< typename Set, typename Tail > struct s_iter
+ : if_<
+ is_same< Tail,set0<> >
+ , s_end_iter<Set>
+ , s_iter_impl<Set,Tail>
+ >::type
+{
+};
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_KEY_TYPE_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_KEY_TYPE_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/key_type_fwd.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct key_type_impl< aux::set_tag >
+{
+ template< typename Set, typename T > struct apply
+ {
+ typedef T type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_KEY_TYPE_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/long.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/mpl/aux_/na.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+#include <boost/mpl/aux_/yes_no.hpp>
+#include <boost/mpl/aux_/overload_names.hpp>
+#include <boost/mpl/aux_/config/operators.hpp>
+
+#include <boost/preprocessor/cat.hpp>
+
+namespace boost { namespace mpl {
+
+#if defined(BOOST_MPL_CFG_USE_OPERATORS_OVERLOADING)
+
+# define BOOST_MPL_AUX_SET0_OVERLOAD(R, f, X, T) \
+ friend R BOOST_PP_CAT(BOOST_MPL_AUX_OVERLOAD_,f)(X const&, T) \
+/**/
+
+# define BOOST_MPL_AUX_SET_OVERLOAD(R, f, X, T) \
+ BOOST_MPL_AUX_SET0_OVERLOAD(R, f, X, T) \
+/**/
+
+#else
+
+# define BOOST_MPL_AUX_SET0_OVERLOAD(R, f, X, T) \
+ static R BOOST_PP_CAT(BOOST_MPL_AUX_OVERLOAD_,f)(X const&, T) \
+/**/
+
+# define BOOST_MPL_AUX_SET_OVERLOAD(R, f, X, T) \
+ BOOST_MPL_AUX_SET0_OVERLOAD(R, f, X, T); \
+ using Base::BOOST_PP_CAT(BOOST_MPL_AUX_OVERLOAD_,f) \
+/**/
+
+#endif
+
+template< typename Dummy = na > struct set0
+{
+ typedef set0<> item_;
+ typedef item_ type;
+ typedef aux::set_tag tag;
+ typedef void_ last_masked_;
+ typedef void_ item_type_;
+ typedef long_<0> size;
+ typedef long_<1> order;
+
+ BOOST_MPL_AUX_SET0_OVERLOAD( aux::no_tag, ORDER_BY_KEY, set0<>, void const volatile* );
+ BOOST_MPL_AUX_SET0_OVERLOAD( aux::yes_tag, IS_MASKED, set0<>, void const volatile* );
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_SIZE_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_SIZE_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/size_fwd.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct size_impl< aux::set_tag >
+{
+ template< typename Set > struct apply
+ : Set::size
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_SIZE_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_TAG_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_TAG_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+namespace boost { namespace mpl { namespace aux {
+
+struct set_tag;
+
+}}}
+
+#endif // BOOST_MPL_SET_AUX_TAG_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_AUX_VALUE_TYPE_IMPL_HPP_INCLUDED
+#define BOOST_MPL_SET_AUX_VALUE_TYPE_IMPL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/value_type_fwd.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+
+namespace boost { namespace mpl {
+
+template<>
+struct value_type_impl< aux::set_tag >
+{
+ template< typename Set, typename T > struct apply
+ {
+ typedef T type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_SET_AUX_VALUE_TYPE_IMPL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SET_SET0_HPP_INCLUDED
+#define BOOST_MPL_SET_SET0_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/set/aux_/at_impl.hpp>
+#include <boost/mpl/set/aux_/clear_impl.hpp>
+//#include <boost/mpl/set/aux_/O1_size.hpp>
+#include <boost/mpl/set/aux_/size_impl.hpp>
+#include <boost/mpl/set/aux_/empty_impl.hpp>
+#include <boost/mpl/set/aux_/insert_impl.hpp>
+#include <boost/mpl/set/aux_/insert_range_impl.hpp>
+#include <boost/mpl/set/aux_/erase_impl.hpp>
+#include <boost/mpl/set/aux_/erase_key_impl.hpp>
+#include <boost/mpl/set/aux_/has_key_impl.hpp>
+#include <boost/mpl/set/aux_/key_type_impl.hpp>
+#include <boost/mpl/set/aux_/value_type_impl.hpp>
+#include <boost/mpl/set/aux_/begin_end_impl.hpp>
+#include <boost/mpl/set/aux_/iterator.hpp>
+#include <boost/mpl/set/aux_/item.hpp>
+#include <boost/mpl/set/aux_/set0.hpp>
+#include <boost/mpl/set/aux_/tag.hpp>
+
+#endif // BOOST_MPL_SET_SET0_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_SIZEOF_HPP_INCLUDED
+#define BOOST_MPL_SIZEOF_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2003
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/size_t.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(T)
+ >
+struct sizeof_
+ : mpl::size_t< sizeof(T) >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,sizeof_,(T))
+};
+
+BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, sizeof_)
+
+}}
+
+#endif // BOOST_MPL_SIZEOF_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_TRANSFORM_HPP_INCLUDED
+#define BOOST_MPL_TRANSFORM_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+#include <boost/mpl/fold.hpp>
+#include <boost/mpl/reverse_fold.hpp>
+#include <boost/mpl/pair_view.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/lambda.hpp>
+#include <boost/mpl/bind.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/aux_/na.hpp>
+#include <boost/mpl/aux_/inserter_algorithm.hpp>
+
+namespace boost { namespace mpl {
+
+namespace aux {
+
+template<
+ typename Seq
+ , typename Op
+ , typename In
+ >
+struct transform1_impl
+ : fold<
+ Seq
+ , typename In::state
+ , bind2< typename lambda< typename In::operation >::type
+ , _1
+ , bind1< typename lambda<Op>::type, _2>
+ >
+ >
+{
+};
+
+template<
+ typename Seq
+ , typename Op
+ , typename In
+ >
+struct reverse_transform1_impl
+ : reverse_fold<
+ Seq
+ , typename In::state
+ , bind2< typename lambda< typename In::operation >::type
+ , _1
+ , bind1< typename lambda<Op>::type, _2>
+ >
+ >
+{
+};
+
+template<
+ typename Seq1
+ , typename Seq2
+ , typename Op
+ , typename In
+ >
+struct transform2_impl
+ : fold<
+ pair_view<Seq1,Seq2>
+ , typename In::state
+ , bind2< typename lambda< typename In::operation >::type
+ , _1
+ , bind2<
+ typename lambda<Op>::type
+ , bind1<first<>,_2>
+ , bind1<second<>,_2>
+ >
+ >
+ >
+{
+};
+
+template<
+ typename Seq1
+ , typename Seq2
+ , typename Op
+ , typename In
+ >
+struct reverse_transform2_impl
+ : reverse_fold<
+ pair_view<Seq1,Seq2>
+ , typename In::state
+ , bind2< typename lambda< typename In::operation >::type
+ , _1
+ , bind2< typename lambda< Op >::type
+ , bind1<first<>,_2>
+ , bind1<second<>,_2>
+ >
+ >
+ >
+{
+};
+
+} // namespace aux
+
+BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, transform1)
+BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, transform2)
+
+#define AUX778076_TRANSFORM_DEF(name) \
+template< \
+ typename BOOST_MPL_AUX_NA_PARAM(Seq1) \
+ , typename BOOST_MPL_AUX_NA_PARAM(Seq2OrOperation) \
+ , typename BOOST_MPL_AUX_NA_PARAM(OperationOrInserter) \
+ , typename BOOST_MPL_AUX_NA_PARAM(Inserter) \
+ > \
+struct name \
+{ \
+ typedef typename eval_if< \
+ or_< \
+ is_na<OperationOrInserter> \
+ , is_lambda_expression< Seq2OrOperation > \
+ , not_< is_sequence<Seq2OrOperation> > \
+ > \
+ , name##1<Seq1,Seq2OrOperation,OperationOrInserter> \
+ , name##2<Seq1,Seq2OrOperation,OperationOrInserter,Inserter> \
+ >::type type; \
+}; \
+BOOST_MPL_AUX_NA_SPEC(4, name) \
+/**/
+
+AUX778076_TRANSFORM_DEF(transform)
+AUX778076_TRANSFORM_DEF(reverse_transform)
+
+#undef AUX778076_TRANSFORM_DEF
+
+}}
+
+#endif // BOOST_MPL_TRANSFORM_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_VALUE_TYPE_FWD_HPP_INCLUDED
+#define BOOST_MPL_VALUE_TYPE_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+// Copyright David Abrahams 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id$
+// $Date$
+// $Revision$
+
+namespace boost { namespace mpl {
+
+template< typename Tag > struct value_type_impl;
+template< typename AssociativeSequence, typename T > struct value_type;
+
+}}
+
+#endif // BOOST_MPL_VALUE_TYPE_FWD_HPP_INCLUDED
--- /dev/null
+/* Copyright 2003-2013 Joaquin M Lopez Munoz.
+ * 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/multi_index for library home page.
+ */
+
+#ifndef BOOST_MULTI_INDEX_DETAIL_SCOPE_GUARD_HPP
+#define BOOST_MULTI_INDEX_DETAIL_SCOPE_GUARD_HPP
+
+#if defined(_MSC_VER)
+#pragma once
+#endif
+
+#include <boost/detail/no_exceptions_support.hpp>
+#include <boost/mpl/if.hpp>
+
+namespace boost{
+
+namespace multi_index{
+
+namespace detail{
+
+/* Until some official version of the ScopeGuard idiom makes it into Boost,
+ * we locally define our own. This is a merely reformated version of
+ * ScopeGuard.h as defined in:
+ * Alexandrescu, A., Marginean, P.:"Generic<Programming>: Change the Way You
+ * Write Exception-Safe Code - Forever", C/C++ Users Jornal, Dec 2000,
+ * http://www.drdobbs.com/184403758
+ * with the following modifications:
+ * - General pretty formatting (pretty to my taste at least.)
+ * - Naming style changed to standard C++ library requirements.
+ * - Added scope_guard_impl4 and obj_scope_guard_impl3, (Boost.MultiIndex
+ * needs them). A better design would provide guards for many more
+ * arguments through the Boost Preprocessor Library.
+ * - Added scope_guard_impl_base::touch (see below.)
+ * - Removed RefHolder and ByRef, whose functionality is provided
+ * already by Boost.Ref.
+ * - Removed static make_guard's and make_obj_guard's, so that the code
+ * will work even if BOOST_NO_MEMBER_TEMPLATES is defined. This forces
+ * us to move some private ctors to public, though.
+ *
+ * NB: CodeWarrior Pro 8 seems to have problems looking up safe_execute
+ * without an explicit qualification.
+ *
+ * We also define the following variants of the idiom:
+ *
+ * - make_guard_if_c<bool>( ... )
+ * - make_guard_if<IntegralConstant>( ... )
+ * - make_obj_guard_if_c<bool>( ... )
+ * - make_obj_guard_if<IntegralConstant>( ... )
+ * which may be used with a compile-time constant to yield
+ * a "null_guard" if the boolean compile-time parameter is false,
+ * or conversely, the guard is only constructed if the constant is true.
+ * This is useful to avoid extra tagging, because the returned
+ * null_guard can be optimzed comlpetely away by the compiler.
+ */
+
+class scope_guard_impl_base
+{
+public:
+ scope_guard_impl_base():dismissed_(false){}
+ void dismiss()const{dismissed_=true;}
+
+ /* This helps prevent some "unused variable" warnings under, for instance,
+ * GCC 3.2.
+ */
+ void touch()const{}
+
+protected:
+ ~scope_guard_impl_base(){}
+
+ scope_guard_impl_base(const scope_guard_impl_base& other):
+ dismissed_(other.dismissed_)
+ {
+ other.dismiss();
+ }
+
+ template<typename J>
+ static void safe_execute(J& j){
+ BOOST_TRY{
+ if(!j.dismissed_)j.execute();
+ }
+ BOOST_CATCH(...){}
+ BOOST_CATCH_END
+ }
+
+ mutable bool dismissed_;
+
+private:
+ scope_guard_impl_base& operator=(const scope_guard_impl_base&);
+};
+
+typedef const scope_guard_impl_base& scope_guard;
+
+struct null_guard : public scope_guard_impl_base
+{
+ template< class T1 >
+ null_guard( const T1& )
+ { }
+
+ template< class T1, class T2 >
+ null_guard( const T1&, const T2& )
+ { }
+
+ template< class T1, class T2, class T3 >
+ null_guard( const T1&, const T2&, const T3& )
+ { }
+
+ template< class T1, class T2, class T3, class T4 >
+ null_guard( const T1&, const T2&, const T3&, const T4& )
+ { }
+
+ template< class T1, class T2, class T3, class T4, class T5 >
+ null_guard( const T1&, const T2&, const T3&, const T4&, const T5& )
+ { }
+};
+
+template< bool cond, class T >
+struct null_guard_return
+{
+ typedef typename boost::mpl::if_c<cond,T,null_guard>::type type;
+};
+
+template<typename F>
+class scope_guard_impl0:public scope_guard_impl_base
+{
+public:
+ scope_guard_impl0(F fun):fun_(fun){}
+ ~scope_guard_impl0(){scope_guard_impl_base::safe_execute(*this);}
+ void execute(){fun_();}
+
+protected:
+
+ F fun_;
+};
+
+template<typename F>
+inline scope_guard_impl0<F> make_guard(F fun)
+{
+ return scope_guard_impl0<F>(fun);
+}
+
+template<bool cond, typename F>
+inline typename null_guard_return<cond,scope_guard_impl0<F> >::type
+make_guard_if_c(F fun)
+{
+ return typename null_guard_return<cond,scope_guard_impl0<F> >::type(fun);
+}
+
+template<typename C, typename F>
+inline typename null_guard_return<C::value,scope_guard_impl0<F> >::type
+make_guard_if(F fun)
+{
+ return make_guard_if<C::value>(fun);
+}
+
+template<typename F,typename P1>
+class scope_guard_impl1:public scope_guard_impl_base
+{
+public:
+ scope_guard_impl1(F fun,P1 p1):fun_(fun),p1_(p1){}
+ ~scope_guard_impl1(){scope_guard_impl_base::safe_execute(*this);}
+ void execute(){fun_(p1_);}
+
+protected:
+ F fun_;
+ const P1 p1_;
+};
+
+template<typename F,typename P1>
+inline scope_guard_impl1<F,P1> make_guard(F fun,P1 p1)
+{
+ return scope_guard_impl1<F,P1>(fun,p1);
+}
+
+template<bool cond, typename F,typename P1>
+inline typename null_guard_return<cond,scope_guard_impl1<F,P1> >::type
+make_guard_if_c(F fun,P1 p1)
+{
+ return typename null_guard_return<cond,scope_guard_impl1<F,P1> >::type(fun,p1);
+}
+
+template<typename C, typename F,typename P1>
+inline typename null_guard_return<C::value,scope_guard_impl1<F,P1> >::type
+make_guard_if(F fun,P1 p1)
+{
+ return make_guard_if_c<C::value>(fun,p1);
+}
+
+template<typename F,typename P1,typename P2>
+class scope_guard_impl2:public scope_guard_impl_base
+{
+public:
+ scope_guard_impl2(F fun,P1 p1,P2 p2):fun_(fun),p1_(p1),p2_(p2){}
+ ~scope_guard_impl2(){scope_guard_impl_base::safe_execute(*this);}
+ void execute(){fun_(p1_,p2_);}
+
+protected:
+ F fun_;
+ const P1 p1_;
+ const P2 p2_;
+};
+
+template<typename F,typename P1,typename P2>
+inline scope_guard_impl2<F,P1,P2> make_guard(F fun,P1 p1,P2 p2)
+{
+ return scope_guard_impl2<F,P1,P2>(fun,p1,p2);
+}
+
+template<bool cond, typename F,typename P1,typename P2>
+inline typename null_guard_return<cond,scope_guard_impl2<F,P1,P2> >::type
+make_guard_if_c(F fun,P1 p1,P2 p2)
+{
+ return typename null_guard_return<cond,scope_guard_impl2<F,P1,P2> >::type(fun,p1,p2);
+}
+
+template<typename C, typename F,typename P1,typename P2>
+inline typename null_guard_return<C::value,scope_guard_impl2<F,P1,P2> >::type
+make_guard_if(F fun,P1 p1,P2 p2)
+{
+ return make_guard_if_c<C::value>(fun,p1,p2);
+}
+
+template<typename F,typename P1,typename P2,typename P3>
+class scope_guard_impl3:public scope_guard_impl_base
+{
+public:
+ scope_guard_impl3(F fun,P1 p1,P2 p2,P3 p3):fun_(fun),p1_(p1),p2_(p2),p3_(p3){}
+ ~scope_guard_impl3(){scope_guard_impl_base::safe_execute(*this);}
+ void execute(){fun_(p1_,p2_,p3_);}
+
+protected:
+ F fun_;
+ const P1 p1_;
+ const P2 p2_;
+ const P3 p3_;
+};
+
+template<typename F,typename P1,typename P2,typename P3>
+inline scope_guard_impl3<F,P1,P2,P3> make_guard(F fun,P1 p1,P2 p2,P3 p3)
+{
+ return scope_guard_impl3<F,P1,P2,P3>(fun,p1,p2,p3);
+}
+
+template<bool cond,typename F,typename P1,typename P2,typename P3>
+inline typename null_guard_return<cond,scope_guard_impl3<F,P1,P2,P3> >::type
+make_guard_if_c(F fun,P1 p1,P2 p2,P3 p3)
+{
+ return typename null_guard_return<cond,scope_guard_impl3<F,P1,P2,P3> >::type(fun,p1,p2,p3);
+}
+
+template<typename C,typename F,typename P1,typename P2,typename P3>
+inline typename null_guard_return< C::value,scope_guard_impl3<F,P1,P2,P3> >::type
+make_guard_if(F fun,P1 p1,P2 p2,P3 p3)
+{
+ return make_guard_if_c<C::value>(fun,p1,p2,p3);
+}
+
+template<typename F,typename P1,typename P2,typename P3,typename P4>
+class scope_guard_impl4:public scope_guard_impl_base
+{
+public:
+ scope_guard_impl4(F fun,P1 p1,P2 p2,P3 p3,P4 p4):
+ fun_(fun),p1_(p1),p2_(p2),p3_(p3),p4_(p4){}
+ ~scope_guard_impl4(){scope_guard_impl_base::safe_execute(*this);}
+ void execute(){fun_(p1_,p2_,p3_,p4_);}
+
+protected:
+ F fun_;
+ const P1 p1_;
+ const P2 p2_;
+ const P3 p3_;
+ const P4 p4_;
+};
+
+template<typename F,typename P1,typename P2,typename P3,typename P4>
+inline scope_guard_impl4<F,P1,P2,P3,P4> make_guard(
+ F fun,P1 p1,P2 p2,P3 p3,P4 p4)
+{
+ return scope_guard_impl4<F,P1,P2,P3,P4>(fun,p1,p2,p3,p4);
+}
+
+template<bool cond, typename F,typename P1,typename P2,typename P3,typename P4>
+inline typename null_guard_return<cond,scope_guard_impl4<F,P1,P2,P3,P4> >::type
+make_guard_if_c(
+ F fun,P1 p1,P2 p2,P3 p3,P4 p4)
+{
+ return typename null_guard_return<cond,scope_guard_impl4<F,P1,P2,P3,P4> >::type(fun,p1,p2,p3,p4);
+}
+
+template<typename C, typename F,typename P1,typename P2,typename P3,typename P4>
+inline typename null_guard_return<C::value,scope_guard_impl4<F,P1,P2,P3,P4> >::type
+make_guard_if(
+ F fun,P1 p1,P2 p2,P3 p3,P4 p4)
+{
+ return make_guard_if_c<C::value>(fun,p1,p2,p3,p4);
+}
+
+template<class Obj,typename MemFun>
+class obj_scope_guard_impl0:public scope_guard_impl_base
+{
+public:
+ obj_scope_guard_impl0(Obj& obj,MemFun mem_fun):obj_(obj),mem_fun_(mem_fun){}
+ ~obj_scope_guard_impl0(){scope_guard_impl_base::safe_execute(*this);}
+ void execute(){(obj_.*mem_fun_)();}
+
+protected:
+ Obj& obj_;
+ MemFun mem_fun_;
+};
+
+template<class Obj,typename MemFun>
+inline obj_scope_guard_impl0<Obj,MemFun> make_obj_guard(Obj& obj,MemFun mem_fun)
+{
+ return obj_scope_guard_impl0<Obj,MemFun>(obj,mem_fun);
+}
+
+template<bool cond, class Obj,typename MemFun>
+inline typename null_guard_return<cond,obj_scope_guard_impl0<Obj,MemFun> >::type
+make_obj_guard_if_c(Obj& obj,MemFun mem_fun)
+{
+ return typename null_guard_return<cond,obj_scope_guard_impl0<Obj,MemFun> >::type(obj,mem_fun);
+}
+
+template<typename C, class Obj,typename MemFun>
+inline typename null_guard_return<C::value,obj_scope_guard_impl0<Obj,MemFun> >::type
+make_obj_guard_if(Obj& obj,MemFun mem_fun)
+{
+ return make_obj_guard_if_c<C::value>(obj,mem_fun);
+}
+
+template<class Obj,typename MemFun,typename P1>
+class obj_scope_guard_impl1:public scope_guard_impl_base
+{
+public:
+ obj_scope_guard_impl1(Obj& obj,MemFun mem_fun,P1 p1):
+ obj_(obj),mem_fun_(mem_fun),p1_(p1){}
+ ~obj_scope_guard_impl1(){scope_guard_impl_base::safe_execute(*this);}
+ void execute(){(obj_.*mem_fun_)(p1_);}
+
+protected:
+ Obj& obj_;
+ MemFun mem_fun_;
+ const P1 p1_;
+};
+
+template<class Obj,typename MemFun,typename P1>
+inline obj_scope_guard_impl1<Obj,MemFun,P1> make_obj_guard(
+ Obj& obj,MemFun mem_fun,P1 p1)
+{
+ return obj_scope_guard_impl1<Obj,MemFun,P1>(obj,mem_fun,p1);
+}
+
+template<bool cond, class Obj,typename MemFun,typename P1>
+inline typename null_guard_return<cond,obj_scope_guard_impl1<Obj,MemFun,P1> >::type
+make_obj_guard_if_c( Obj& obj,MemFun mem_fun,P1 p1)
+{
+ return typename null_guard_return<cond,obj_scope_guard_impl1<Obj,MemFun,P1> >::type(obj,mem_fun,p1);
+}
+
+template<typename C, class Obj,typename MemFun,typename P1>
+inline typename null_guard_return<C::value,obj_scope_guard_impl1<Obj,MemFun,P1> >::type
+make_obj_guard_if( Obj& obj,MemFun mem_fun,P1 p1)
+{
+ return make_obj_guard_if_c<C::value>(obj,mem_fun,p1);
+}
+
+template<class Obj,typename MemFun,typename P1,typename P2>
+class obj_scope_guard_impl2:public scope_guard_impl_base
+{
+public:
+ obj_scope_guard_impl2(Obj& obj,MemFun mem_fun,P1 p1,P2 p2):
+ obj_(obj),mem_fun_(mem_fun),p1_(p1),p2_(p2)
+ {}
+ ~obj_scope_guard_impl2(){scope_guard_impl_base::safe_execute(*this);}
+ void execute(){(obj_.*mem_fun_)(p1_,p2_);}
+
+protected:
+ Obj& obj_;
+ MemFun mem_fun_;
+ const P1 p1_;
+ const P2 p2_;
+};
+
+template<class Obj,typename MemFun,typename P1,typename P2>
+inline obj_scope_guard_impl2<Obj,MemFun,P1,P2>
+make_obj_guard(Obj& obj,MemFun mem_fun,P1 p1,P2 p2)
+{
+ return obj_scope_guard_impl2<Obj,MemFun,P1,P2>(obj,mem_fun,p1,p2);
+}
+
+template<bool cond, class Obj,typename MemFun,typename P1,typename P2>
+inline typename null_guard_return<cond,obj_scope_guard_impl2<Obj,MemFun,P1,P2> >::type
+make_obj_guard_if_c(Obj& obj,MemFun mem_fun,P1 p1,P2 p2)
+{
+ return typename null_guard_return<cond,obj_scope_guard_impl2<Obj,MemFun,P1,P2> >::type(obj,mem_fun,p1,p2);
+}
+
+template<typename C, class Obj,typename MemFun,typename P1,typename P2>
+inline typename null_guard_return<C::value,obj_scope_guard_impl2<Obj,MemFun,P1,P2> >::type
+make_obj_guard_if(Obj& obj,MemFun mem_fun,P1 p1,P2 p2)
+{
+ return make_obj_guard_if_c<C::value>(obj,mem_fun,p1,p2);
+}
+
+template<class Obj,typename MemFun,typename P1,typename P2,typename P3>
+class obj_scope_guard_impl3:public scope_guard_impl_base
+{
+public:
+ obj_scope_guard_impl3(Obj& obj,MemFun mem_fun,P1 p1,P2 p2,P3 p3):
+ obj_(obj),mem_fun_(mem_fun),p1_(p1),p2_(p2),p3_(p3)
+ {}
+ ~obj_scope_guard_impl3(){scope_guard_impl_base::safe_execute(*this);}
+ void execute(){(obj_.*mem_fun_)(p1_,p2_,p3_);}
+
+protected:
+ Obj& obj_;
+ MemFun mem_fun_;
+ const P1 p1_;
+ const P2 p2_;
+ const P3 p3_;
+};
+
+template<class Obj,typename MemFun,typename P1,typename P2,typename P3>
+inline obj_scope_guard_impl3<Obj,MemFun,P1,P2,P3>
+make_obj_guard(Obj& obj,MemFun mem_fun,P1 p1,P2 p2,P3 p3)
+{
+ return obj_scope_guard_impl3<Obj,MemFun,P1,P2,P3>(obj,mem_fun,p1,p2,p3);
+}
+
+template<bool cond, class Obj,typename MemFun,typename P1,typename P2,typename P3>
+inline typename null_guard_return<cond,obj_scope_guard_impl3<Obj,MemFun,P1,P2,P3> >::type
+make_obj_guard_if_c(Obj& obj,MemFun mem_fun,P1 p1,P2 p2,P3 p3)
+{
+ return typename null_guard_return<cond,obj_scope_guard_impl3<Obj,MemFun,P1,P2,P3> >::type(obj,mem_fun,p1,p2,p3);
+}
+
+template<typename C, class Obj,typename MemFun,typename P1,typename P2,typename P3>
+inline typename null_guard_return<C::value,obj_scope_guard_impl3<Obj,MemFun,P1,P2,P3> >::type
+make_obj_guard_if(Obj& obj,MemFun mem_fun,P1 p1,P2 p2,P3 p3)
+{
+ return make_obj_guard_if_c<C::value>(obj,mem_fun,p1,p2,p3);
+}
+
+} /* namespace multi_index::detail */
+
+} /* namespace multi_index */
+
+} /* namespace boost */
+
+#endif
+++ /dev/null
-// Boost operators.hpp header file ----------------------------------------//
-
-// (C) Copyright David Abrahams, Jeremy Siek, Daryle Walker 1999-2001.
-// (C) Copyright Daniel Frey 2002-2016.
-// 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/utility/operators.htm for documentation.
-
-// Revision History
-// 22 Feb 16 Added ADL protection, preserve old work-arounds in
-// operators_v1.hpp and clean up this file. (Daniel Frey)
-// 16 Dec 10 Limit warning suppression for 4284 to older versions of VC++
-// (Matthew Bradbury, fixes #4432)
-// 07 Aug 08 Added "euclidean" spelling. (Daniel Frey)
-// 03 Apr 08 Make sure "convertible to bool" is sufficient
-// for T::operator<, etc. (Daniel Frey)
-// 24 May 07 Changed empty_base to depend on T, see
-// http://svn.boost.org/trac/boost/ticket/979
-// 21 Oct 02 Modified implementation of operators to allow compilers with a
-// correct named return value optimization (NRVO) to produce optimal
-// code. (Daniel Frey)
-// 02 Dec 01 Bug fixed in random_access_iteratable. (Helmut Zeisel)
-// 28 Sep 01 Factored out iterator operator groups. (Daryle Walker)
-// 27 Aug 01 'left' form for non commutative operators added;
-// additional classes for groups of related operators added;
-// workaround for empty base class optimization
-// bug of GCC 3.0 (Helmut Zeisel)
-// 25 Jun 01 output_iterator_helper changes: removed default template
-// parameters, added support for self-proxying, additional
-// documentation and tests (Aleksey Gurtovoy)
-// 29 May 01 Added operator classes for << and >>. Added input and output
-// iterator helper classes. Added classes to connect equality and
-// relational operators. Added classes for groups of related
-// operators. Reimplemented example operator and iterator helper
-// classes in terms of the new groups. (Daryle Walker, with help
-// from Alexy Gurtovoy)
-// 11 Feb 01 Fixed bugs in the iterator helpers which prevented explicitly
-// supplied arguments from actually being used (Dave Abrahams)
-// 04 Jul 00 Fixed NO_OPERATORS_IN_NAMESPACE bugs, major cleanup and
-// refactoring of compiler workarounds, additional documentation
-// (Alexy Gurtovoy and Mark Rodgers with some help and prompting from
-// Dave Abrahams)
-// 28 Jun 00 General cleanup and integration of bugfixes from Mark Rodgers and
-// Jeremy Siek (Dave Abrahams)
-// 20 Jun 00 Changes to accommodate Borland C++Builder 4 and Borland C++ 5.5
-// (Mark Rodgers)
-// 20 Jun 00 Minor fixes to the prior revision (Aleksey Gurtovoy)
-// 10 Jun 00 Support for the base class chaining technique was added
-// (Aleksey Gurtovoy). See documentation and the comments below
-// for the details.
-// 12 Dec 99 Initial version with iterator operators (Jeremy Siek)
-// 18 Nov 99 Change name "divideable" to "dividable", remove unnecessary
-// specializations of dividable, subtractable, modable (Ed Brey)
-// 17 Nov 99 Add comments (Beman Dawes)
-// Remove unnecessary specialization of operators<> (Ed Brey)
-// 15 Nov 99 Fix less_than_comparable<T,U> second operand type for first two
-// operators.(Beman Dawes)
-// 12 Nov 99 Add operators templates (Ed Brey)
-// 11 Nov 99 Add single template parameter version for compilers without
-// partial specialization (Beman Dawes)
-// 10 Nov 99 Initial version
-
-// 10 Jun 00:
-// An additional optional template parameter was added to most of
-// operator templates to support the base class chaining technique (see
-// documentation for the details). Unfortunately, a straightforward
-// implementation of this change would have broken compatibility with the
-// previous version of the library by making it impossible to use the same
-// template name (e.g. 'addable') for both the 1- and 2-argument versions of
-// an operator template. This implementation solves the backward-compatibility
-// issue at the cost of some simplicity.
-//
-// One of the complications is an existence of special auxiliary class template
-// 'is_chained_base<>' (see 'operators_detail' namespace below), which is used
-// to determine whether its template parameter is a library's operator template
-// or not. You have to specialize 'is_chained_base<>' for each new
-// operator template you add to the library.
-//
-// However, most of the non-trivial implementation details are hidden behind
-// several local macros defined below, and as soon as you understand them,
-// you understand the whole library implementation.
-
-#ifndef BOOST_OPERATORS_HPP
-#define BOOST_OPERATORS_HPP
-
-// If old work-arounds are needed, refer to the preserved version without
-// ADL protection.
-#if defined(BOOST_NO_OPERATORS_IN_NAMESPACE) || defined(BOOST_USE_OPERATORS_V1)
-#include "operators_v1.hpp"
-#else
-
-#include <cstddef>
-#include <iterator>
-
-#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-
-#if defined(__sgi) && !defined(__GNUC__)
-# pragma set woff 1234
-#endif
-
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1600)
-# pragma warning( disable : 4284 ) // complaint about return type of
-#endif // operator-> not begin a UDT
-
-// In this section we supply the xxxx1 and xxxx2 forms of the operator
-// templates, which are explicitly targeted at the 1-type-argument and
-// 2-type-argument operator forms, respectively.
-
-namespace boost
-{
-namespace operators_impl
-{
-namespace operators_detail
-{
-
-template <typename T> class empty_base {};
-
-} // namespace operators_detail
-
-// Basic operator classes (contributed by Dave Abrahams) ------------------//
-
-// Note that friend functions defined in a class are implicitly inline.
-// See the C++ std, 11.4 [class.friend] paragraph 5
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct less_than_comparable2 : B
-{
- friend bool operator<=(const T& x, const U& y) { return !static_cast<bool>(x > y); }
- friend bool operator>=(const T& x, const U& y) { return !static_cast<bool>(x < y); }
- friend bool operator>(const U& x, const T& y) { return y < x; }
- friend bool operator<(const U& x, const T& y) { return y > x; }
- friend bool operator<=(const U& x, const T& y) { return !static_cast<bool>(y < x); }
- friend bool operator>=(const U& x, const T& y) { return !static_cast<bool>(y > x); }
-};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct less_than_comparable1 : B
-{
- friend bool operator>(const T& x, const T& y) { return y < x; }
- friend bool operator<=(const T& x, const T& y) { return !static_cast<bool>(y < x); }
- friend bool operator>=(const T& x, const T& y) { return !static_cast<bool>(x < y); }
-};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct equality_comparable2 : B
-{
- friend bool operator==(const U& y, const T& x) { return x == y; }
- friend bool operator!=(const U& y, const T& x) { return !static_cast<bool>(x == y); }
- friend bool operator!=(const T& y, const U& x) { return !static_cast<bool>(y == x); }
-};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct equality_comparable1 : B
-{
- friend bool operator!=(const T& x, const T& y) { return !static_cast<bool>(x == y); }
-};
-
-// A macro which produces "name_2left" from "name".
-#define BOOST_OPERATOR2_LEFT(name) name##2##_##left
-
-// NRVO-friendly implementation (contributed by Daniel Frey) ---------------//
-
-#if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
-
-// This is the optimal implementation for ISO/ANSI C++,
-// but it requires the compiler to implement the NRVO.
-// If the compiler has no NRVO, this is the best symmetric
-// implementation available.
-
-#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
-template <class T, class U, class B = operators_detail::empty_base<T> > \
-struct NAME##2 : B \
-{ \
- friend T operator OP( const T& lhs, const U& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
- friend T operator OP( const U& lhs, const T& rhs ) \
- { T nrv( rhs ); nrv OP##= lhs; return nrv; } \
-}; \
- \
-template <class T, class B = operators_detail::empty_base<T> > \
-struct NAME##1 : B \
-{ \
- friend T operator OP( const T& lhs, const T& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
-};
-
-#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
-template <class T, class U, class B = operators_detail::empty_base<T> > \
-struct NAME##2 : B \
-{ \
- friend T operator OP( const T& lhs, const U& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
-}; \
- \
-template <class T, class U, class B = operators_detail::empty_base<T> > \
-struct BOOST_OPERATOR2_LEFT(NAME) : B \
-{ \
- friend T operator OP( const U& lhs, const T& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
-}; \
- \
-template <class T, class B = operators_detail::empty_base<T> > \
-struct NAME##1 : B \
-{ \
- friend T operator OP( const T& lhs, const T& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
-};
-
-#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
-
-// For compilers without NRVO the following code is optimal, but not
-// symmetric! Note that the implementation of
-// BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide
-// optimization opportunities to the compiler :)
-
-#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
-template <class T, class U, class B = operators_detail::empty_base<T> > \
-struct NAME##2 : B \
-{ \
- friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
- friend T operator OP( const U& lhs, T rhs ) { return rhs OP##= lhs; } \
-}; \
- \
-template <class T, class B = operators_detail::empty_base<T> > \
-struct NAME##1 : B \
-{ \
- friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
-};
-
-#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
-template <class T, class U, class B = operators_detail::empty_base<T> > \
-struct NAME##2 : B \
-{ \
- friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
-}; \
- \
-template <class T, class U, class B = operators_detail::empty_base<T> > \
-struct BOOST_OPERATOR2_LEFT(NAME) : B \
-{ \
- friend T operator OP( const U& lhs, const T& rhs ) \
- { return T( lhs ) OP##= rhs; } \
-}; \
- \
-template <class T, class B = operators_detail::empty_base<T> > \
-struct NAME##1 : B \
-{ \
- friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
-};
-
-#endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
-
-BOOST_BINARY_OPERATOR_COMMUTATIVE( multipliable, * )
-BOOST_BINARY_OPERATOR_COMMUTATIVE( addable, + )
-BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( subtractable, - )
-BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( dividable, / )
-BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( modable, % )
-BOOST_BINARY_OPERATOR_COMMUTATIVE( xorable, ^ )
-BOOST_BINARY_OPERATOR_COMMUTATIVE( andable, & )
-BOOST_BINARY_OPERATOR_COMMUTATIVE( orable, | )
-
-#undef BOOST_BINARY_OPERATOR_COMMUTATIVE
-#undef BOOST_BINARY_OPERATOR_NON_COMMUTATIVE
-#undef BOOST_OPERATOR2_LEFT
-
-// incrementable and decrementable contributed by Jeremy Siek
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct incrementable : B
-{
- friend T operator++(T& x, int)
- {
- incrementable_type nrv(x);
- ++x;
- return nrv;
- }
-private: // The use of this typedef works around a Borland bug
- typedef T incrementable_type;
-};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct decrementable : B
-{
- friend T operator--(T& x, int)
- {
- decrementable_type nrv(x);
- --x;
- return nrv;
- }
-private: // The use of this typedef works around a Borland bug
- typedef T decrementable_type;
-};
-
-// Iterator operator classes (contributed by Jeremy Siek) ------------------//
-
-template <class T, class P, class B = operators_detail::empty_base<T> >
-struct dereferenceable : B
-{
- P operator->() const
- {
- return &*static_cast<const T&>(*this);
- }
-};
-
-template <class T, class I, class R, class B = operators_detail::empty_base<T> >
-struct indexable : B
-{
- R operator[](I n) const
- {
- return *(static_cast<const T&>(*this) + n);
- }
-};
-
-// More operator classes (contributed by Daryle Walker) --------------------//
-// (NRVO-friendly implementation contributed by Daniel Frey) ---------------//
-
-#if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
-
-#define BOOST_BINARY_OPERATOR( NAME, OP ) \
-template <class T, class U, class B = operators_detail::empty_base<T> > \
-struct NAME##2 : B \
-{ \
- friend T operator OP( const T& lhs, const U& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
-}; \
- \
-template <class T, class B = operators_detail::empty_base<T> > \
-struct NAME##1 : B \
-{ \
- friend T operator OP( const T& lhs, const T& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
-};
-
-#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
-
-#define BOOST_BINARY_OPERATOR( NAME, OP ) \
-template <class T, class U, class B = operators_detail::empty_base<T> > \
-struct NAME##2 : B \
-{ \
- friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
-}; \
- \
-template <class T, class B = operators_detail::empty_base<T> > \
-struct NAME##1 : B \
-{ \
- friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
-};
-
-#endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
-
-BOOST_BINARY_OPERATOR( left_shiftable, << )
-BOOST_BINARY_OPERATOR( right_shiftable, >> )
-
-#undef BOOST_BINARY_OPERATOR
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct equivalent2 : B
-{
- friend bool operator==(const T& x, const U& y)
- {
- return !static_cast<bool>(x < y) && !static_cast<bool>(x > y);
- }
-};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct equivalent1 : B
-{
- friend bool operator==(const T&x, const T&y)
- {
- return !static_cast<bool>(x < y) && !static_cast<bool>(y < x);
- }
-};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct partially_ordered2 : B
-{
- friend bool operator<=(const T& x, const U& y)
- { return static_cast<bool>(x < y) || static_cast<bool>(x == y); }
- friend bool operator>=(const T& x, const U& y)
- { return static_cast<bool>(x > y) || static_cast<bool>(x == y); }
- friend bool operator>(const U& x, const T& y)
- { return y < x; }
- friend bool operator<(const U& x, const T& y)
- { return y > x; }
- friend bool operator<=(const U& x, const T& y)
- { return static_cast<bool>(y > x) || static_cast<bool>(y == x); }
- friend bool operator>=(const U& x, const T& y)
- { return static_cast<bool>(y < x) || static_cast<bool>(y == x); }
-};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct partially_ordered1 : B
-{
- friend bool operator>(const T& x, const T& y)
- { return y < x; }
- friend bool operator<=(const T& x, const T& y)
- { return static_cast<bool>(x < y) || static_cast<bool>(x == y); }
- friend bool operator>=(const T& x, const T& y)
- { return static_cast<bool>(y < x) || static_cast<bool>(x == y); }
-};
-
-// Combined operator classes (contributed by Daryle Walker) ----------------//
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct totally_ordered2
- : less_than_comparable2<T, U
- , equality_comparable2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct totally_ordered1
- : less_than_comparable1<T
- , equality_comparable1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct additive2
- : addable2<T, U
- , subtractable2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct additive1
- : addable1<T
- , subtractable1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct multiplicative2
- : multipliable2<T, U
- , dividable2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct multiplicative1
- : multipliable1<T
- , dividable1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct integer_multiplicative2
- : multiplicative2<T, U
- , modable2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct integer_multiplicative1
- : multiplicative1<T
- , modable1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct arithmetic2
- : additive2<T, U
- , multiplicative2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct arithmetic1
- : additive1<T
- , multiplicative1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct integer_arithmetic2
- : additive2<T, U
- , integer_multiplicative2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct integer_arithmetic1
- : additive1<T
- , integer_multiplicative1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct bitwise2
- : xorable2<T, U
- , andable2<T, U
- , orable2<T, U, B
- > > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct bitwise1
- : xorable1<T
- , andable1<T
- , orable1<T, B
- > > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct unit_steppable
- : incrementable<T
- , decrementable<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct shiftable2
- : left_shiftable2<T, U
- , right_shiftable2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct shiftable1
- : left_shiftable1<T
- , right_shiftable1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct ring_operators2
- : additive2<T, U
- , subtractable2_left<T, U
- , multipliable2<T, U, B
- > > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct ring_operators1
- : additive1<T
- , multipliable1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct ordered_ring_operators2
- : ring_operators2<T, U
- , totally_ordered2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct ordered_ring_operators1
- : ring_operators1<T
- , totally_ordered1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct field_operators2
- : ring_operators2<T, U
- , dividable2<T, U
- , dividable2_left<T, U, B
- > > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct field_operators1
- : ring_operators1<T
- , dividable1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct ordered_field_operators2
- : field_operators2<T, U
- , totally_ordered2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct ordered_field_operators1
- : field_operators1<T
- , totally_ordered1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct euclidian_ring_operators2
- : ring_operators2<T, U
- , dividable2<T, U
- , dividable2_left<T, U
- , modable2<T, U
- , modable2_left<T, U, B
- > > > > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct euclidian_ring_operators1
- : ring_operators1<T
- , dividable1<T
- , modable1<T, B
- > > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct ordered_euclidian_ring_operators2
- : totally_ordered2<T, U
- , euclidian_ring_operators2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct ordered_euclidian_ring_operators1
- : totally_ordered1<T
- , euclidian_ring_operators1<T, B
- > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct euclidean_ring_operators2
- : ring_operators2<T, U
- , dividable2<T, U
- , dividable2_left<T, U
- , modable2<T, U
- , modable2_left<T, U, B
- > > > > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct euclidean_ring_operators1
- : ring_operators1<T
- , dividable1<T
- , modable1<T, B
- > > > {};
-
-template <class T, class U, class B = operators_detail::empty_base<T> >
-struct ordered_euclidean_ring_operators2
- : totally_ordered2<T, U
- , euclidean_ring_operators2<T, U, B
- > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct ordered_euclidean_ring_operators1
- : totally_ordered1<T
- , euclidean_ring_operators1<T, B
- > > {};
-
-template <class T, class P, class B = operators_detail::empty_base<T> >
-struct input_iteratable
- : equality_comparable1<T
- , incrementable<T
- , dereferenceable<T, P, B
- > > > {};
-
-template <class T, class B = operators_detail::empty_base<T> >
-struct output_iteratable
- : incrementable<T, B
- > {};
-
-template <class T, class P, class B = operators_detail::empty_base<T> >
-struct forward_iteratable
- : input_iteratable<T, P, B
- > {};
-
-template <class T, class P, class B = operators_detail::empty_base<T> >
-struct bidirectional_iteratable
- : forward_iteratable<T, P
- , decrementable<T, B
- > > {};
-
-// To avoid repeated derivation from equality_comparable,
-// which is an indirect base class of bidirectional_iterable,
-// random_access_iteratable must not be derived from totally_ordered1
-// but from less_than_comparable1 only. (Helmut Zeisel, 02-Dec-2001)
-template <class T, class P, class D, class R, class B = operators_detail::empty_base<T> >
-struct random_access_iteratable
- : bidirectional_iteratable<T, P
- , less_than_comparable1<T
- , additive2<T, D
- , indexable<T, D, R, B
- > > > > {};
-
-
-//
-// Here's where we put it all together, defining the xxxx forms of the templates.
-// We also define specializations of is_chained_base<> for
-// the xxxx, xxxx1, and xxxx2 templates.
-//
-
-namespace operators_detail
-{
-
-// A type parameter is used instead of a plain bool because Borland's compiler
-// didn't cope well with the more obvious non-type template parameter.
-struct true_t {};
-struct false_t {};
-
-} // namespace operators_detail
-
-// is_chained_base<> - a traits class used to distinguish whether an operator
-// template argument is being used for base class chaining, or is specifying a
-// 2nd argument type.
-
-// Unspecialized version assumes that most types are not being used for base
-// class chaining. We specialize for the operator templates defined in this
-// library.
-template<class T> struct is_chained_base {
- typedef operators_detail::false_t value;
-};
-
-// Provide a specialization of 'is_chained_base<>'
-// for a 4-type-argument operator template.
-# define BOOST_OPERATOR_TEMPLATE4(template_name4) \
- template<class T, class U, class V, class W, class B> \
- struct is_chained_base< template_name4<T, U, V, W, B> > { \
- typedef operators_detail::true_t value; \
- };
-
-// Provide a specialization of 'is_chained_base<>'
-// for a 3-type-argument operator template.
-# define BOOST_OPERATOR_TEMPLATE3(template_name3) \
- template<class T, class U, class V, class B> \
- struct is_chained_base< template_name3<T, U, V, B> > { \
- typedef operators_detail::true_t value; \
- };
-
-// Provide a specialization of 'is_chained_base<>'
-// for a 2-type-argument operator template.
-# define BOOST_OPERATOR_TEMPLATE2(template_name2) \
- template<class T, class U, class B> \
- struct is_chained_base< template_name2<T, U, B> > { \
- typedef operators_detail::true_t value; \
- };
-
-// Provide a specialization of 'is_chained_base<>'
-// for a 1-type-argument operator template.
-# define BOOST_OPERATOR_TEMPLATE1(template_name1) \
- template<class T, class B> \
- struct is_chained_base< template_name1<T, B> > { \
- typedef operators_detail::true_t value; \
- };
-
-// BOOST_OPERATOR_TEMPLATE(template_name) defines template_name<> such that it
-// can be used for specifying both 1-argument and 2-argument forms. Requires the
-// existence of two previously defined class templates named '<template_name>1'
-// and '<template_name>2' which must implement the corresponding 1- and 2-
-// argument forms.
-//
-// The template type parameter O == is_chained_base<U>::value is used to
-// distinguish whether the 2nd argument to <template_name> is being used for
-// base class chaining from another boost operator template or is describing a
-// 2nd operand type. O == true_t only when U is actually an another operator
-// template from the library. Partial specialization is used to select an
-// implementation in terms of either '<template_name>1' or '<template_name>2'.
-//
-
-# define BOOST_OPERATOR_TEMPLATE(template_name) \
-template <class T \
- ,class U = T \
- ,class B = operators_detail::empty_base<T> \
- ,class O = typename is_chained_base<U>::value \
- > \
-struct template_name; \
- \
-template<class T, class U, class B> \
-struct template_name<T, U, B, operators_detail::false_t> \
- : template_name##2<T, U, B> {}; \
- \
-template<class T, class U> \
-struct template_name<T, U, operators_detail::empty_base<T>, operators_detail::true_t> \
- : template_name##1<T, U> {}; \
- \
-template <class T, class B> \
-struct template_name<T, T, B, operators_detail::false_t> \
- : template_name##1<T, B> {}; \
- \
-template<class T, class U, class B, class O> \
-struct is_chained_base< template_name<T, U, B, O> > { \
- typedef operators_detail::true_t value; \
-}; \
- \
-BOOST_OPERATOR_TEMPLATE2(template_name##2) \
-BOOST_OPERATOR_TEMPLATE1(template_name##1)
-
-BOOST_OPERATOR_TEMPLATE(less_than_comparable)
-BOOST_OPERATOR_TEMPLATE(equality_comparable)
-BOOST_OPERATOR_TEMPLATE(multipliable)
-BOOST_OPERATOR_TEMPLATE(addable)
-BOOST_OPERATOR_TEMPLATE(subtractable)
-BOOST_OPERATOR_TEMPLATE2(subtractable2_left)
-BOOST_OPERATOR_TEMPLATE(dividable)
-BOOST_OPERATOR_TEMPLATE2(dividable2_left)
-BOOST_OPERATOR_TEMPLATE(modable)
-BOOST_OPERATOR_TEMPLATE2(modable2_left)
-BOOST_OPERATOR_TEMPLATE(xorable)
-BOOST_OPERATOR_TEMPLATE(andable)
-BOOST_OPERATOR_TEMPLATE(orable)
-
-BOOST_OPERATOR_TEMPLATE1(incrementable)
-BOOST_OPERATOR_TEMPLATE1(decrementable)
-
-BOOST_OPERATOR_TEMPLATE2(dereferenceable)
-BOOST_OPERATOR_TEMPLATE3(indexable)
-
-BOOST_OPERATOR_TEMPLATE(left_shiftable)
-BOOST_OPERATOR_TEMPLATE(right_shiftable)
-BOOST_OPERATOR_TEMPLATE(equivalent)
-BOOST_OPERATOR_TEMPLATE(partially_ordered)
-
-BOOST_OPERATOR_TEMPLATE(totally_ordered)
-BOOST_OPERATOR_TEMPLATE(additive)
-BOOST_OPERATOR_TEMPLATE(multiplicative)
-BOOST_OPERATOR_TEMPLATE(integer_multiplicative)
-BOOST_OPERATOR_TEMPLATE(arithmetic)
-BOOST_OPERATOR_TEMPLATE(integer_arithmetic)
-BOOST_OPERATOR_TEMPLATE(bitwise)
-BOOST_OPERATOR_TEMPLATE1(unit_steppable)
-BOOST_OPERATOR_TEMPLATE(shiftable)
-BOOST_OPERATOR_TEMPLATE(ring_operators)
-BOOST_OPERATOR_TEMPLATE(ordered_ring_operators)
-BOOST_OPERATOR_TEMPLATE(field_operators)
-BOOST_OPERATOR_TEMPLATE(ordered_field_operators)
-BOOST_OPERATOR_TEMPLATE(euclidian_ring_operators)
-BOOST_OPERATOR_TEMPLATE(ordered_euclidian_ring_operators)
-BOOST_OPERATOR_TEMPLATE(euclidean_ring_operators)
-BOOST_OPERATOR_TEMPLATE(ordered_euclidean_ring_operators)
-BOOST_OPERATOR_TEMPLATE2(input_iteratable)
-BOOST_OPERATOR_TEMPLATE1(output_iteratable)
-BOOST_OPERATOR_TEMPLATE2(forward_iteratable)
-BOOST_OPERATOR_TEMPLATE2(bidirectional_iteratable)
-BOOST_OPERATOR_TEMPLATE4(random_access_iteratable)
-
-#undef BOOST_OPERATOR_TEMPLATE
-#undef BOOST_OPERATOR_TEMPLATE4
-#undef BOOST_OPERATOR_TEMPLATE3
-#undef BOOST_OPERATOR_TEMPLATE2
-#undef BOOST_OPERATOR_TEMPLATE1
-
-template <class T, class U>
-struct operators2
- : totally_ordered2<T,U
- , integer_arithmetic2<T,U
- , bitwise2<T,U
- > > > {};
-
-template <class T, class U = T>
-struct operators : operators2<T, U> {};
-
-template <class T> struct operators<T, T>
- : totally_ordered<T
- , integer_arithmetic<T
- , bitwise<T
- , unit_steppable<T
- > > > > {};
-
-// Iterator helper classes (contributed by Jeremy Siek) -------------------//
-// (Input and output iterator helpers contributed by Daryle Walker) -------//
-// (Changed to use combined operator classes by Daryle Walker) ------------//
-template <class T,
- class V,
- class D = std::ptrdiff_t,
- class P = V const *,
- class R = V const &>
-struct input_iterator_helper
- : input_iteratable<T, P
- , std::iterator<std::input_iterator_tag, V, D, P, R
- > > {};
-
-template<class T>
-struct output_iterator_helper
- : output_iteratable<T
- , std::iterator<std::output_iterator_tag, void, void, void, void
- > >
-{
- T& operator*() { return static_cast<T&>(*this); }
- T& operator++() { return static_cast<T&>(*this); }
-};
-
-template <class T,
- class V,
- class D = std::ptrdiff_t,
- class P = V*,
- class R = V&>
-struct forward_iterator_helper
- : forward_iteratable<T, P
- , std::iterator<std::forward_iterator_tag, V, D, P, R
- > > {};
-
-template <class T,
- class V,
- class D = std::ptrdiff_t,
- class P = V*,
- class R = V&>
-struct bidirectional_iterator_helper
- : bidirectional_iteratable<T, P
- , std::iterator<std::bidirectional_iterator_tag, V, D, P, R
- > > {};
-
-template <class T,
- class V,
- class D = std::ptrdiff_t,
- class P = V*,
- class R = V&>
-struct random_access_iterator_helper
- : random_access_iteratable<T, P, D, R
- , std::iterator<std::random_access_iterator_tag, V, D, P, R
- > >
-{
- friend D requires_difference_operator(const T& x, const T& y) {
- return x - y;
- }
-}; // random_access_iterator_helper
-
-} // namespace operators_impl
-using namespace operators_impl;
-
-} // namespace boost
-
-#if defined(__sgi) && !defined(__GNUC__)
-#pragma reset woff 1234
-#endif
-
-#endif // BOOST_NO_OPERATORS_IN_NAMESPACE
-#endif // BOOST_OPERATORS_HPP
--- /dev/null
+// Copyright David Abrahams, Daniel Wallin 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See www.boost.org/libs/parameter for documentation.
+
+#ifndef BOOST_PARAMETER_050401_HPP
+#define BOOST_PARAMETER_050401_HPP
+
+#include <boost/parameter/parameters.hpp>
+#include <boost/parameter/keyword.hpp>
+#include <boost/parameter/binding.hpp>
+#include <boost/parameter/value_type.hpp>
+#include <boost/parameter/macros.hpp>
+#include <boost/parameter/match.hpp>
+#include <boost/parameter/name.hpp>
+#include <boost/parameter/preprocessor.hpp>
+
+#endif // BOOST_PARAMETER_050401_HPP
+
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef ARG_LIST_050329_HPP
+#define ARG_LIST_050329_HPP
+
+#include <boost/parameter/aux_/void.hpp>
+#include <boost/parameter/aux_/result_of0.hpp>
+#include <boost/parameter/aux_/default.hpp>
+#include <boost/parameter/aux_/parameter_requirements.hpp>
+#include <boost/parameter/aux_/yesno.hpp>
+#include <boost/parameter/aux_/is_maybe.hpp>
+#include <boost/parameter/config.hpp>
+
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/begin.hpp>
+#include <boost/mpl/end.hpp>
+#include <boost/mpl/iterator_tags.hpp>
+
+#include <boost/type_traits/add_reference.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+
+namespace boost { namespace parameter {
+
+// Forward declaration for aux::arg_list, below.
+template<class T> struct keyword;
+
+namespace aux {
+
+// Tag type passed to MPL lambda.
+struct lambda_tag;
+
+//
+// Structures used to build the tuple of actual arguments. The
+// tuple is a nested cons-style list of arg_list specializations
+// terminated by an empty_arg_list.
+//
+// Each specialization of arg_list is derived from its successor in
+// the list type. This feature is used along with using
+// declarations to build member function overload sets that can
+// match against keywords.
+//
+
+// MPL sequence support
+struct arg_list_tag;
+
+// Terminates arg_list<> and represents an empty list. Since this
+// is just the terminating case you might want to look at arg_list
+// first, to get a feel for what's really happening here.
+
+struct empty_arg_list
+{
+ empty_arg_list() {}
+
+ // Constructor taking BOOST_PARAMETER_MAX_ARITY empty_arg_list
+ // arguments; this makes initialization
+ empty_arg_list(
+ BOOST_PP_ENUM_PARAMS(
+ BOOST_PARAMETER_MAX_ARITY, void_ BOOST_PP_INTERCEPT
+ ))
+ {}
+
+ // A metafunction class that, given a keyword and a default
+ // type, returns the appropriate result type for a keyword
+ // lookup given that default
+ struct binding
+ {
+ template<class KW, class Default, class Reference>
+ struct apply
+ {
+ typedef Default type;
+ };
+ };
+
+ // Terminator for has_key, indicating that the keyword is unique
+ template <class KW>
+ static no_tag has_key(KW*);
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+
+ // The overload set technique doesn't work with these older
+ // compilers, so they need some explicit handholding.
+
+ // A metafunction class that, given a keyword, returns the type
+ // of the base sublist whose get() function can produce the
+ // value for that key
+ struct key_owner
+ {
+ template<class KW>
+ struct apply
+ {
+ typedef empty_arg_list type;
+ };
+ };
+
+ template <class K, class T>
+ T& get(default_<K,T> x) const
+ {
+ return x.value;
+ }
+
+ template <class K, class F>
+ typename result_of0<F>::type
+ get(lazy_default<K,F> x) const
+ {
+ return x.compute_default();
+ }
+#endif
+
+ // If this function is called, it means there is no argument
+ // in the list that matches the supplied keyword. Just return
+ // the default value.
+ template <class K, class Default>
+ Default& operator[](default_<K, Default> x) const
+ {
+ return x.value;
+ }
+
+ // If this function is called, it means there is no argument
+ // in the list that matches the supplied keyword. Just evaluate
+ // and return the default value.
+ template <class K, class F>
+ typename result_of0<F>::type
+ operator[](
+ BOOST_PARAMETER_lazy_default_fallback<K,F> x) const
+ {
+ return x.compute_default();
+ }
+
+ // No argument corresponding to ParameterRequirements::key_type
+ // was found if we match this overload, so unless that parameter
+ // has a default, we indicate that the actual arguments don't
+ // match the function's requirements.
+ template <class ParameterRequirements, class ArgPack>
+ static typename ParameterRequirements::has_default
+ satisfies(ParameterRequirements*, ArgPack*);
+
+ // MPL sequence support
+ typedef empty_arg_list type; // convenience
+ typedef arg_list_tag tag; // For dispatching to sequence intrinsics
+};
+
+// Forward declaration for arg_list::operator,
+template <class KW, class T>
+struct tagged_argument;
+
+template <class T>
+struct get_reference
+{
+ typedef typename T::reference type;
+};
+
+// A tuple of tagged arguments, terminated with empty_arg_list.
+// Every TaggedArg is an instance of tagged_argument<>.
+template <class TaggedArg, class Next = empty_arg_list>
+struct arg_list : Next
+{
+ typedef arg_list<TaggedArg,Next> self;
+ typedef typename TaggedArg::key_type key_type;
+
+ typedef typename is_maybe<typename TaggedArg::value_type>::type holds_maybe;
+
+ typedef typename mpl::eval_if<
+ holds_maybe
+ , get_reference<typename TaggedArg::value_type>
+ , get_reference<TaggedArg>
+ >::type reference;
+
+ typedef typename mpl::if_<
+ holds_maybe
+ , reference
+ , typename TaggedArg::value_type
+ >::type value_type;
+
+ TaggedArg arg; // Stores the argument
+
+ // Store the arguments in successive nodes of this list
+ template< // class A0, class A1, ...
+ BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, class A)
+ >
+ arg_list( // A0& a0, A1& a1, ...
+ BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PARAMETER_MAX_ARITY, A, & a)
+ )
+ : Next( // a1, a2, ...
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PARAMETER_MAX_ARITY, a)
+ , void_reference()
+ )
+ , arg(a0)
+ {}
+
+ // Create a new list by prepending arg to a copy of tail. Used
+ // when incrementally building this structure with the comma
+ // operator.
+ arg_list(TaggedArg head, Next const& tail)
+ : Next(tail)
+ , arg(head)
+ {}
+
+ // A metafunction class that, given a keyword and a default
+ // type, returns the appropriate result type for a keyword
+ // lookup given that default
+ struct binding
+ {
+ template <class KW, class Default, class Reference>
+ struct apply
+ {
+ typedef typename mpl::eval_if<
+ boost::is_same<KW, key_type>
+ , mpl::if_<Reference, reference, value_type>
+ , mpl::apply_wrap3<typename Next::binding, KW, Default, Reference>
+ >::type type;
+ };
+ };
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ // Overload for key_type, so the assert below will fire if the
+ // same keyword is used again
+ static yes_tag has_key(key_type*);
+ using Next::has_key;
+
+ BOOST_MPL_ASSERT_MSG(
+ sizeof(Next::has_key((key_type*)0)) == sizeof(no_tag)
+ , duplicate_keyword, (key_type)
+ );
+
+#endif
+ //
+ // Begin implementation of indexing operators for looking up
+ // specific arguments by name
+ //
+
+ // Helpers that handle the case when TaggedArg is
+ // empty<T>.
+ template <class D>
+ reference get_default(D const&, mpl::false_) const
+ {
+ return arg.value;
+ }
+
+ template <class D>
+ reference get_default(D const& d, mpl::true_) const
+ {
+ return arg.value ? arg.value.get() : arg.value.construct(d.value);
+ }
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ // These older compilers don't support the overload set creation
+ // idiom well, so we need to do all the return type calculation
+ // for the compiler and dispatch through an outer function template
+
+ // A metafunction class that, given a keyword, returns the base
+ // sublist whose get() function can produce the value for that
+ // key.
+ struct key_owner
+ {
+ template<class KW>
+ struct apply
+ {
+ typedef typename mpl::eval_if<
+ boost::is_same<KW, key_type>
+ , mpl::identity<arg_list<TaggedArg,Next> >
+ , mpl::apply_wrap1<typename Next::key_owner,KW>
+ >::type type;
+ };
+ };
+
+ // Outer indexing operators that dispatch to the right node's
+ // get() function.
+ template <class KW>
+ typename mpl::apply_wrap3<binding, KW, void_, mpl::true_>::type
+ operator[](keyword<KW> const& x) const
+ {
+ typename mpl::apply_wrap1<key_owner, KW>::type const& sublist = *this;
+ return sublist.get(x);
+ }
+
+ template <class KW, class Default>
+ typename mpl::apply_wrap3<binding, KW, Default&, mpl::true_>::type
+ operator[](default_<KW, Default> x) const
+ {
+ typename mpl::apply_wrap1<key_owner, KW>::type const& sublist = *this;
+ return sublist.get(x);
+ }
+
+ template <class KW, class F>
+ typename mpl::apply_wrap3<
+ binding,KW
+ , typename result_of0<F>::type
+ , mpl::true_
+ >::type
+ operator[](lazy_default<KW,F> x) const
+ {
+ typename mpl::apply_wrap1<key_owner, KW>::type const& sublist = *this;
+ return sublist.get(x);
+ }
+
+ // These just return the stored value; when empty_arg_list is
+ // reached, indicating no matching argument was passed, the
+ // default is returned, or if no default_ or lazy_default was
+ // passed, compilation fails.
+ reference get(keyword<key_type> const&) const
+ {
+ BOOST_MPL_ASSERT_NOT((holds_maybe));
+ return arg.value;
+ }
+
+ template <class Default>
+ reference get(default_<key_type,Default> const& d) const
+ {
+ return get_default(d, holds_maybe());
+ }
+
+ template <class Default>
+ reference get(lazy_default<key_type, Default>) const
+ {
+ return arg.value;
+ }
+
+#else
+
+ reference operator[](keyword<key_type> const&) const
+ {
+ BOOST_MPL_ASSERT_NOT((holds_maybe));
+ return arg.value;
+ }
+
+ template <class Default>
+ reference operator[](default_<key_type, Default> const& d) const
+ {
+ return get_default(d, holds_maybe());
+ }
+
+ template <class Default>
+ reference operator[](lazy_default<key_type, Default>) const
+ {
+ return arg.value;
+ }
+
+ // Builds an overload set including operator[]s defined in base
+ // classes.
+ using Next::operator[];
+
+ //
+ // End of indexing support
+ //
+
+
+ //
+ // For parameter_requirements matching this node's key_type,
+ // return a bool constant wrapper indicating whether the
+ // requirements are satisfied by TaggedArg. Used only for
+ // compile-time computation and never really called, so a
+ // declaration is enough.
+ //
+ template <class HasDefault, class Predicate, class ArgPack>
+ static typename mpl::apply_wrap2<
+ typename mpl::lambda<Predicate, lambda_tag>::type
+ , value_type, ArgPack
+ >::type
+ satisfies(
+ parameter_requirements<key_type,Predicate,HasDefault>*
+ , ArgPack*
+ );
+
+ // Builds an overload set including satisfies functions defined
+ // in base classes.
+ using Next::satisfies;
+#endif
+
+ // Comma operator to compose argument list without using parameters<>.
+ // Useful for argument lists with undetermined length.
+ template <class KW, class T2>
+ arg_list<tagged_argument<KW, T2>, self>
+ operator,(tagged_argument<KW,T2> x) const
+ {
+ return arg_list<tagged_argument<KW,T2>, self>(x, *this);
+ }
+
+ // MPL sequence support
+ typedef self type; // Convenience for users
+ typedef Next tail_type; // For the benefit of iterators
+ typedef arg_list_tag tag; // For dispatching to sequence intrinsics
+};
+
+// MPL sequence support
+template <class ArgumentPack>
+struct arg_list_iterator
+{
+ typedef mpl::forward_iterator_tag category;
+
+ // The incremented iterator
+ typedef arg_list_iterator<typename ArgumentPack::tail_type> next;
+
+ // dereferencing yields the key type
+ typedef typename ArgumentPack::key_type type;
+};
+
+template <>
+struct arg_list_iterator<empty_arg_list> {};
+
+}} // namespace parameter::aux
+
+// MPL sequence support
+namespace mpl
+{
+ template <>
+ struct begin_impl<parameter::aux::arg_list_tag>
+ {
+ template <class S>
+ struct apply
+ {
+ typedef parameter::aux::arg_list_iterator<S> type;
+ };
+ };
+
+ template <>
+ struct end_impl<parameter::aux::arg_list_tag>
+ {
+ template <class>
+ struct apply
+ {
+ typedef parameter::aux::arg_list_iterator<parameter::aux::empty_arg_list> type;
+ };
+ };
+}
+
+} // namespace boost
+
+#endif // ARG_LIST_050329_HPP
+
--- /dev/null
+// Copyright Daniel Wallin 2006. Use, modification and distribution is
+// subject to the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_CAST_060902_HPP
+# define BOOST_PARAMETER_CAST_060902_HPP
+
+# include <boost/detail/workaround.hpp>
+
+# if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+# include <boost/type_traits/add_reference.hpp>
+# include <boost/type_traits/remove_const.hpp>
+# endif
+
+namespace boost { namespace parameter { namespace aux {
+
+struct use_default_tag {};
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+
+# define BOOST_PARAMETER_FUNCTION_CAST(value, predicate) value
+
+# else
+
+// Handles possible implicit casts. Used by preprocessor.hpp to
+// normalize user input.
+//
+// cast<void*>::execute() is identity
+// cast<void*(X)>::execute() is identity
+// cast<void(X)>::execute() casts to X
+//
+// preprocessor.hpp uses this like this:
+//
+// #define X(value, predicate)
+// cast<void predicate>::execute(value)
+//
+// X(something, *)
+// X(something, *(predicate))
+// X(something, (int))
+
+template <class T, class Args>
+struct cast;
+
+template <class Args>
+struct cast<void*, Args>
+{
+ static use_default_tag execute(use_default_tag)
+ {
+ return use_default_tag();
+ }
+
+ static use_default_tag remove_const(use_default_tag)
+ {
+ return use_default_tag();
+ }
+
+ template <class U>
+ static U& execute(U& value)
+ {
+ return value;
+ }
+
+ template <class U>
+ static U& remove_const(U& x)
+ {
+ return x;
+ }
+};
+
+#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
+
+typedef void* voidstar;
+
+template <class T, class Args>
+struct cast<voidstar(T), Args>
+ : cast<void*, Args>
+{
+};
+
+#else
+
+template <class T, class Args>
+struct cast<void*(T), Args>
+ : cast<void*, Args>
+{
+};
+
+#endif
+
+// This is a hack used in cast<> to turn the user supplied type,
+// which may or may not be a placeholder expression into one, so
+// that it will be properly evaluated by mpl::apply.
+template <class T, class Dummy = mpl::_1>
+struct as_placeholder_expr
+{
+ typedef T type;
+};
+
+template <class T, class Args>
+struct cast<void(T), Args>
+{
+ typedef typename mpl::apply2<
+ as_placeholder_expr<T>, Args, Args>::type type0;
+
+ typedef typename boost::add_reference<
+ typename boost::remove_const<type0>::type
+ >::type reference;
+
+ static use_default_tag execute(use_default_tag)
+ {
+ return use_default_tag();
+ }
+
+ static use_default_tag remove_const(use_default_tag)
+ {
+ return use_default_tag();
+ }
+
+ static type0 execute(type0 value)
+ {
+ return value;
+ }
+
+ template <class U>
+ static reference remove_const(U const& x)
+ {
+ return const_cast<reference>(x);
+ }
+};
+
+# define BOOST_PARAMETER_FUNCTION_CAST(value, predicate, args) \
+ boost::parameter::aux::cast<void predicate, args>::remove_const( \
+ boost::parameter::aux::cast<void predicate, args>::execute(value) \
+ )
+
+# endif
+
+}}} // namespace boost::parameter::aux
+
+#endif // BOOST_PARAMETER_CAST_060902_HPP
+
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef DEFAULT_050329_HPP
+# define DEFAULT_050329_HPP
+
+# include <boost/detail/workaround.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+// A wrapper for the default value passed by the user when resolving
+// the value of the parameter with the given Keyword
+template <class Keyword, class Value>
+struct default_
+{
+ default_(Value& x)
+ : value(x)
+ {}
+
+ Value& value;
+};
+
+//
+// lazy_default --
+//
+// A wrapper for the default value computation function passed by
+// the user when resolving the value of the parameter with the
+// given keyword
+//
+# if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
+// These compilers need a little extra help with overload
+// resolution; we have empty_arg_list's operator[] accept a base
+// class to make that overload less preferable.
+template <class KW, class DefaultComputer>
+struct lazy_default_base
+{
+ lazy_default_base(DefaultComputer const& x)
+ : compute_default(x)
+ {}
+ DefaultComputer const& compute_default;
+};
+
+template <class KW, class DefaultComputer>
+struct lazy_default
+ : lazy_default_base<KW,DefaultComputer>
+ {
+ lazy_default(DefaultComputer const & x)
+ : lazy_default_base<KW,DefaultComputer>(x)
+ {}
+ };
+# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base
+# else
+template <class KW, class DefaultComputer>
+struct lazy_default
+{
+ lazy_default(const DefaultComputer& x)
+ : compute_default(x)
+ {}
+ DefaultComputer const& compute_default;
+};
+# define BOOST_PARAMETER_lazy_default_fallback lazy_default
+# endif
+
+}}} // namespace boost::parameter::aux
+
+#endif // DEFAULT_050329_HPP
+
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2010. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_IS_MAYBE_050329_HPP
+#define BOOST_PARAMETER_IS_MAYBE_050329_HPP
+
+#include <boost/type_traits/is_base_and_derived.hpp>
+
+namespace boost {
+namespace parameter {
+namespace aux {
+
+struct maybe_base {};
+
+template <class T>
+struct is_maybe
+ : is_base_and_derived<maybe_base, T>
+{};
+
+} // namespace aux
+} // namespace parameter
+} // namespace boost
+
+#endif // BOOST_PARAMETER_IS_MAYBE_050329_HPP
--- /dev/null
+// Copyright David Abrahams, Daniel Wallin 2003. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// This file generates overloads in this format:
+//
+// template<class A0, class A1>
+// typename mpl::apply_wrap1<
+// aux::make_arg_list<
+// PS0,A0
+// , aux::make_arg_list<
+// PS1,A1
+// , mpl::identity<aux::empty_arg_list>
+// >
+// >
+// , unnamed_list
+// >::type
+// operator()(A0 const& a0, A1 const& a1) const
+// {
+// typedef typename mpl::apply_wrap1<
+// aux::make_arg_list<
+// PS0,A0
+// , aux::make_arg_list<
+// PS1,A1
+// , mpl::identity<aux::empty_arg_list>
+// >
+// >
+// >::type arg_tuple;
+//
+// return arg_tuple(
+// a0
+// , a1
+// , aux::void_()
+// ...
+// );
+// }
+//
+
+#if !defined(BOOST_PP_IS_ITERATING)
+# error Boost.Parameters - do not include this file!
+#endif
+
+#define N BOOST_PP_ITERATION()
+
+#define BOOST_PARAMETER_open_list(z, n, text) \
+ aux::item< \
+ BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
+
+#define BOOST_PARAMETER_close_list(z, n, text) >
+
+#define BOOST_PARAMETER_arg_list(n) \
+ aux::make_arg_list< \
+ BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
+ , void_ \
+ BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \
+ , deduced_list \
+ , aux::tag_keyword_arg \
+ >
+
+#define BOOST_PARAMETER_arg_pack_init(z, n, limit) \
+ BOOST_PP_CAT(a, BOOST_PP_SUB(limit,n))
+
+template<BOOST_PP_ENUM_PARAMS(N, class A)>
+typename mpl::first<
+ typename BOOST_PARAMETER_arg_list(N)::type
+>::type
+operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)) const
+{
+ typedef typename BOOST_PARAMETER_arg_list(N)::type result;
+
+ typedef typename mpl::first<result>::type result_type;
+ typedef typename mpl::second<result>::type error;
+ error();
+
+ return result_type(
+ BOOST_PP_ENUM(N, BOOST_PARAMETER_arg_pack_init, BOOST_PP_DEC(N))
+ BOOST_PP_ENUM_TRAILING_PARAMS(
+ BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, N)
+ , aux::void_reference() BOOST_PP_INTERCEPT
+ ));
+}
+
+#undef BOOST_PARAMETER_arg_list
+#undef BOOST_PARAMETER_open_list
+#undef BOOST_PARAMETER_close_list
+#undef N
+
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef PARAMETER_REQUIREMENTS_050331_HPP
+#define PARAMETER_REQUIREMENTS_050331_HPP
+
+namespace boost { namespace parameter { namespace aux {
+
+// Used to pass static information about parameter requirements
+// through the satisfies() overload set (below). The
+// matched function is never invoked, but its type indicates whether
+// a parameter matches at compile-time
+template <class Keyword, class Predicate, class HasDefault>
+struct parameter_requirements
+{
+ typedef Keyword keyword;
+ typedef Predicate predicate;
+ typedef HasDefault has_default;
+};
+
+}}} // namespace boost::parameter::aux
+
+#endif // PARAMETER_REQUIREMENTS_050331_HPP
--- /dev/null
+// Copyright David Abrahams 2006. 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_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
+# define BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
+
+# include <boost/config.hpp>
+# include <boost/detail/workaround.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+// A macro that takes a parenthesized C++ type name (T) and transforms
+// it into an un-parenthesized type expression equivalent to T.
+# define BOOST_PARAMETER_PARENTHESIZED_TYPE(x) \
+ boost::parameter::aux::unaryfunptr_arg_type< void(*)x >::type
+
+// A metafunction that transforms void(*)(T) -> T
+template <class UnaryFunctionPointer>
+struct unaryfunptr_arg_type;
+
+template <class Arg>
+struct unaryfunptr_arg_type<void(*)(Arg)>
+{
+ typedef Arg type;
+};
+
+template <>
+struct unaryfunptr_arg_type<void(*)(void)>
+{
+ typedef void type;
+};
+
+}}} // namespace boost::parameter::aux
+
+#endif // BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
--- /dev/null
+// Copyright Daniel Wallin 2005. Use, modification and distribution is
+// subject to the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_FLATTEN_051217_HPP
+# define BOOST_PARAMETER_FLATTEN_051217_HPP
+
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/rem.hpp>
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/seq/for_each.hpp>
+# include <boost/preprocessor/seq/for_each_i.hpp>
+# include <boost/preprocessor/identity.hpp>
+# include <boost/preprocessor/selection/max.hpp>
+# include <boost/preprocessor/arithmetic/sub.hpp>
+# include <boost/preprocessor/repetition/enum_trailing.hpp>
+# include <boost/parameter/aux_/preprocessor/for_each.hpp>
+
+# define BOOST_PARAMETER_FLATTEN_SPLIT_required required,
+# define BOOST_PARAMETER_FLATTEN_SPLIT_optional optional,
+# define BOOST_PARAMETER_FLATTEN_SPLIT_deduced deduced,
+
+# define BOOST_PARAMETER_FLATTEN_SPLIT(sub) \
+ BOOST_PP_CAT(BOOST_PARAMETER_FLATTEN_SPLIT_, sub)
+
+# define BOOST_PARAMETER_FLATTEN_QUALIFIER(sub) \
+ BOOST_PP_SPLIT(0, BOOST_PARAMETER_FLATTEN_SPLIT(sub))
+
+# define BOOST_PARAMETER_FLATTEN_ARGS(sub) \
+ BOOST_PP_SPLIT(1, BOOST_PARAMETER_FLATTEN_SPLIT(sub))
+
+# define BOOST_PARAMETER_FLATTEN_ARITY_optional(arities) \
+ BOOST_PP_TUPLE_ELEM(3,0,arities)
+
+# define BOOST_PARAMETER_FLATTEN_ARITY_required(arities) \
+ BOOST_PP_TUPLE_ELEM(3,1,arities)
+
+# define BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM(z, n, data) ~
+# define BOOST_PARAMETER_FLATTEN_SPEC0(r, n, elem, data) \
+ (( \
+ BOOST_PP_TUPLE_ELEM(3,2,data) \
+ , BOOST_PP_TUPLE_REM(BOOST_PP_TUPLE_ELEM(3,0,data)) elem \
+ BOOST_PP_ENUM_TRAILING( \
+ BOOST_PP_SUB( \
+ BOOST_PP_TUPLE_ELEM(3,1,data) \
+ , BOOST_PP_TUPLE_ELEM(3,0,data) \
+ ) \
+ , BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM \
+ , ~ \
+ ) \
+ ))
+
+# define BOOST_PARAMETER_FLATTEN_SPEC_AUX(r, arity, max_arity, spec, transform) \
+ BOOST_PARAMETER_FOR_EACH_R( \
+ r \
+ , arity \
+ , BOOST_PARAMETER_FLATTEN_ARGS(spec) \
+ , (arity, max_arity, transform(BOOST_PARAMETER_FLATTEN_QUALIFIER(spec))) \
+ , BOOST_PARAMETER_FLATTEN_SPEC0 \
+ )
+
+# define BOOST_PARAMETER_FLATTEN_IDENTITY(x) x
+
+# define BOOST_PARAMETER_FLATTEN_SPEC_optional(r, arities, spec) \
+ BOOST_PARAMETER_FLATTEN_SPEC_AUX( \
+ r \
+ , BOOST_PP_CAT( \
+ BOOST_PARAMETER_FLATTEN_ARITY_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
+ )(arities) \
+ , BOOST_PP_TUPLE_ELEM(3,2,arities) \
+ , spec \
+ , BOOST_PARAMETER_FLATTEN_IDENTITY \
+ )
+
+# define BOOST_PARAMETER_FLATTEN_SPEC_required(r, arities, spec) \
+ BOOST_PARAMETER_FLATTEN_SPEC_optional(r, arities, spec)
+
+# define BOOST_PARAMETER_FLATTEN_SPEC_AS_DEDUCED(x) BOOST_PP_CAT(deduced_,x)
+
+# define BOOST_PARAMETER_FLATTEN_SPEC_deduced_M(r, arities, n, spec) \
+ BOOST_PARAMETER_FLATTEN_SPEC_AUX( \
+ r \
+ , BOOST_PP_CAT( \
+ BOOST_PARAMETER_FLATTEN_ARITY_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
+ )(arities) \
+ , BOOST_PP_TUPLE_ELEM(3,2,arities) \
+ , spec \
+ , BOOST_PARAMETER_FLATTEN_SPEC_AS_DEDUCED \
+ )
+
+# define BOOST_PARAMETER_FLATTEN_SPEC_deduced(r, arities, spec) \
+ BOOST_PP_SEQ_FOR_EACH_I_R( \
+ r \
+ , BOOST_PARAMETER_FLATTEN_SPEC_deduced_M \
+ , arities \
+ , BOOST_PARAMETER_FLATTEN_ARGS(spec) \
+ )
+
+# define BOOST_PARAMETER_FLATTEN_SPEC(r, arities, spec) \
+ BOOST_PP_CAT( \
+ BOOST_PARAMETER_FLATTEN_SPEC_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
+ )(r, arities, spec)
+
+# define BOOST_PARAMETER_FLATTEN(optional_arity, required_arity, wanted_arity, specs) \
+ BOOST_PP_SEQ_FOR_EACH( \
+ BOOST_PARAMETER_FLATTEN_SPEC \
+ , ( \
+ optional_arity, required_arity \
+ , wanted_arity \
+ ) \
+ , specs \
+ )
+
+#endif // BOOST_PARAMETER_FLATTEN_051217_HPP
+
--- /dev/null
+// Copyright Daniel Wallin 2005. Use, modification and distribution is
+// subject to the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_FOR_EACH_051217_HPP
+# define BOOST_PARAMETER_FOR_EACH_051217_HPP
+
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/detail/split.hpp>
+# include <boost/preprocessor/logical/not.hpp>
+# include <boost/preprocessor/facilities/is_empty.hpp>
+# include <boost/preprocessor/tuple/eat.hpp>
+# include <boost/preprocessor/arithmetic/inc.hpp>
+# include <boost/preprocessor/repeat.hpp>
+# include <boost/preprocessor/punctuation/comma_if.hpp>
+# include <boost/preprocessor/for.hpp>
+# include <boost/preprocessor/repetition/deduce_r.hpp>
+
+# define BOOST_PARAMETER_FOR_EACH_head_aux2(x,y) (x,y), ~
+# define BOOST_PARAMETER_FOR_EACH_head_aux3(x,y,z) (x,y,z), ~
+# define BOOST_PARAMETER_FOR_EACH_head_aux4(x,y,z,u) (x,y,z,u), ~
+# define BOOST_PARAMETER_FOR_EACH_head(n,x) \
+ BOOST_PP_SPLIT(0, BOOST_PP_CAT(BOOST_PARAMETER_FOR_EACH_head_aux,n) x)
+
+# define BOOST_PARAMETER_FOR_EACH_pred_aux_BOOST_PARAMETER_FOR_EACH_END_SENTINEL
+# define BOOST_PARAMETER_FOR_EACH_pred_aux_check(x) \
+ BOOST_PP_NOT(BOOST_PP_IS_EMPTY( \
+ BOOST_PP_CAT(BOOST_PARAMETER_FOR_EACH_pred_aux_, x) \
+ )), ~
+
+# define BOOST_PARAMETER_FOR_EACH_pred_aux2(x,y) \
+ BOOST_PARAMETER_FOR_EACH_pred_aux_check(x)
+# define BOOST_PARAMETER_FOR_EACH_pred_aux3(x,y,z) \
+ BOOST_PARAMETER_FOR_EACH_pred_aux_check(x)
+# define BOOST_PARAMETER_FOR_EACH_pred_aux4(x,y,z,u) \
+ BOOST_PARAMETER_FOR_EACH_pred_aux_check(x)
+
+# define BOOST_PARAMETER_FOR_EACH_pred_aux0(n,x) \
+ BOOST_PP_CAT(BOOST_PARAMETER_FOR_EACH_pred_aux,n) x
+
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
+# define BOOST_PARAMETER_FOR_EACH_pred_SPLIT_FIRST(x) \
+ BOOST_PP_SPLIT(0, x)
+
+# define BOOST_PARAMETER_FOR_EACH_pred(r, state) \
+ BOOST_PARAMETER_FOR_EACH_pred_SPLIT_FIRST( \
+ BOOST_PARAMETER_FOR_EACH_pred_aux0( \
+ BOOST_PP_TUPLE_ELEM(5,3,state) \
+ , BOOST_PP_TUPLE_ELEM(5,0,state) \
+ ) \
+ )
+# else
+# define BOOST_PARAMETER_FOR_EACH_pred(r, state) \
+ BOOST_PP_SPLIT( \
+ 0 \
+ , BOOST_PARAMETER_FOR_EACH_pred_aux0( \
+ BOOST_PP_TUPLE_ELEM(5,3,state) \
+ , BOOST_PP_TUPLE_ELEM(5,0,state) \
+ ) \
+ )
+# endif
+
+# define BOOST_PARAMETER_FOR_EACH_op(r, state) \
+ ( \
+ BOOST_PP_TUPLE_EAT(BOOST_PP_TUPLE_ELEM(5,3,state)) \
+ BOOST_PP_TUPLE_ELEM(5,0,state) \
+ , BOOST_PP_TUPLE_ELEM(5,1,state) \
+ , BOOST_PP_TUPLE_ELEM(5,2,state) \
+ , BOOST_PP_TUPLE_ELEM(5,3,state) \
+ , BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(5,4,state)) \
+ )
+
+# define BOOST_PARAMETER_FOR_EACH_macro(r, state) \
+ BOOST_PP_TUPLE_ELEM(5,2,state)( \
+ r \
+ , BOOST_PP_TUPLE_ELEM(5,4,state) \
+ , BOOST_PARAMETER_FOR_EACH_head( \
+ BOOST_PP_TUPLE_ELEM(5,3,state) \
+ , BOOST_PP_TUPLE_ELEM(5,0,state) \
+ ) \
+ , BOOST_PP_TUPLE_ELEM(5,1,state) \
+ )
+
+# define BOOST_PARAMETER_FOR_EACH_build_end_sentinel(z,n,text) \
+ BOOST_PP_COMMA_IF(n) BOOST_PARAMETER_FOR_EACH_END_SENTINEL
+# define BOOST_PARAMETER_FOR_EACH_build_end_sentinel_tuple(arity) \
+ ( \
+ BOOST_PP_REPEAT(arity, BOOST_PARAMETER_FOR_EACH_build_end_sentinel, _) \
+ )
+
+# define BOOST_PARAMETER_FOR_EACH_R(r, arity, list, data, macro) \
+ BOOST_PP_CAT(BOOST_PP_FOR_, r)( \
+ (list BOOST_PARAMETER_FOR_EACH_build_end_sentinel_tuple(arity), data, macro, arity, 0) \
+ , BOOST_PARAMETER_FOR_EACH_pred \
+ , BOOST_PARAMETER_FOR_EACH_op \
+ , BOOST_PARAMETER_FOR_EACH_macro \
+ )
+
+# define BOOST_PARAMETER_FOR_EACH(arity, list, data, macro) \
+ BOOST_PARAMETER_FOR_EACH_R(BOOST_PP_DEDUCE_R(), arity, list, data, macro)
+
+#endif // BOOST_PARAMETER_FOR_EACH_051217_HPP
+
--- /dev/null
+// Copyright David Abrahams 2005. 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_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
+# define BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
+
+# include <boost/utility/result_of.hpp>
+
+// A metafunction returning the result of invoking a nullary function
+// object of the given type.
+
+#ifndef BOOST_NO_RESULT_OF
+
+# include <boost/utility/result_of.hpp>
+namespace boost { namespace parameter { namespace aux {
+template <class F>
+struct result_of0 : result_of<F()>
+{};
+
+}}} // namespace boost::parameter::aux_
+
+#else
+
+namespace boost { namespace parameter { namespace aux {
+template <class F>
+struct result_of0
+{
+ typedef typename F::result_type type;
+};
+
+}}} // namespace boost::parameter::aux_
+
+#endif
+
+
+#endif // BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
--- /dev/null
+// Copyright Daniel Wallin 2006. Use, modification and distribution is
+// subject to the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_SET_060912_HPP
+# define BOOST_PARAMETER_SET_060912_HPP
+
+# include <boost/detail/workaround.hpp>
+
+# if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+# include <boost/mpl/insert.hpp>
+# include <boost/mpl/set/set0.hpp>
+# include <boost/mpl/has_key.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+typedef mpl::set0<> set0;
+
+template <class Set, class K>
+struct insert_
+{
+ typedef typename mpl::insert<Set, K>::type type;
+};
+
+template <class Set, class K>
+struct has_key_
+{
+ typedef typename mpl::has_key<Set, K>::type type;
+};
+
+}}} // namespace boost::parameter::aux
+
+# else
+
+# include <boost/mpl/list.hpp>
+# include <boost/mpl/end.hpp>
+# include <boost/mpl/find.hpp>
+# include <boost/mpl/not.hpp>
+# include <boost/mpl/push_front.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+typedef mpl::list0<> set0;
+
+template <class Set, class K>
+struct insert_
+{
+ typedef typename mpl::push_front<Set, K>::type type;
+};
+
+template <class Set, class K>
+struct has_key_
+{
+ typedef typename mpl::find<Set, K>::type iter;
+ typedef mpl::not_<
+ is_same<iter, typename mpl::end<Set>::type>
+ > type;
+};
+
+}}} // namespace boost::parameter::aux
+
+# endif
+
+
+#endif // BOOST_PARAMETER_SET_060912_HPP
+
--- /dev/null
+// Copyright David Abrahams 2005. 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_PARAMETER_AUX_TAG_DWA2005610_HPP
+# define BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
+
+# include <boost/parameter/aux_/unwrap_cv_reference.hpp>
+# include <boost/parameter/aux_/tagged_argument.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+template <class Keyword, class ActualArg
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ , class = typename is_cv_reference_wrapper<ActualArg>::type
+#endif
+ >
+struct tag
+{
+ typedef tagged_argument<
+ Keyword
+ , typename unwrap_cv_reference<ActualArg>::type
+ > type;
+};
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+template <class Keyword, class ActualArg>
+struct tag<Keyword,ActualArg,mpl::false_>
+{
+ typedef tagged_argument<
+ Keyword
+ , ActualArg
+ > type;
+};
+#endif
+
+}}} // namespace boost::parameter::aux_
+
+#endif // BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP
+# define BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP
+
+# include <boost/parameter/aux_/void.hpp>
+# include <boost/parameter/aux_/arg_list.hpp>
+# include <boost/parameter/aux_/result_of0.hpp>
+# include <boost/mpl/if.hpp>
+# include <boost/mpl/apply_wrap.hpp>
+# include <boost/mpl/and.hpp>
+# include <boost/mpl/not.hpp>
+# include <boost/type_traits/is_same.hpp>
+# include <boost/type_traits/is_convertible.hpp>
+# include <boost/type_traits/is_reference.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+struct empty_arg_list;
+struct arg_list_tag;
+
+struct tagged_argument_base {};
+
+// Holds a reference to an argument of type Arg associated with
+// keyword Keyword
+
+template <class Keyword, class Arg>
+struct tagged_argument : tagged_argument_base
+{
+ typedef Keyword key_type;
+ typedef Arg value_type;
+ typedef Arg& reference;
+
+ tagged_argument(reference x) : value(x) {}
+
+ // A metafunction class that, given a keyword and a default
+ // type, returns the appropriate result type for a keyword
+ // lookup given that default
+ struct binding
+ {
+ template <class KW, class Default, class Reference>
+ struct apply
+ {
+ typedef typename mpl::eval_if<
+ boost::is_same<KW, key_type>
+ , mpl::if_<Reference, reference, value_type>
+ , mpl::identity<Default>
+ >::type type;
+ };
+ };
+
+ // Comma operator to compose argument list without using parameters<>.
+ // Useful for argument lists with undetermined length.
+ template <class Keyword2, class Arg2>
+ arg_list<
+ tagged_argument<Keyword, Arg>
+ , arg_list<tagged_argument<Keyword2, Arg2> >
+ >
+ operator,(tagged_argument<Keyword2, Arg2> x) const
+ {
+ return arg_list<
+ tagged_argument<Keyword, Arg>
+ , arg_list<tagged_argument<Keyword2, Arg2> >
+ >(
+ *this
+ , arg_list<tagged_argument<Keyword2, Arg2> >(x, empty_arg_list())
+ );
+ }
+
+ reference operator[](keyword<Keyword> const&) const
+ {
+ return value;
+ }
+
+# if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ template <class KW, class Default>
+ Default& get_with_default(default_<KW,Default> const& x, int) const
+ {
+ return x.value;
+ }
+
+ template <class Default>
+ reference get_with_default(default_<key_type,Default> const&, long) const
+ {
+ return value;
+ }
+
+ template <class KW, class Default>
+ typename mpl::apply_wrap3<binding, KW, Default&, mpl::true_>::type
+ operator[](default_<KW,Default> const& x) const
+ {
+ return get_with_default(x, 0L);
+ }
+
+ template <class KW, class F>
+ typename result_of0<F>::type
+ get_with_lazy_default(lazy_default<KW,F> const& x, int) const
+ {
+ return x.compute_default();
+ }
+
+ template <class F>
+ reference get_with_lazy_default(lazy_default<key_type,F> const&, long) const
+ {
+ return value;
+ }
+
+ template <class KW, class F>
+ typename mpl::apply_wrap3<
+ binding,KW
+ , typename result_of0<F>::type
+ , mpl::true_
+ >::type
+ operator[](lazy_default<KW,F> const& x) const
+ {
+ return get_with_lazy_default(x, 0L);
+ }
+# else
+ template <class Default>
+ reference operator[](default_<key_type,Default> const& ) const
+ {
+ return value;
+ }
+
+ template <class F>
+ reference operator[](lazy_default<key_type,F> const& ) const
+ {
+ return value;
+ }
+
+ template <class KW, class Default>
+ Default& operator[](default_<KW,Default> const& x) const
+ {
+ return x.value;
+ }
+
+ template <class KW, class F>
+ typename result_of0<F>::type operator[](lazy_default<KW,F> const& x) const
+ {
+ return x.compute_default();
+ }
+
+ template <class ParameterRequirements>
+ static typename ParameterRequirements::has_default
+ satisfies(ParameterRequirements*);
+
+ template <class HasDefault, class Predicate>
+ static typename mpl::apply1<Predicate, value_type>::type
+ satisfies(
+ parameter_requirements<key_type,Predicate,HasDefault>*
+ );
+# endif
+
+ reference value;
+# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
+ // warning suppression
+ private:
+ void operator=(tagged_argument const&);
+ public:
+# endif
+ // MPL sequence support
+ typedef tagged_argument type; // Convenience for users
+ typedef empty_arg_list tail_type; // For the benefit of iterators
+ typedef arg_list_tag tag; // For dispatching to sequence intrinsics
+};
+
+// Defines a metafunction, is_tagged_argument, that identifies
+// tagged_argument specializations and their derived classes.
+template <class T>
+struct is_tagged_argument_aux
+ : is_convertible<T*,tagged_argument_base const*>
+{};
+
+template <class T>
+struct is_tagged_argument
+ : mpl::and_<
+ mpl::not_<is_reference<T> >
+ , is_tagged_argument_aux<T>
+ >
+{};
+
+}}} // namespace boost::parameter::aux
+
+#endif // BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP
+
--- /dev/null
+// Copyright Daniel Wallin 2006. Use, modification and distribution is
+// subject to the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
+# define BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
+
+# include <boost/mpl/and.hpp>
+# include <boost/mpl/not.hpp>
+# include <boost/type_traits/is_convertible.hpp>
+# include <boost/type_traits/is_reference.hpp>
+
+namespace boost { namespace parameter {
+
+namespace aux
+{
+
+ struct template_keyword_tag {};
+
+ template <class T, class U>
+ struct is_pointer_convertible
+ : is_convertible<T*, U*>
+ {};
+
+ template <class T>
+ struct is_template_keyword
+ : mpl::and_<
+ mpl::not_<is_reference<T> >
+ , is_pointer_convertible<T, template_keyword_tag>
+ >
+ {};
+
+} // namespace aux
+
+template <class Tag, class T>
+struct template_keyword
+ : aux::template_keyword_tag
+{
+ typedef Tag key_type;
+ typedef T value_type;
+ typedef value_type reference;
+};
+
+}} // namespace boost::parameter
+
+#endif // BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
+
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef UNWRAP_CV_REFERENCE_050328_HPP
+#define UNWRAP_CV_REFERENCE_050328_HPP
+
+#include <boost/parameter/aux_/yesno.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/eval_if.hpp>
+
+namespace boost { template<class T> class reference_wrapper; }
+
+namespace boost { namespace parameter { namespace aux {
+
+//
+// reference_wrapper support -- because of the forwarding problem,
+// when passing arguments positionally by non-const reference, we
+// ask users of named parameter interfaces to use ref(x) to wrap
+// them.
+//
+
+// is_cv_reference_wrapper returns mpl::true_ if T is of type
+// reference_wrapper<U> cv
+template <class U>
+yes_tag is_cv_reference_wrapper_check(reference_wrapper<U> const volatile*);
+no_tag is_cv_reference_wrapper_check(...);
+
+template <class T>
+struct is_cv_reference_wrapper
+{
+ BOOST_STATIC_CONSTANT(
+ bool, value = (
+ sizeof(is_cv_reference_wrapper_check((T*)0)) == sizeof(yes_tag)
+ )
+ );
+
+ typedef mpl::bool_<
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ is_cv_reference_wrapper::
+#endif
+ value> type;
+};
+
+// Needed for unwrap_cv_reference below. T might be const, so
+// eval_if might fail because of deriving from T const on EDG.
+template <class T>
+struct get_type
+{
+ typedef typename T::type type;
+};
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+template <class T, class is_reference_wrapper = typename is_cv_reference_wrapper<T>::type>
+struct unwrap_cv_reference
+{
+ typedef T type;
+};
+
+template <class T>
+struct unwrap_cv_reference<T const, mpl::false_>
+{
+ typedef T const type;
+};
+
+template <class T>
+struct unwrap_cv_reference<T, mpl::true_>
+ : T
+{};
+
+#else
+// Produces the unwrapped type to hold a reference to in named<>
+// Can't use boost::unwrap_reference<> here because it
+// doesn't handle the case where T = reference_wrapper<U> cv
+template <class T>
+struct unwrap_cv_reference
+{
+ typedef typename mpl::eval_if<
+ is_cv_reference_wrapper<T>
+ , get_type<T>
+ , mpl::identity<T>
+ >::type type;
+};
+#endif
+
+}}} // namespace boost::parameter::aux
+
+#endif // UNWRAP_CV_REFERENCE_050328_HPP
+
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_VOID_050329_HPP
+#define BOOST_PARAMETER_VOID_050329_HPP
+
+namespace boost { namespace parameter {
+
+// A placemarker for "no argument passed."
+// MAINTAINER NOTE: Do not make this into a metafunction
+struct void_ {};
+
+namespace aux
+{
+
+ inline void_& void_reference()
+ {
+ static void_ instance;
+ return instance;
+ }
+
+} // namespace aux
+
+}} // namespace boost::parameter
+
+#endif // BOOST_PARAMETER_VOID_050329_HPP
+
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef YESNO_050328_HPP
+#define YESNO_050328_HPP
+
+#include <boost/mpl/bool.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+// types used with the "sizeof trick" to capture the results of
+// overload resolution at compile-time.
+typedef char yes_tag;
+typedef char (&no_tag)[2];
+
+// mpl::true_ and mpl::false_ are not distinguishable by sizeof(),
+// so we pass them through these functions to get a type that is.
+yes_tag to_yesno(mpl::true_);
+no_tag to_yesno(mpl::false_);
+
+}}} // namespace boost::parameter::aux
+
+#endif // YESNO_050328_HPP
+
--- /dev/null
+// Copyright David Abrahams 2005. 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_PARAMETER_BINDING_DWA200558_HPP
+# define BOOST_PARAMETER_BINDING_DWA200558_HPP
+
+# include <boost/mpl/apply.hpp>
+# include <boost/mpl/assert.hpp>
+# include <boost/mpl/and.hpp>
+# include <boost/parameter/aux_/result_of0.hpp>
+# include <boost/parameter/aux_/void.hpp>
+# include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace parameter {
+
+// A metafunction that, given an argument pack, returns the type of
+// the parameter identified by the given keyword. If no such
+// parameter has been specified, returns Default
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+template <class Parameters, class Keyword, class Default>
+struct binding0
+{
+ typedef typename mpl::apply_wrap3<
+ typename Parameters::binding,Keyword,Default,mpl::true_
+ >::type type;
+
+ BOOST_MPL_ASSERT_NOT((
+ mpl::and_<
+ is_same<Default, void_>
+ , is_same<type, void_>
+ >
+ ));
+};
+# endif
+
+template <class Parameters, class Keyword, class Default = void_>
+struct binding
+{
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ typedef typename mpl::eval_if<
+ mpl::is_placeholder<Parameters>
+ , mpl::identity<int>
+ , binding0<Parameters,Keyword,Default>
+ >::type type;
+# else
+ typedef typename mpl::apply_wrap3<
+ typename Parameters::binding,Keyword,Default,mpl::true_
+ >::type type;
+
+ BOOST_MPL_ASSERT_NOT((
+ mpl::and_<
+ is_same<Default, void_>
+ , is_same<type, void_>
+ >
+ ));
+# endif
+
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(3,binding,(Parameters,Keyword,Default))
+};
+
+// A metafunction that, given an argument pack, returns the type of
+// the parameter identified by the given keyword. If no such
+// parameter has been specified, returns the type returned by invoking
+// DefaultFn
+template <class Parameters, class Keyword, class DefaultFn>
+struct lazy_binding
+{
+ typedef typename mpl::apply_wrap3<
+ typename Parameters::binding
+ , Keyword
+ , typename aux::result_of0<DefaultFn>::type
+ , mpl::true_
+ >::type type;
+};
+
+
+}} // namespace boost::parameter
+
+#endif // BOOST_PARAMETER_BINDING_DWA200558_HPP
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_CONFIG_050403_HPP
+#define BOOST_PARAMETER_CONFIG_050403_HPP
+
+#ifndef BOOST_PARAMETER_MAX_ARITY
+# define BOOST_PARAMETER_MAX_ARITY 8
+#endif
+
+#endif // BOOST_PARAMETER_CONFIG_050403_HPP
+
--- /dev/null
+// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef KEYWORD_050328_HPP
+#define KEYWORD_050328_HPP
+
+#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
+#include <boost/parameter/aux_/tag.hpp>
+#include <boost/parameter/aux_/default.hpp>
+
+namespace boost { namespace parameter {
+
+// Instances of unique specializations of keyword<...> serve to
+// associate arguments with parameter names. For example:
+//
+// struct rate_; // parameter names
+// struct skew_;
+// namespace
+// {
+// keyword<rate_> rate; // keywords
+// keyword<skew_> skew;
+// }
+//
+// ...
+//
+// f(rate = 1, skew = 2.4);
+//
+template <class Tag>
+struct keyword
+{
+ template <class T>
+ typename aux::tag<Tag, T>::type const
+ operator=(T& x) const
+ {
+ typedef typename aux::tag<Tag, T>::type result;
+ return result(x);
+ }
+
+ template <class Default>
+ aux::default_<Tag, Default>
+ operator|(Default& default_) const
+ {
+ return aux::default_<Tag, Default>(default_);
+ }
+
+ template <class Default>
+ aux::lazy_default<Tag, Default>
+ operator||(Default& default_) const
+ {
+ return aux::lazy_default<Tag, Default>(default_);
+ }
+
+ template <class T>
+ typename aux::tag<Tag, T const>::type const
+ operator=(T const& x) const
+ {
+ typedef typename aux::tag<Tag, T const>::type result;
+ return result(x);
+ }
+
+ template <class Default>
+ aux::default_<Tag, const Default>
+ operator|(const Default& default_) const
+ {
+ return aux::default_<Tag, const Default>(default_);
+ }
+
+ template <class Default>
+ aux::lazy_default<Tag, Default>
+ operator||(Default const& default_) const
+ {
+ return aux::lazy_default<Tag, Default>(default_);
+ }
+
+ public: // Insurance against ODR violations
+
+ // People will need to define these keywords in header files. To
+ // prevent ODR violations, it's important that the keyword used in
+ // every instantiation of a function template is the same object.
+ // We provide a reference to a common instance of each keyword
+ // object and prevent construction by users.
+ static keyword<Tag> const instance;
+
+ // This interface is deprecated
+ static keyword<Tag>& get()
+ {
+ return const_cast<keyword<Tag>&>(instance);
+ }
+};
+
+template <class Tag>
+keyword<Tag> const keyword<Tag>::instance = {};
+
+// Reduces boilerplate required to declare and initialize keywords
+// without violating ODR. Declares a keyword tag type with the given
+// name in namespace tag_namespace, and declares and initializes a
+// reference in an anonymous namespace to a singleton instance of that
+// type.
+
+#define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
+ namespace tag_namespace \
+ { \
+ struct name \
+ { \
+ static char const* keyword_name() \
+ { \
+ return #name; \
+ } \
+ }; \
+ } \
+ namespace \
+ { \
+ ::boost::parameter::keyword<tag_namespace::name> const& name \
+ = ::boost::parameter::keyword<tag_namespace::name>::instance;\
+ }
+
+}} // namespace boost::parameter
+
+#endif // KEYWORD_050328_HPP
+
--- /dev/null
+// Copyright David Abrahams, Daniel Wallin 2003. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_MACROS_050412_HPP
+#define BOOST_PARAMETER_MACROS_050412_HPP
+
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/logical/bool.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/control/expr_if.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/detail/workaround.hpp>
+
+#define BOOST_PARAMETER_FUN_TEMPLATE_HEAD1(n) \
+ template<BOOST_PP_ENUM_PARAMS(n, class T)>
+
+#define BOOST_PARAMETER_FUN_TEMPLATE_HEAD0(n)
+
+#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
+
+# define BOOST_PARAMETER_MATCH_TYPE(n, param) \
+ BOOST_PP_EXPR_IF(n, typename) param::match \
+ < \
+ BOOST_PP_ENUM_PARAMS(n, T) \
+ >::type
+
+#else
+
+# define BOOST_PARAMETER_MATCH_TYPE(n, param) param
+
+#endif
+
+#define BOOST_PARAMETER_FUN_DECL(z, n, params) \
+ \
+ BOOST_PP_CAT(BOOST_PARAMETER_FUN_TEMPLATE_HEAD, BOOST_PP_BOOL(n))(n) \
+ \
+ BOOST_PP_TUPLE_ELEM(3, 0, params) \
+ BOOST_PP_TUPLE_ELEM(3, 1, params)( \
+ BOOST_PP_ENUM_BINARY_PARAMS(n, T, const& p) \
+ BOOST_PP_COMMA_IF(n) \
+ BOOST_PARAMETER_MATCH_TYPE(n,BOOST_PP_TUPLE_ELEM(3, 2, params)) \
+ kw = BOOST_PP_TUPLE_ELEM(3, 2, params)() \
+ ) \
+ { \
+ return BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 1, params), _with_named_params)( \
+ kw(BOOST_PP_ENUM_PARAMS(n, p)) \
+ ); \
+ }
+
+// Generates:
+//
+// template<class Params>
+// ret name ## _with_named_params(Params const&);
+//
+// template<class T0>
+// ret name(T0 const& p0, typename parameters::match<T0>::type kw = parameters())
+// {
+// return name ## _with_named_params(kw(p0));
+// }
+//
+// template<class T0, ..., class TN>
+// ret name(T0 const& p0, ..., TN const& PN
+// , typename parameters::match<T0, ..., TN>::type kw = parameters())
+// {
+// return name ## _with_named_params(kw(p0, ..., pN));
+// }
+//
+// template<class Params>
+// ret name ## _with_named_params(Params const&)
+//
+// lo and hi determines the min and max arity of the generated functions.
+
+#define BOOST_PARAMETER_FUN(ret, name, lo, hi, parameters) \
+ \
+ template<class Params> \
+ ret BOOST_PP_CAT(name, _with_named_params)(Params const& p); \
+ \
+ BOOST_PP_REPEAT_FROM_TO( \
+ lo, BOOST_PP_INC(hi), BOOST_PARAMETER_FUN_DECL, (ret, name, parameters)) \
+ \
+ template<class Params> \
+ ret BOOST_PP_CAT(name, _with_named_params)(Params const& p)
+
+#define BOOST_PARAMETER_MEMFUN(ret, name, lo, hi, parameters) \
+ \
+ BOOST_PP_REPEAT_FROM_TO( \
+ lo, BOOST_PP_INC(hi), BOOST_PARAMETER_FUN_DECL, (ret, name, parameters)) \
+ \
+ template<class Params> \
+ ret BOOST_PP_CAT(name, _with_named_params)(Params const& p)
+
+#endif // BOOST_PARAMETER_MACROS_050412_HPP
+
--- /dev/null
+// Copyright David Abrahams 2005. 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_PARAMETER_MATCH_DWA2005714_HPP
+# define BOOST_PARAMETER_MATCH_DWA2005714_HPP
+
+# include <boost/detail/workaround.hpp>
+# include <boost/preprocessor/seq/enum.hpp>
+
+# if BOOST_WORKAROUND(__MWERKS__, <= 0x3003)
+// Temporary version of BOOST_PP_SEQ_ENUM until Paul M. integrates the workaround.
+# define BOOST_PARAMETER_SEQ_ENUM_I(size,seq) BOOST_PP_CAT(BOOST_PP_SEQ_ENUM_, size) seq
+# define BOOST_PARAMETER_SEQ_ENUM(seq) BOOST_PARAMETER_SEQ_ENUM_I(BOOST_PP_SEQ_SIZE(seq), seq)
+# else
+# define BOOST_PARAMETER_SEQ_ENUM(seq) BOOST_PP_SEQ_ENUM(seq)
+# endif
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+
+# include <boost/parameter/config.hpp>
+# include <boost/parameter/aux_/void.hpp>
+# include <boost/preprocessor/arithmetic/sub.hpp>
+# include <boost/preprocessor/facilities/intercept.hpp>
+# include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+
+# define BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes) \
+ BOOST_PP_ENUM_TRAILING_PARAMS( \
+ BOOST_PP_SUB( \
+ BOOST_PARAMETER_MAX_ARITY \
+ , BOOST_PP_SEQ_SIZE(ArgTypes) \
+ ) \
+ , ::boost::parameter::void_ BOOST_PP_INTERCEPT \
+ )
+
+# else
+
+# define BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes)
+
+# endif
+
+//
+// Generates, e.g.
+//
+// typename dfs_params::match<A1,A2>::type name = dfs_params()
+//
+// with workarounds for Borland compatibility.
+//
+
+# define BOOST_PARAMETER_MATCH(ParameterSpec, ArgTypes, name) \
+ typename ParameterSpec ::match< \
+ BOOST_PARAMETER_SEQ_ENUM(ArgTypes) \
+ BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes) \
+ >::type name = ParameterSpec ()
+
+#endif // BOOST_PARAMETER_MATCH_DWA2005714_HPP
--- /dev/null
+// Copyright Daniel Wallin 2006. Use, modification and distribution is
+// subject to the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_NAME_060806_HPP
+# define BOOST_PARAMETER_NAME_060806_HPP
+
+# include <boost/parameter/keyword.hpp>
+# include <boost/parameter/value_type.hpp>
+# include <boost/detail/workaround.hpp>
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/stringize.hpp>
+# include <boost/preprocessor/control/iif.hpp>
+# include <boost/preprocessor/tuple/eat.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/mpl/placeholders.hpp>
+
+# if !defined(BOOST_NO_SFINAE) \
+ && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
+
+# include <boost/utility/enable_if.hpp>
+# include <boost/mpl/lambda.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+// Tag type passed to MPL lambda.
+struct lambda_tag;
+
+struct name_tag_base
+{};
+
+template <class Tag>
+struct name_tag
+{};
+
+template <class T>
+struct is_name_tag
+ : mpl::false_
+{};
+
+}}} // namespace boost::parameter::aux
+
+namespace boost { namespace mpl {
+
+template <class T>
+struct lambda<
+ T
+ , typename boost::enable_if<
+ parameter::aux::is_name_tag<T>, parameter::aux::lambda_tag
+ >::type
+>
+{
+ typedef true_ is_le;
+ typedef bind3< quote3<parameter::value_type>, arg<2>, T, void> result_;
+ typedef result_ type;
+};
+
+}} // namespace boost::mpl
+
+# endif
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+# include <boost/preprocessor/detail/split.hpp>
+// From Paul Mensonides
+# define BOOST_PARAMETER_IS_BINARY(x) \
+ BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_BINARY_C x BOOST_PP_COMMA() 0) \
+ /**/
+# define BOOST_PARAMETER_IS_BINARY_C(x,y) \
+ ~, 1 BOOST_PP_RPAREN() \
+ BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~ \
+ /**/
+# else
+# include <boost/preprocessor/detail/is_binary.hpp>
+# define BOOST_PARAMETER_IS_BINARY(x) BOOST_PP_IS_BINARY(x)
+# endif
+
+# define BOOST_PARAMETER_BASIC_NAME(tag_namespace, tag, name) \
+ namespace tag_namespace \
+ { \
+ struct tag \
+ { \
+ static char const* keyword_name() \
+ { \
+ return BOOST_PP_STRINGIZE(tag); \
+ } \
+ \
+ typedef boost::parameter::value_type< \
+ boost::mpl::_2, tag, boost::parameter::void_ \
+ > _; \
+ \
+ typedef boost::parameter::value_type< \
+ boost::mpl::_2, tag, boost::parameter::void_ \
+ > _1; \
+ }; \
+ } \
+ namespace \
+ { \
+ ::boost::parameter::keyword<tag_namespace::tag> const& name \
+ = ::boost::parameter::keyword<tag_namespace::tag>::instance; \
+ }
+
+# define BOOST_PARAMETER_COMPLEX_NAME_TUPLE1(tag,namespace) \
+ (tag, namespace), ~
+
+# define BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name) \
+ BOOST_PP_TUPLE_ELEM(2, 0, (BOOST_PARAMETER_COMPLEX_NAME_TUPLE1 name))
+
+# define BOOST_PARAMETER_COMPLEX_NAME_TAG(name) \
+ BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name))
+
+# define BOOST_PARAMETER_COMPLEX_NAME_NAMESPACE(name) \
+ BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name))
+
+# define BOOST_PARAMETER_COMPLEX_NAME(name) \
+ BOOST_PARAMETER_BASIC_NAME( \
+ BOOST_PARAMETER_COMPLEX_NAME_NAMESPACE(name) \
+ , BOOST_PP_TUPLE_EAT(2) name \
+ , BOOST_PARAMETER_COMPLEX_NAME_TAG(name) \
+ ) \
+/**/
+
+# define BOOST_PARAMETER_SIMPLE_NAME(name) \
+ BOOST_PARAMETER_BASIC_NAME(tag, name, BOOST_PP_CAT(_, name))
+
+# define BOOST_PARAMETER_NAME(name) \
+ BOOST_PP_IIF( \
+ BOOST_PARAMETER_IS_BINARY(name) \
+ , BOOST_PARAMETER_COMPLEX_NAME \
+ , BOOST_PARAMETER_SIMPLE_NAME \
+ )(name) \
+/**/
+
+
+# define BOOST_PARAMETER_TEMPLATE_KEYWORD(name) \
+ namespace tag \
+ { \
+ struct name; \
+ } \
+ template <class T> \
+ struct name \
+ : boost::parameter::template_keyword<tag::name, T> \
+ {}; \
+/**/
+
+#endif // BOOST_PARAMETER_NAME_060806_HPP
+
--- /dev/null
+// Copyright David Abrahams, Daniel Wallin 2003. Use, modification and
+// distribution is subject to the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETERS_031014_HPP
+#define BOOST_PARAMETERS_031014_HPP
+
+#include <boost/detail/is_xxx.hpp>
+
+#include <boost/type_traits/is_const.hpp>
+
+#include <boost/mpl/lambda.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/always.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/pair.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/enum_shifted.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+#include <boost/preprocessor/seq/elem.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+#include <boost/parameter/aux_/arg_list.hpp>
+#include <boost/parameter/aux_/yesno.hpp>
+#include <boost/parameter/aux_/void.hpp>
+#include <boost/parameter/aux_/default.hpp>
+#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
+#include <boost/parameter/aux_/tagged_argument.hpp>
+#include <boost/parameter/aux_/tag.hpp>
+#include <boost/parameter/aux_/template_keyword.hpp>
+#include <boost/parameter/aux_/set.hpp>
+#include <boost/parameter/config.hpp>
+
+namespace parameter_
+{
+ template <class T>
+ struct unmatched_argument
+ {
+ BOOST_MPL_ASSERT((boost::is_same<T,void>));
+ typedef int type;
+ };
+} // namespace parameter_
+
+namespace boost {
+
+template<class T> class reference_wrapper;
+
+namespace parameter {
+
+namespace aux { struct use_default {}; }
+
+// These templates can be used to describe the treatment of particular
+// named parameters for the purposes of overload elimination with
+// SFINAE, by placing specializations in the parameters<...> list. In
+// order for a treated function to participate in overload resolution:
+//
+// - all keyword tags wrapped in required<...> must have a matching
+// actual argument
+//
+// - The actual argument type matched by every keyword tag
+// associated with a predicate must satisfy that predicate
+//
+// If a keyword k is specified without an optional<...> or
+// required<...>, wrapper, it is treated as though optional<k> were
+// specified.
+//
+// If a keyword k is specified with deduced<...>, that keyword
+// will be automatically deduced from the argument list.
+//
+template <class Tag, class Predicate = aux::use_default>
+struct required
+{
+ typedef Tag key_type;
+ typedef Predicate predicate;
+};
+
+template <class Tag, class Predicate = aux::use_default>
+struct optional
+{
+ typedef Tag key_type;
+ typedef Predicate predicate;
+};
+
+template <class Tag>
+struct deduced
+{
+ typedef Tag key_type;
+};
+
+namespace aux
+{
+ // Defines metafunctions, is_required and is_optional, that
+ // identify required<...>, optional<...> and deduced<...> specializations.
+ BOOST_DETAIL_IS_XXX_DEF(required, required, 2)
+ BOOST_DETAIL_IS_XXX_DEF(optional, optional, 2)
+ BOOST_DETAIL_IS_XXX_DEF(deduced_aux, deduced, 1)
+
+ template <class S>
+ struct is_deduced0
+ : is_deduced_aux<
+ typename S::key_type
+ >::type
+ {};
+
+ template <class S>
+ struct is_deduced
+ : mpl::eval_if<
+ mpl::or_<
+ is_optional<S>, is_required<S>
+ >
+ , is_deduced0<S>
+ , mpl::false_
+ >::type
+ {};
+
+ //
+ // key_type, has_default, and predicate --
+ //
+ // These metafunctions accept a ParameterSpec and extract the
+ // keyword tag, whether or not a default is supplied for the
+ // parameter, and the predicate that the corresponding actual
+ // argument type is required match.
+ //
+ // a ParameterSpec is a specialization of either keyword<...>,
+ // required<...>, optional<...>
+ //
+
+ // helper for key_type<...>, below.
+ template <class T>
+ struct get_tag_type0
+ {
+ typedef typename T::key_type type;
+ };
+
+ template <class T>
+ struct get_tag_type
+ : mpl::eval_if<
+ is_deduced_aux<typename T::key_type>
+ , get_tag_type0<typename T::key_type>
+ , mpl::identity<typename T::key_type>
+ >
+ {};
+
+ template <class T>
+ struct tag_type
+ : mpl::eval_if<
+ mpl::or_<
+ is_optional<T>
+ , is_required<T>
+ >
+ , get_tag_type<T>
+ , mpl::identity<T>
+ >
+ {};
+
+ template <class T>
+ struct has_default
+ : mpl::not_<is_required<T> >
+ {};
+
+ // helper for get_predicate<...>, below
+ template <class T>
+ struct get_predicate_or_default
+ {
+ typedef T type;
+ };
+
+ template <>
+ struct get_predicate_or_default<use_default>
+ {
+ typedef mpl::always<mpl::true_> type;
+ };
+
+ // helper for predicate<...>, below
+ template <class T>
+ struct get_predicate
+ {
+ typedef typename
+ get_predicate_or_default<typename T::predicate>::type
+ type;
+ };
+
+ template <class T>
+ struct predicate
+ : mpl::eval_if<
+ mpl::or_<
+ is_optional<T>
+ , is_required<T>
+ >
+ , get_predicate<T>
+ , mpl::identity<mpl::always<mpl::true_> >
+ >
+ {
+ };
+
+
+ // Converts a ParameterSpec into a specialization of
+ // parameter_requirements. We need to do this in order to get the
+ // tag_type into the type in a way that can be conveniently matched
+ // by a satisfies(...) member function in arg_list.
+ template <class ParameterSpec>
+ struct as_parameter_requirements
+ {
+ typedef parameter_requirements<
+ typename tag_type<ParameterSpec>::type
+ , typename predicate<ParameterSpec>::type
+ , typename has_default<ParameterSpec>::type
+ > type;
+ };
+
+ template <class T>
+ struct is_named_argument
+ : mpl::or_<
+ is_template_keyword<T>
+ , is_tagged_argument<T>
+ >
+ {};
+
+ // Returns mpl::true_ iff the given ParameterRequirements are
+ // satisfied by ArgList.
+ template <class ArgList, class ParameterRequirements>
+ struct satisfies
+ {
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+ // VC7.1 can't handle the sizeof() implementation below,
+ // so we use this instead.
+ typedef typename mpl::apply_wrap3<
+ typename ArgList::binding
+ , typename ParameterRequirements::keyword
+ , void_
+ , mpl::false_
+ >::type bound;
+
+ typedef typename mpl::eval_if<
+ is_same<bound, void_>
+ , typename ParameterRequirements::has_default
+ , mpl::apply_wrap2<
+ typename mpl::lambda<
+ typename ParameterRequirements::predicate, lambda_tag
+ >::type
+ , bound
+ , ArgList
+ >
+ >::type type;
+#else
+ BOOST_STATIC_CONSTANT(
+ bool, value = (
+ sizeof(
+ aux::to_yesno(
+ ArgList::satisfies((ParameterRequirements*)0, (ArgList*)0)
+ )
+ ) == sizeof(yes_tag)
+ )
+ );
+
+ typedef mpl::bool_<satisfies::value> type;
+#endif
+ };
+
+ // Returns mpl::true_ if the requirements of the given ParameterSpec
+ // are satisfied by ArgList.
+ template <class ArgList, class ParameterSpec>
+ struct satisfies_requirements_of
+ : satisfies<
+ ArgList
+ , typename as_parameter_requirements<ParameterSpec>::type
+ >
+ {};
+
+ // Tags a deduced argument Arg with the keyword tag of Spec using TagFn.
+ // Returns the tagged argument and the mpl::set<> UsedArgs with the
+ // tag of Spec inserted.
+ template <class UsedArgs, class Spec, class Arg, class TagFn>
+ struct tag_deduced
+ {
+ typedef mpl::pair<
+ typename mpl::apply_wrap2<TagFn, typename tag_type<Spec>::type, Arg>::type
+ , typename aux::insert_<UsedArgs, typename tag_type<Spec>::type>::type
+ > type;
+ };
+
+ template <
+ class Argument
+ , class ArgumentPack
+ , class DeducedArgs
+ , class UsedArgs
+ , class TagFn
+ >
+ struct deduce_tag;
+
+ // Tag type passed to MPL lambda.
+ struct lambda_tag;
+
+ // Helper for deduce_tag<> below.
+ template <
+ class Argument
+ , class ArgumentPack
+ , class DeducedArgs
+ , class UsedArgs
+ , class TagFn
+ >
+ struct deduce_tag0
+ {
+ typedef typename DeducedArgs::spec spec;
+
+ typedef typename mpl::apply_wrap2<
+ typename mpl::lambda<
+ typename spec::predicate, lambda_tag
+ >::type
+ , Argument
+ , ArgumentPack
+ >::type condition;
+
+ // Deduced parameter matches several arguments.
+
+ BOOST_MPL_ASSERT((
+ mpl::not_<mpl::and_<
+ condition
+ , aux::has_key_<UsedArgs, typename tag_type<spec>::type>
+ > >
+ ));
+
+ typedef typename mpl::eval_if<
+ condition
+ , tag_deduced<UsedArgs, spec, Argument, TagFn>
+ , deduce_tag<Argument, ArgumentPack, typename DeducedArgs::tail, UsedArgs, TagFn>
+ >::type type;
+ };
+
+ // Tries to deduced a keyword tag for a given Argument.
+ // Returns an mpl::pair<> consisting of the tagged_argument<>,
+ // and an mpl::set<> where the new tag has been inserted.
+ //
+ // Argument: The argument type to be tagged.
+ //
+ // ArgumentPack: The ArgumentPack built so far.
+ //
+ // DeducedArgs: A specialization of deduced_item<> (see below).
+ // A list containing only the deduced ParameterSpecs.
+ //
+ // UsedArgs: An mpl::set<> containing the keyword tags used so far.
+ //
+ // TagFn: A metafunction class used to tag positional or deduced
+ // arguments with a keyword tag.
+
+ template <
+ class Argument
+ , class ArgumentPack
+ , class DeducedArgs
+ , class UsedArgs
+ , class TagFn
+ >
+ struct deduce_tag
+ {
+ typedef typename mpl::eval_if<
+ is_same<DeducedArgs, void_>
+ , mpl::pair<void_, UsedArgs>
+ , deduce_tag0<Argument, ArgumentPack, DeducedArgs, UsedArgs, TagFn>
+ >::type type;
+ };
+
+ template <
+ class List
+ , class DeducedArgs
+ , class TagFn
+ , class Positional
+ , class UsedArgs
+ , class ArgumentPack
+ , class Error
+ >
+ struct make_arg_list_aux;
+
+ // Inserts Tagged::key_type into the UserArgs set.
+ // Extra indirection to lazily evaluate Tagged::key_type.
+ template <class UsedArgs, class Tagged>
+ struct insert_tagged
+ {
+ typedef typename aux::insert_<
+ UsedArgs, typename Tagged::key_type
+ >::type type;
+ };
+
+ // Borland needs the insane extra-indirection workaround below
+ // so that it doesn't magically drop the const qualifier from
+ // the argument type.
+
+ template <
+ class List
+ , class DeducedArgs
+ , class TagFn
+ , class Positional
+ , class UsedArgs
+ , class ArgumentPack
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ , class argument
+#endif
+ , class Error
+ >
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ struct make_arg_list00
+#else
+ struct make_arg_list0
+#endif
+ {
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ typedef typename List::arg argument;
+#endif
+ typedef typename List::spec parameter_spec;
+ typedef typename tag_type<parameter_spec>::type tag_;
+
+ typedef is_named_argument<argument> is_tagged;
+
+ // If this argument is either explicitly tagged or a deduced
+ // parameter, we turn off positional matching.
+ typedef mpl::and_<
+ mpl::not_<
+ mpl::or_<is_deduced<parameter_spec>, is_tagged>
+ >
+ , Positional
+ > positional;
+
+ // If this parameter is explicitly tagged we add it to the
+ // used-parmeters set. We only really need to add parameters
+ // that are deduced, but we would need a way to check if
+ // a given tag corresponds to a deduced parameter spec.
+ typedef typename mpl::eval_if<
+ is_tagged
+ , insert_tagged<UsedArgs, argument>
+ , mpl::identity<UsedArgs>
+ >::type used_args;
+
+ // If this parameter is neither explicitly tagged, nor
+ // positionally matched; deduce the tag from the deduced
+ // parameter specs.
+ typedef typename mpl::eval_if<
+ mpl::or_<is_tagged, positional>
+ , mpl::pair<void_, used_args>
+ , deduce_tag<argument, ArgumentPack, DeducedArgs, used_args, TagFn>
+ >::type deduced_data;
+
+ // If this parameter is explicitly tagged..
+ typedef typename mpl::eval_if<
+ is_tagged
+ , mpl::identity<argument> // .. just use it
+ , mpl::eval_if< // .. else, if positional matching is turned on..
+ positional
+ , mpl::apply_wrap2<TagFn, tag_, argument> // .. tag it positionally
+ , mpl::first<deduced_data> // .. else, use the deduced tag
+ >
+ >::type tagged;
+
+ // We build the arg_list incrementally as we go, prepending new
+ // nodes.
+
+ typedef typename mpl::if_<
+ mpl::and_<
+ is_same<Error, void_>
+ , is_same<tagged, void_>
+ >
+ , parameter_::unmatched_argument<argument>
+ , void_
+ >::type error;
+
+ typedef typename mpl::if_<
+ is_same<tagged, void_>
+ , ArgumentPack
+ , arg_list<tagged, ArgumentPack>
+ >::type argument_pack;
+
+ typedef typename make_arg_list_aux<
+ typename List::tail
+ , DeducedArgs
+ , TagFn
+ , positional
+ , typename deduced_data::second
+ , argument_pack
+ , error
+ >::type type;
+ };
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ template <
+ class List
+ , class DeducedArgs
+ , class TagFn
+ , class Positional
+ , class UsedArgs
+ , class ArgumentPack
+ , class Error
+ >
+ struct make_arg_list0
+ {
+ typedef typename mpl::eval_if<
+ typename List::is_arg_const
+ , make_arg_list00<
+ List
+ , DeducedArgs
+ , TagFn
+ , Positional
+ , UsedArgs
+ , ArgumentPack
+ , typename List::arg const
+ , Error
+ >
+ , make_arg_list00<
+ List
+ , DeducedArgs
+ , TagFn
+ , Positional
+ , UsedArgs
+ , ArgumentPack
+ , typename List::arg
+ , Error
+ >
+ >::type type;
+ };
+#endif
+
+ // Returns an ArgumentPack where the list of arguments has
+ // been tagged with keyword tags.
+ //
+ // List: A specialization of item<> (see below). Contains
+ // both the ordered ParameterSpecs, and the given arguments.
+ //
+ // DeducedArgs: A specialization of deduced_item<> (see below).
+ // A list containing only the deduced ParameterSpecs.
+ //
+ // TagFn: A metafunction class used to tag positional or deduced
+ // arguments with a keyword tag.
+ //
+ // Position: An mpl::bool_<> specialization indicating if positional
+ // matching is to be performed.
+ //
+ // DeducedSet: An mpl::set<> containing the keyword tags used so far.
+ //
+ // ArgumentPack: The ArgumentPack built so far. This is initially an
+ // empty_arg_list and is built incrementally.
+ //
+
+ template <
+ class List
+ , class DeducedArgs
+ , class TagFn
+ , class Positional
+ , class DeducedSet
+ , class ArgumentPack
+ , class Error
+ >
+ struct make_arg_list_aux
+ {
+ typedef typename mpl::eval_if<
+ is_same<List, void_>
+ , mpl::identity<mpl::pair<ArgumentPack, Error> >
+ , make_arg_list0<List, DeducedArgs, TagFn, Positional, DeducedSet, ArgumentPack, Error>
+ >::type type;
+ };
+
+ // VC6.5 was choking on the default parameters for make_arg_list_aux, so
+ // this just forwards to that adding in the defaults.
+ template <
+ class List
+ , class DeducedArgs
+ , class TagFn
+ , class EmitErrors = mpl::true_
+ >
+ struct make_arg_list
+ {
+ typedef typename make_arg_list_aux<
+ List, DeducedArgs, TagFn, mpl::true_, aux::set0, empty_arg_list, void_
+ >::type type;
+ };
+
+ // A parameter spec item typelist.
+ template <class Spec, class Arg, class Tail = void_>
+ struct item
+ {
+ typedef Spec spec;
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ typedef is_const<Arg> is_arg_const;
+#endif
+
+ typedef Arg arg;
+ typedef Tail tail;
+ };
+
+ template <class Spec, class Arg, class Tail>
+ struct make_item
+ {
+ typedef item<Spec, Arg, typename Tail::type> type;
+ };
+
+ // Creates a item typelist.
+ template <class Spec, class Arg, class Tail>
+ struct make_items
+ {
+ typedef typename mpl::eval_if<
+ is_same<Arg, void_>
+ , mpl::identity<void_>
+ , make_item<Spec, Arg, Tail>
+ >::type type;
+ };
+
+ // A typelist that stored deduced parameter specs.
+ template <class ParameterSpec, class Tail = void_>
+ struct deduced_item
+ {
+ typedef ParameterSpec spec;
+ typedef Tail tail;
+ };
+
+ // Evaluate Tail and construct deduced_item list.
+ template <class Spec, class Tail>
+ struct make_deduced_item
+ {
+ typedef deduced_item<Spec, typename Tail::type> type;
+ };
+
+ template <class Spec, class Tail>
+ struct make_deduced_items
+ {
+ typedef typename mpl::eval_if<
+ is_same<Spec, void_>
+ , mpl::identity<void_>
+ , mpl::eval_if<
+ is_deduced<Spec>
+ , make_deduced_item<Spec, Tail>
+ , Tail
+ >
+ >::type type;
+ };
+
+ // Generates:
+ //
+ // make<
+ // parameter_spec#0, argument_type#0
+ // , make<
+ // parameter_spec#1, argument_type#1
+ // , ... mpl::identity<aux::empty_arg_list>
+ // ...>
+ // >
+#define BOOST_PARAMETER_make_arg_list(z, n, names) \
+ BOOST_PP_SEQ_ELEM(0,names)< \
+ BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1,names), n), \
+ BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(2,names), n),
+
+#define BOOST_PARAMETER_right_angle(z, n, text) >
+
+#define BOOST_PARAMETER_build_arg_list(n, make, parameter_spec, argument_type) \
+ BOOST_PP_REPEAT( \
+ n, BOOST_PARAMETER_make_arg_list, (make)(parameter_spec)(argument_type)) \
+ mpl::identity<void_> \
+ BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
+
+#define BOOST_PARAMETER_make_deduced_list(z, n, names) \
+ BOOST_PP_SEQ_ELEM(0,names)< \
+ BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1,names), n),
+
+#define BOOST_PARAMETER_build_deduced_list(n, make, parameter_spec) \
+ BOOST_PP_REPEAT( \
+ n, BOOST_PARAMETER_make_deduced_list, (make)(parameter_spec)) \
+ mpl::identity<void_> \
+ BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
+
+ struct tag_keyword_arg
+ {
+ template <class K, class T>
+ struct apply
+ : tag<K,T>
+ {};
+ };
+
+ struct tag_template_keyword_arg
+ {
+ template <class K, class T>
+ struct apply
+ {
+ typedef template_keyword<K,T> type;
+ };
+ };
+
+} // namespace aux
+
+#define BOOST_PARAMETER_FORWARD_TYPEDEF(z, i, names) \
+ typedef BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0,names),i) BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1,names),i);
+
+#define BOOST_PARAMETER_FORWARD_TYPEDEFS(n, src, dest) \
+ BOOST_PP_REPEAT(n, BOOST_PARAMETER_FORWARD_TYPEDEF, (src)(dest))
+
+
+#define BOOST_PARAMETER_TEMPLATE_ARGS(z, n, text) class BOOST_PP_CAT(PS, n) = void_
+
+template<
+ class PS0
+ , BOOST_PP_ENUM_SHIFTED(BOOST_PARAMETER_MAX_ARITY, BOOST_PARAMETER_TEMPLATE_ARGS, _)
+>
+struct parameters
+{
+#undef BOOST_PARAMETER_TEMPLATE_ARGS
+
+ typedef typename BOOST_PARAMETER_build_deduced_list(
+ BOOST_PARAMETER_MAX_ARITY, aux::make_deduced_items, PS
+ )::type deduced_list;
+
+ // if the elements of NamedList match the criteria of overload
+ // resolution, returns a type which can be constructed from
+ // parameters. Otherwise, this is not a valid metafunction (no nested
+ // ::type).
+
+
+#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
+ // If NamedList satisfies the PS0, PS1, ..., this is a
+ // metafunction returning parameters. Otherwise it
+ // has no nested ::type.
+ template <class ArgumentPackAndError>
+ struct match_base
+ : mpl::if_<
+ // mpl::and_<
+ // aux::satisfies_requirements_of<NamedList,PS0>
+ // , mpl::and_<
+ // aux::satisfies_requirements_of<NamedList,PS1>...
+ // ..., mpl::true_
+ // ...> >
+
+# define BOOST_PARAMETER_satisfies(z, n, text) \
+ mpl::and_< \
+ aux::satisfies_requirements_of< \
+ typename mpl::first<ArgumentPackAndError>::type \
+ , BOOST_PP_CAT(PS, n)> \
+ ,
+ mpl::and_<
+ is_same<typename mpl::second<ArgumentPackAndError>::type, void_>
+ , BOOST_PP_REPEAT(BOOST_PARAMETER_MAX_ARITY, BOOST_PARAMETER_satisfies, _)
+ mpl::true_
+ BOOST_PP_REPEAT(BOOST_PARAMETER_MAX_ARITY, BOOST_PARAMETER_right_angle, _)
+ >
+
+# undef BOOST_PARAMETER_satisfies
+
+ , mpl::identity<parameters>
+ , void_
+ >
+ {};
+#endif
+
+ // Specializations are to be used as an optional argument to
+ // eliminate overloads via SFINAE
+ template<
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ // Borland simply can't handle default arguments in member
+ // class templates. People wishing to write portable code can
+ // explicitly specify BOOST_PARAMETER_MAX_ARITY arguments
+ BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, class A)
+#else
+ BOOST_PP_ENUM_BINARY_PARAMS(
+ BOOST_PARAMETER_MAX_ARITY, class A, = void_ BOOST_PP_INTERCEPT
+ )
+#endif
+ >
+ struct match
+# if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
+ : match_base<
+ typename aux::make_arg_list<
+ typename BOOST_PARAMETER_build_arg_list(
+ BOOST_PARAMETER_MAX_ARITY, aux::make_items, PS, A
+ )::type
+ , deduced_list
+ , aux::tag_keyword_arg
+ , mpl::false_ // Don't emit errors when doing SFINAE
+ >::type
+ >::type
+ {};
+# else
+ {
+ typedef parameters<
+ BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, PS)
+ > type;
+ };
+# endif
+
+ // Metafunction that returns an ArgumentPack.
+
+ // TODO, bind has to instantiate the error type in the result
+ // of make_arg_list.
+
+ template <
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ // Borland simply can't handle default arguments in member
+ // class templates. People wishing to write portable code can
+ // explicitly specify BOOST_PARAMETER_MAX_ARITY arguments
+ BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, class A)
+#else
+ BOOST_PP_ENUM_BINARY_PARAMS(
+ BOOST_PARAMETER_MAX_ARITY, class A, = void_ BOOST_PP_INTERCEPT
+ )
+#endif
+ >
+ struct bind
+ {
+ typedef typename aux::make_arg_list<
+ typename BOOST_PARAMETER_build_arg_list(
+ BOOST_PARAMETER_MAX_ARITY, aux::make_items, PS, A
+ )::type
+ , deduced_list
+ , aux::tag_template_keyword_arg
+ >::type result;
+
+ typedef typename mpl::first<result>::type type;
+ };
+
+ BOOST_PARAMETER_FORWARD_TYPEDEFS(BOOST_PARAMETER_MAX_ARITY, PS, parameter_spec)
+
+ //
+ // The function call operator is used to build an arg_list that
+ // labels the positional parameters and maintains whatever other
+ // tags may have been specified by the caller.
+ //
+ // !!!NOTE!!!
+ //
+ // The make_arg_list<> produces a reversed arg_list, so
+ // we need to pass the arguments to its constructor
+ // reversed.
+ //
+ aux::empty_arg_list operator()() const
+ {
+ return aux::empty_arg_list();
+ }
+
+ template<class A0>
+ typename mpl::first<
+ typename aux::make_arg_list<
+ aux::item<
+ PS0,A0
+ >
+ , deduced_list
+ , aux::tag_keyword_arg
+ >::type
+ >::type
+ operator()(A0& a0) const
+ {
+ typedef typename aux::make_arg_list<
+ aux::item<
+ PS0,A0
+ >
+ , deduced_list
+ , aux::tag_keyword_arg
+ >::type result;
+
+ typedef typename mpl::first<result>::type result_type;
+ typedef typename mpl::second<result>::type error;
+ error();
+
+ return result_type(
+ a0
+ // , void_(), void_(), void_() ...
+ BOOST_PP_ENUM_TRAILING_PARAMS(
+ BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, 1)
+ , aux::void_reference() BOOST_PP_INTERCEPT)
+ );
+ }
+
+ template<class A0, class A1>
+ typename mpl::first<
+ typename aux::make_arg_list<
+ aux::item<
+ PS0,A0
+ , aux::item<
+ PS1,A1
+ >
+ >
+ , deduced_list
+ , aux::tag_keyword_arg
+ >::type
+ >::type
+ operator()(A0& a0, A1& a1) const
+ {
+ typedef typename aux::make_arg_list<
+ aux::item<
+ PS0,A0
+ , aux::item<
+ PS1,A1
+ >
+ >
+ , deduced_list
+ , aux::tag_keyword_arg
+ >::type result;
+
+ typedef typename mpl::first<result>::type result_type;
+ typedef typename mpl::second<result>::type error;
+ error();
+
+ return result_type(
+ a1,a0
+ // , void_(), void_() ...
+ BOOST_PP_ENUM_TRAILING_PARAMS(
+ BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, 2)
+ , aux::void_reference() BOOST_PP_INTERCEPT)
+ );
+ }
+
+ // Higher arities are handled by the preprocessor
+#define BOOST_PP_ITERATION_PARAMS_1 (3,( \
+ 3,BOOST_PARAMETER_MAX_ARITY,<boost/parameter/aux_/overloads.hpp> \
+ ))
+#include BOOST_PP_ITERATE()
+
+};
+
+} // namespace parameter
+
+} // namespace boost
+
+#endif // BOOST_PARAMETERS_031014_HPP
+
--- /dev/null
+// Copyright Daniel Wallin 2006. Use, modification and distribution is
+// subject to the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_PREPROCESSOR_060206_HPP
+# define BOOST_PARAMETER_PREPROCESSOR_060206_HPP
+
+# include <boost/parameter/parameters.hpp>
+# include <boost/parameter/binding.hpp>
+# include <boost/parameter/match.hpp>
+
+# include <boost/parameter/aux_/parenthesized_type.hpp>
+# include <boost/parameter/aux_/cast.hpp>
+# include <boost/parameter/aux_/preprocessor/flatten.hpp>
+
+# include <boost/preprocessor/repetition/repeat_from_to.hpp>
+# include <boost/preprocessor/comparison/equal.hpp>
+# include <boost/preprocessor/control/if.hpp>
+# include <boost/preprocessor/control/iif.hpp>
+# include <boost/preprocessor/control/expr_if.hpp>
+# include <boost/preprocessor/repetition/enum_params.hpp>
+# include <boost/preprocessor/repetition/enum_binary_params.hpp>
+# include <boost/preprocessor/repetition/enum_trailing.hpp>
+# include <boost/preprocessor/seq/first_n.hpp>
+# include <boost/preprocessor/seq/for_each_product.hpp>
+# include <boost/preprocessor/seq/for_each_i.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/eat.hpp>
+# include <boost/preprocessor/seq/fold_left.hpp>
+# include <boost/preprocessor/seq/push_back.hpp>
+# include <boost/preprocessor/seq/size.hpp>
+# include <boost/preprocessor/seq/enum.hpp>
+# include <boost/preprocessor/seq/push_back.hpp>
+
+# include <boost/preprocessor/detail/is_nullary.hpp>
+
+# include <boost/mpl/always.hpp>
+# include <boost/mpl/apply_wrap.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+# if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
+
+// Given Match, which is "void x" where x is an argument matching
+// criterion, extract a corresponding MPL predicate.
+template <class Match>
+struct unwrap_predicate;
+
+// Match anything
+template <>
+struct unwrap_predicate<void*>
+{
+ typedef mpl::always<mpl::true_> type;
+};
+
+#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
+
+typedef void* voidstar;
+
+// A matching predicate is explicitly specified
+template <class Predicate>
+struct unwrap_predicate<voidstar (Predicate)>
+{
+ typedef Predicate type;
+};
+
+#else
+
+// A matching predicate is explicitly specified
+template <class Predicate>
+struct unwrap_predicate<void *(Predicate)>
+{
+ typedef Predicate type;
+};
+
+#endif
+
+
+// A type to which the argument is supposed to be convertible is
+// specified
+template <class Target>
+struct unwrap_predicate<void (Target)>
+{
+ typedef is_convertible<mpl::_, Target> type;
+};
+
+// Recast the ParameterSpec's nested match metafunction as a free metafunction
+template <
+ class Parameters
+ , BOOST_PP_ENUM_BINARY_PARAMS(
+ BOOST_PARAMETER_MAX_ARITY, class A, = boost::parameter::void_ BOOST_PP_INTERCEPT
+ )
+>
+struct match
+ : Parameters::template match<
+ BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, A)
+ >
+{};
+# endif
+
+# undef false_
+
+template <
+ class Parameters
+ , BOOST_PP_ENUM_BINARY_PARAMS(
+ BOOST_PARAMETER_MAX_ARITY, class A, = boost::parameter::void_ BOOST_PP_INTERCEPT
+ )
+>
+struct argument_pack
+{
+ typedef typename make_arg_list<
+ typename BOOST_PARAMETER_build_arg_list(
+ BOOST_PARAMETER_MAX_ARITY, make_items, typename Parameters::parameter_spec, A
+ )::type
+ , typename Parameters::deduced_list
+ , tag_keyword_arg
+ , mpl::false_
+ >::type result;
+ typedef typename mpl::first<result>::type type;
+};
+
+// Works around VC6 problem where it won't accept rvalues.
+template <class T>
+T& as_lvalue(T& value, long)
+{
+ return value;
+}
+
+template <class T>
+T const& as_lvalue(T const& value, int)
+{
+ return value;
+}
+
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+
+template <class Predicate, class T, class Args>
+struct apply_predicate
+{
+ BOOST_MPL_ASSERT((
+ mpl::and_<mpl::false_,T>
+ ));
+
+ typedef typename mpl::if_<
+ typename mpl::apply2<Predicate,T,Args>::type
+ , char
+ , int
+ >::type type;
+};
+
+template <class P>
+struct funptr_predicate
+{
+ static P p;
+
+ template <class T, class Args, class P0>
+ static typename apply_predicate<P0,T,Args>::type
+ check_predicate(type<T>, Args*, void**(*)(P0));
+
+ template <class T, class Args, class P0>
+ static typename mpl::if_<
+ is_convertible<T,P0>
+ , char
+ , int
+ >::type check_predicate(type<T>, Args*, void*(*)(P0));
+
+ template <class T, class Args>
+ struct apply
+ {
+ BOOST_STATIC_CONSTANT(bool, result =
+ sizeof(check_predicate(boost::type<T>(), (Args*)0, &p)) == 1
+ );
+
+ typedef mpl::bool_<apply<T,Args>::result> type;
+ };
+};
+
+template <>
+struct funptr_predicate<void**>
+ : mpl::always<mpl::true_>
+{};
+
+# endif
+
+}}} // namespace boost::parameter::aux
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+// From Paul Mensonides
+# define BOOST_PARAMETER_IS_NULLARY(x) \
+ BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_NULLARY_C x BOOST_PP_COMMA() 0) \
+ /**/
+# define BOOST_PARAMETER_IS_NULLARY_C() \
+ ~, 1 BOOST_PP_RPAREN() \
+ BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~ \
+ /**/
+# else
+# define BOOST_PARAMETER_IS_NULLARY(x) BOOST_PP_IS_NULLARY(x)
+# endif
+
+# define BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_static ()
+# define BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
+ BOOST_PARAMETER_IS_NULLARY( \
+ BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_,name) \
+ )
+
+# if !defined(BOOST_MSVC)
+# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static
+# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
+ BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name)
+# else
+// Workaround for MSVC preprocessor.
+//
+// When stripping static from "static f", msvc will produce
+// " f". The leading whitespace doesn't go away when pasting
+// the token with something else, so this thing is a hack to
+// strip the whitespace.
+# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static (
+# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
+ BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name))
+# define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
+ BOOST_PP_SEQ_HEAD( \
+ BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
+ )
+# endif
+
+# define BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \
+ BOOST_PP_EXPR_IF( \
+ BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
+ , static \
+ )
+
+# define BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
+ BOOST_PP_IF( \
+ BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
+ , BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC \
+ , name BOOST_PP_TUPLE_EAT(1) \
+ )(name)
+
+// Calculates [begin, end) arity range.
+
+# define BOOST_PARAMETER_ARITY_RANGE_M_optional(state) state
+# define BOOST_PARAMETER_ARITY_RANGE_M_deduced_optional(state) state
+# define BOOST_PARAMETER_ARITY_RANGE_M_required(state) BOOST_PP_INC(state)
+# define BOOST_PARAMETER_ARITY_RANGE_M_deduced_required(state) BOOST_PP_INC(state)
+
+# define BOOST_PARAMETER_ARITY_RANGE_M(s, state, x) \
+ BOOST_PP_CAT( \
+ BOOST_PARAMETER_ARITY_RANGE_M_ \
+ , BOOST_PARAMETER_FN_ARG_QUALIFIER(x) \
+ )(state)
+/**/
+
+# define BOOST_PARAMETER_ARITY_RANGE(args) \
+ ( \
+ BOOST_PP_SEQ_FOLD_LEFT(BOOST_PARAMETER_ARITY_RANGE_M, 0, args) \
+ , BOOST_PP_INC(BOOST_PP_SEQ_SIZE(args)) \
+ )
+/**/
+
+// Accessor macros for the argument specs tuple.
+# define BOOST_PARAMETER_FN_ARG_QUALIFIER(x) \
+ BOOST_PP_TUPLE_ELEM(4,0,x)
+/**/
+
+# define BOOST_PARAMETER_FN_ARG_NAME(x) \
+ BOOST_PP_TUPLE_ELEM(4,1,x)
+/**/
+
+# define BOOST_PARAMETER_FN_ARG_PRED(x) \
+ BOOST_PP_TUPLE_ELEM(4,2,x)
+/**/
+
+# define BOOST_PARAMETER_FN_ARG_DEFAULT(x) \
+ BOOST_PP_TUPLE_ELEM(4,3,x)
+/**/
+
+# define BOOST_PARAMETETER_FUNCTION_EAT_KEYWORD_QUALIFIER_out(x)
+# define BOOST_PARAMETETER_FUNCTION_EAT_KEYWORD_QUALIFIER_in_out(x)
+
+// Returns 1 if x is either "out(k)" or "in_out(k)".
+# define BOOST_PARAMETER_FUNCTION_IS_KEYWORD_QUALIFIER(x) \
+ BOOST_PP_IS_EMPTY( \
+ BOOST_PP_CAT(BOOST_PARAMETETER_FUNCTION_EAT_KEYWORD_QUALIFIER_, x) \
+ ) \
+/**/
+
+# define BOOST_PARAMETETER_FUNCTION_GET_KEYWORD_QUALIFIER_out(x) x
+# define BOOST_PARAMETETER_FUNCTION_GET_KEYWORD_QUALIFIER_in_out(x) x
+# define BOOST_PARAMETER_FUNCTION_KEYWORD_GET(x) \
+ BOOST_PP_CAT(BOOST_PARAMETETER_FUNCTION_GET_KEYWORD_QUALIFIER_, x)
+/**/
+
+// Returns the keyword of x, where x is either a keyword qualifier
+// or a keyword.
+//
+// k => k
+// out(k) => k
+// in_out(k) => k
+//
+# define BOOST_PARAMETER_FUNCTION_KEYWORD(x) \
+ BOOST_PP_IF( \
+ BOOST_PARAMETER_FUNCTION_IS_KEYWORD_QUALIFIER(x) \
+ , BOOST_PARAMETER_FUNCTION_KEYWORD_GET \
+ , x BOOST_PP_TUPLE_EAT(1) \
+ )(x)
+/**/
+
+# define BOOST_PARAMETER_FN_ARG_KEYWORD(x) \
+ BOOST_PARAMETER_FUNCTION_KEYWORD( \
+ BOOST_PARAMETER_FN_ARG_NAME(x) \
+ )
+
+// Builds forwarding functions.
+
+# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_TEMPLATE_Z(z, n) \
+ template<BOOST_PP_ENUM_PARAMS_Z(z, n, class ParameterArgumentType)>
+/**/
+
+# if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
+# define BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z(z, name, parameters, n) \
+ , typename boost::parameter::aux::match< \
+ parameters, BOOST_PP_ENUM_PARAMS(n, ParameterArgumentType) \
+ >::type = parameters()
+# else
+# define BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z(z, name, parameters, n)
+# endif
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(base) \
+ BOOST_PP_CAT( \
+ boost_param_parameters_ \
+ , BOOST_PP_CAT(__LINE__, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)) \
+ )
+
+// Produce a name for a result type metafunction for the function
+// named base
+# define BOOST_PARAMETER_FUNCTION_RESULT_NAME(base) \
+ BOOST_PP_CAT( \
+ boost_param_result_ \
+ , BOOST_PP_CAT(__LINE__,BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base)) \
+ )
+
+// Can't do boost_param_impl_ ## basee because base might start with an underscore
+// daniel: what? how is that relevant? the reason for using CAT() is to make sure
+// base is expanded. i'm not sure we need to here, but it's more stable to do it.
+# define BOOST_PARAMETER_IMPL(base) \
+ BOOST_PP_CAT(boost_param_impl,BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base))
+
+# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION00(z, n, r, data, elem) \
+ BOOST_PP_IF( \
+ n \
+ , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_TEMPLATE_Z, BOOST_PP_TUPLE_EAT(2) \
+ )(z,n) \
+ BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(7,3,data)) \
+ inline \
+ BOOST_PP_EXPR_IF(n, typename) \
+ BOOST_PARAMETER_FUNCTION_RESULT_NAME(BOOST_PP_TUPLE_ELEM(7,3,data))< \
+ BOOST_PP_EXPR_IF(n, typename) \
+ boost::parameter::aux::argument_pack< \
+ BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(BOOST_PP_TUPLE_ELEM(7,3,data)) \
+ BOOST_PP_COMMA_IF(n) \
+ BOOST_PP_IF( \
+ n, BOOST_PP_SEQ_ENUM, BOOST_PP_TUPLE_EAT(1) \
+ )(elem) \
+ >::type \
+ >::type \
+ BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(7,3,data))( \
+ BOOST_PP_IF( \
+ n \
+ , BOOST_PP_SEQ_FOR_EACH_I_R \
+ , BOOST_PP_TUPLE_EAT(4) \
+ )( \
+ r \
+ , BOOST_PARAMETER_FUNCTION_ARGUMENT \
+ , ~ \
+ , elem \
+ ) \
+ BOOST_PP_IF(n, BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z, BOOST_PP_TUPLE_EAT(4))( \
+ z \
+ , BOOST_PP_TUPLE_ELEM(7,3,data) \
+ , BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(BOOST_PP_TUPLE_ELEM(7,3,data)) \
+ , n \
+ ) \
+ ) BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(7,4,data), const) \
+ { \
+ return BOOST_PARAMETER_IMPL(BOOST_PP_TUPLE_ELEM(7,3,data))( \
+ BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(BOOST_PP_TUPLE_ELEM(7,3,data))()( \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, a) \
+ ) \
+ ); \
+ }
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION0(r, data, elem) \
+ BOOST_PARAMETER_FUNCTION_FWD_FUNCTION00( \
+ BOOST_PP_TUPLE_ELEM(7,0,data) \
+ , BOOST_PP_TUPLE_ELEM(7,1,data) \
+ , r \
+ , data \
+ , elem \
+ )
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_ARITY_0(z, n, data) \
+ BOOST_PARAMETER_FUNCTION_FWD_FUNCTION00( \
+ z, n, BOOST_PP_DEDUCE_R() \
+ , (z, n, BOOST_PP_TUPLE_REM(5) data) \
+ , ~ \
+ )
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_ARITY_N(z, n, data) \
+ BOOST_PP_SEQ_FOR_EACH( \
+ BOOST_PARAMETER_FUNCTION_FWD_FUNCTION0 \
+ , (z, n, BOOST_PP_TUPLE_REM(5) data) \
+ , BOOST_PP_SEQ_FOR_EACH_PRODUCT( \
+ BOOST_PARAMETER_FUNCTION_FWD_PRODUCT \
+ , BOOST_PP_SEQ_FIRST_N( \
+ n, BOOST_PP_TUPLE_ELEM(5,3,data) \
+ ) \
+ ) \
+ )
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTION(z, n, data) \
+ BOOST_PP_IF( \
+ n \
+ , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_ARITY_N \
+ , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_ARITY_0 \
+ )(z,n,data) \
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS0( \
+ result,name,args,const_,combinations,range \
+) \
+ BOOST_PP_REPEAT_FROM_TO( \
+ BOOST_PP_TUPLE_ELEM(2,0,range), BOOST_PP_TUPLE_ELEM(2,1,range) \
+ , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION \
+ , (result,name,const_,combinations,BOOST_PP_TUPLE_ELEM(2,1,range)) \
+ )
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS(result,name,args, const_, combinations) \
+ BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS0( \
+ result, name, args, const_, combinations, BOOST_PARAMETER_ARITY_RANGE(args) \
+ )
+/**/
+
+// Builds boost::parameter::parameters<> specialization
+# define BOOST_PARAMETER_FUNCTION_PARAMETERS_QUALIFIER_optional(tag) \
+ optional<tag
+
+# define BOOST_PARAMETER_FUNCTION_PARAMETERS_QUALIFIER_required(tag) \
+ required<tag
+
+# define BOOST_PARAMETER_FUNCTION_PARAMETERS_QUALIFIER_deduced_optional(tag) \
+ optional<boost::parameter::deduced<tag>
+
+# define BOOST_PARAMETER_FUNCTION_PARAMETERS_QUALIFIER_deduced_required(tag) \
+ required<boost::parameter::deduced<tag>
+
+# if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+
+# define BOOST_PARAMETER_FUNCTION_PARAMETERS_M(r,tag_namespace,i,elem) \
+ BOOST_PP_COMMA_IF(i) \
+ boost::parameter::BOOST_PP_CAT( \
+ BOOST_PARAMETER_FUNCTION_PARAMETERS_QUALIFIER_ \
+ , BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
+ )( \
+ tag_namespace::BOOST_PARAMETER_FUNCTION_KEYWORD( \
+ BOOST_PARAMETER_FN_ARG_KEYWORD(elem) \
+ ) \
+ ) \
+ , typename boost::parameter::aux::unwrap_predicate< \
+ void BOOST_PARAMETER_FN_ARG_PRED(elem) \
+ >::type \
+ >
+# elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+# define BOOST_PARAMETER_FUNCTION_PARAMETERS_M(r,tag_namespace,i,elem) \
+ BOOST_PP_COMMA_IF(i) \
+ boost::parameter::BOOST_PP_CAT( \
+ BOOST_PARAMETER_FUNCTION_PARAMETERS_QUALIFIER_ \
+ , BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
+ )( \
+ tag_namespace::BOOST_PARAMETER_FUNCTION_KEYWORD( \
+ BOOST_PARAMETER_FN_ARG_KEYWORD(elem) \
+ ) \
+ ) \
+ , boost::mpl::always<boost::mpl::true_> \
+ >
+# endif
+
+# define BOOST_PARAMETER_FUNCTION_PARAMETERS(tag_namespace, base, args) \
+ template <class BoostParameterDummy> \
+ struct BOOST_PP_CAT( \
+ BOOST_PP_CAT(boost_param_params_, __LINE__) \
+ , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
+ ) : boost::parameter::parameters< \
+ BOOST_PP_SEQ_FOR_EACH_I( \
+ BOOST_PARAMETER_FUNCTION_PARAMETERS_M, tag_namespace, args \
+ ) \
+ > \
+ {}; \
+ \
+ typedef BOOST_PP_CAT( \
+ BOOST_PP_CAT(boost_param_params_, __LINE__) \
+ , BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
+ )<int>
+
+// Defines result type metafunction
+# define BOOST_PARAMETER_FUNCTION_RESULT_ARG(z, _, i, x) \
+ BOOST_PP_COMMA_IF(i) class BOOST_PP_TUPLE_ELEM(3,1,x)
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_RESULT_(result, name, args) \
+ template <class Args> \
+ struct BOOST_PARAMETER_FUNCTION_RESULT_NAME(name) \
+ { \
+ typedef typename BOOST_PARAMETER_PARENTHESIZED_TYPE(result) type; \
+ };
+
+// Defines implementation function
+# define BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name) \
+ template <class Args> \
+ typename BOOST_PARAMETER_FUNCTION_RESULT_NAME(name)< \
+ Args \
+ >::type BOOST_PARAMETER_IMPL(name)(Args const& args)
+
+# define BOOST_PARAMETER_FUNCTION_IMPL_FWD(name) \
+ BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name);
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(state, arg) \
+ ( \
+ BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4, 0, state)) \
+ , BOOST_PP_SEQ_PUSH_BACK(BOOST_PP_TUPLE_ELEM(4, 1, state), arg) \
+ , BOOST_PP_TUPLE_ELEM(4, 2, state) \
+ , BOOST_PP_TUPLE_ELEM(4, 3, state) \
+ )
+
+# define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_required(state, arg) \
+ BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(state, arg)
+
+# define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(state, arg) \
+ ( \
+ BOOST_PP_TUPLE_ELEM(4, 0, state) \
+ , BOOST_PP_TUPLE_ELEM(4, 1, state) \
+ , BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4, 2, state)) \
+ , BOOST_PP_SEQ_PUSH_BACK(BOOST_PP_TUPLE_ELEM(4, 3, state), arg) \
+ )
+
+# define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_optional(state, arg) \
+ BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(state, arg)
+
+# define BOOST_PARAMETER_FUNCTION_SPLIT_ARG(s, state, arg) \
+ BOOST_PP_CAT( \
+ BOOST_PARAMETER_FUNCTION_SPLIT_ARG_ \
+ , BOOST_PARAMETER_FN_ARG_QUALIFIER(arg) \
+ )(state, arg)
+
+// Returns (required_count, required, optional_count, optionals) tuple
+# define BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args) \
+ BOOST_PP_SEQ_FOLD_LEFT( \
+ BOOST_PARAMETER_FUNCTION_SPLIT_ARG \
+ , (0,BOOST_PP_SEQ_NIL, 0,BOOST_PP_SEQ_NIL) \
+ , args \
+ )
+
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG_NAME(keyword) \
+ BOOST_PP_CAT(BOOST_PP_CAT(keyword,_),type)
+
+// Helpers used as parameters to BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS.
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_TEMPLATE_ARG(r, _, arg) \
+ , class BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG_NAME( \
+ BOOST_PARAMETER_FN_ARG_KEYWORD(arg) \
+ )
+
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG(r, _, arg) \
+ , BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG_NAME( \
+ BOOST_PARAMETER_FN_ARG_KEYWORD(arg) \
+ )& BOOST_PARAMETER_FN_ARG_KEYWORD(arg)
+
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_PARAMETER(r, _, arg) \
+ , BOOST_PARAMETER_FN_ARG_KEYWORD(arg)
+
+// Produces a name for the dispatch functions.
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name) \
+ BOOST_PP_CAT( \
+ boost_param_default_ \
+ , BOOST_PP_CAT(__LINE__, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name)) \
+ )
+
+// Helper macro used below to produce lists based on the keyword argument
+// names. macro is applied to every element. n is the number of
+// optional arguments that should be included.
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS(macro, n, split_args) \
+ BOOST_PP_SEQ_FOR_EACH( \
+ macro \
+ , ~ \
+ , BOOST_PP_TUPLE_ELEM(4,1,split_args) \
+ ) \
+ BOOST_PP_SEQ_FOR_EACH( \
+ macro \
+ , ~ \
+ , BOOST_PP_SEQ_FIRST_N( \
+ BOOST_PP_SUB(BOOST_PP_TUPLE_ELEM(4,2,split_args), n) \
+ , BOOST_PP_TUPLE_ELEM(4,3,split_args) \
+ ) \
+ )
+
+// Generates a keyword | default expression.
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT(arg, tag_namespace) \
+ boost::parameter::keyword< \
+ tag_namespace::BOOST_PARAMETER_FN_ARG_KEYWORD(arg) \
+ >::instance | boost::parameter::aux::use_default_tag()
+
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_GET_ARG(arg, tag_ns) \
+ BOOST_PARAMETER_FUNCTION_CAST( \
+ args[ \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT( \
+ arg, tag_ns \
+ ) \
+ ] \
+ , BOOST_PARAMETER_FN_ARG_PRED(arg) \
+ , Args \
+ )
+
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_BODY(name, n, split_args, tag_namespace) \
+ { \
+ return BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name)( \
+ (ResultType(*)())0 \
+ , args \
+ , 0L \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_PARAMETER \
+ , n \
+ , split_args \
+ ) \
+ , BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_GET_ARG( \
+ BOOST_PP_SEQ_ELEM( \
+ BOOST_PP_SUB(BOOST_PP_TUPLE_ELEM(4,2,split_args), n) \
+ , BOOST_PP_TUPLE_ELEM(4,3,split_args) \
+ ) \
+ , tag_namespace \
+ ) \
+ ); \
+ }
+
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_ACTUAL_DEFAULT(arg) \
+ BOOST_PARAMETER_FUNCTION_CAST( \
+ boost::parameter::aux::as_lvalue(BOOST_PARAMETER_FN_ARG_DEFAULT(arg), 0L) \
+ , BOOST_PARAMETER_FN_ARG_PRED(arg) \
+ , Args \
+ )
+
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT_BODY(name, n, split_args, tag_ns, const_) \
+ template < \
+ class ResultType \
+ , class Args \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_TEMPLATE_ARG \
+ , BOOST_PP_INC(n) \
+ , split_args \
+ ) \
+ > \
+ BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \
+ ResultType BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name)( \
+ ResultType(*)() \
+ , Args const& args \
+ , long \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG \
+ , BOOST_PP_INC(n) \
+ , split_args \
+ ) \
+ , boost::parameter::aux::use_default_tag \
+ ) BOOST_PP_EXPR_IF(const_, const) \
+ { \
+ return BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name)( \
+ (ResultType(*)())0 \
+ , args \
+ , 0L \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_PARAMETER \
+ , BOOST_PP_INC(n) \
+ , split_args \
+ ) \
+ , BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_ACTUAL_DEFAULT( \
+ BOOST_PP_SEQ_ELEM( \
+ BOOST_PP_SUB(BOOST_PP_TUPLE_ELEM(4,2,split_args), BOOST_PP_INC(n)) \
+ , BOOST_PP_TUPLE_ELEM(4,3,split_args) \
+ ) \
+ ) \
+ ); \
+ }
+
+// Produces a forwarding layer in the default evaluation machine.
+//
+// data is a tuple:
+//
+// (name, split_args)
+//
+// Where name is the base name of the function, and split_args is a tuple:
+//
+// (required_count, required_args, optional_count, required_args)
+//
+
+
+// defines the actual function body for BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION below.
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION0(z, n, data) \
+ template < \
+ class ResultType \
+ , class Args \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_TEMPLATE_ARG \
+ , n \
+ , BOOST_PP_TUPLE_ELEM(5,1,data) \
+ ) \
+ > \
+ BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(5,0,data)) \
+ ResultType BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(BOOST_PP_TUPLE_ELEM(5,0,data))( \
+ ResultType(*)() \
+ , Args const& args \
+ , int \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG \
+ , n \
+ , BOOST_PP_TUPLE_ELEM(5,1,data) \
+ ) \
+ ) BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(5,2,data), const) \
+ BOOST_PP_IF( \
+ n \
+ , BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_BODY \
+ , ; BOOST_PP_TUPLE_EAT(4) \
+ )( \
+ BOOST_PP_TUPLE_ELEM(5,0,data) \
+ , n \
+ , BOOST_PP_TUPLE_ELEM(5,1,data) \
+ , BOOST_PP_TUPLE_ELEM(5,3,data) \
+ )
+
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION(z, n, data) \
+ BOOST_PP_IF( \
+ BOOST_PP_AND( \
+ BOOST_PP_NOT(n) \
+ , BOOST_PP_TUPLE_ELEM(5,4,data) \
+ ) \
+ , BOOST_PP_TUPLE_EAT(3) \
+ , BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION0 \
+ )(z, n, data) \
+ BOOST_PP_IF( \
+ BOOST_PP_EQUAL(n, BOOST_PP_TUPLE_ELEM(4,2,BOOST_PP_TUPLE_ELEM(5,1,data))) \
+ , BOOST_PP_TUPLE_EAT(5) \
+ , BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT_BODY \
+ )( \
+ BOOST_PP_TUPLE_ELEM(5,0,data) \
+ , n \
+ , BOOST_PP_TUPLE_ELEM(5,1,data) \
+ , BOOST_PP_TUPLE_ELEM(5,3,data) \
+ , BOOST_PP_TUPLE_ELEM(5,2,data) \
+ )
+
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_GET_ARG(r, tag_ns, arg) \
+ , BOOST_PARAMETER_FUNCTION_CAST( \
+ args[ \
+ boost::parameter::keyword<tag_ns::BOOST_PARAMETER_FN_ARG_KEYWORD(arg)>::instance \
+ ] \
+ , BOOST_PARAMETER_FN_ARG_PRED(arg) \
+ , Args \
+ )
+
+// Generates the function template that recives a ArgumentPack, and then
+// goes on to call the layers of overloads generated by
+// BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER.
+# define BOOST_PARAMETER_FUNCTION_INITIAL_DISPATCH_FUNCTION(name, split_args, const_, tag_ns) \
+ template <class Args> \
+ typename BOOST_PARAMETER_FUNCTION_RESULT_NAME(name)<Args>::type \
+ BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \
+ BOOST_PARAMETER_IMPL(name)(Args const& args) BOOST_PP_EXPR_IF(const_, const) \
+ { \
+ return BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name)( \
+ (typename BOOST_PARAMETER_FUNCTION_RESULT_NAME(name)<Args>::type(*)())0 \
+ , args \
+ , 0L \
+ \
+ BOOST_PP_SEQ_FOR_EACH( \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_GET_ARG \
+ , tag_ns \
+ , BOOST_PP_TUPLE_ELEM(4,1,split_args) \
+ ) \
+ \
+ ); \
+ }
+
+// Helper for BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER below.
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER_AUX( \
+ name, split_args, skip_fwd_decl, const_, tag_namespace \
+ ) \
+ BOOST_PP_REPEAT_FROM_TO( \
+ 0 \
+ , BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4, 2, split_args)) \
+ , BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION \
+ , (name, split_args, const_, tag_namespace, skip_fwd_decl) \
+ ) \
+ \
+ BOOST_PARAMETER_FUNCTION_INITIAL_DISPATCH_FUNCTION(name, split_args, const_, tag_namespace) \
+\
+ template < \
+ class ResultType \
+ , class Args \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_TEMPLATE_ARG \
+ , 0 \
+ , split_args \
+ ) \
+ > \
+ BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \
+ ResultType BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name)( \
+ ResultType(*)() \
+ , Args const& \
+ , int \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG \
+ , 0 \
+ , split_args \
+ ) \
+ ) BOOST_PP_EXPR_IF(const_, const)
+
+// Generates a bunch of forwarding functions that each extract
+// one more argument.
+# define BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER(name, args, skip_fwd_decl, const_, tag_ns) \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER_AUX( \
+ name, BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args), skip_fwd_decl, const_, tag_ns \
+ )
+/**/
+
+// Defines the result metafunction and the parameters specialization.
+# define BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_FUNCTION_RESULT_(result, name, args) \
+ \
+ BOOST_PARAMETER_FUNCTION_PARAMETERS(tag_namespace, name, args) \
+ BOOST_PARAMETER_FUNCTION_PARAMETERS_NAME(name); \
+
+// Helper for BOOST_PARAMETER_FUNCTION below.
+# define BOOST_PARAMETER_FUNCTION_AUX(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name); \
+\
+ BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS( \
+ result, name, args, 0 \
+ , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \
+ ) \
+ \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER(name, args, 0, 0, tag_namespace)
+
+// Defines a Boost.Parameter enabled function with the new syntax.
+# define BOOST_PARAMETER_FUNCTION(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_FUNCTION_AUX( \
+ result, name, tag_namespace \
+ , BOOST_PARAMETER_FLATTEN(3, 2, 3, args) \
+ ) \
+/**/
+
+// Defines a Boost.Parameter enabled function.
+# define BOOST_PARAMETER_BASIC_FUNCTION_AUX(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \
+ \
+ BOOST_PARAMETER_FUNCTION_IMPL_FWD(name) \
+ \
+ BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS( \
+ result, name, args, 0 \
+ , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \
+ ) \
+ \
+ BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name)
+
+# define BOOST_PARAMETER_BASIC_FUNCTION(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_BASIC_FUNCTION_AUX( \
+ result, name, tag_namespace \
+ , BOOST_PARAMETER_FLATTEN(2, 2, 3, args) \
+ ) \
+/**/
+
+// Defines a Boost.Parameter enabled member function.
+# define BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX(result, name, tag_namespace, args, const_) \
+ BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \
+ \
+ BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS( \
+ result, name, args, const_ \
+ , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \
+ ) \
+ \
+ BOOST_PARAMETER_FUNCTION_IMPL_HEAD(name) BOOST_PP_EXPR_IF(const_, const) \
+/**/
+
+# define BOOST_PARAMETER_BASIC_MEMBER_FUNCTION(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX( \
+ result, name, tag_namespace \
+ , BOOST_PARAMETER_FLATTEN(2, 2, 3, args) \
+ , 0 \
+ )
+/**/
+
+# define BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_BASIC_MEMBER_FUNCTION_AUX( \
+ result, name, tag_namespace \
+ , BOOST_PARAMETER_FLATTEN(2, 2, 3, args) \
+ , 1 \
+ )
+/**/
+
+
+
+# define BOOST_PARAMETER_MEMBER_FUNCTION_AUX(result, name, tag_namespace, const_, args) \
+ BOOST_PARAMETER_FUNCTION_HEAD(result, name, tag_namespace, args) \
+\
+ BOOST_PARAMETER_FUNCTION_FWD_FUNCTIONS( \
+ result, name, args, const_ \
+ , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \
+ ) \
+ \
+ BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER(name, args, 1, const_, tag_namespace)
+
+// Defines a Boost.Parameter enabled function with the new syntax.
+# define BOOST_PARAMETER_MEMBER_FUNCTION(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_MEMBER_FUNCTION_AUX( \
+ result, name, tag_namespace, 0 \
+ , BOOST_PARAMETER_FLATTEN(3, 2, 3, args) \
+ ) \
+/**/
+
+# define BOOST_PARAMETER_CONST_MEMBER_FUNCTION(result, name, tag_namespace, args) \
+ BOOST_PARAMETER_MEMBER_FUNCTION_AUX( \
+ result, name, tag_namespace, 1 \
+ , BOOST_PARAMETER_FLATTEN(3, 2, 3, args) \
+ ) \
+/**/
+
+// Defines a Boost.Parameter enabled constructor.
+
+# define BOOST_PARAMETER_FUNCTION_ARGUMENT(r, _, i, elem) \
+ BOOST_PP_COMMA_IF(i) elem& BOOST_PP_CAT(a, i)
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR00(z, n, r, data, elem) \
+ BOOST_PP_IF( \
+ n \
+ , BOOST_PARAMETER_FUNCTION_FWD_FUNCTION_TEMPLATE_Z, BOOST_PP_TUPLE_EAT(2) \
+ )(z, n) \
+ BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n,1), explicit) \
+ BOOST_PP_TUPLE_ELEM(6,2,data)( \
+ BOOST_PP_IF( \
+ n \
+ , BOOST_PP_SEQ_FOR_EACH_I_R \
+ , BOOST_PP_TUPLE_EAT(4) \
+ )( \
+ r \
+ , BOOST_PARAMETER_FUNCTION_ARGUMENT \
+ , ~ \
+ , elem \
+ ) \
+ BOOST_PP_IF(n, BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z, BOOST_PP_TUPLE_EAT(4))( \
+ z \
+ , BOOST_PP_TUPLE_ELEM(6,3,data) \
+ , BOOST_PP_CAT(constructor_parameters, __LINE__) \
+ , n \
+ ) \
+ ) \
+ : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(6,3,data)) ( \
+ BOOST_PP_CAT(constructor_parameters, __LINE__)()( \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, a) \
+ ) \
+ ) \
+ {}
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR0(r, data, elem) \
+ BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR00( \
+ BOOST_PP_TUPLE_ELEM(6,0,data) \
+ , BOOST_PP_TUPLE_ELEM(6,1,data) \
+ , r \
+ , data \
+ , elem \
+ )
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_PRODUCT(r, product) \
+ (product)
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR_ARITY_0(z, n, data) \
+ BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR00( \
+ z, n, BOOST_PP_DEDUCE_R() \
+ , (z, n, BOOST_PP_TUPLE_REM(4) data) \
+ , ~ \
+ )
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR_ARITY_N(z, n, data) \
+ BOOST_PP_SEQ_FOR_EACH( \
+ BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR0 \
+ , (z, n, BOOST_PP_TUPLE_REM(4) data) \
+ , BOOST_PP_SEQ_FOR_EACH_PRODUCT( \
+ BOOST_PARAMETER_FUNCTION_FWD_PRODUCT \
+ , BOOST_PP_SEQ_FIRST_N( \
+ n, BOOST_PP_TUPLE_ELEM(4,2,data) \
+ ) \
+ ) \
+ )
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR(z, n, data) \
+ BOOST_PP_IF( \
+ n \
+ , BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR_ARITY_N \
+ , BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR_ARITY_0 \
+ )(z,n,data) \
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTORS0(class_,base,args,combinations,range) \
+ BOOST_PP_REPEAT_FROM_TO( \
+ BOOST_PP_TUPLE_ELEM(2,0,range), BOOST_PP_TUPLE_ELEM(2,1,range) \
+ , BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTOR \
+ , (class_,base,combinations,BOOST_PP_TUPLE_ELEM(2,1,range)) \
+ )
+/**/
+
+# define BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTORS(class_,base,args,combinations) \
+ BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTORS0( \
+ class_, base, args, combinations, BOOST_PARAMETER_ARITY_RANGE(args) \
+ )
+/**/
+
+# define BOOST_PARAMETER_CONSTRUCTOR_AUX(class_, base, tag_namespace, args) \
+ BOOST_PARAMETER_FUNCTION_PARAMETERS(tag_namespace, ctor, args) \
+ BOOST_PP_CAT(constructor_parameters, __LINE__); \
+\
+ BOOST_PARAMETER_FUNCTION_FWD_CONSTRUCTORS( \
+ class_, base, args \
+ , BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \
+ ) \
+/**/
+
+# define BOOST_PARAMETER_CONSTRUCTOR(class_, base, tag_namespace, args) \
+ BOOST_PARAMETER_CONSTRUCTOR_AUX( \
+ class_, base, tag_namespace \
+ , BOOST_PARAMETER_FLATTEN(2, 2, 3, args) \
+ )
+/**/
+
+# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+# define BOOST_PARAMETER_FUNCTION_FWD_COMBINATION(r, _, i, elem) \
+ (BOOST_PP_IF( \
+ BOOST_PARAMETER_FUNCTION_IS_KEYWORD_QUALIFIER( \
+ BOOST_PARAMETER_FN_ARG_NAME(elem) \
+ ) \
+ , (const ParameterArgumentType ## i)(ParameterArgumentType ## i) \
+ , (const ParameterArgumentType ## i) \
+ ))
+// No partial ordering. This feature doesn't work.
+# else
+# define BOOST_PARAMETER_FUNCTION_FWD_COMBINATION(r, _, i, elem) \
+ (BOOST_PP_IF( \
+ BOOST_PARAMETER_FUNCTION_IS_KEYWORD_QUALIFIER( \
+ BOOST_PARAMETER_FN_ARG_NAME(elem) \
+ ) \
+ , (ParameterArgumentType ## i) \
+ , (const ParameterArgumentType ## i) \
+ ))
+# endif
+
+# define BOOST_PARAMETER_FUNCTION_FWD_COMBINATIONS(args) \
+ BOOST_PP_SEQ_FOR_EACH_I(BOOST_PARAMETER_FUNCTION_FWD_COMBINATION, ~, args)
+
+#endif // BOOST_PARAMETER_PREPROCESSOR_060206_HPP
+
--- /dev/null
+// Copyright Daniel Wallin 2006. Use, modification and distribution is
+// subject to the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_PARAMETER_VALUE_TYPE_060921_HPP
+# define BOOST_PARAMETER_VALUE_TYPE_060921_HPP
+
+# include <boost/mpl/apply.hpp>
+# include <boost/mpl/assert.hpp>
+# include <boost/mpl/and.hpp>
+# include <boost/parameter/aux_/result_of0.hpp>
+# include <boost/parameter/aux_/void.hpp>
+# include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace parameter {
+
+// A metafunction that, given an argument pack, returns the type of
+// the parameter identified by the given keyword. If no such
+// parameter has been specified, returns Default
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+template <class Parameters, class Keyword, class Default>
+struct value_type0
+{
+ typedef typename mpl::apply_wrap3<
+ typename Parameters::binding,Keyword,Default,mpl::false_
+ >::type type;
+
+ BOOST_MPL_ASSERT_NOT((
+ mpl::and_<
+ is_same<Default, void_>
+ , is_same<type, void_>
+ >
+ ));
+};
+# endif
+
+template <class Parameters, class Keyword, class Default = void_>
+struct value_type
+{
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ typedef typename mpl::eval_if<
+ mpl::is_placeholder<Parameters>
+ , mpl::identity<int>
+ , value_type0<Parameters,Keyword,Default>
+ >::type type;
+# else
+ typedef typename mpl::apply_wrap3<
+ typename Parameters::binding,Keyword,Default,mpl::false_
+ >::type type;
+
+ BOOST_MPL_ASSERT_NOT((
+ mpl::and_<
+ is_same<Default, void_>
+ , is_same<type, void_>
+ >
+ ));
+# endif
+
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(3,value_type,(Parameters,Keyword,Default))
+};
+
+// A metafunction that, given an argument pack, returns the type of
+// the parameter identified by the given keyword. If no such
+// parameter has been specified, returns the type returned by invoking
+// DefaultFn
+template <class Parameters, class Keyword, class DefaultFn>
+struct lazy_value_type
+{
+ typedef typename mpl::apply_wrap3<
+ typename Parameters::binding
+ , Keyword
+ , typename aux::result_of0<DefaultFn>::type
+ , mpl::false_
+ >::type type;
+};
+
+
+}} // namespace boost::parameter
+
+#endif // BOOST_PARAMETER_VALUE_TYPE_060921_HPP
+
--- /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_ARITHMETIC_HPP
+# define BOOST_PREPROCESSOR_ARITHMETIC_HPP
+#
+# include <boost/preprocessor/arithmetic/add.hpp>
+# include <boost/preprocessor/arithmetic/dec.hpp>
+# include <boost/preprocessor/arithmetic/div.hpp>
+# include <boost/preprocessor/arithmetic/inc.hpp>
+# include <boost/preprocessor/arithmetic/mod.hpp>
+# include <boost/preprocessor/arithmetic/mul.hpp>
+# include <boost/preprocessor/arithmetic/sub.hpp>
+#
+# 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_ARITHMETIC_DIV_HPP
+# define BOOST_PREPROCESSOR_ARITHMETIC_DIV_HPP
+#
+# include <boost/preprocessor/arithmetic/detail/div_base.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+#
+# /* BOOST_PP_DIV */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_DIV(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_DIV_BASE(x, y))
+# else
+# define BOOST_PP_DIV(x, y) BOOST_PP_DIV_I(x, y)
+# define BOOST_PP_DIV_I(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_DIV_BASE(x, y))
+# endif
+#
+# /* BOOST_PP_DIV_D */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_DIV_D(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_DIV_BASE_D(d, x, y))
+# else
+# define BOOST_PP_DIV_D(d, x, y) BOOST_PP_DIV_D_I(d, x, y)
+# define BOOST_PP_DIV_D_I(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_DIV_BASE_D(d, x, y))
+# 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_ARITHMETIC_MUL_HPP
+# define BOOST_PREPROCESSOR_ARITHMETIC_MUL_HPP
+#
+# include <boost/preprocessor/arithmetic/add.hpp>
+# include <boost/preprocessor/arithmetic/dec.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/control/while.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_MUL */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_MUL(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
+# else
+# define BOOST_PP_MUL(x, y) BOOST_PP_MUL_I(x, y)
+# define BOOST_PP_MUL_I(x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
+# endif
+#
+# define BOOST_PP_MUL_P(d, rxy) BOOST_PP_TUPLE_ELEM(3, 2, rxy)
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_MUL_O(d, rxy) BOOST_PP_MUL_O_IM(d, BOOST_PP_TUPLE_REM_3 rxy)
+# define BOOST_PP_MUL_O_IM(d, im) BOOST_PP_MUL_O_I(d, im)
+# else
+# define BOOST_PP_MUL_O(d, rxy) BOOST_PP_MUL_O_I(d, BOOST_PP_TUPLE_ELEM(3, 0, rxy), BOOST_PP_TUPLE_ELEM(3, 1, rxy), BOOST_PP_TUPLE_ELEM(3, 2, rxy))
+# endif
+#
+# define BOOST_PP_MUL_O_I(d, r, x, y) (BOOST_PP_ADD_D(d, r, x), x, BOOST_PP_DEC(y))
+#
+# /* BOOST_PP_MUL_D */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_MUL_D(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
+# else
+# define BOOST_PP_MUL_D(d, x, y) BOOST_PP_MUL_D_I(d, x, y)
+# define BOOST_PP_MUL_D_I(d, x, y) BOOST_PP_TUPLE_ELEM(3, 0, BOOST_PP_WHILE_ ## d(BOOST_PP_MUL_P, BOOST_PP_MUL_O, (0, x, y)))
+# 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_COMPARISON_EQUAL_HPP
+# define BOOST_PREPROCESSOR_COMPARISON_EQUAL_HPP
+#
+# include <boost/preprocessor/comparison/not_equal.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/logical/compl.hpp>
+#
+# /* BOOST_PP_EQUAL */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_EQUAL(x, y) BOOST_PP_COMPL(BOOST_PP_NOT_EQUAL(x, y))
+# else
+# define BOOST_PP_EQUAL(x, y) BOOST_PP_EQUAL_I(x, y)
+# define BOOST_PP_EQUAL_I(x, y) BOOST_PP_COMPL(BOOST_PP_NOT_EQUAL(x, y))
+# endif
+#
+# /* BOOST_PP_EQUAL_D */
+#
+# define BOOST_PP_EQUAL_D(d, x, y) BOOST_PP_EQUAL(x, y)
+#
+# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_DETAIL_IS_NULLARY_HPP
+# define BOOST_PREPROCESSOR_DETAIL_IS_NULLARY_HPP
+#
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/detail/check.hpp>
+#
+# /* BOOST_PP_IS_NULLARY */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_IS_NULLARY(x) BOOST_PP_CHECK(x, BOOST_PP_IS_NULLARY_CHECK)
+# else
+# define BOOST_PP_IS_NULLARY(x) BOOST_PP_IS_NULLARY_I(x)
+# define BOOST_PP_IS_NULLARY_I(x) BOOST_PP_CHECK(x, BOOST_PP_IS_NULLARY_CHECK)
+# endif
+#
+# define BOOST_PP_IS_NULLARY_CHECK() 1
+# define BOOST_PP_CHECK_RESULT_BOOST_PP_IS_NULLARY_CHECK 0, BOOST_PP_NIL
+#
+# endif
+++ /dev/null
-# /* **************************************************************************
-# * *
-# * (C) Copyright Paul Mensonides 2002.
-# * Distributed under the Boost Software License, Version 1.0. (See
-# * accompanying file LICENSE_1_0.txt or copy at
-# * http://www.boost.org/LICENSE_1_0.txt)
-# * *
-# ************************************************************************** */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_DETAIL_IS_UNARY_HPP
-# define BOOST_PREPROCESSOR_DETAIL_IS_UNARY_HPP
-#
-# include <boost/preprocessor/config/config.hpp>
-# include <boost/preprocessor/detail/check.hpp>
-#
-# /* BOOST_PP_IS_UNARY */
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define BOOST_PP_IS_UNARY(x) BOOST_PP_CHECK(x, BOOST_PP_IS_UNARY_CHECK)
-# else
-# define BOOST_PP_IS_UNARY(x) BOOST_PP_IS_UNARY_I(x)
-# define BOOST_PP_IS_UNARY_I(x) BOOST_PP_CHECK(x, BOOST_PP_IS_UNARY_CHECK)
-# endif
-#
-# define BOOST_PP_IS_UNARY_CHECK(a) 1
-# define BOOST_PP_CHECK_RESULT_BOOST_PP_IS_UNARY_CHECK 0, BOOST_PP_NIL
-#
-# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_FOR_HPP
+# define BOOST_PREPROCESSOR_FOR_HPP
+#
+# include <boost/preprocessor/repetition/for.hpp>
+#
+# endif
+++ /dev/null
-# /* **************************************************************************
-# * *
-# * (C) Copyright Paul Mensonides 2002.
-# * Distributed under the Boost Software License, Version 1.0. (See
-# * accompanying file LICENSE_1_0.txt or copy at
-# * http://www.boost.org/LICENSE_1_0.txt)
-# * *
-# ************************************************************************** */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_IF_HPP
-# define BOOST_PREPROCESSOR_IF_HPP
-#
-# include <boost/preprocessor/control/if.hpp>
-#
-# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_ITERATION_HPP
+# define BOOST_PREPROCESSOR_ITERATION_HPP
+#
+# include <boost/preprocessor/iteration/iterate.hpp>
+# include <boost/preprocessor/iteration/local.hpp>
+# include <boost/preprocessor/iteration/self.hpp>
+#
+# endif
+++ /dev/null
-# /* **************************************************************************
-# * *
-# * (C) Copyright Paul Mensonides 2002.
-# * Distributed under the Boost Software License, Version 1.0. (See
-# * accompanying file LICENSE_1_0.txt or copy at
-# * http://www.boost.org/LICENSE_1_0.txt)
-# * *
-# ************************************************************************** */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_LOGICAL_BITOR_HPP
-# define BOOST_PREPROCESSOR_LOGICAL_BITOR_HPP
-#
-# include <boost/preprocessor/config/config.hpp>
-#
-# /* BOOST_PP_BITOR */
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
-# define BOOST_PP_BITOR(x, y) BOOST_PP_BITOR_I(x, y)
-# else
-# define BOOST_PP_BITOR(x, y) BOOST_PP_BITOR_OO((x, y))
-# define BOOST_PP_BITOR_OO(par) BOOST_PP_BITOR_I ## par
-# endif
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
-# define BOOST_PP_BITOR_I(x, y) BOOST_PP_BITOR_ ## x ## y
-# else
-# define BOOST_PP_BITOR_I(x, y) BOOST_PP_BITOR_ID(BOOST_PP_BITOR_ ## x ## y)
-# define BOOST_PP_BITOR_ID(id) id
-# endif
-#
-# define BOOST_PP_BITOR_00 0
-# define BOOST_PP_BITOR_01 1
-# define BOOST_PP_BITOR_10 1
-# define BOOST_PP_BITOR_11 1
-#
-# 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_LOGICAL_OR_HPP
-# define BOOST_PREPROCESSOR_LOGICAL_OR_HPP
-#
-# include <boost/preprocessor/config/config.hpp>
-# include <boost/preprocessor/logical/bool.hpp>
-# include <boost/preprocessor/logical/bitor.hpp>
-#
-# /* BOOST_PP_OR */
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define BOOST_PP_OR(p, q) BOOST_PP_BITOR(BOOST_PP_BOOL(p), BOOST_PP_BOOL(q))
-# else
-# define BOOST_PP_OR(p, q) BOOST_PP_OR_I(p, q)
-# define BOOST_PP_OR_I(p, q) BOOST_PP_BITOR(BOOST_PP_BOOL(p), BOOST_PP_BOOL(q))
-# endif
-#
-# endif
+++ /dev/null
-# /* **************************************************************************
-# * *
-# * (C) Copyright Paul Mensonides 2002.
-# * Distributed under the Boost Software License, Version 1.0. (See
-# * accompanying file LICENSE_1_0.txt or copy at
-# * http://www.boost.org/LICENSE_1_0.txt)
-# * *
-# ************************************************************************** */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_REPEAT_FROM_TO_HPP
-# define BOOST_PREPROCESSOR_REPEAT_FROM_TO_HPP
-#
-# include <boost/preprocessor/repetition/repeat_from_to.hpp>
-#
-# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_REPETITION_HPP
+# define BOOST_PREPROCESSOR_REPETITION_HPP
+#
+# include <boost/preprocessor/repetition/deduce_r.hpp>
+# include <boost/preprocessor/repetition/deduce_z.hpp>
+# include <boost/preprocessor/repetition/enum.hpp>
+# include <boost/preprocessor/repetition/enum_binary_params.hpp>
+# include <boost/preprocessor/repetition/enum_params.hpp>
+# include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+# include <boost/preprocessor/repetition/enum_params_with_defaults.hpp>
+# include <boost/preprocessor/repetition/enum_shifted.hpp>
+# include <boost/preprocessor/repetition/enum_shifted_binary_params.hpp>
+# include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+# include <boost/preprocessor/repetition/enum_trailing.hpp>
+# include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
+# include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+# include <boost/preprocessor/repetition/for.hpp>
+# include <boost/preprocessor/repetition/repeat.hpp>
+# include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#
+# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_REPETITION_DEDUCE_R_HPP
+# define BOOST_PREPROCESSOR_REPETITION_DEDUCE_R_HPP
+#
+# include <boost/preprocessor/detail/auto_rec.hpp>
+# include <boost/preprocessor/repetition/for.hpp>
+#
+# /* BOOST_PP_DEDUCE_R */
+#
+# define BOOST_PP_DEDUCE_R() BOOST_PP_AUTO_REC(BOOST_PP_FOR_P, 256)
+#
+# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_REPETITION_DEDUCE_Z_HPP
+# define BOOST_PREPROCESSOR_REPETITION_DEDUCE_Z_HPP
+#
+# include <boost/preprocessor/detail/auto_rec.hpp>
+# include <boost/preprocessor/repetition/repeat.hpp>
+#
+# /* BOOST_PP_DEDUCE_Z */
+#
+# define BOOST_PP_DEDUCE_Z() BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4)
+#
+# 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_REPETITION_ENUM_PARAMS_WITH_DEFAULTS_HPP
+# define BOOST_PREPROCESSOR_REPETITION_ENUM_PARAMS_WITH_DEFAULTS_HPP
+#
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#
+# /* BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS */
+#
+# define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(count, param, def) BOOST_PP_ENUM_BINARY_PARAMS(count, param, = def)
+#
+# 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_REPETITION_ENUM_SHIFTED_HPP
+# define BOOST_PREPROCESSOR_REPETITION_ENUM_SHIFTED_HPP
+#
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/arithmetic/dec.hpp>
+# include <boost/preprocessor/arithmetic/inc.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/debug/error.hpp>
+# include <boost/preprocessor/detail/auto_rec.hpp>
+# include <boost/preprocessor/punctuation/comma_if.hpp>
+# include <boost/preprocessor/repetition/repeat.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_ENUM_SHIFTED */
+#
+# if 0
+# define BOOST_PP_ENUM_SHIFTED(count, macro, data)
+# endif
+#
+# define BOOST_PP_ENUM_SHIFTED BOOST_PP_CAT(BOOST_PP_ENUM_SHIFTED_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4))
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_ENUM_SHIFTED_1(c, m, d) BOOST_PP_REPEAT_1(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_1, (m, d))
+# define BOOST_PP_ENUM_SHIFTED_2(c, m, d) BOOST_PP_REPEAT_2(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_2, (m, d))
+# define BOOST_PP_ENUM_SHIFTED_3(c, m, d) BOOST_PP_REPEAT_3(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_3, (m, d))
+# else
+# define BOOST_PP_ENUM_SHIFTED_1(c, m, d) BOOST_PP_ENUM_SHIFTED_1_I(c, m, d)
+# define BOOST_PP_ENUM_SHIFTED_2(c, m, d) BOOST_PP_ENUM_SHIFTED_1_2(c, m, d)
+# define BOOST_PP_ENUM_SHIFTED_3(c, m, d) BOOST_PP_ENUM_SHIFTED_1_3(c, m, d)
+# define BOOST_PP_ENUM_SHIFTED_1_I(c, m, d) BOOST_PP_REPEAT_1(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_1, (m, d))
+# define BOOST_PP_ENUM_SHIFTED_2_I(c, m, d) BOOST_PP_REPEAT_2(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_2, (m, d))
+# define BOOST_PP_ENUM_SHIFTED_3_I(c, m, d) BOOST_PP_REPEAT_3(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_3, (m, d))
+# endif
+#
+# define BOOST_PP_ENUM_SHIFTED_4(c, m, d) BOOST_PP_ERROR(0x0003)
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_ENUM_SHIFTED_M_1(z, n, md) BOOST_PP_ENUM_SHIFTED_M_1_IM(z, n, BOOST_PP_TUPLE_REM_2 md)
+# define BOOST_PP_ENUM_SHIFTED_M_2(z, n, md) BOOST_PP_ENUM_SHIFTED_M_2_IM(z, n, BOOST_PP_TUPLE_REM_2 md)
+# define BOOST_PP_ENUM_SHIFTED_M_3(z, n, md) BOOST_PP_ENUM_SHIFTED_M_3_IM(z, n, BOOST_PP_TUPLE_REM_2 md)
+# define BOOST_PP_ENUM_SHIFTED_M_1_IM(z, n, im) BOOST_PP_ENUM_SHIFTED_M_1_I(z, n, im)
+# define BOOST_PP_ENUM_SHIFTED_M_2_IM(z, n, im) BOOST_PP_ENUM_SHIFTED_M_2_I(z, n, im)
+# define BOOST_PP_ENUM_SHIFTED_M_3_IM(z, n, im) BOOST_PP_ENUM_SHIFTED_M_3_I(z, n, im)
+# else
+# define BOOST_PP_ENUM_SHIFTED_M_1(z, n, md) BOOST_PP_ENUM_SHIFTED_M_1_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md))
+# define BOOST_PP_ENUM_SHIFTED_M_2(z, n, md) BOOST_PP_ENUM_SHIFTED_M_2_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md))
+# define BOOST_PP_ENUM_SHIFTED_M_3(z, n, md) BOOST_PP_ENUM_SHIFTED_M_3_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md))
+# endif
+#
+# define BOOST_PP_ENUM_SHIFTED_M_1_I(z, n, m, d) BOOST_PP_COMMA_IF(n) m(z, BOOST_PP_INC(n), d)
+# define BOOST_PP_ENUM_SHIFTED_M_2_I(z, n, m, d) BOOST_PP_COMMA_IF(n) m(z, BOOST_PP_INC(n), d)
+# define BOOST_PP_ENUM_SHIFTED_M_3_I(z, n, m, d) BOOST_PP_COMMA_IF(n) m(z, BOOST_PP_INC(n), d)
+#
+# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2005. *
+# * Distributed under the Boost Software License, Version 1.0. (See *
+# * accompanying file LICENSE_1_0.txt or copy at *
+# * http://www.boost.org/LICENSE_1_0.txt) *
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_REPETITION_ENUM_SHIFTED_BINARY_PARAMS_HPP
+# define BOOST_PREPROCESSOR_REPETITION_ENUM_SHIFTED_BINARY_PARAMS_HPP
+#
+# include <boost/preprocessor/arithmetic/dec.hpp>
+# include <boost/preprocessor/arithmetic/inc.hpp>
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/punctuation/comma_if.hpp>
+# include <boost/preprocessor/repetition/repeat.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(count, p1, p2) BOOST_PP_REPEAT(BOOST_PP_DEC(count), BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
+# else
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(count, p1, p2) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_I(count, p1, p2)
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_I(count, p1, p2) BOOST_PP_REPEAT(BOOST_PP_DEC(count), BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
+# endif
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_IM(z, n, BOOST_PP_TUPLE_REM_2 pp)
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_IM(z, n, im) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_I(z, n, im)
+# else
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, pp), BOOST_PP_TUPLE_ELEM(2, 1, pp))
+# endif
+#
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M_I(z, n, p1, p2) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(p1, BOOST_PP_INC(n)) BOOST_PP_CAT(p2, BOOST_PP_INC(n))
+#
+# /* BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(BOOST_PP_DEC(count), BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
+# else
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z_I(z, count, p1, p2)
+# define BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_Z_I(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(BOOST_PP_DEC(count), BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS_M, (p1, p2))
+# endif
+#
+# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_REPETITION_ENUM_TRAILING_BINARY_PARAMS_HPP
+# define BOOST_PREPROCESSOR_REPETITION_ENUM_TRAILING_BINARY_PARAMS_HPP
+#
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/repetition/repeat.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_ENUM_TRAILING_BINARY_PARAMS */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(count, p1, p2) BOOST_PP_REPEAT(count, BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M, (p1, p2))
+# else
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(count, p1, p2) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_I(count, p1, p2)
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_I(count, p1, p2) BOOST_PP_REPEAT(count, BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M, (p1, p2))
+# endif
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_IM(z, n, BOOST_PP_TUPLE_REM_2 pp)
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_IM(z, n, im) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_I(z, n, im)
+# else
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, pp), BOOST_PP_TUPLE_ELEM(2, 1, pp))
+# endif
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_I(z, n, p1, p2) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_II(z, n, p1, p2)
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_II(z, n, p1, p2) , p1 ## n p2 ## n
+# else
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M_I(z, n, p1, p2) , BOOST_PP_CAT(p1, n) BOOST_PP_CAT(p2, n)
+# endif
+#
+# /* BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(count, BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M, (p1, p2))
+# else
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z_I(z, count, p1, p2)
+# define BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z_I(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(count, BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_M, (p1, p2))
+# 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_SELECTION_MAX_HPP
+# define BOOST_PREPROCESSOR_SELECTION_MAX_HPP
+#
+# include <boost/preprocessor/comparison/less_equal.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/control/iif.hpp>
+#
+# /* BOOST_PP_MAX */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_MAX(x, y) BOOST_PP_IIF(BOOST_PP_LESS_EQUAL(x, y), y, x)
+# else
+# define BOOST_PP_MAX(x, y) BOOST_PP_MAX_I(x, y)
+# define BOOST_PP_MAX_I(x, y) BOOST_PP_IIF(BOOST_PP_LESS_EQUAL(x, y), y, x)
+# endif
+#
+# /* BOOST_PP_MAX_D */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_MAX_D(d, x, y) BOOST_PP_IIF(BOOST_PP_LESS_EQUAL_D(d, x, y), y, x)
+# else
+# define BOOST_PP_MAX_D(d, x, y) BOOST_PP_MAX_D_I(d, x, y)
+# define BOOST_PP_MAX_D_I(d, x, y) BOOST_PP_IIF(BOOST_PP_LESS_EQUAL_D(d, x, y), y, x)
+# endif
+#
+# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_SEQ_FOR_EACH_HPP
+# define BOOST_PREPROCESSOR_SEQ_FOR_EACH_HPP
+#
+# include <boost/preprocessor/arithmetic/dec.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/control/if.hpp>
+# include <boost/preprocessor/control/iif.hpp>
+# include <boost/preprocessor/repetition/for.hpp>
+# include <boost/preprocessor/seq/seq.hpp>
+# include <boost/preprocessor/seq/size.hpp>
+# include <boost/preprocessor/seq/detail/is_empty.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_SEQ_FOR_EACH */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK(macro, data, seq)
+# else
+# define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq)
+# define BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK(macro, data, seq)
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC(macro, data, seq) BOOST_PP_FOR((macro, data, seq, BOOST_PP_SEQ_SIZE(seq)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
+# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY(macro, data, seq)
+#
+# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK(macro, data, seq) \
+ BOOST_PP_IIF \
+ ( \
+ BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
+ BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC, \
+ BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY \
+ ) \
+ (macro, data, seq) \
+/**/
+#
+# define BOOST_PP_SEQ_FOR_EACH_P(r, x) BOOST_PP_TUPLE_ELEM(4, 3, x)
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I x
+# else
+# define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I(BOOST_PP_TUPLE_ELEM(4, 0, x), BOOST_PP_TUPLE_ELEM(4, 1, x), BOOST_PP_TUPLE_ELEM(4, 2, x), BOOST_PP_TUPLE_ELEM(4, 3, x))
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_O_I(macro, data, seq, sz) \
+ BOOST_PP_SEQ_FOR_EACH_O_I_DEC(macro, data, seq, BOOST_PP_DEC(sz)) \
+/**/
+# define BOOST_PP_SEQ_FOR_EACH_O_I_DEC(macro, data, seq, sz) \
+ ( \
+ macro, \
+ data, \
+ BOOST_PP_IF \
+ ( \
+ sz, \
+ BOOST_PP_SEQ_FOR_EACH_O_I_TAIL, \
+ BOOST_PP_SEQ_FOR_EACH_O_I_NIL \
+ ) \
+ (seq), \
+ sz \
+ ) \
+/**/
+# define BOOST_PP_SEQ_FOR_EACH_O_I_TAIL(seq) BOOST_PP_SEQ_TAIL(seq)
+# define BOOST_PP_SEQ_FOR_EACH_O_I_NIL(seq) BOOST_PP_NIL
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_IM(r, BOOST_PP_TUPLE_REM_4 x)
+# define BOOST_PP_SEQ_FOR_EACH_M_IM(r, im) BOOST_PP_SEQ_FOR_EACH_M_I(r, im)
+# else
+# define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_I(r, BOOST_PP_TUPLE_ELEM(4, 0, x), BOOST_PP_TUPLE_ELEM(4, 1, x), BOOST_PP_TUPLE_ELEM(4, 2, x), BOOST_PP_TUPLE_ELEM(4, 3, x))
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_M_I(r, macro, data, seq, sz) macro(r, data, BOOST_PP_SEQ_HEAD(seq))
+#
+# /* BOOST_PP_SEQ_FOR_EACH_R */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_R(r, macro, data, seq)
+# else
+# define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq)
+# define BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_R(r, macro, data, seq)
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC_R(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq, BOOST_PP_SEQ_SIZE(seq)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
+# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY_R(r, macro, data, seq)
+#
+# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_R(r, macro, data, seq) \
+ BOOST_PP_IIF \
+ ( \
+ BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
+ BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC_R, \
+ BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY_R \
+ ) \
+ (r, macro, data, seq) \
+/**/
+#
+# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_SEQ_FOR_EACH_PRODUCT_HPP
+# define BOOST_PREPROCESSOR_SEQ_FOR_EACH_PRODUCT_HPP
+#
+# include <boost/preprocessor/arithmetic/dec.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/control/if.hpp>
+# include <boost/preprocessor/repetition/for.hpp>
+# include <boost/preprocessor/seq/seq.hpp>
+# include <boost/preprocessor/seq/size.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_SEQ_FOR_EACH_PRODUCT */
+#
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT(macro, sets) BOOST_PP_SEQ_FOR_EACH_PRODUCT_E(BOOST_PP_FOR, macro, sets)
+#
+# /* BOOST_PP_SEQ_FOR_EACH_PRODUCT_R */
+#
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_R(r, macro, sets) BOOST_PP_SEQ_FOR_EACH_PRODUCT_E(BOOST_PP_FOR_ ## r, macro, sets)
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_E(impl, macro, sets) impl((BOOST_PP_SEQ_HEAD(sets)(nil), BOOST_PP_SEQ_TAIL(sets)(nil), (nil), macro), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_0)
+# else
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_E(impl, macro, sets) BOOST_PP_SEQ_FOR_EACH_PRODUCT_E_I(impl, macro, sets)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_E_I(impl, macro, sets) impl((BOOST_PP_SEQ_HEAD(sets)(nil), BOOST_PP_SEQ_TAIL(sets)(nil), (nil), macro), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_0)
+# endif
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_P(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_P_I data
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_P_I(cset, rset, res, macro) BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(cset))
+# else
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_P(r, data) BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(4, 0, data)))
+# endif
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_O(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_O_I data
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_O_I(cset, rset, res, macro) (BOOST_PP_SEQ_TAIL(cset), rset, res, macro)
+# else
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_O(r, data) (BOOST_PP_SEQ_TAIL(BOOST_PP_TUPLE_ELEM(4, 0, data)), BOOST_PP_TUPLE_ELEM(4, 1, data), BOOST_PP_TUPLE_ELEM(4, 2, data), BOOST_PP_TUPLE_ELEM(4, 3, data))
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, i) BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(4, 1, data))), BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_ ## i, BOOST_PP_SEQ_FOR_EACH_PRODUCT_I)
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_I(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_I_I(r, BOOST_PP_TUPLE_ELEM(4, 0, data), BOOST_PP_TUPLE_ELEM(4, 1, data), BOOST_PP_TUPLE_ELEM(4, 2, data), BOOST_PP_TUPLE_ELEM(4, 3, data))
+# else
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_I(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_I_IM(r, BOOST_PP_TUPLE_REM_4 data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_I_IM(r, im) BOOST_PP_SEQ_FOR_EACH_PRODUCT_I_I(r, im)
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_I_I(r, cset, rset, res, macro) macro(r, BOOST_PP_SEQ_TAIL(res (BOOST_PP_SEQ_HEAD(cset))))
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_H_I data
+# else
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_H_I(BOOST_PP_TUPLE_ELEM(4, 0, data), BOOST_PP_TUPLE_ELEM(4, 1, data), BOOST_PP_TUPLE_ELEM(4, 2, data), BOOST_PP_TUPLE_ELEM(4, 3, data))
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_H_I(cset, rset, res, macro) (BOOST_PP_SEQ_HEAD(rset)(nil), BOOST_PP_SEQ_TAIL(rset), res (BOOST_PP_SEQ_HEAD(cset)), macro)
+#
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_0(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 0)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_1(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 1)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_2(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 2)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_3(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 3)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_4(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 4)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_5(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 5)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_6(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 6)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_7(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 7)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_8(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 8)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_9(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 9)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_10(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 10)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_11(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 11)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_12(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 12)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_13(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 13)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_14(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 14)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_15(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 15)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_16(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 16)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_17(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 17)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_18(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 18)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_19(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 19)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_20(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 20)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_21(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 21)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_22(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 22)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_23(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 23)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_24(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 24)(r, data)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_25(r, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT_C(data, 25)(r, data)
+#
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_0(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_1)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_1(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_2)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_2(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_3)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_3(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_4)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_4(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_5)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_5(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_6)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_6(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_7)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_7(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_8)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_8(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_9)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_9(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_10)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_10(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_11)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_11(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_12)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_12(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_13)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_13(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_14)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_14(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_15)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_15(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_16)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_16(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_17)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_17(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_18)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_18(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_19)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_19(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_20)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_20(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_21)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_21(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_22)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_22(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_23)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_23(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_24)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_24(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_25)
+# define BOOST_PP_SEQ_FOR_EACH_PRODUCT_N_25(r, data) BOOST_PP_FOR_ ## r(BOOST_PP_SEQ_FOR_EACH_PRODUCT_H(data), BOOST_PP_SEQ_FOR_EACH_PRODUCT_P, BOOST_PP_SEQ_FOR_EACH_PRODUCT_O, BOOST_PP_SEQ_FOR_EACH_PRODUCT_M_26)
+#
+# endif
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_SEQ_PUSH_BACK_HPP
+# define BOOST_PREPROCESSOR_SEQ_PUSH_BACK_HPP
+#
+# /* BOOST_PP_SEQ_PUSH_BACK */
+#
+# define BOOST_PP_SEQ_PUSH_BACK(seq, elem) seq(elem)
+#
+# endif
+++ /dev/null
-#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
-#define BOOST_SHARED_ARRAY_HPP_INCLUDED
-
-//
-// shared_array.hpp
-//
-// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
-// Copyright (c) 2001, 2002 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)
-//
-// See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
-//
-
-#include <boost/smart_ptr/shared_array.hpp>
-
-#endif // #ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2006. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org/libs/signals
-
-#ifndef BOOST_SIGNAL_HPP
-#define BOOST_SIGNAL_HPP
-
-#ifndef BOOST_SIGNALS_NO_DEPRECATION_WARNING
-# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-# pragma message ("Warning: Boost.Signals is no longer being maintained and is now deprecated. Please switch to Boost.Signals2. To disable this warning message, define BOOST_SIGNALS_NO_DEPRECATION_WARNING.")
-# elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-# warning "Boost.Signals is no longer being maintained and is now deprecated. Please switch to Boost.Signals2. To disable this warning message, define BOOST_SIGNALS_NO_DEPRECATION_WARNING."
-# endif
-#endif
-
-#ifndef BOOST_SIGNALS_MAX_ARGS
-# define BOOST_SIGNALS_MAX_ARGS 10
-#endif
-
-#include <boost/config.hpp>
-#include <boost/type_traits/function_traits.hpp>
-#include <boost/signals/signal0.hpp>
-#include <boost/signals/signal1.hpp>
-#include <boost/signals/signal2.hpp>
-#include <boost/signals/signal3.hpp>
-#include <boost/signals/signal4.hpp>
-#include <boost/signals/signal5.hpp>
-#include <boost/signals/signal6.hpp>
-#include <boost/signals/signal7.hpp>
-#include <boost/signals/signal8.hpp>
-#include <boost/signals/signal9.hpp>
-#include <boost/signals/signal10.hpp>
-#include <boost/function.hpp>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost {
-#ifndef BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
- namespace BOOST_SIGNALS_NAMESPACE {
- namespace detail {
- template<int Arity,
- typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl;
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<0, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal0<typename traits::result_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<1, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal1<typename traits::result_type,
- typename traits::arg1_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<2, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal2<typename traits::result_type,
- typename traits::arg1_type,
- typename traits::arg2_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<3, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal3<typename traits::result_type,
- typename traits::arg1_type,
- typename traits::arg2_type,
- typename traits::arg3_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<4, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal4<typename traits::result_type,
- typename traits::arg1_type,
- typename traits::arg2_type,
- typename traits::arg3_type,
- typename traits::arg4_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<5, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal5<typename traits::result_type,
- typename traits::arg1_type,
- typename traits::arg2_type,
- typename traits::arg3_type,
- typename traits::arg4_type,
- typename traits::arg5_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<6, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal6<typename traits::result_type,
- typename traits::arg1_type,
- typename traits::arg2_type,
- typename traits::arg3_type,
- typename traits::arg4_type,
- typename traits::arg5_type,
- typename traits::arg6_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<7, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal7<typename traits::result_type,
- typename traits::arg1_type,
- typename traits::arg2_type,
- typename traits::arg3_type,
- typename traits::arg4_type,
- typename traits::arg5_type,
- typename traits::arg6_type,
- typename traits::arg7_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<8, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal8<typename traits::result_type,
- typename traits::arg1_type,
- typename traits::arg2_type,
- typename traits::arg3_type,
- typename traits::arg4_type,
- typename traits::arg5_type,
- typename traits::arg6_type,
- typename traits::arg7_type,
- typename traits::arg8_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<9, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal9<typename traits::result_type,
- typename traits::arg1_type,
- typename traits::arg2_type,
- typename traits::arg3_type,
- typename traits::arg4_type,
- typename traits::arg5_type,
- typename traits::arg6_type,
- typename traits::arg7_type,
- typename traits::arg8_type,
- typename traits::arg9_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- class real_get_signal_impl<10, Signature, Combiner, Group, GroupCompare,
- SlotFunction>
- {
- typedef function_traits<Signature> traits;
-
- public:
- typedef signal10<typename traits::result_type,
- typename traits::arg1_type,
- typename traits::arg2_type,
- typename traits::arg3_type,
- typename traits::arg4_type,
- typename traits::arg5_type,
- typename traits::arg6_type,
- typename traits::arg7_type,
- typename traits::arg8_type,
- typename traits::arg9_type,
- typename traits::arg10_type,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction> type;
- };
-
- template<typename Signature,
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction>
- struct get_signal_impl :
- public real_get_signal_impl<(function_traits<Signature>::arity),
- Signature,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction>
- {
- };
-
- } // end namespace detail
- } // end namespace BOOST_SIGNALS_NAMESPACE
-
- // Very lightweight wrapper around the signalN classes that allows signals to
- // be created where the number of arguments does not need to be part of the
- // class name.
- template<
- typename Signature, // function type R (T1, T2, ..., TN)
- typename Combiner = last_value<typename function_traits<Signature>::result_type>,
- typename Group = int,
- typename GroupCompare = std::less<Group>,
- typename SlotFunction = function<Signature>
- >
- class signal :
- public BOOST_SIGNALS_NAMESPACE::detail::get_signal_impl<Signature,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction>::type
- {
- typedef typename BOOST_SIGNALS_NAMESPACE::detail::get_signal_impl<
- Signature,
- Combiner,
- Group,
- GroupCompare,
- SlotFunction>::type base_type;
-
- public:
- explicit signal(const Combiner& combiner = Combiner(),
- const GroupCompare& group_compare = GroupCompare()) :
- base_type(combiner, group_compare)
- {
- }
- };
-#endif // ndef BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
-
-} // end namespace boost
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif // BOOST_SIGNAL_HPP
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_CONNECTION_HPP
-#define BOOST_SIGNALS_CONNECTION_HPP
-
-#include <boost/signals/detail/signals_common.hpp>
-#include <boost/smart_ptr.hpp>
-#include <boost/operators.hpp>
-#include <boost/any.hpp>
-#include <list>
-#include <cassert>
-#include <utility>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
- class trackable;
-
- namespace detail {
- // Represents an object that has been bound as part of a slot, and how
- // to notify that object of a disconnect
- struct bound_object {
- void* obj;
- void* data;
- void (*disconnect)(void*, void*);
-
- bool operator==(const bound_object& other) const
- { return obj == other.obj && data == other.data; }
- bool operator<(const bound_object& other) const
- { return obj < other.obj; }
-
- // To support intel 80 compiler, 2004/03/18 (Mark Rodgers)
- bool operator!=(const bound_object& other) const
- { return !(*this==other); }
- bool operator>(const bound_object& other) const
- { return !(*this < other); }
- };
-
- // Describes the connection between a signal and the objects that are
- // bound for a specific slot. Enables notification of the signal and the
- // slots when a disconnect is requested.
- struct basic_connection {
- void* signal;
- void* signal_data;
- void (*signal_disconnect)(void*, void*);
- bool blocked_;
-
- std::list<bound_object> bound_objects;
- };
- } // end namespace detail
-
- // The user may freely pass around the "connection" object and terminate
- // the connection at any time using disconnect().
- class BOOST_SIGNALS_DECL connection :
- private less_than_comparable1<connection>,
- private equality_comparable1<connection>
- {
- public:
- connection() : con(), controlling_connection(false) {}
- connection(const connection&);
- ~connection();
-
- // Block he connection: if the connection is still active, there
- // will be no notification
- void block(bool should_block = true) { con->blocked_ = should_block; }
- void unblock() { con->blocked_ = false; }
- bool blocked() const { return !connected() || con->blocked_; }
-
- // Disconnect the signal and slot, if they are connected
- void disconnect() const;
-
- // Returns true if the signal and slot are connected
- bool connected() const { return con.get() && con->signal_disconnect; }
-
- // Comparison of connections
- bool operator==(const connection& other) const;
- bool operator<(const connection& other) const;
-
- // Connection assignment
- connection& operator=(const connection& other) ;
-
- // Swap connections
- void swap(connection& other);
-
- public: // TBD: CHANGE THIS
- // Set whether this connection object is controlling or not
- void set_controlling(bool control = true)
- { controlling_connection = control; }
-
- shared_ptr<BOOST_SIGNALS_NAMESPACE::detail::basic_connection>
- get_connection() const
- { return con; }
-
- private:
- friend class detail::signal_base_impl;
- friend class detail::slot_base;
- friend class trackable;
-
- // Reset this connection to refer to a different actual connection
- void reset(BOOST_SIGNALS_NAMESPACE::detail::basic_connection*);
-
- // Add a bound object to this connection (not for users)
- void add_bound_object(const BOOST_SIGNALS_NAMESPACE::detail::bound_object& b);
-
- friend class BOOST_SIGNALS_NAMESPACE::detail::bound_objects_visitor;
-
- // Pointer to the actual contents of the connection
- shared_ptr<BOOST_SIGNALS_NAMESPACE::detail::basic_connection> con;
-
- // True if the destruction of this connection object should disconnect
- bool controlling_connection;
- };
-
- // Similar to connection, but will disconnect the connection when it is
- // destroyed unless release() has been called.
- class BOOST_SIGNALS_DECL scoped_connection : public connection {
- public:
- scoped_connection() : connection(), released(false) {}
- scoped_connection(const connection&);
- scoped_connection(const scoped_connection&);
- ~scoped_connection();
-
- connection release();
-
- void swap(scoped_connection&);
-
- scoped_connection& operator=(const connection&);
- scoped_connection& operator=(const scoped_connection&);
-
- private:
- bool released;
- };
-
- namespace detail {
- struct connection_slot_pair {
- connection first;
- any second;
-
- connection_slot_pair() {}
-
- connection_slot_pair(const connection& c, const any& a)
- : first(c), second(a)
- {
- }
-
- // Dummys to allow explicit instantiation to work
- bool operator==(const connection_slot_pair&) const { return false; }
- bool operator<(const connection_slot_pair&) const { return false;}
- };
-
- // Determines if the underlying connection is disconnected
- struct is_disconnected {
- typedef connection_slot_pair argument_type;
- typedef bool result_type;
-
- inline bool operator()(const argument_type& c) const
- {
- return !c.first.connected();
- }
- };
-
- // Determines if the underlying connection is callable, ie if
- // it is connected and not blocked
- struct is_callable {
- typedef connection_slot_pair argument_type;
- typedef bool result_type;
-
- inline bool operator()(const argument_type& c) const
- {
- return c.first.connected() && !c.first.blocked() ;
- }
- };
-
- // Autodisconnects the bound object when it is destroyed unless the
- // release method is invoked.
- class auto_disconnect_bound_object {
- public:
- auto_disconnect_bound_object(const bound_object& b) :
- binding(b), auto_disconnect(true)
- {
- }
-
- ~auto_disconnect_bound_object()
- {
- if (auto_disconnect)
- binding.disconnect(binding.obj, binding.data);
- }
-
- void release() { auto_disconnect = false; }
-
- private:
- bound_object binding;
- bool auto_disconnect;
- };
- } // end namespace detail
- } // end namespace BOOST_SIGNALS_NAMESPACE
-} // end namespace boost
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif // BOOST_SIGNALS_CONNECTION_HPP
+++ /dev/null
-/*
- *
- * Copyright (c) 1998-2002
- * John Maddock
- *
- * Copyright (c) 2003-2004
- * Douglas Gregor
- *
- * 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_SIGNALS_CONFIG_HPP
-#define BOOST_SIGNALS_CONFIG_HPP
-
-#include <boost/config.hpp>
-
-#ifdef BOOST_HAS_DECLSPEC
-# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SIGNALS_DYN_LINK)
-# ifdef BOOST_SIGNALS_SOURCE
-# define BOOST_SIGNALS_DECL __declspec(dllexport)
-# else
-# define BOOST_SIGNALS_DECL __declspec(dllimport)
-# endif // BOOST_SIGNALS_SOURCE
-# endif // DYN_LINK
-#endif // BOOST_HAS_DECLSPEC
-
-#ifndef BOOST_SIGNALS_DECL
-# define BOOST_SIGNALS_DECL
-#endif
-
-// Setup autolinking
-#if !defined(BOOST_SIGNALS_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SIGNALS_NO_LIB)
-# define BOOST_LIB_NAME boost_signals
-
-# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SIGNALS_DYN_LINK)
-# define BOOST_DYN_LINK
-# endif
-
-# include <boost/config/auto_link.hpp>
-#endif // autolinking on
-
-#endif // BOOST_SIGNALS_CONFIG_HPP
-
-
-
-
-
-
-
-
-
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_NAMED_SLOT_MAP_HPP
-#define BOOST_SIGNALS_NAMED_SLOT_MAP_HPP
-
-#include <boost/signals/detail/config.hpp>
-#include <boost/signals/detail/signals_common.hpp>
-#include <boost/signals/connection.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/function/function2.hpp>
-#include <boost/iterator/iterator_facade.hpp>
-#include <map>
-#include <memory>
-#include <utility>
-
-namespace boost { namespace BOOST_SIGNALS_NAMESPACE {
-
-enum connect_position { at_back, at_front };
-
-namespace detail {
-
-class stored_group
-{
- public:
- enum storage_kind { sk_empty, sk_front, sk_back, sk_group };
-
- stored_group(storage_kind p_kind = sk_empty) : kind(p_kind), group() { }
-
- template<typename T>
- stored_group(const T& p_group) : kind(sk_group), group(new T(p_group)) { }
-
- bool is_front() const { return kind == sk_front; }
- bool is_back() const { return kind == sk_back; }
- bool empty() const { return kind == sk_empty; }
-
- void* get() const { return group.get(); }
-
- private:
- storage_kind kind;
- shared_ptr<void> group;
-};
-
-typedef function2<bool, stored_group, stored_group> compare_type;
-
-// This function object bridges from a pair of any objects that hold
-// values of type Key to the underlying function object that compares
-// values of type Key.
-template<typename Compare, typename Key>
-class group_bridge_compare {
-public:
- typedef bool result_type;
- typedef const stored_group& first_argument_type;
- typedef const stored_group& second_argument_type;
-
- group_bridge_compare(const Compare& c) : comp(c)
- { }
-
- bool operator()(const stored_group& k1, const stored_group& k2) const
- {
- if (k1.is_front()) return !k2.is_front();
- if (k1.is_back()) return false;
- if (k2.is_front()) return false;
- if (k2.is_back()) return true;
-
- // Neither is empty, so compare their values to order them
- return comp(*static_cast<Key*>(k1.get()), *static_cast<Key*>(k2.get()));
- }
-
-private:
- Compare comp;
-};
-
-class BOOST_SIGNALS_DECL named_slot_map_iterator :
- public iterator_facade<named_slot_map_iterator,
- connection_slot_pair,
- forward_traversal_tag>
-{
- typedef std::list<connection_slot_pair> group_list;
- typedef group_list::iterator slot_pair_iterator;
- typedef std::map<stored_group, group_list, compare_type> slot_container_type;
- typedef slot_container_type::iterator group_iterator;
- typedef slot_container_type::const_iterator const_group_iterator;
-
- typedef iterator_facade<named_slot_map_iterator,
- connection_slot_pair,
- forward_traversal_tag> inherited;
-public:
- named_slot_map_iterator() : slot_assigned(false)
- { }
- named_slot_map_iterator(const named_slot_map_iterator& other)
- : group(other.group), last_group(other.last_group),
- slot_assigned(other.slot_assigned)
- {
- if (slot_assigned) slot_ = other.slot_;
- }
- named_slot_map_iterator& operator=(const named_slot_map_iterator& other)
- {
- slot_assigned = other.slot_assigned;
- group = other.group;
- last_group = other.last_group;
- if (slot_assigned) slot_ = other.slot_;
- return *this;
- }
- connection_slot_pair& dereference() const
- {
- return *slot_;
- }
- void increment()
- {
- ++slot_;
- if (slot_ == group->second.end()) {
- ++group;
- init_next_group();
- }
- }
- bool equal(const named_slot_map_iterator& other) const {
- return (group == other.group
- && (group == last_group
- || slot_ == other.slot_));
- }
-
-#if BOOST_WORKAROUND(_MSC_VER, <= 1900)
- void decrement();
- void advance(difference_type);
-#endif
-
-private:
- named_slot_map_iterator(group_iterator giter, group_iterator last) :
- group(giter), last_group(last), slot_assigned(false)
- { init_next_group(); }
- named_slot_map_iterator(group_iterator giter, group_iterator last,
- slot_pair_iterator slot) :
- group(giter), last_group(last), slot_(slot), slot_assigned(true)
- { }
-
- void init_next_group()
- {
- while (group != last_group && group->second.empty()) ++group;
- if (group != last_group) {
- slot_ = group->second.begin();
- slot_assigned = true;
- }
- }
-
- group_iterator group;
- group_iterator last_group;
- slot_pair_iterator slot_;
- bool slot_assigned;
-
- friend class named_slot_map;
-};
-
-class BOOST_SIGNALS_DECL named_slot_map
-{
-public:
- typedef named_slot_map_iterator iterator;
-
- named_slot_map(const compare_type& compare);
-
- void clear();
- iterator begin();
- iterator end();
- iterator insert(const stored_group& name, const connection& con,
- const any& slot, connect_position at);
- void disconnect(const stored_group& name);
- void erase(iterator pos);
- void remove_disconnected_slots();
-
-private:
- typedef std::list<connection_slot_pair> group_list;
- typedef std::map<stored_group, group_list, compare_type> slot_container_type;
- typedef slot_container_type::iterator group_iterator;
- typedef slot_container_type::const_iterator const_group_iterator;
-
- bool empty(const_group_iterator group) const
- {
- return (group->second.empty() && group != groups.begin() && group != back);
- }
- slot_container_type groups;
- group_iterator back;
-};
-
-} } }
-
-#endif // BOOST_SIGNALS_NAMED_SLOT_MAP_HPP
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL_BASE_HEADER
-#define BOOST_SIGNALS_SIGNAL_BASE_HEADER
-
-#include <boost/signals/detail/config.hpp>
-#include <boost/signals/detail/signals_common.hpp>
-#include <boost/signals/detail/named_slot_map.hpp>
-#include <boost/signals/connection.hpp>
-#include <boost/signals/trackable.hpp>
-#include <boost/signals/slot.hpp>
-#include <boost/smart_ptr.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/function/function2.hpp>
-#include <utility>
-#include <vector>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
- namespace detail {
- // Must be constructed before calling the slots, because it safely
- // manages call depth
- class BOOST_SIGNALS_DECL call_notification {
- public:
- call_notification(const shared_ptr<signal_base_impl>&);
- ~call_notification();
-
- shared_ptr<signal_base_impl> impl;
- };
-
- // Implementation of base class for all signals. It handles the
- // management of the underlying slot lists.
- class BOOST_SIGNALS_DECL signal_base_impl {
- public:
- friend class call_notification;
-
- typedef function2<bool, stored_group, stored_group> compare_type;
-
- // Make sure that an exception does not cause the "clearing" flag to
- // remain set
- class temporarily_set_clearing {
- public:
- temporarily_set_clearing(signal_base_impl* b) : base(b)
- {
- base->flags.clearing = true;
- }
-
- ~temporarily_set_clearing()
- {
- base->flags.clearing = false;
- }
-
- private:
- signal_base_impl* base;
- };
-
- friend class temporarily_set_clearing;
-
- signal_base_impl(const compare_type&, const any&);
- ~signal_base_impl();
-
- // Disconnect all slots connected to this signal
- void disconnect_all_slots();
-
- // Are there any connected slots?
- bool empty() const;
-
- // The number of connected slots
- std::size_t num_slots() const;
-
- // Disconnect all slots in the given group
- void disconnect(const stored_group&);
-
- // We're being notified that a slot has disconnected
- static void slot_disconnected(void* obj, void* data);
-
- connection connect_slot(const any& slot,
- const stored_group& name,
- shared_ptr<slot_base::data_t> data,
- connect_position at);
-
- private:
- // Remove all of the slots that have been marked "disconnected"
- void remove_disconnected_slots() const;
-
- public:
- // Our call depth when invoking slots (> 1 when we have a loop)
- mutable int call_depth;
-
- struct {
- // True if some slots have disconnected, but we were not able to
- // remove them from the list of slots because there are valid
- // iterators into the slot list
- mutable bool delayed_disconnect:1;
-
- // True if we are disconnecting all disconnected slots
- bool clearing:1;
- } flags;
-
- // Slots
- mutable named_slot_map slots_;
- any combiner_;
-
- // Types
- typedef named_slot_map::iterator iterator;
- };
-
- class BOOST_SIGNALS_DECL signal_base : public noncopyable {
- public:
- typedef signal_base_impl::compare_type compare_type;
-
- friend class call_notification;
-
- signal_base(const compare_type& comp, const any& combiner);
- ~signal_base();
-
- public:
- // Disconnect all slots connected to this signal
- void disconnect_all_slots() { impl->disconnect_all_slots(); }
-
- // Are there any connected slots?
- bool empty() const { return impl->empty(); }
-
- // How many slots are connected?
- std::size_t num_slots() const { return impl->num_slots(); }
-
- protected:
- connection connect_slot(const any& slot,
- const stored_group& name,
- shared_ptr<slot_base::data_t> data,
- connect_position at)
- {
- return impl->connect_slot(slot, name, data, at);
- }
-
- typedef named_slot_map::iterator iterator;
-
- shared_ptr<signal_base_impl> impl;
- };
- } // end namespace detail
- } // end namespace BOOST_SIGNALS_NAMESPACE
-} // end namespace boost
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif // BOOST_SIGNALS_SIGNAL_BASE_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_COMMON_HEADER
-#define BOOST_SIGNALS_COMMON_HEADER
-
-#ifndef BOOST_SIGNALS_NAMESPACE
-# define BOOST_SIGNALS_NAMESPACE signals
-#endif
-
-#include <boost/type_traits/conversion_traits.hpp>
-#include <boost/ref.hpp>
-#include <boost/signals/detail/config.hpp>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
- namespace detail {
- // The unusable class is a placeholder for unused function arguments
- // It is also completely unusable except that it constructable from
- // anything. This helps compilers without partial specialization
- // handle slots returning void.
- struct unusable {
- unusable() {}
- };
-
- // Determine the result type of a slot call
- template<typename R>
- struct slot_result_type {
- typedef R type;
- };
-
- template<>
- struct slot_result_type<void> {
- typedef unusable type;
- };
-
- // Determine if the given type T is a signal
- class signal_base;
-
- template<typename T>
- struct is_signal {
- BOOST_STATIC_CONSTANT(bool,
- value = (is_convertible<T*, signal_base*>::value));
- };
-
- /*
- * The IF implementation is temporary code. When a Boost metaprogramming
- * library is introduced, Boost.Signals will use it instead.
- */
- namespace intimate {
- struct SelectThen
- {
- template<typename Then, typename Else>
- struct Result
- {
- typedef Then type;
- };
- };
-
- struct SelectElse
- {
- template<typename Then, typename Else>
- struct Result
- {
- typedef Else type;
- };
- };
-
- template<bool Condition>
- struct Selector
- {
- typedef SelectThen type;
- };
-
- template<>
- struct Selector<false>
- {
- typedef SelectElse type;
- };
- } // end namespace intimate
-
- template<bool Condition, typename Then, typename Else>
- struct IF
- {
- typedef typename intimate::Selector<Condition>::type select;
- typedef typename select::template Result<Then,Else>::type type;
- };
-
- // Determine if the incoming argument is a reference_wrapper
- template<typename T>
- struct is_ref
- {
- BOOST_STATIC_CONSTANT(bool, value = false);
- };
-
- template<typename T>
- struct is_ref<reference_wrapper<T> >
- {
- BOOST_STATIC_CONSTANT(bool, value = true);
- };
-
- // A slot can be a signal, a reference to a function object, or a
- // function object.
- struct signal_tag {};
- struct reference_tag {};
- struct value_tag {};
-
- // Classify the given slot as a signal, a reference-to-slot, or a
- // standard slot
- template<typename S>
- class get_slot_tag {
- typedef typename IF<(is_signal<S>::value),
- signal_tag,
- value_tag>::type signal_or_value;
-
- public:
- typedef typename IF<(is_ref<S>::value),
- reference_tag,
- signal_or_value>::type type;
- };
-
- // Forward declaration needed in lots of places
- class signal_base_impl;
- class bound_objects_visitor;
- class slot_base;
- } // end namespace detail
- } // end namespace BOOST_SIGNALS_NAMESPACE
-} // end namespace boost
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif // BOOST_SIGNALS_COMMON_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SLOT_CALL_ITERATOR
-#define BOOST_SIGNALS_SLOT_CALL_ITERATOR
-
-#include <memory>
-#include <boost/iterator/iterator_facade.hpp>
-#include <boost/smart_ptr.hpp>
-#include <boost/signals/detail/config.hpp>
-#include <boost/signals/connection.hpp>
-#include <boost/optional.hpp>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
- namespace detail {
-
- // Generates a slot call iterator. Essentially, this is an iterator that:
- // - skips over disconnected slots in the underlying list
- // - calls the connected slots when dereferenced
- // - caches the result of calling the slots
- template<typename Function, typename Iterator>
- class slot_call_iterator
- : public iterator_facade<slot_call_iterator<Function, Iterator>,
- typename Function::result_type,
- single_pass_traversal_tag,
- typename Function::result_type const&>
- {
- typedef iterator_facade<slot_call_iterator<Function, Iterator>,
- typename Function::result_type,
- single_pass_traversal_tag,
- typename Function::result_type const&>
- inherited;
-
- typedef typename Function::result_type result_type;
-
- friend class iterator_core_access;
-
- public:
- slot_call_iterator(Iterator iter_in, Iterator end_in, Function func,
- optional<result_type> &c)
- : iter(iter_in), end(end_in), f(func), cache(&c)
- {
- iter = std::find_if(iter, end, is_callable());
- }
-
- typename inherited::reference
- dereference() const
- {
- if (!cache->is_initialized()) {
- cache->reset(f(*iter));
- }
-
- return cache->get();
- }
-
- void increment()
- {
- iter = std::find_if(++iter, end, is_callable());
- cache->reset();
- }
-
- bool equal(const slot_call_iterator& other) const
- {
- iter = std::find_if(iter, end, is_callable());
- other.iter = std::find_if(other.iter, other.end,
- is_callable());
- return iter == other.iter;
- }
-
- private:
- mutable Iterator iter;
- Iterator end;
- Function f;
- optional<result_type>* cache;
- };
- } // end namespace detail
- } // end namespace BOOST_SIGNALS_NAMESPACE
-} // end namespace boost
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif // BOOST_SIGNALS_SLOT_CALL_ITERATOR
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL0_HEADER
-#define BOOST_SIGNALS_SIGNAL0_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 0
-#define BOOST_SIGNALS_TEMPLATE_PARMS
-#define BOOST_SIGNALS_TEMPLATE_ARGS
-#define BOOST_SIGNALS_PARMS
-#define BOOST_SIGNALS_ARGS
-#define BOOST_SIGNALS_BOUND_ARGS
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS
-#define BOOST_SIGNALS_COPY_PARMS
-#define BOOST_SIGNALS_INIT_ARGS
-#define BOOST_SIGNALS_ARG_TYPES
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL0_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL1_HEADER
-#define BOOST_SIGNALS_SIGNAL1_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 1
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1
-#define BOOST_SIGNALS_PARMS T1 a1
-#define BOOST_SIGNALS_ARGS a1
-#define BOOST_SIGNALS_BOUND_ARGS args->a1
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL1_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL10_HEADER
-#define BOOST_SIGNALS_SIGNAL10_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 10
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
-#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10
-#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6, a7, a8, a9, a10
-#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6, args->a7, args->a8, args->a9, args->a10
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9;T10 a10;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9, T10 ia10
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9), a10(ia10)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; typedef T8 arg8_type; typedef T9 arg9_type; typedef T10 arg10_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL10_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL2_HEADER
-#define BOOST_SIGNALS_SIGNAL2_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 2
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2
-#define BOOST_SIGNALS_PARMS T1 a1, T2 a2
-#define BOOST_SIGNALS_ARGS a1, a2
-#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL2_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL3_HEADER
-#define BOOST_SIGNALS_SIGNAL3_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 3
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3
-#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3
-#define BOOST_SIGNALS_ARGS a1, a2, a3
-#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL3_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL4_HEADER
-#define BOOST_SIGNALS_SIGNAL4_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 4
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4
-#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4
-#define BOOST_SIGNALS_ARGS a1, a2, a3, a4
-#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL4_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL5_HEADER
-#define BOOST_SIGNALS_SIGNAL5_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 5
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5
-#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5
-#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5
-#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL5_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL6_HEADER
-#define BOOST_SIGNALS_SIGNAL6_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 6
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6
-#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6
-#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6
-#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL6_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL7_HEADER
-#define BOOST_SIGNALS_SIGNAL7_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 7
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7
-#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7
-#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6, a7
-#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6, args->a7
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL7_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL8_HEADER
-#define BOOST_SIGNALS_SIGNAL8_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 8
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7, T8
-#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8
-#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6, a7, a8
-#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6, args->a7, args->a8
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; typedef T8 arg8_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL8_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2003. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SIGNAL9_HEADER
-#define BOOST_SIGNALS_SIGNAL9_HEADER
-
-#define BOOST_SIGNALS_NUM_ARGS 9
-#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9
-#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7, T8, T9
-#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9
-#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6, a7, a8, a9
-#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6, args->a7, args->a8, args->a9
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9;
-#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9
-#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; typedef T8 arg8_type; typedef T9 arg9_type;
-
-#include <boost/signals/signal_template.hpp>
-
-#undef BOOST_SIGNALS_ARG_TYPES
-#undef BOOST_SIGNALS_INIT_ARGS
-#undef BOOST_SIGNALS_COPY_PARMS
-#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
-#undef BOOST_SIGNALS_BOUND_ARGS
-#undef BOOST_SIGNALS_ARGS
-#undef BOOST_SIGNALS_PARMS
-#undef BOOST_SIGNALS_TEMPLATE_ARGS
-#undef BOOST_SIGNALS_TEMPLATE_PARMS
-#undef BOOST_SIGNALS_NUM_ARGS
-
-#endif // BOOST_SIGNALS_SIGNAL9_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-// This file intentionally does not have include guards, because it is meant
-// to be included multiple times (one for each signalN class). The
-// BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED macro merely serves to
-// suppress reinclusion of the files that this header depends on.
-
-#ifndef BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED
-#define BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED
-# include <boost/config.hpp>
-# include <boost/signals/connection.hpp>
-# include <boost/ref.hpp>
-# include <boost/signals/slot.hpp>
-# include <boost/last_value.hpp>
-# include <boost/signals/detail/signal_base.hpp>
-# include <boost/signals/detail/slot_call_iterator.hpp>
-# include <boost/mpl/bool.hpp>
-# include <boost/type_traits/is_convertible.hpp>
-# include <cassert>
-# include <functional>
-# include <memory>
-#endif // !BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-// Include the appropriate functionN header
-#define BOOST_SIGNAL_FUNCTION_N_HEADER BOOST_JOIN(<boost/function/function,BOOST_SIGNALS_NUM_ARGS.hpp>)
-#include BOOST_SIGNAL_FUNCTION_N_HEADER
-
-// Determine if a comma should follow a listing of the arguments/parameters
-#if BOOST_SIGNALS_NUM_ARGS == 0
-# define BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
-#else
-# define BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS ,
-#endif // BOOST_SIGNALS_NUM_ARGS > 0
-
-// Define class names used
-#define BOOST_SIGNALS_SIGNAL BOOST_JOIN(signal,BOOST_SIGNALS_NUM_ARGS)
-#define BOOST_SIGNALS_FUNCTION BOOST_JOIN(function,BOOST_SIGNALS_NUM_ARGS)
-#define BOOST_SIGNALS_ARGS_STRUCT BOOST_JOIN(args,BOOST_SIGNALS_NUM_ARGS)
-#define BOOST_SIGNALS_CALL_BOUND BOOST_JOIN(call_bound,BOOST_SIGNALS_NUM_ARGS)
-
-// Define commonly-used instantiations
-#define BOOST_SIGNALS_ARGS_STRUCT_INST \
- BOOST_SIGNALS_NAMESPACE::detail::BOOST_SIGNALS_ARGS_STRUCT<BOOST_SIGNALS_TEMPLATE_ARGS>
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
- namespace detail {
- // Holds the arguments for a bound slot call in a single place
- template<BOOST_SIGNALS_TEMPLATE_PARMS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- typename Dummy = int>
- struct BOOST_SIGNALS_ARGS_STRUCT {
- BOOST_SIGNALS_ARGS_STRUCT(BOOST_SIGNALS_COPY_PARMS)
- BOOST_SIGNALS_INIT_ARGS
- {
- }
-
- BOOST_SIGNALS_ARGS_AS_MEMBERS
- };
-
- // Function object that calls the function object given to it, passing
- // the bound arguments along to that underlying function object
- template<typename R>
- struct BOOST_SIGNALS_CALL_BOUND {
- template<BOOST_SIGNALS_TEMPLATE_PARMS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- typename F>
- struct caller {
- typedef BOOST_SIGNALS_ARGS_STRUCT<BOOST_SIGNALS_TEMPLATE_ARGS>*
- args_type;
-
- args_type args;
-
- typedef R result_type;
-
- caller() {}
- caller(args_type a) : args(a) {}
-
- template<typename Pair>
- R operator()(const Pair& slot) const
- {
- F* target = const_cast<F*>(unsafe_any_cast<F>(&slot.second));
- return (*target)(BOOST_SIGNALS_BOUND_ARGS);
- }
- };
- };
-
- template<>
- struct BOOST_SIGNALS_CALL_BOUND<void> {
- template<BOOST_SIGNALS_TEMPLATE_PARMS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- typename F>
- struct caller {
- typedef BOOST_SIGNALS_ARGS_STRUCT<BOOST_SIGNALS_TEMPLATE_ARGS>*
- args_type;
-
- args_type args;
-
- typedef unusable result_type;
-
- caller(args_type a) : args(a) {}
-
- template<typename Pair>
- unusable operator()(const Pair& slot) const
- {
- F* target = const_cast<F*>(unsafe_any_cast<F>(&slot.second));
- (*target)(BOOST_SIGNALS_BOUND_ARGS);
- return unusable();
- }
- };
- };
- } // namespace detail
- } // namespace BOOST_SIGNALS_NAMESPACE
-
- // The actual signalN class
- template<
- typename R,
- BOOST_SIGNALS_TEMPLATE_PARMS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- typename Combiner = last_value<R>,
- typename Group = int,
- typename GroupCompare = std::less<Group>,
- typename SlotFunction = BOOST_SIGNALS_FUNCTION<
- R BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- BOOST_SIGNALS_TEMPLATE_ARGS>
- >
- class BOOST_SIGNALS_SIGNAL :
- public BOOST_SIGNALS_NAMESPACE::detail::signal_base, // management of slot list
- public BOOST_SIGNALS_NAMESPACE::trackable // signals are trackable
- {
- public:
- // The slot function type
- typedef SlotFunction slot_function_type;
-
- // Result type of a slot
- typedef typename BOOST_SIGNALS_NAMESPACE::detail::slot_result_type<R>::type
- slot_result_type;
-
- // Argument types
- BOOST_SIGNALS_ARG_TYPES
-
-#if BOOST_SIGNALS_NUM_ARGS == 1
- typedef T1 argument_type;
-#elif BOOST_SIGNALS_NUM_ARGS == 2
- typedef T1 first_argument_type;
- typedef T2 second_argument_type;
-#endif
-
- private:
- // The real slot name comparison object type
- typedef BOOST_SIGNALS_NAMESPACE::detail::group_bridge_compare<GroupCompare, Group>
- real_group_compare_type;
-
- // The function object passed to the slot call iterator that will call
- // the underlying slot function with its arguments bound
- typedef BOOST_SIGNALS_NAMESPACE::detail::BOOST_SIGNALS_CALL_BOUND<R>
- outer_bound_slot_caller;
- typedef typename outer_bound_slot_caller::template
- caller<BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- slot_function_type>
- call_bound_slot;
-
- public:
- // Combiner's result type
- typedef typename Combiner::result_type result_type;
-
- // Combiner type
- typedef Combiner combiner_type;
-
- // Slot type
- typedef slot<slot_function_type> slot_type;
-
- // Slot name type and comparison
- typedef Group group_type;
- typedef GroupCompare group_compare_type;
-
- typedef BOOST_SIGNALS_NAMESPACE::detail::slot_call_iterator<
- call_bound_slot, iterator> slot_call_iterator;
-
- explicit
- BOOST_SIGNALS_SIGNAL(const Combiner& c = Combiner(),
- const GroupCompare& comp = GroupCompare()) :
- BOOST_SIGNALS_NAMESPACE::detail::signal_base(real_group_compare_type(comp),
- c)
- {
- }
-
- // Connect a slot to this signal
- BOOST_SIGNALS_NAMESPACE::connection
- connect(const slot_type&,
- BOOST_SIGNALS_NAMESPACE::connect_position at
- = BOOST_SIGNALS_NAMESPACE::at_back);
-
-
- BOOST_SIGNALS_NAMESPACE::connection
- connect(const group_type&, const slot_type&,
- BOOST_SIGNALS_NAMESPACE::connect_position at
- = BOOST_SIGNALS_NAMESPACE::at_back);
-
- template<typename T>
- void disconnect(const T& t)
- {
- typedef mpl::bool_<(is_convertible<T, group_type>::value)> is_group;
- this->do_disconnect(t, is_group());
- }
-
- private:
- // Disconnect a named slot
- void do_disconnect(const group_type& group, mpl::bool_<true>)
- {
- impl->disconnect(group);
- }
-
- template<typename Function>
- void do_disconnect(const Function& f, mpl::bool_<false>)
- {
- // Notify the slot handling code that we are iterating through the slots
- BOOST_SIGNALS_NAMESPACE::detail::call_notification notification(this->impl);
-
- for (iterator i = impl->slots_.begin(); i != impl->slots_.end(); ++i) {
- slot_function_type& s = *unsafe_any_cast<slot_function_type>(&i->second);
- if (s == f) i->first.disconnect();
- }
- }
-
- public:
-
- // Emit the signal
- result_type operator()(BOOST_SIGNALS_PARMS);
- result_type operator()(BOOST_SIGNALS_PARMS) const;
-
- Combiner& combiner()
- { return *unsafe_any_cast<Combiner>(&impl->combiner_); }
-
- const Combiner& combiner() const
- { return *unsafe_any_cast<const Combiner>(&impl->combiner_); }
- };
-
- template<
- typename R,
- BOOST_SIGNALS_TEMPLATE_PARMS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction
- >
- BOOST_SIGNALS_NAMESPACE::connection
- BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- Combiner, Group, GroupCompare, SlotFunction
- >::connect(const slot_type& in_slot,
- BOOST_SIGNALS_NAMESPACE::connect_position at)
- {
- using boost::BOOST_SIGNALS_NAMESPACE::detail::stored_group;
-
- // If the slot has been disconnected, just return a disconnected
- // connection
- if (!in_slot.is_active()) {
- return BOOST_SIGNALS_NAMESPACE::connection();
- }
-
- return impl->connect_slot(in_slot.get_slot_function(), stored_group(),
- in_slot.get_data(), at);
- }
-
- template<
- typename R,
- BOOST_SIGNALS_TEMPLATE_PARMS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction
- >
- BOOST_SIGNALS_NAMESPACE::connection
- BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- Combiner, Group, GroupCompare, SlotFunction
- >::connect(const group_type& group,
- const slot_type& in_slot,
- BOOST_SIGNALS_NAMESPACE::connect_position at)
- {
- // If the slot has been disconnected, just return a disconnected
- // connection
- if (!in_slot.is_active()) {
- return BOOST_SIGNALS_NAMESPACE::connection();
- }
-
- return impl->connect_slot(in_slot.get_slot_function(), group,
- in_slot.get_data(), at);
- }
-
- template<
- typename R,
- BOOST_SIGNALS_TEMPLATE_PARMS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction
- >
- typename BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- Combiner, Group, GroupCompare, SlotFunction>::result_type
- BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- Combiner, Group, GroupCompare, SlotFunction
- >::operator()(BOOST_SIGNALS_PARMS)
- {
- // Notify the slot handling code that we are making a call
- BOOST_SIGNALS_NAMESPACE::detail::call_notification notification(this->impl);
-
- // Construct a function object that will call the underlying slots
- // with the given arguments.
-#if BOOST_SIGNALS_NUM_ARGS == 0
- BOOST_SIGNALS_ARGS_STRUCT_INST args;
-#else
- BOOST_SIGNALS_ARGS_STRUCT_INST args(BOOST_SIGNALS_ARGS);
-#endif // BOOST_SIGNALS_NUM_ARGS > 0
- call_bound_slot f(&args);
-
- typedef typename call_bound_slot::result_type call_result_type;
- optional<call_result_type> cache;
- // Let the combiner call the slots via a pair of input iterators
- return combiner()(slot_call_iterator(notification.impl->slots_.begin(),
- impl->slots_.end(), f, cache),
- slot_call_iterator(notification.impl->slots_.end(),
- impl->slots_.end(), f, cache));
- }
-
- template<
- typename R,
- BOOST_SIGNALS_TEMPLATE_PARMS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- typename Combiner,
- typename Group,
- typename GroupCompare,
- typename SlotFunction
- >
- typename BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- Combiner, Group, GroupCompare, SlotFunction>::result_type
- BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- Combiner, Group, GroupCompare, SlotFunction
- >::operator()(BOOST_SIGNALS_PARMS) const
- {
- // Notify the slot handling code that we are making a call
- BOOST_SIGNALS_NAMESPACE::detail::call_notification notification(this->impl);
-
- // Construct a function object that will call the underlying slots
- // with the given arguments.
-#if BOOST_SIGNALS_NUM_ARGS == 0
- BOOST_SIGNALS_ARGS_STRUCT_INST args;
-#else
- BOOST_SIGNALS_ARGS_STRUCT_INST args(BOOST_SIGNALS_ARGS);
-#endif // BOOST_SIGNALS_NUM_ARGS > 0
-
- call_bound_slot f(&args);
-
- typedef typename call_bound_slot::result_type call_result_type;
- optional<call_result_type> cache;
-
- // Let the combiner call the slots via a pair of input iterators
- return combiner()(slot_call_iterator(notification.impl->slots_.begin(),
- impl->slots_.end(), f, cache),
- slot_call_iterator(notification.impl->slots_.end(),
- impl->slots_.end(), f, cache));
- }
-} // namespace boost
-
-#undef BOOST_SIGNAL_FUNCTION_N_HEADER
-#undef BOOST_SIGNALS_ARGS_STRUCT_INST
-#undef BOOST_SIGNALS_CALL_BOUND
-#undef BOOST_SIGNALS_ARGS_STRUCT
-#undef BOOST_SIGNALS_FUNCTION
-#undef BOOST_SIGNALS_SIGNAL
-#undef BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_SLOT_HEADER
-#define BOOST_SIGNALS_SLOT_HEADER
-
-#include <boost/signals/detail/signals_common.hpp>
-#include <boost/signals/connection.hpp>
-#include <boost/signals/trackable.hpp>
-#include <boost/visit_each.hpp>
-#include <boost/shared_ptr.hpp>
-#include <cassert>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
- namespace detail {
- class BOOST_SIGNALS_DECL slot_base {
- // We would have to enumerate all of the signalN classes here as
- // friends to make this private (as it otherwise should be). We can't
- // name all of them because we don't know how many there are.
- public:
- struct data_t {
- std::vector<const trackable*> bound_objects;
- connection watch_bound_objects;
- };
- shared_ptr<data_t> get_data() const { return data; }
-
- // Get the set of bound objects
- std::vector<const trackable*>& get_bound_objects() const
- { return data->bound_objects; }
-
- // Determine if this slot is still "active", i.e., all of the bound
- // objects still exist
- bool is_active() const
- { return data->watch_bound_objects.connected(); }
-
- protected:
- // Create a connection for this slot
- void create_connection();
-
- shared_ptr<data_t> data;
-
- private:
- static void bound_object_destructed(void*, void*) {}
- };
- } // end namespace detail
-
- // Get the slot so that it can be copied
- template<typename F>
- reference_wrapper<const F>
- get_invocable_slot(const F& f, BOOST_SIGNALS_NAMESPACE::detail::signal_tag)
- { return reference_wrapper<const F>(f); }
-
- template<typename F>
- const F&
- get_invocable_slot(const F& f, BOOST_SIGNALS_NAMESPACE::detail::reference_tag)
- { return f; }
-
- template<typename F>
- const F&
- get_invocable_slot(const F& f, BOOST_SIGNALS_NAMESPACE::detail::value_tag)
- { return f; }
-
- // Get the slot so that it can be inspected for trackable objects
- template<typename F>
- const F&
- get_inspectable_slot(const F& f, BOOST_SIGNALS_NAMESPACE::detail::signal_tag)
- { return f; }
-
- template<typename F>
- const F&
- get_inspectable_slot(const reference_wrapper<F>& f, BOOST_SIGNALS_NAMESPACE::detail::reference_tag)
- { return f.get(); }
-
- template<typename F>
- const F&
- get_inspectable_slot(const F& f, BOOST_SIGNALS_NAMESPACE::detail::value_tag)
- { return f; }
-
- // Determines the type of the slot - is it a signal, a reference to a
- // slot or just a normal slot.
- template<typename F>
- typename BOOST_SIGNALS_NAMESPACE::detail::get_slot_tag<F>::type
- tag_type(const F&)
- {
- typedef typename BOOST_SIGNALS_NAMESPACE::detail::get_slot_tag<F>::type
- the_tag_type;
- the_tag_type tag = the_tag_type();
- return tag;
- }
-
- } // end namespace BOOST_SIGNALS_NAMESPACE
-
- template<typename SlotFunction>
- class slot : public BOOST_SIGNALS_NAMESPACE::detail::slot_base {
- typedef BOOST_SIGNALS_NAMESPACE::detail::slot_base inherited;
- typedef typename inherited::data_t data_t;
-
- public:
- template<typename F>
- slot(const F& f) : slot_function(BOOST_SIGNALS_NAMESPACE::get_invocable_slot(f, BOOST_SIGNALS_NAMESPACE::tag_type(f)))
- {
- this->data.reset(new data_t);
-
- // Visit each of the bound objects and store them for later use
- // An exception thrown here will allow the basic_connection to be
- // destroyed when this goes out of scope, and no other connections
- // have been made.
- BOOST_SIGNALS_NAMESPACE::detail::bound_objects_visitor
- do_bind(this->data->bound_objects);
- visit_each(do_bind,
- BOOST_SIGNALS_NAMESPACE::get_inspectable_slot
- (f, BOOST_SIGNALS_NAMESPACE::tag_type(f)));
- create_connection();
- }
-
-#ifdef __BORLANDC__
- template<typename F>
- slot(F* f) : slot_function(f)
- {
- this->data.reset(new data_t);
- create_connection();
- }
-#endif // __BORLANDC__
-
- // We would have to enumerate all of the signalN classes here as friends
- // to make this private (as it otherwise should be). We can't name all of
- // them because we don't know how many there are.
- public:
- // Get the slot function to call the actual slot
- const SlotFunction& get_slot_function() const { return slot_function; }
-
- void release() const { data->watch_bound_objects.set_controlling(false); }
-
- private:
- slot(); // no default constructor
- slot& operator=(const slot&); // no assignment operator
-
- SlotFunction slot_function;
- };
-} // end namespace boost
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif // BOOST_SIGNALS_SLOT_HEADER
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#ifndef BOOST_SIGNALS_TRACKABLE_HPP
-#define BOOST_SIGNALS_TRACKABLE_HPP
-
-#include <boost/type_traits.hpp>
-#include <boost/signals/connection.hpp>
-#include <boost/ref.hpp>
-#include <boost/utility/addressof.hpp>
-#include <list>
-#include <vector>
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
-#endif
-
-namespace boost {
-
-namespace BOOST_SIGNALS_NAMESPACE {
- // Base class for "trackable" objects that can be tracked when they are
- // bound in slot target functions. When a trackable object is destroyed,
- // the signal/slot connections are disconnected automatically.
- class BOOST_SIGNALS_DECL trackable {
- private:
- static void signal_disconnected(void* obj, void* data);
-
- friend class detail::signal_base_impl;
- friend class detail::slot_base;
- void signal_connected(connection, BOOST_SIGNALS_NAMESPACE::detail::bound_object&) const;
-
- protected:
- trackable() : connected_signals(), dying(false) {}
- trackable(const trackable&) : connected_signals(), dying(false) {}
- ~trackable();
-
- trackable& operator=(const trackable&)
- {
- dying = true;
- connected_signals.clear();
- dying = false;
- return *this;
- }
-
- private:
- typedef std::list<connection> connection_list;
- typedef connection_list::iterator connection_iterator;
-
- // List of connections that this object is part of
- mutable connection_list connected_signals;
-
- // True when the object is being destroyed
- mutable bool dying;
- };
-
- namespace detail {
- template<bool Cond> struct truth {};
-
- // A visitor that adds each trackable object to a vector
- class bound_objects_visitor {
- public:
- bound_objects_visitor(std::vector<const trackable*>& v) :
- bound_objects(v)
- {
- }
-
- template<typename T>
- void operator()(const T& t) const
- {
- decode(t, 0);
- }
-
- private:
- // decode() decides between a reference wrapper and anything else
- template<typename T>
- void decode(const reference_wrapper<T>& t, int) const
- {
- add_if_trackable(t.get_pointer());
- }
-
- template<typename T>
- void decode(const T& t, long) const
- {
- typedef truth<(is_pointer<T>::value)> is_a_pointer;
- maybe_get_pointer(t, is_a_pointer());
- }
-
- // maybe_get_pointer() decides between a pointer and a non-pointer
- template<typename T>
- void maybe_get_pointer(const T& t, truth<true>) const
- {
- add_if_trackable(t);
- }
-
- template<typename T>
- void maybe_get_pointer(const T& t, truth<false>) const
- {
- // Take the address of this object, because the object itself may be
- // trackable
- add_if_trackable(boost::addressof(t));
- }
-
- // add_if_trackable() adds trackable objects to the list of bound objects
- inline void add_if_trackable(const trackable* b) const
- {
- if (b) {
- bound_objects.push_back(b);
- }
- }
-
- inline void add_if_trackable(const void*) const { }
-
- template<typename R>
- inline void add_if_trackable(R (*)()) const { }
-
- template<typename R, typename T1>
- inline void add_if_trackable(R (*)(T1)) const { }
-
- template<typename R, typename T1, typename T2>
- inline void add_if_trackable(R (*)(T1, T2)) const { }
-
- template<typename R, typename T1, typename T2, typename T3>
- inline void add_if_trackable(R (*)(T1, T2, T3)) const { }
-
- template<typename R, typename T1, typename T2, typename T3, typename T4>
- inline void add_if_trackable(R (*)(T1, T2, T3, T4)) const { }
-
- template<typename R, typename T1, typename T2, typename T3, typename T4,
- typename T5>
- inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5)) const { }
-
- template<typename R, typename T1, typename T2, typename T3, typename T4,
- typename T5, typename T6>
- inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6)) const { }
-
- template<typename R, typename T1, typename T2, typename T3, typename T4,
- typename T5, typename T6, typename T7>
- inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7)) const { }
-
- template<typename R, typename T1, typename T2, typename T3, typename T4,
- typename T5, typename T6, typename T7, typename T8>
- inline void
- add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7, T8)) const { }
-
- template<typename R, typename T1, typename T2, typename T3, typename T4,
- typename T5, typename T6, typename T7, typename T8, typename T9>
- inline void
- add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9)) const { }
-
- template<typename R, typename T1, typename T2, typename T3, typename T4,
- typename T5, typename T6, typename T7, typename T8, typename T9,
- typename T10>
- inline void
- add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)) const { }
-
- std::vector<const trackable*>& bound_objects;
- };
- } // end namespace detail
-} // end namespace BOOST_SIGNALS_NAMESPACE
-
-} // end namespace boost
-
-#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_SUFFIX
-#endif
-
-#endif // BOOST_SIGNALS_TRACKABLE_HPP
--- /dev/null
+// A convenience header for Boost.Signals2, should pull in everying in the library.
+
+// Copyright (c) 2008-2009 Frank Mori Hess
+
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_SIGNALS2_HPP
+#define BOOST_SIGNALS2_HPP
+
+// For documentation, see http://www.boost.org/libs/signals2/
+
+#include <boost/signals2/deconstruct.hpp>
+#include <boost/signals2/deconstruct_ptr.hpp>
+#include <boost/signals2/dummy_mutex.hpp>
+#include <boost/signals2/last_value.hpp>
+#include <boost/signals2/signal.hpp>
+#include <boost/signals2/signal_type.hpp>
+#include <boost/signals2/shared_connection_block.hpp>
+
+#endif
--- /dev/null
+/*
+ boost::signals2::connection provides a handle to a signal/slot connection.
+
+ Author: Frank Mori Hess <fmhess@users.sourceforge.net>
+ Begin: 2007-01-23
+*/
+// Copyright Frank Mori Hess 2007-2008.
+// 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/signals2 for library home page.
+
+#ifndef BOOST_SIGNALS2_CONNECTION_HPP
+#define BOOST_SIGNALS2_CONNECTION_HPP
+
+#include <boost/function.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/signals2/detail/auto_buffer.hpp>
+#include <boost/signals2/detail/null_output_iterator.hpp>
+#include <boost/signals2/detail/unique_lock.hpp>
+#include <boost/signals2/slot.hpp>
+#include <boost/weak_ptr.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ inline void null_deleter(const void*) {}
+ namespace detail
+ {
+ // This lock maintains a list of shared_ptr<void>
+ // which will be destroyed only after the lock
+ // has released its mutex. Used to garbage
+ // collect disconnected slots
+ template<typename Mutex>
+ class garbage_collecting_lock: public noncopyable
+ {
+ public:
+ garbage_collecting_lock(Mutex &m):
+ lock(m)
+ {}
+ void add_trash(const shared_ptr<void> &piece_of_trash)
+ {
+ garbage.push_back(piece_of_trash);
+ }
+ private:
+ // garbage must be declared before lock
+ // to insure it is destroyed after lock is
+ // destroyed.
+ auto_buffer<shared_ptr<void>, store_n_objects<10> > garbage;
+ unique_lock<Mutex> lock;
+ };
+
+ class connection_body_base
+ {
+ public:
+ connection_body_base():
+ _connected(true), m_slot_refcount(1)
+ {
+ }
+ virtual ~connection_body_base() {}
+ void disconnect()
+ {
+ garbage_collecting_lock<connection_body_base> local_lock(*this);
+ nolock_disconnect(local_lock);
+ }
+ template<typename Mutex>
+ void nolock_disconnect(garbage_collecting_lock<Mutex> &lock_arg) const
+ {
+ if(_connected)
+ {
+ _connected = false;
+ dec_slot_refcount(lock_arg);
+ }
+ }
+ virtual bool connected() const = 0;
+ shared_ptr<void> get_blocker()
+ {
+ unique_lock<connection_body_base> local_lock(*this);
+ shared_ptr<void> blocker = _weak_blocker.lock();
+ if(blocker == shared_ptr<void>())
+ {
+ blocker.reset(this, &null_deleter);
+ _weak_blocker = blocker;
+ }
+ return blocker;
+ }
+ bool blocked() const
+ {
+ return !_weak_blocker.expired();
+ }
+ bool nolock_nograb_blocked() const
+ {
+ return nolock_nograb_connected() == false || blocked();
+ }
+ bool nolock_nograb_connected() const {return _connected;}
+ // expose part of Lockable concept of mutex
+ virtual void lock() = 0;
+ virtual void unlock() = 0;
+
+ // Slot refcount should be incremented while
+ // a signal invocation is using the slot, in order
+ // to prevent slot from being destroyed mid-invocation.
+ // garbage_collecting_lock parameter enforces
+ // the existance of a lock before this
+ // method is called
+ template<typename Mutex>
+ void inc_slot_refcount(const garbage_collecting_lock<Mutex> &)
+ {
+ BOOST_ASSERT(m_slot_refcount != 0);
+ ++m_slot_refcount;
+ }
+ // if slot refcount decrements to zero due to this call,
+ // it puts a
+ // shared_ptr to the slot in the garbage collecting lock,
+ // which will destroy the slot only after it unlocks.
+ template<typename Mutex>
+ void dec_slot_refcount(garbage_collecting_lock<Mutex> &lock_arg) const
+ {
+ BOOST_ASSERT(m_slot_refcount != 0);
+ if(--m_slot_refcount == 0)
+ {
+ lock_arg.add_trash(release_slot());
+ }
+ }
+
+ protected:
+ virtual shared_ptr<void> release_slot() const = 0;
+
+ weak_ptr<void> _weak_blocker;
+ private:
+ mutable bool _connected;
+ mutable unsigned m_slot_refcount;
+ };
+
+ template<typename GroupKey, typename SlotType, typename Mutex>
+ class connection_body: public connection_body_base
+ {
+ public:
+ typedef Mutex mutex_type;
+ connection_body(const SlotType &slot_in, const boost::shared_ptr<mutex_type> &signal_mutex):
+ m_slot(new SlotType(slot_in)), _mutex(signal_mutex)
+ {
+ }
+ virtual ~connection_body() {}
+ virtual bool connected() const
+ {
+ garbage_collecting_lock<mutex_type> local_lock(*_mutex);
+ nolock_grab_tracked_objects(local_lock, detail::null_output_iterator());
+ return nolock_nograb_connected();
+ }
+ const GroupKey& group_key() const {return _group_key;}
+ void set_group_key(const GroupKey &key) {_group_key = key;}
+ template<typename M>
+ void disconnect_expired_slot(garbage_collecting_lock<M> &lock_arg)
+ {
+ if(!m_slot) return;
+ bool expired = slot().expired();
+ if(expired == true)
+ {
+ nolock_disconnect(lock_arg);
+ }
+ }
+ template<typename M, typename OutputIterator>
+ void nolock_grab_tracked_objects(garbage_collecting_lock<M> &lock_arg,
+ OutputIterator inserter) const
+ {
+ if(!m_slot) return;
+ slot_base::tracked_container_type::const_iterator it;
+ for(it = slot().tracked_objects().begin();
+ it != slot().tracked_objects().end();
+ ++it)
+ {
+ void_shared_ptr_variant locked_object
+ (
+ apply_visitor
+ (
+ detail::lock_weak_ptr_visitor(),
+ *it
+ )
+ );
+ if(apply_visitor(detail::expired_weak_ptr_visitor(), *it))
+ {
+ nolock_disconnect(lock_arg);
+ return;
+ }
+ *inserter++ = locked_object;
+ }
+ }
+ // expose Lockable concept of mutex
+ virtual void lock()
+ {
+ _mutex->lock();
+ }
+ virtual void unlock()
+ {
+ _mutex->unlock();
+ }
+ SlotType &slot()
+ {
+ return *m_slot;
+ }
+ const SlotType &slot() const
+ {
+ return *m_slot;
+ }
+ protected:
+ virtual shared_ptr<void> release_slot() const
+ {
+
+ shared_ptr<void> released_slot = m_slot;
+ m_slot.reset();
+ return released_slot;
+ }
+ private:
+ mutable boost::shared_ptr<SlotType> m_slot;
+ const boost::shared_ptr<mutex_type> _mutex;
+ GroupKey _group_key;
+ };
+ }
+
+ class shared_connection_block;
+
+ class connection
+ {
+ public:
+ friend class shared_connection_block;
+
+ connection() {}
+ connection(const connection &other): _weak_connection_body(other._weak_connection_body)
+ {}
+ connection(const boost::weak_ptr<detail::connection_body_base> &connectionBody):
+ _weak_connection_body(connectionBody)
+ {}
+
+ // move support
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ connection(connection && other): _weak_connection_body(std::move(other._weak_connection_body))
+ {
+ // make sure other is reset, in case it is a scoped_connection (so it
+ // won't disconnect on destruction after being moved away from).
+ other._weak_connection_body.reset();
+ }
+ connection & operator=(connection && other)
+ {
+ if(&other == this) return *this;
+ _weak_connection_body = std::move(other._weak_connection_body);
+ // make sure other is reset, in case it is a scoped_connection (so it
+ // won't disconnect on destruction after being moved away from).
+ other._weak_connection_body.reset();
+ return *this;
+ }
+#endif // !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ connection & operator=(const connection & other)
+ {
+ if(&other == this) return *this;
+ _weak_connection_body = other._weak_connection_body;
+ return *this;
+ }
+
+ ~connection() {}
+ void disconnect() const
+ {
+ boost::shared_ptr<detail::connection_body_base> connectionBody(_weak_connection_body.lock());
+ if(connectionBody == 0) return;
+ connectionBody->disconnect();
+ }
+ bool connected() const
+ {
+ boost::shared_ptr<detail::connection_body_base> connectionBody(_weak_connection_body.lock());
+ if(connectionBody == 0) return false;
+ return connectionBody->connected();
+ }
+ bool blocked() const
+ {
+ boost::shared_ptr<detail::connection_body_base> connectionBody(_weak_connection_body.lock());
+ if(connectionBody == 0) return true;
+ return connectionBody->blocked();
+ }
+ bool operator==(const connection& other) const
+ {
+ boost::shared_ptr<detail::connection_body_base> connectionBody(_weak_connection_body.lock());
+ boost::shared_ptr<detail::connection_body_base> otherConnectionBody(other._weak_connection_body.lock());
+ return connectionBody == otherConnectionBody;
+ }
+ bool operator!=(const connection& other) const
+ {
+ return !(*this == other);
+ }
+ bool operator<(const connection& other) const
+ {
+ boost::shared_ptr<detail::connection_body_base> connectionBody(_weak_connection_body.lock());
+ boost::shared_ptr<detail::connection_body_base> otherConnectionBody(other._weak_connection_body.lock());
+ return connectionBody < otherConnectionBody;
+ }
+ void swap(connection &other)
+ {
+ using std::swap;
+ swap(_weak_connection_body, other._weak_connection_body);
+ }
+ protected:
+
+ boost::weak_ptr<detail::connection_body_base> _weak_connection_body;
+ };
+ inline void swap(connection &conn1, connection &conn2)
+ {
+ conn1.swap(conn2);
+ }
+
+ class scoped_connection: public connection
+ {
+ public:
+ scoped_connection() {}
+ scoped_connection(const connection &other):
+ connection(other)
+ {}
+ ~scoped_connection()
+ {
+ disconnect();
+ }
+ scoped_connection& operator=(const connection &rhs)
+ {
+ disconnect();
+ connection::operator=(rhs);
+ return *this;
+ }
+
+ // move support
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ scoped_connection(scoped_connection && other): connection(std::move(other))
+ {
+ }
+ scoped_connection(connection && other): connection(std::move(other))
+ {
+ }
+ scoped_connection & operator=(scoped_connection && other)
+ {
+ if(&other == this) return *this;
+ disconnect();
+ connection::operator=(std::move(other));
+ return *this;
+ }
+ scoped_connection & operator=(connection && other)
+ {
+ if(&other == this) return *this;
+ disconnect();
+ connection::operator=(std::move(other));
+ return *this;
+ }
+#endif // !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+ connection release()
+ {
+ connection conn(_weak_connection_body);
+ _weak_connection_body.reset();
+ return conn;
+ }
+ private:
+ scoped_connection(const scoped_connection &other);
+ scoped_connection& operator=(const scoped_connection &rhs);
+ };
+ // Sun 5.9 compiler doesn't find the swap for base connection class when
+ // arguments are scoped_connection, so we provide this explicitly.
+ inline void swap(scoped_connection &conn1, scoped_connection &conn2)
+ {
+ conn1.swap(conn2);
+ }
+ }
+}
+
+#endif // BOOST_SIGNALS2_CONNECTION_HPP
--- /dev/null
+#ifndef BOOST_SIGNALS2_DECONSTRUCT_HPP
+#define BOOST_SIGNALS2_DECONSTRUCT_HPP
+
+// deconstruct.hpp
+//
+// A factory function for creating a shared_ptr which creates
+// an object and its owning shared_ptr with one allocation, similar
+// to make_shared<T>(). It also supports postconstructors
+// and predestructors through unqualified calls of adl_postconstruct() and
+// adl_predestruct, relying on argument-dependent
+// lookup to find the appropriate postconstructor or predestructor.
+// Passing arguments to postconstructors is also supported.
+//
+// based on make_shared.hpp and make_shared_access patch from Michael Marcin
+//
+// Copyright (c) 2007, 2008 Peter Dimov
+// Copyright (c) 2008 Michael Marcin
+// Copyright (c) 2009 Frank Mori Hess
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+// See http://www.boost.org
+// for more information
+
+#include <boost/config.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/type_traits/alignment_of.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/type_traits/type_with_alignment.hpp>
+#include <cstddef>
+#include <new>
+
+namespace boost
+{
+ template<typename T> class enable_shared_from_this;
+
+namespace signals2
+{
+ class deconstruct_access;
+
+namespace detail
+{
+ inline void adl_predestruct(...) {}
+} // namespace detail
+
+template<typename T>
+ class postconstructor_invoker
+{
+public:
+ operator const shared_ptr<T> & () const
+ {
+ return postconstruct();
+ }
+ const shared_ptr<T>& postconstruct() const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()));
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ template<class... Args>
+ const shared_ptr<T>& postconstruct(Args && ... args)
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ std::forward<Args>(args)...);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+#else // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ template<typename A1>
+ const shared_ptr<T>& postconstruct(const A1 &a1) const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ a1);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+ template<typename A1, typename A2>
+ const shared_ptr<T>& postconstruct(const A1 &a1, const A2 &a2) const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ a1, a2);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+ template<typename A1, typename A2, typename A3>
+ const shared_ptr<T>& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3) const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ a1, a2, a3);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+ template<typename A1, typename A2, typename A3, typename A4>
+ const shared_ptr<T>& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ a1, a2, a3, a4);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+ template<typename A1, typename A2, typename A3, typename A4, typename A5>
+ const shared_ptr<T>& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ a1, a2, a3, a4, a5);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+ template<typename A1, typename A2, typename A3, typename A4, typename A5,
+ typename A6>
+ const shared_ptr<T>& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5,
+ const A6 &a6) const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ a1, a2, a3, a4, a5, a6);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+ template<typename A1, typename A2, typename A3, typename A4, typename A5,
+ typename A6, typename A7>
+ const shared_ptr<T>& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5,
+ const A6 &a6, const A7 &a7) const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ a1, a2, a3, a4, a5, a6, a7);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+ template<typename A1, typename A2, typename A3, typename A4, typename A5,
+ typename A6, typename A7, typename A8>
+ const shared_ptr<T>& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5,
+ const A6 &a6, const A7 &a7, const A8 &a8) const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ a1, a2, a3, a4, a5, a6, a7, a8);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+ template<typename A1, typename A2, typename A3, typename A4, typename A5,
+ typename A6, typename A7, typename A8, typename A9>
+ const shared_ptr<T>& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5,
+ const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9) const
+ {
+ if(!_postconstructed)
+ {
+ adl_postconstruct(_sp, const_cast<typename boost::remove_const<T>::type *>(_sp.get()),
+ a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ _postconstructed = true;
+ }
+ return _sp;
+ }
+#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+private:
+ friend class boost::signals2::deconstruct_access;
+ postconstructor_invoker(const shared_ptr<T> & sp):
+ _sp(sp), _postconstructed(false)
+ {}
+ shared_ptr<T> _sp;
+ mutable bool _postconstructed;
+};
+
+namespace detail
+{
+
+template< std::size_t N, std::size_t A > struct sp_aligned_storage
+{
+ union type
+ {
+ char data_[ N ];
+ typename boost::type_with_alignment< A >::type align_;
+ };
+};
+
+template< class T > class deconstruct_deleter
+{
+private:
+
+ typedef typename sp_aligned_storage< sizeof( T ), ::boost::alignment_of< T >::value >::type storage_type;
+
+ bool initialized_;
+ storage_type storage_;
+
+private:
+
+ void destroy()
+ {
+ if( initialized_ )
+ {
+ T* p = reinterpret_cast< T* >( storage_.data_ );
+ using boost::signals2::detail::adl_predestruct;
+ adl_predestruct(const_cast<typename boost::remove_const<T>::type *>(p));
+ p->~T();
+ initialized_ = false;
+ }
+ }
+
+public:
+
+ deconstruct_deleter(): initialized_( false )
+ {
+ }
+
+ // this copy constructor is an optimization: we don't need to copy the storage_ member,
+ // and shouldn't be copying anyways after initialized_ becomes true
+ deconstruct_deleter(const deconstruct_deleter &): initialized_( false )
+ {
+ }
+
+ ~deconstruct_deleter()
+ {
+ destroy();
+ }
+
+ void operator()( T * )
+ {
+ destroy();
+ }
+
+ void * address()
+ {
+ return storage_.data_;
+ }
+
+ void set_initialized()
+ {
+ initialized_ = true;
+ }
+};
+} // namespace detail
+
+class deconstruct_access
+{
+public:
+
+ template< class T >
+ static postconstructor_invoker<T> deconstruct()
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T();
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+
+ }
+
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+ // Variadic templates, rvalue reference
+
+ template< class T, class... Args >
+ static postconstructor_invoker<T> deconstruct( Args && ... args )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( std::forward<Args>( args )... );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+#else
+
+ template< class T, class A1 >
+ static postconstructor_invoker<T> deconstruct( A1 const & a1 )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( a1 );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+ template< class T, class A1, class A2 >
+ static postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2 )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( a1, a2 );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+ template< class T, class A1, class A2, class A3 >
+ static postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3 )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( a1, a2, a3 );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+ template< class T, class A1, class A2, class A3, class A4 >
+ static postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( a1, a2, a3, a4 );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+ template< class T, class A1, class A2, class A3, class A4, class A5 >
+ static postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( a1, a2, a3, a4, a5 );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+ template< class T, class A1, class A2, class A3, class A4, class A5, class A6 >
+ static postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( a1, a2, a3, a4, a5, a6 );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+ template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
+ static postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( a1, a2, a3, a4, a5, a6, a7 );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+ template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
+ static postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8 );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+ template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
+ static postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
+ {
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() );
+
+ detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt );
+
+ void * pv = pd->address();
+
+ new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
+ pd->set_initialized();
+
+ boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) );
+ boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get());
+ return retval;
+ }
+
+#endif
+};
+
+// Zero-argument versions
+//
+// Used even when variadic templates are available because of the new T() vs new T issue
+
+template< class T > postconstructor_invoker<T> deconstruct()
+{
+ return deconstruct_access::deconstruct<T>();
+}
+
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+// Variadic templates, rvalue reference
+
+template< class T, class... Args > postconstructor_invoker< T > deconstruct( Args && ... args )
+{
+ return deconstruct_access::deconstruct<T>( std::forward<Args>( args )... );
+}
+
+#else
+
+// C++03 version
+
+template< class T, class A1 >
+postconstructor_invoker<T> deconstruct( A1 const & a1 )
+{
+ return deconstruct_access::deconstruct<T>(a1);
+}
+
+template< class T, class A1, class A2 >
+postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2 )
+{
+ return deconstruct_access::deconstruct<T>(a1,a2);
+}
+
+template< class T, class A1, class A2, class A3 >
+postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3 )
+{
+ return deconstruct_access::deconstruct<T>(a1,a2,a3);
+}
+
+template< class T, class A1, class A2, class A3, class A4 >
+postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
+{
+ return deconstruct_access::deconstruct<T>(a1,a2,a3,a4);
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5 >
+postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
+{
+ return deconstruct_access::deconstruct<T>(a1,a2,a3,a4,a5);
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5, class A6 >
+postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
+{
+ return deconstruct_access::deconstruct<T>(a1,a2,a3,a4,a5,a6);
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
+postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
+{
+ return deconstruct_access::deconstruct<T>(a1,a2,a3,a4,a5,a6,a7);
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
+postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
+{
+ return deconstruct_access::deconstruct<T>(a1,a2,a3,a4,a5,a6,a7,a8);
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
+postconstructor_invoker<T> deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
+{
+ return deconstruct_access::deconstruct<T>(a1,a2,a3,a4,a5,a6,a7,a8,a9);
+}
+
+#endif
+
+} // namespace signals2
+} // namespace boost
+
+#endif // #ifndef BOOST_SIGNALS2_DECONSTRUCT_HPP
--- /dev/null
+// DEPRECATED in favor of adl_postconstruct and adl_predestruct with
+// deconstruct<T>().
+// A factory function for creating a shared_ptr that enhances the plain
+// shared_ptr constructors by adding support for postconstructors
+// and predestructors through the boost::signals2::postconstructible and
+// boost::signals2::predestructible base classes.
+//
+// Copyright Frank Mori Hess 2007-2008.
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_SIGNALS2_DECONSTRUCT_PTR_HPP
+#define BOOST_SIGNALS2_DECONSTRUCT_PTR_HPP
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+#include <boost/signals2/postconstructible.hpp>
+#include <boost/signals2/predestructible.hpp>
+#include <boost/shared_ptr.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ inline void do_postconstruct(const postconstructible *ptr)
+ {
+ postconstructible *nonconst_ptr = const_cast<postconstructible*>(ptr);
+ nonconst_ptr->postconstruct();
+ }
+ inline void do_postconstruct(...)
+ {
+ }
+ inline void do_predestruct(...)
+ {
+ }
+ inline void do_predestruct(const predestructible *ptr)
+ {
+ try
+ {
+ predestructible *nonconst_ptr = const_cast<predestructible*>(ptr);
+ nonconst_ptr->predestruct();
+ }
+ catch(...)
+ {
+ BOOST_ASSERT(false);
+ }
+ }
+ }
+
+ template<typename T> class predestructing_deleter
+ {
+ public:
+ void operator()(const T *ptr) const
+ {
+ detail::do_predestruct(ptr);
+ checked_delete(ptr);
+ }
+ };
+
+ template<typename T>
+ shared_ptr<T> deconstruct_ptr(T *ptr)
+ {
+ if(ptr == 0) return shared_ptr<T>(ptr);
+ shared_ptr<T> shared(ptr, boost::signals2::predestructing_deleter<T>());
+ detail::do_postconstruct(ptr);
+ return shared;
+ }
+ template<typename T, typename D>
+ shared_ptr<T> deconstruct_ptr(T *ptr, D deleter)
+ {
+ shared_ptr<T> shared(ptr, deleter);
+ if(ptr == 0) return shared;
+ detail::do_postconstruct(ptr);
+ return shared;
+ }
+ }
+}
+
+#endif // BOOST_SIGNALS2_DECONSTRUCT_PTR_HPP
--- /dev/null
+// Copyright Thorsten Ottosen, 2009.
+// 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_SIGNALS2_DETAIL_AUTO_BUFFER_HPP_25_02_2009
+#define BOOST_SIGNALS2_DETAIL_AUTO_BUFFER_HPP_25_02_2009
+
+#include <boost/detail/workaround.hpp>
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(push)
+#pragma warning(disable:4996)
+#endif
+
+#include <boost/assert.hpp>
+#include <boost/iterator/reverse_iterator.hpp>
+#include <boost/iterator/iterator_traits.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/multi_index/detail/scope_guard.hpp>
+#include <boost/swap.hpp>
+#include <boost/type_traits/aligned_storage.hpp>
+#include <boost/type_traits/alignment_of.hpp>
+#include <boost/type_traits/has_nothrow_copy.hpp>
+#include <boost/type_traits/has_nothrow_assign.hpp>
+#include <boost/type_traits/has_trivial_assign.hpp>
+#include <boost/type_traits/has_trivial_constructor.hpp>
+#include <boost/type_traits/has_trivial_destructor.hpp>
+#include <algorithm>
+#include <cstring>
+#include <iterator>
+#include <memory>
+#include <stdexcept>
+
+namespace boost
+{
+namespace signals2
+{
+namespace detail
+{
+ //
+ // Policies for creating the stack buffer.
+ //
+ template< unsigned N >
+ struct store_n_objects
+ {
+ BOOST_STATIC_CONSTANT( unsigned, value = N );
+ };
+
+ template< unsigned N >
+ struct store_n_bytes
+ {
+ BOOST_STATIC_CONSTANT( unsigned, value = N );
+ };
+
+ namespace auto_buffer_detail
+ {
+ template< class Policy, class T >
+ struct compute_buffer_size
+ {
+ BOOST_STATIC_CONSTANT( unsigned, value = Policy::value * sizeof(T) );
+ };
+
+ template< unsigned N, class T >
+ struct compute_buffer_size< store_n_bytes<N>, T >
+ {
+ BOOST_STATIC_CONSTANT( unsigned, value = N );
+ };
+
+ template< class Policy, class T >
+ struct compute_buffer_objects
+ {
+ BOOST_STATIC_CONSTANT( unsigned, value = Policy::value );
+ };
+
+ template< unsigned N, class T >
+ struct compute_buffer_objects< store_n_bytes<N>, T >
+ {
+ BOOST_STATIC_CONSTANT( unsigned, value = N / sizeof(T) );
+ };
+ }
+
+ struct default_grow_policy
+ {
+ template< class SizeType >
+ static SizeType new_capacity( SizeType capacity )
+ {
+ //
+ // @remark: we grow the capacity quite agressively.
+ // this is justified since we aim to minimize
+ // heap-allocations, and because we mostly use
+ // the buffer locally.
+ return capacity * 4u;
+ }
+
+ template< class SizeType >
+ static bool should_shrink( SizeType, SizeType )
+ {
+ //
+ // @remark: when defining a new grow policy, one might
+ // choose that if the waated space is less
+ // than a certain percentage, then it is of
+ // little use to shrink.
+ //
+ return true;
+ }
+ };
+
+ template< class T,
+ class StackBufferPolicy = store_n_objects<256>,
+ class GrowPolicy = default_grow_policy,
+ class Allocator = std::allocator<T> >
+ class auto_buffer;
+
+
+
+ template
+ <
+ class T,
+ class StackBufferPolicy,
+ class GrowPolicy,
+ class Allocator
+ >
+ class auto_buffer : Allocator
+ {
+ private:
+ enum { N = auto_buffer_detail::
+ compute_buffer_objects<StackBufferPolicy,T>::value };
+
+ BOOST_STATIC_CONSTANT( bool, is_stack_buffer_empty = N == 0u );
+
+ typedef auto_buffer<T, store_n_objects<0>, GrowPolicy, Allocator>
+ local_buffer;
+
+ public:
+ typedef Allocator allocator_type;
+ typedef T value_type;
+ typedef typename Allocator::size_type size_type;
+ typedef typename Allocator::difference_type difference_type;
+ typedef T* pointer;
+ typedef typename Allocator::pointer allocator_pointer;
+ typedef const T* const_pointer;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef pointer iterator;
+ typedef const_pointer const_iterator;
+ typedef boost::reverse_iterator<iterator> reverse_iterator;
+ typedef boost::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef typename boost::mpl::if_c< boost::has_trivial_assign<T>::value
+ && sizeof(T) <= sizeof(long double),
+ const value_type,
+ const_reference >::type
+ optimized_const_reference;
+ private:
+
+ pointer allocate( size_type capacity_arg )
+ {
+ if( capacity_arg > N )
+ return &*get_allocator().allocate( capacity_arg );
+ else
+ return static_cast<T*>( members_.address() );
+ }
+
+ void deallocate( pointer where, size_type capacity_arg )
+ {
+ if( capacity_arg <= N )
+ return;
+ get_allocator().deallocate( allocator_pointer(where), capacity_arg );
+ }
+
+ template< class I >
+ static void copy_impl( I begin, I end, pointer where, std::random_access_iterator_tag )
+ {
+ copy_rai( begin, end, where, boost::has_trivial_assign<T>() );
+ }
+
+ static void copy_rai( const T* begin, const T* end,
+ pointer where, const boost::true_type& )
+ {
+ std::memcpy( where, begin, sizeof(T) * std::distance(begin,end) );
+ }
+
+ template< class I, bool b >
+ static void copy_rai( I begin, I end,
+ pointer where, const boost::integral_constant<bool, b>& )
+ {
+ std::uninitialized_copy( begin, end, where );
+ }
+
+ template< class I >
+ static void copy_impl( I begin, I end, pointer where, std::bidirectional_iterator_tag )
+ {
+ std::uninitialized_copy( begin, end, where );
+ }
+
+ template< class I >
+ static void copy_impl( I begin, I end, pointer where )
+ {
+ copy_impl( begin, end, where,
+ typename std::iterator_traits<I>::iterator_category() );
+ }
+
+ template< class I, class I2 >
+ static void assign_impl( I begin, I end, I2 where )
+ {
+ assign_impl( begin, end, where, boost::has_trivial_assign<T>() );
+ }
+
+ template< class I, class I2 >
+ static void assign_impl( I begin, I end, I2 where, const boost::true_type& )
+ {
+ std::memcpy( where, begin, sizeof(T) * std::distance(begin,end) );
+ }
+
+ template< class I, class I2 >
+ static void assign_impl( I begin, I end, I2 where, const boost::false_type& )
+ {
+ for( ; begin != end; ++begin, ++where )
+ *where = *begin;
+ }
+
+ void unchecked_push_back_n( size_type n, const boost::true_type& )
+ {
+ std::uninitialized_fill( end(), end() + n, T() );
+ size_ += n;
+ }
+
+ void unchecked_push_back_n( size_type n, const boost::false_type& )
+ {
+ for( size_type i = 0u; i < n; ++i )
+ unchecked_push_back();
+ }
+
+ void auto_buffer_destroy( pointer where, const boost::false_type& )
+ {
+ (*where).~T();
+ }
+
+ void auto_buffer_destroy( pointer, const boost::true_type& )
+ { }
+
+ void auto_buffer_destroy( pointer where )
+ {
+ auto_buffer_destroy( where, boost::has_trivial_destructor<T>() );
+ }
+
+ void destroy_back_n( size_type n, const boost::false_type& )
+ {
+ BOOST_ASSERT( n > 0 );
+ pointer buffer = buffer_ + size_ - 1u;
+ pointer new_end = buffer - n;
+ for( ; buffer > new_end; --buffer )
+ auto_buffer_destroy( buffer );
+ }
+
+ void destroy_back_n( size_type, const boost::true_type& )
+ { }
+
+ void destroy_back_n( size_type n )
+ {
+ destroy_back_n( n, boost::has_trivial_destructor<T>() );
+ }
+
+ void auto_buffer_destroy( const boost::false_type& x )
+ {
+ if( size_ )
+ destroy_back_n( size_, x );
+ deallocate( buffer_, members_.capacity_ );
+ }
+
+ void auto_buffer_destroy( const boost::true_type& )
+ {
+ deallocate( buffer_, members_.capacity_ );
+ }
+
+ pointer move_to_new_buffer( size_type new_capacity, const boost::false_type& )
+ {
+ pointer new_buffer = allocate( new_capacity ); // strong
+ boost::multi_index::detail::scope_guard guard =
+ boost::multi_index::detail::make_obj_guard( *this,
+ &auto_buffer::deallocate,
+ new_buffer,
+ new_capacity );
+ copy_impl( begin(), end(), new_buffer ); // strong
+ guard.dismiss(); // nothrow
+ return new_buffer;
+ }
+
+ pointer move_to_new_buffer( size_type new_capacity, const boost::true_type& )
+ {
+ pointer new_buffer = allocate( new_capacity ); // strong
+ copy_impl( begin(), end(), new_buffer ); // nothrow
+ return new_buffer;
+ }
+
+ void reserve_impl( size_type new_capacity )
+ {
+ pointer new_buffer = move_to_new_buffer( new_capacity,
+ boost::has_nothrow_copy<T>() );
+ (*this).~auto_buffer();
+ buffer_ = new_buffer;
+ members_.capacity_ = new_capacity;
+ BOOST_ASSERT( size_ <= members_.capacity_ );
+ }
+
+ size_type new_capacity_impl( size_type n )
+ {
+ BOOST_ASSERT( n > members_.capacity_ );
+ size_type new_capacity = GrowPolicy::new_capacity( members_.capacity_ );
+ // @todo: consider to check for allocator.max_size()
+ return (std::max)(new_capacity,n);
+ }
+
+ static void swap_helper( auto_buffer& l, auto_buffer& r,
+ const boost::true_type& )
+ {
+ BOOST_ASSERT( l.is_on_stack() && r.is_on_stack() );
+
+ auto_buffer temp( l.begin(), l.end() );
+ assign_impl( r.begin(), r.end(), l.begin() );
+ assign_impl( temp.begin(), temp.end(), r.begin() );
+ boost::swap( l.size_, r.size_ );
+ boost::swap( l.members_.capacity_, r.members_.capacity_ );
+ }
+
+ static void swap_helper( auto_buffer& l, auto_buffer& r,
+ const boost::false_type& )
+ {
+ BOOST_ASSERT( l.is_on_stack() && r.is_on_stack() );
+ size_type min_size = (std::min)(l.size_,r.size_);
+ size_type max_size = (std::max)(l.size_,r.size_);
+ size_type diff = max_size - min_size;
+ auto_buffer* smallest = l.size_ == min_size ? &l : &r;
+ auto_buffer* largest = smallest == &l ? &r : &l;
+
+ // @remark: the implementation below is not as fast
+ // as it could be if we assumed T had a default
+ // constructor.
+
+ size_type i = 0u;
+ for( ; i < min_size; ++i )
+ boost::swap( (*smallest)[i], (*largest)[i] );
+
+ for( ; i < max_size; ++i )
+ smallest->unchecked_push_back( (*largest)[i] );
+
+ largest->pop_back_n( diff );
+ boost::swap( l.members_.capacity_, r.members_.capacity_ );
+ }
+
+ void one_sided_swap( auto_buffer& temp ) // nothrow
+ {
+ BOOST_ASSERT( !temp.is_on_stack() );
+ this->~auto_buffer();
+ // @remark: must be nothrow
+ get_allocator() = temp.get_allocator();
+ members_.capacity_ = temp.members_.capacity_;
+ buffer_ = temp.buffer_;
+ BOOST_ASSERT( temp.size_ >= size_ + 1u );
+ size_ = temp.size_;
+ temp.buffer_ = 0;
+ BOOST_ASSERT( temp.is_valid() );
+ }
+
+ template< class I >
+ void insert_impl( const_iterator before, I begin_arg, I end_arg,
+ std::input_iterator_tag )
+ {
+ for( ; begin_arg != end_arg; ++begin_arg )
+ {
+ before = insert( before, *begin_arg );
+ ++before;
+ }
+ }
+
+ void grow_back( size_type n, const boost::true_type& )
+ {
+ BOOST_ASSERT( size_ + n <= members_.capacity_ );
+ size_ += n;
+ }
+
+ void grow_back( size_type n, const boost::false_type& )
+ {
+ unchecked_push_back_n(n);
+ }
+
+ void grow_back( size_type n )
+ {
+ grow_back( n, boost::has_trivial_constructor<T>() );
+ }
+
+ void grow_back_one( const boost::true_type& )
+ {
+ BOOST_ASSERT( size_ + 1 <= members_.capacity_ );
+ size_ += 1;
+ }
+
+ void grow_back_one( const boost::false_type& )
+ {
+ unchecked_push_back();
+ }
+
+ void grow_back_one()
+ {
+ grow_back_one( boost::has_trivial_constructor<T>() );
+ }
+
+ template< class I >
+ void insert_impl( const_iterator before, I begin_arg, I end_arg,
+ std::forward_iterator_tag )
+ {
+ difference_type n = std::distance(begin_arg, end_arg);
+
+ if( size_ + n <= members_.capacity_ )
+ {
+ bool is_back_insertion = before == cend();
+ if( !is_back_insertion )
+ {
+ grow_back( n );
+ iterator where = const_cast<T*>(before);
+ std::copy( before, cend() - n, where + n );
+ assign_impl( begin_arg, end_arg, where );
+ }
+ else
+ {
+ unchecked_push_back( begin_arg, end_arg );
+ }
+ BOOST_ASSERT( is_valid() );
+ return;
+ }
+
+ auto_buffer temp( new_capacity_impl( size_ + n ) );
+ temp.unchecked_push_back( cbegin(), before );
+ temp.unchecked_push_back( begin_arg, end_arg );
+ temp.unchecked_push_back( before, cend() );
+ one_sided_swap( temp );
+ BOOST_ASSERT( is_valid() );
+ }
+
+ public:
+ bool is_valid() const // invariant
+ {
+ // @remark: allowed for N==0 and when
+ // using a locally instance
+ // in insert()/one_sided_swap()
+ if( buffer_ == 0 )
+ return true;
+
+ if( members_.capacity_ < N )
+ return false;
+
+ if( !is_on_stack() && members_.capacity_ <= N )
+ return false;
+
+ if( buffer_ == members_.address() )
+ if( members_.capacity_ > N )
+ return false;
+
+ if( size_ > members_.capacity_ )
+ return false;
+
+ return true;
+ }
+
+ auto_buffer()
+ : members_( N ),
+ buffer_( static_cast<T*>(members_.address()) ),
+ size_( 0u )
+ {
+ BOOST_ASSERT( is_valid() );
+ }
+
+ auto_buffer( const auto_buffer& r )
+ : members_( (std::max)(r.size_,size_type(N)) ),
+ buffer_( allocate( members_.capacity_ ) ),
+ size_( 0 )
+ {
+ copy_impl( r.begin(), r.end(), buffer_ );
+ size_ = r.size_;
+ BOOST_ASSERT( is_valid() );
+ }
+
+ auto_buffer& operator=( const auto_buffer& r ) // basic
+ {
+ if( this == &r )
+ return *this;
+
+ difference_type diff = size_ - r.size_;
+ if( diff >= 0 )
+ {
+ pop_back_n( static_cast<size_type>(diff) );
+ assign_impl( r.begin(), r.end(), begin() );
+ }
+ else
+ {
+ if( members_.capacity_ >= r.size() )
+ {
+ unchecked_push_back_n( static_cast<size_type>(-diff) );
+ assign_impl( r.begin(), r.end(), begin() );
+ }
+ else
+ {
+ // @remark: we release memory as early as possible
+ // since we only give the basic guarantee
+ (*this).~auto_buffer();
+ buffer_ = 0;
+ pointer new_buffer = allocate( r.size() );
+ boost::multi_index::detail::scope_guard guard =
+ boost::multi_index::detail::make_obj_guard( *this,
+ &auto_buffer::deallocate,
+ new_buffer,
+ r.size() );
+ copy_impl( r.begin(), r.end(), new_buffer );
+ guard.dismiss();
+ buffer_ = new_buffer;
+ members_.capacity_ = r.size();
+ size_ = members_.capacity_;
+ }
+ }
+
+ BOOST_ASSERT( size() == r.size() );
+ BOOST_ASSERT( is_valid() );
+ return *this;
+ }
+
+ explicit auto_buffer( size_type capacity_arg )
+ : members_( (std::max)(capacity_arg, size_type(N)) ),
+ buffer_( allocate(members_.capacity_) ),
+ size_( 0 )
+ {
+ BOOST_ASSERT( is_valid() );
+ }
+
+ auto_buffer( size_type size_arg, optimized_const_reference init_value )
+ : members_( (std::max)(size_arg, size_type(N)) ),
+ buffer_( allocate(members_.capacity_) ),
+ size_( 0 )
+ {
+ std::uninitialized_fill( buffer_, buffer_ + size_arg, init_value );
+ size_ = size_arg;
+ BOOST_ASSERT( is_valid() );
+ }
+
+ auto_buffer( size_type capacity_arg, const allocator_type& a )
+ : allocator_type( a ),
+ members_( (std::max)(capacity_arg, size_type(N)) ),
+ buffer_( allocate(members_.capacity_) ),
+ size_( 0 )
+ {
+ BOOST_ASSERT( is_valid() );
+ }
+
+ auto_buffer( size_type size_arg, optimized_const_reference init_value,
+ const allocator_type& a )
+ : allocator_type( a ),
+ members_( (std::max)(size_arg, size_type(N)) ),
+ buffer_( allocate(members_.capacity_) ),
+ size_( 0 )
+ {
+ std::uninitialized_fill( buffer_, buffer_ + size_arg, init_value );
+ size_ = size_arg;
+ BOOST_ASSERT( is_valid() );
+ }
+
+ template< class ForwardIterator >
+ auto_buffer( ForwardIterator begin_arg, ForwardIterator end_arg )
+ :
+ members_( std::distance(begin_arg, end_arg) ),
+ buffer_( allocate(members_.capacity_) ),
+ size_( 0 )
+ {
+ copy_impl( begin_arg, end_arg, buffer_ );
+ size_ = members_.capacity_;
+ if( members_.capacity_ < N )
+ members_.capacity_ = N;
+ BOOST_ASSERT( is_valid() );
+ }
+
+ template< class ForwardIterator >
+ auto_buffer( ForwardIterator begin_arg, ForwardIterator end_arg,
+ const allocator_type& a )
+ : allocator_type( a ),
+ members_( std::distance(begin_arg, end_arg) ),
+ buffer_( allocate(members_.capacity_) ),
+ size_( 0 )
+ {
+ copy_impl( begin_arg, end_arg, buffer_ );
+ size_ = members_.capacity_;
+ if( members_.capacity_ < N )
+ members_.capacity_ = N;
+ BOOST_ASSERT( is_valid() );
+ }
+
+ ~auto_buffer()
+ {
+ BOOST_ASSERT( is_valid() );
+ if( buffer_ ) // do we need this check? Yes, but only
+ // for N = 0u + local instances in one_sided_swap()
+ auto_buffer_destroy( boost::has_trivial_destructor<T>() );
+ }
+
+ public:
+ bool empty() const
+ {
+ return size_ == 0;
+ }
+
+ bool full() const
+ {
+ return size_ == members_.capacity_;
+ }
+
+ bool is_on_stack() const
+ {
+ return members_.capacity_ <= N;
+ }
+
+ size_type size() const
+ {
+ return size_;
+ }
+
+ size_type capacity() const
+ {
+ return members_.capacity_;
+ }
+
+ public:
+ pointer data()
+ {
+ return buffer_;
+ }
+
+ const_pointer data() const
+ {
+ return buffer_;
+ }
+
+ allocator_type& get_allocator()
+ {
+ return static_cast<allocator_type&>(*this);
+ }
+
+ const allocator_type& get_allocator() const
+ {
+ return static_cast<const allocator_type&>(*this);
+ }
+
+ public:
+ iterator begin()
+ {
+ return buffer_;
+ }
+
+ const_iterator begin() const
+ {
+ return buffer_;
+ }
+
+ iterator end()
+ {
+ return buffer_ + size_;
+ }
+
+ const_iterator end() const
+ {
+ return buffer_ + size_;
+ }
+
+ reverse_iterator rbegin()
+ {
+ return reverse_iterator(end());
+ }
+
+ const_reverse_iterator rbegin() const
+ {
+ return const_reverse_iterator(end());
+ }
+
+ reverse_iterator rend()
+ {
+ return reverse_iterator(begin());
+ }
+
+ const_reverse_iterator rend() const
+ {
+ return const_reverse_iterator(begin());
+ }
+
+ const_iterator cbegin() const
+ {
+ return const_cast<const auto_buffer*>(this)->begin();
+ }
+
+ const_iterator cend() const
+ {
+ return const_cast<const auto_buffer*>(this)->end();
+ }
+
+ const_reverse_iterator crbegin() const
+ {
+ return const_cast<const auto_buffer*>(this)->rbegin();
+ }
+
+ const_reverse_iterator crend() const
+ {
+ return const_cast<const auto_buffer*>(this)->rend();
+ }
+
+ public:
+ reference front()
+ {
+ return buffer_[0];
+ }
+
+ optimized_const_reference front() const
+ {
+ return buffer_[0];
+ }
+
+ reference back()
+ {
+ return buffer_[size_-1];
+ }
+
+ optimized_const_reference back() const
+ {
+ return buffer_[size_-1];
+ }
+
+ reference operator[]( size_type n )
+ {
+ BOOST_ASSERT( n < size_ );
+ return buffer_[n];
+ }
+
+ optimized_const_reference operator[]( size_type n ) const
+ {
+ BOOST_ASSERT( n < size_ );
+ return buffer_[n];
+ }
+
+ void unchecked_push_back()
+ {
+ BOOST_ASSERT( !full() );
+ new (buffer_ + size_) T;
+ ++size_;
+ }
+
+ void unchecked_push_back_n( size_type n )
+ {
+ BOOST_ASSERT( size_ + n <= members_.capacity_ );
+ unchecked_push_back_n( n, boost::has_trivial_assign<T>() );
+ }
+
+ void unchecked_push_back( optimized_const_reference x ) // non-growing
+ {
+ BOOST_ASSERT( !full() );
+ new (buffer_ + size_) T( x );
+ ++size_;
+ }
+
+ template< class ForwardIterator >
+ void unchecked_push_back( ForwardIterator begin_arg,
+ ForwardIterator end_arg ) // non-growing
+ {
+ BOOST_ASSERT( size_ + std::distance(begin_arg, end_arg) <= members_.capacity_ );
+ copy_impl( begin_arg, end_arg, buffer_ + size_ );
+ size_ += std::distance(begin_arg, end_arg);
+ }
+
+ void reserve_precisely( size_type n )
+ {
+ BOOST_ASSERT( members_.capacity_ >= N );
+
+ if( n <= members_.capacity_ )
+ return;
+ reserve_impl( n );
+ BOOST_ASSERT( members_.capacity_ == n );
+ }
+
+ void reserve( size_type n ) // strong
+ {
+ BOOST_ASSERT( members_.capacity_ >= N );
+
+ if( n <= members_.capacity_ )
+ return;
+
+ reserve_impl( new_capacity_impl( n ) );
+ BOOST_ASSERT( members_.capacity_ >= n );
+ }
+
+ void push_back()
+ {
+ if( size_ != members_.capacity_ )
+ {
+ unchecked_push_back();
+ }
+ else
+ {
+ reserve( size_ + 1u );
+ unchecked_push_back();
+ }
+ }
+
+ void push_back( optimized_const_reference x )
+ {
+ if( size_ != members_.capacity_ )
+ {
+ unchecked_push_back( x );
+ }
+ else
+ {
+ reserve( size_ + 1u );
+ unchecked_push_back( x );
+ }
+ }
+
+ template< class ForwardIterator >
+ void push_back( ForwardIterator begin_arg, ForwardIterator end_arg )
+ {
+ difference_type diff = std::distance(begin_arg, end_arg);
+ if( size_ + diff > members_.capacity_ )
+ reserve( size_ + diff );
+ unchecked_push_back( begin_arg, end_arg );
+ }
+
+ iterator insert( const_iterator before, optimized_const_reference x ) // basic
+ {
+ // @todo: consider if we want to support x in 'this'
+ if( size_ < members_.capacity_ )
+ {
+ bool is_back_insertion = before == cend();
+ iterator where = const_cast<T*>(before);
+
+ if( !is_back_insertion )
+ {
+ grow_back_one();
+ std::copy( before, cend() - 1u, where + 1u );
+ *where = x;
+ BOOST_ASSERT( is_valid() );
+ }
+ else
+ {
+ unchecked_push_back( x );
+ }
+ return where;
+ }
+
+ auto_buffer temp( new_capacity_impl( size_ + 1u ) );
+ temp.unchecked_push_back( cbegin(), before );
+ iterator result = temp.end();
+ temp.unchecked_push_back( x );
+ temp.unchecked_push_back( before, cend() );
+ one_sided_swap( temp );
+ BOOST_ASSERT( is_valid() );
+ return result;
+ }
+
+ void insert( const_iterator before, size_type n,
+ optimized_const_reference x )
+ {
+ // @todo: see problems above
+ if( size_ + n <= members_.capacity_ )
+ {
+ grow_back( n );
+ iterator where = const_cast<T*>(before);
+ std::copy( before, cend() - n, where + n );
+ std::fill( where, where + n, x );
+ BOOST_ASSERT( is_valid() );
+ return;
+ }
+
+ auto_buffer temp( new_capacity_impl( size_ + n ) );
+ temp.unchecked_push_back( cbegin(), before );
+ std::uninitialized_fill_n( temp.end(), n, x );
+ temp.size_ += n;
+ temp.unchecked_push_back( before, cend() );
+ one_sided_swap( temp );
+ BOOST_ASSERT( is_valid() );
+ }
+
+ template< class ForwardIterator >
+ void insert( const_iterator before,
+ ForwardIterator begin_arg, ForwardIterator end_arg ) // basic
+ {
+ typedef typename std::iterator_traits<ForwardIterator>
+ ::iterator_category category;
+ insert_impl( before, begin_arg, end_arg, category() );
+ }
+
+ void pop_back()
+ {
+ BOOST_ASSERT( !empty() );
+ auto_buffer_destroy( buffer_ + size_ - 1, boost::has_trivial_destructor<T>() );
+ --size_;
+ }
+
+ void pop_back_n( size_type n )
+ {
+ BOOST_ASSERT( n <= size_ );
+ if( n )
+ {
+ destroy_back_n( n );
+ size_ -= n;
+ }
+ }
+
+ void clear()
+ {
+ pop_back_n( size_ );
+ }
+
+ iterator erase( const_iterator where )
+ {
+ BOOST_ASSERT( !empty() );
+ BOOST_ASSERT( cbegin() <= where );
+ BOOST_ASSERT( cend() > where );
+
+ unsigned elements = cend() - where - 1u;
+
+ if( elements > 0u )
+ {
+ const_iterator start = where + 1u;
+ std::copy( start, start + elements,
+ const_cast<T*>(where) );
+ }
+ pop_back();
+ BOOST_ASSERT( !full() );
+ iterator result = const_cast<T*>( where );
+ BOOST_ASSERT( result <= end() );
+ return result;
+ }
+
+ iterator erase( const_iterator from, const_iterator to )
+ {
+ BOOST_ASSERT( !(std::distance(from,to)>0) ||
+ !empty() );
+ BOOST_ASSERT( cbegin() <= from );
+ BOOST_ASSERT( cend() >= to );
+
+ unsigned elements = std::distance(to,cend());
+
+ if( elements > 0u )
+ {
+ BOOST_ASSERT( elements > 0u );
+ std::copy( to, to + elements,
+ const_cast<T*>(from) );
+ }
+ pop_back_n( std::distance(from,to) );
+ BOOST_ASSERT( !full() );
+ iterator result = const_cast<T*>( from );
+ BOOST_ASSERT( result <= end() );
+ return result;
+ }
+
+ void shrink_to_fit()
+ {
+ if( is_on_stack() || !GrowPolicy::should_shrink(size_,members_.capacity_) )
+ return;
+
+ reserve_impl( size_ );
+ members_.capacity_ = (std::max)(size_type(N),members_.capacity_);
+ BOOST_ASSERT( is_on_stack() || size_ == members_.capacity_ );
+ BOOST_ASSERT( !is_on_stack() || size_ <= members_.capacity_ );
+ }
+
+ pointer uninitialized_grow( size_type n ) // strong
+ {
+ if( size_ + n <= members_.capacity_ )
+ reserve( size_ + n );
+
+ pointer res = end();
+ size_ += n;
+ return res;
+ }
+
+ void uninitialized_shrink( size_type n ) // nothrow
+ {
+ // @remark: test for wrap-around
+ BOOST_ASSERT( size_ - n <= members_.capacity_ );
+ size_ -= n;
+ }
+
+ void uninitialized_resize( size_type n )
+ {
+ if( n > size() )
+ uninitialized_grow( n - size() );
+ else if( n < size() )
+ uninitialized_shrink( size() - n );
+
+ BOOST_ASSERT( size() == n );
+ }
+
+ // nothrow - if both buffer are on the heap, or
+ // - if one buffer is on the heap and one has
+ // 'has_allocated_buffer() == false', or
+ // - if copy-construction cannot throw
+ // basic - otherwise (better guarantee impossible)
+ // requirement: the allocator must be no-throw-swappable
+ void swap( auto_buffer& r )
+ {
+ bool on_stack = is_on_stack();
+ bool r_on_stack = r.is_on_stack();
+ bool both_on_heap = !on_stack && !r_on_stack;
+ if( both_on_heap )
+ {
+ boost::swap( get_allocator(), r.get_allocator() );
+ boost::swap( members_.capacity_, r.members_.capacity_ );
+ boost::swap( buffer_, r.buffer_ );
+ boost::swap( size_, r.size_ );
+ BOOST_ASSERT( is_valid() );
+ BOOST_ASSERT( r.is_valid() );
+ return;
+ }
+
+ BOOST_ASSERT( on_stack || r_on_stack );
+ bool exactly_one_on_stack = (on_stack && !r_on_stack) ||
+ (!on_stack && r_on_stack);
+
+ //
+ // Remark: we now know that we can copy into
+ // the unused stack buffer.
+ //
+ if( exactly_one_on_stack )
+ {
+ auto_buffer* one_on_stack = on_stack ? this : &r;
+ auto_buffer* other = on_stack ? &r : this;
+ pointer new_buffer = static_cast<T*>(other->members_.address());
+ copy_impl( one_on_stack->begin(), one_on_stack->end(),
+ new_buffer ); // strong
+ one_on_stack->~auto_buffer(); // nothrow
+ boost::swap( get_allocator(), r.get_allocator() ); // assume nothrow
+ boost::swap( members_.capacity_, r.members_.capacity_ );
+ boost::swap( size_, r.size_ );
+ one_on_stack->buffer_ = other->buffer_;
+ other->buffer_ = new_buffer;
+ BOOST_ASSERT( other->is_on_stack() );
+ BOOST_ASSERT( !one_on_stack->is_on_stack() );
+ BOOST_ASSERT( is_valid() );
+ BOOST_ASSERT( r.is_valid() );
+ return;
+ }
+
+ BOOST_ASSERT( on_stack && r_on_stack );
+ swap_helper( *this, r, boost::has_trivial_assign<T>() );
+ BOOST_ASSERT( is_valid() );
+ BOOST_ASSERT( r.is_valid() );
+ }
+
+ private:
+ typedef boost::aligned_storage< N * sizeof(T),
+ boost::alignment_of<T>::value >
+ storage;
+
+ struct members_type : storage /* to enable EBO */
+ {
+ size_type capacity_;
+
+ members_type( size_type capacity )
+ : capacity_(capacity)
+ { }
+
+ void* address() const
+ { return const_cast<storage&>(static_cast<const storage&>(*this)).address(); }
+ };
+
+ members_type members_;
+ pointer buffer_;
+ size_type size_;
+
+ };
+
+ template< class T, class SBP, class GP, class A >
+ inline void swap( auto_buffer<T,SBP,GP,A>& l, auto_buffer<T,SBP,GP,A>& r )
+ {
+ l.swap( r );
+ }
+
+ template< class T, class SBP, class GP, class A >
+ inline bool operator==( const auto_buffer<T,SBP,GP,A>& l,
+ const auto_buffer<T,SBP,GP,A>& r )
+ {
+ if( l.size() != r.size() )
+ return false;
+ return std::equal( l.begin(), l.end(), r.begin() );
+ }
+
+ template< class T, class SBP, class GP, class A >
+ inline bool operator!=( const auto_buffer<T,SBP,GP,A>& l,
+ const auto_buffer<T,SBP,GP,A>& r )
+ {
+ return !(l == r);
+ }
+
+ template< class T, class SBP, class GP, class A >
+ inline bool operator<( const auto_buffer<T,SBP,GP,A>& l,
+ const auto_buffer<T,SBP,GP,A>& r )
+ {
+ return std::lexicographical_compare( l.begin(), l.end(),
+ r.begin(), r.end() );
+ }
+
+ template< class T, class SBP, class GP, class A >
+ inline bool operator>( const auto_buffer<T,SBP,GP,A>& l,
+ const auto_buffer<T,SBP,GP,A>& r )
+ {
+ return (r < l);
+ }
+
+ template< class T, class SBP, class GP, class A >
+ inline bool operator<=( const auto_buffer<T,SBP,GP,A>& l,
+ const auto_buffer<T,SBP,GP,A>& r )
+ {
+ return !(r > l);
+ }
+
+ template< class T, class SBP, class GP, class A >
+ inline bool operator>=( const auto_buffer<T,SBP,GP,A>& l,
+ const auto_buffer<T,SBP,GP,A>& r )
+ {
+ return !(l < r);
+ }
+
+} // namespace detail
+} // namespace signals2
+}
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(pop)
+#endif
+
+#endif
--- /dev/null
+
+// helper code for dealing with tracking non-boost shared_ptr/weak_ptr
+
+// Copyright Frank Mori Hess 2009.
+// 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/signals2 for library home page.
+
+#ifndef BOOST_SIGNALS2_FOREIGN_PTR_HPP
+#define BOOST_SIGNALS2_FOREIGN_PTR_HPP
+
+#include <algorithm>
+#include <boost/config.hpp>
+#include <boost/assert.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/smart_ptr/bad_weak_ptr.hpp>
+#include <boost/utility/swap.hpp>
+
+#ifndef BOOST_NO_CXX11_SMART_PTR
+#include <memory>
+#endif
+
+namespace boost
+{
+ template<typename T> class shared_ptr;
+ template<typename T> class weak_ptr;
+
+ namespace signals2
+ {
+ template<typename WeakPtr> struct weak_ptr_traits
+ {};
+ template<typename T> struct weak_ptr_traits<boost::weak_ptr<T> >
+ {
+ typedef boost::shared_ptr<T> shared_type;
+ };
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template<typename T> struct weak_ptr_traits<std::weak_ptr<T> >
+ {
+ typedef std::shared_ptr<T> shared_type;
+ };
+#endif
+
+ template<typename SharedPtr> struct shared_ptr_traits
+ {};
+
+ template<typename T> struct shared_ptr_traits<boost::shared_ptr<T> >
+ {
+ typedef boost::weak_ptr<T> weak_type;
+ };
+#ifndef BOOST_NO_CXX11_SMART_PTR
+ template<typename T> struct shared_ptr_traits<std::shared_ptr<T> >
+ {
+ typedef std::weak_ptr<T> weak_type;
+ };
+#endif
+
+ namespace detail
+ {
+ struct foreign_shared_ptr_impl_base
+ {
+ virtual ~foreign_shared_ptr_impl_base() {}
+ virtual void* get() const = 0;
+ virtual foreign_shared_ptr_impl_base * clone() const = 0;
+ };
+
+ template<typename FSP>
+ class foreign_shared_ptr_impl: public foreign_shared_ptr_impl_base
+ {
+ public:
+ foreign_shared_ptr_impl(const FSP &p): _p(p)
+ {}
+ virtual void * get() const
+ {
+ return _p.get();
+ }
+ virtual foreign_shared_ptr_impl * clone() const
+ {
+ return new foreign_shared_ptr_impl(*this);
+ }
+ private:
+ FSP _p;
+ };
+
+ class foreign_void_shared_ptr
+ {
+ public:
+ foreign_void_shared_ptr():
+ _p(0)
+ {}
+ foreign_void_shared_ptr(const foreign_void_shared_ptr &other):
+ _p(other._p->clone())
+ {}
+ template<typename FSP>
+ explicit foreign_void_shared_ptr(const FSP &fsp):
+ _p(new foreign_shared_ptr_impl<FSP>(fsp))
+ {}
+ ~foreign_void_shared_ptr()
+ {
+ delete _p;
+ }
+ foreign_void_shared_ptr & operator=(const foreign_void_shared_ptr &other)
+ {
+ if(&other == this) return *this;
+ foreign_void_shared_ptr(other).swap(*this);
+ return *this;
+ }
+ void swap(foreign_void_shared_ptr &other)
+ {
+ boost::swap(_p, other._p);
+ }
+ private:
+ foreign_shared_ptr_impl_base *_p;
+ };
+
+ struct foreign_weak_ptr_impl_base
+ {
+ virtual ~foreign_weak_ptr_impl_base() {}
+ virtual foreign_void_shared_ptr lock() const = 0;
+ virtual bool expired() const = 0;
+ virtual foreign_weak_ptr_impl_base * clone() const = 0;
+ };
+
+ template<typename FWP>
+ class foreign_weak_ptr_impl: public foreign_weak_ptr_impl_base
+ {
+ public:
+ foreign_weak_ptr_impl(const FWP &p): _p(p)
+ {}
+ virtual foreign_void_shared_ptr lock() const
+ {
+ return foreign_void_shared_ptr(_p.lock());
+ }
+ virtual bool expired() const
+ {
+ return _p.expired();
+ }
+ virtual foreign_weak_ptr_impl * clone() const
+ {
+ return new foreign_weak_ptr_impl(*this);
+ }
+ private:
+ FWP _p;
+ };
+
+ class foreign_void_weak_ptr
+ {
+ public:
+ foreign_void_weak_ptr()
+ {}
+ foreign_void_weak_ptr(const foreign_void_weak_ptr &other):
+ _p(other._p->clone())
+ {}
+ template<typename FWP>
+ explicit foreign_void_weak_ptr(const FWP &fwp):
+ _p(new foreign_weak_ptr_impl<FWP>(fwp))
+ {}
+ foreign_void_weak_ptr & operator=(const foreign_void_weak_ptr &other)
+ {
+ if(&other == this) return *this;
+ foreign_void_weak_ptr(other).swap(*this);
+ return *this;
+ }
+ void swap(foreign_void_weak_ptr &other)
+ {
+ boost::swap(_p, other._p);
+ }
+ foreign_void_shared_ptr lock() const
+ {
+ return _p->lock();
+ }
+ bool expired() const
+ {
+ return _p->expired();
+ }
+ private:
+ boost::scoped_ptr<foreign_weak_ptr_impl_base> _p;
+ };
+ } // namespace detail
+
+ } // namespace signals2
+} // namespace boost
+
+#endif // BOOST_SIGNALS2_FOREIGN_PTR_HPP
--- /dev/null
+//
+// boost/signals2/detail/lwm_nop.hpp
+//
+// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2008 Frank Mori Hess
+//
+// 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_SIGNALS2_LWM_NOP_HPP
+#define BOOST_SIGNALS2_LWM_NOP_HPP
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+
+#include <boost/signals2/dummy_mutex.hpp>
+
+namespace boost
+{
+
+namespace signals2
+{
+
+class mutex: public dummy_mutex
+{
+};
+
+} // namespace signals2
+
+} // namespace boost
+
+#endif // #ifndef BOOST_SIGNALS2_LWM_NOP_HPP
--- /dev/null
+//
+// boost/signals2/detail/lwm_pthreads.hpp
+//
+// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2008 Frank Mori Hess
+//
+// 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_SIGNALS2_LWM_PTHREADS_HPP
+#define BOOST_SIGNALS2_LWM_PTHREADS_HPP
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#include <boost/assert.hpp>
+#include <pthread.h>
+
+namespace boost
+{
+
+namespace signals2
+{
+
+class mutex
+{
+private:
+
+ pthread_mutex_t m_;
+
+ mutex(mutex const &);
+ mutex & operator=(mutex const &);
+
+public:
+
+ mutex()
+ {
+
+// HPUX 10.20 / DCE has a nonstandard pthread_mutex_init
+
+#if defined(__hpux) && defined(_DECTHREADS_)
+ BOOST_VERIFY(pthread_mutex_init(&m_, pthread_mutexattr_default) == 0);
+#else
+ BOOST_VERIFY(pthread_mutex_init(&m_, 0) == 0);
+#endif
+ }
+
+ ~mutex()
+ {
+ BOOST_VERIFY(pthread_mutex_destroy(&m_) == 0);
+ }
+
+ void lock()
+ {
+ BOOST_VERIFY(pthread_mutex_lock(&m_) == 0);
+ }
+
+ bool try_lock()
+ {
+ return pthread_mutex_trylock(&m_) == 0;
+ }
+
+ void unlock()
+ {
+ BOOST_VERIFY(pthread_mutex_unlock(&m_) == 0);
+ }
+};
+
+} // namespace signals2
+
+} // namespace boost
+
+#endif // #ifndef BOOST_SIGNALS2_LWM_PTHREADS_HPP
--- /dev/null
+//
+// boost/signals2/detail/lwm_win32_cs.hpp
+//
+// Copyright (c) 2002, 2003 Peter Dimov
+// Copyright (c) 2008 Frank Mori Hess
+// Copyright (c) Microsoft Corporation 2014
+//
+// 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_SIGNALS2_LWM_WIN32_CS_HPP
+#define BOOST_SIGNALS2_LWM_WIN32_CS_HPP
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#include <boost/assert.hpp>
+
+#ifdef BOOST_USE_WINDOWS_H
+# include <windows.h>
+#endif
+
+#include <boost/predef/platform.h>
+
+namespace boost
+{
+
+namespace signals2
+{
+
+#ifndef BOOST_USE_WINDOWS_H
+
+struct critical_section
+{
+ struct critical_section_debug * DebugInfo;
+ long LockCount;
+ long RecursionCount;
+ void * OwningThread;
+ void * LockSemaphore;
+#if defined(_WIN64)
+ unsigned __int64 SpinCount;
+#else
+ unsigned long SpinCount;
+#endif
+};
+
+#if BOOST_PLAT_WINDOWS_RUNTIME
+extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSectionEx(critical_section *, unsigned long, unsigned long);
+#else
+extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(critical_section *);
+#endif
+extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(critical_section *);
+extern "C" __declspec(dllimport) int __stdcall TryEnterCriticalSection(critical_section *);
+extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(critical_section *);
+extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(critical_section *);
+
+#else
+
+typedef ::CRITICAL_SECTION critical_section;
+
+#endif // #ifndef BOOST_USE_WINDOWS_H
+
+class mutex
+{
+private:
+
+ critical_section cs_;
+
+ mutex(mutex const &);
+ mutex & operator=(mutex const &);
+
+public:
+
+ mutex()
+ {
+#if BOOST_PLAT_WINDOWS_RUNTIME
+ InitializeCriticalSectionEx(&cs_, 4000, 0);
+#else
+ InitializeCriticalSection(&cs_);
+#endif
+ }
+
+ ~mutex()
+ {
+ DeleteCriticalSection(&cs_);
+ }
+
+ void lock()
+ {
+ EnterCriticalSection(&cs_);
+ }
+// TryEnterCriticalSection only exists on Windows NT 4.0 and later
+#if (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400))
+ bool try_lock()
+ {
+ return TryEnterCriticalSection(&cs_) != 0;
+ }
+#else
+ bool try_lock()
+ {
+ BOOST_ASSERT(false);
+ return false;
+ }
+#endif
+ void unlock()
+ {
+ LeaveCriticalSection(&cs_);
+ }
+};
+
+} // namespace signals2
+
+} // namespace boost
+
+#endif // #ifndef BOOST_SIGNALS2_LWM_WIN32_CS_HPP
--- /dev/null
+/*
+ An output iterator which simply discards output.
+*/
+// Copyright Frank Mori Hess 2008.
+// 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/signals2 for library home page.
+
+#ifndef BOOST_SIGNALS2_NULL_OUTPUT_ITERATOR_HPP
+#define BOOST_SIGNALS2_NULL_OUTPUT_ITERATOR_HPP
+
+#include <boost/function_output_iterator.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ class does_nothing
+ {
+ public:
+ template<typename T>
+ void operator()(const T&) const
+ {}
+ };
+ typedef boost::function_output_iterator<does_nothing> null_output_iterator;
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#endif // BOOST_SIGNALS2_NULL_OUTPUT_ITERATOR_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2009.
+// Copyright Timmo Stange 2007.
+// Copyright Douglas Gregor 2001-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP
+#define BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP
+
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/signals2/detail/signals_common_macros.hpp>
+
+#define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_INC(BOOST_SIGNALS2_MAX_ARGS))
+#define BOOST_PP_FILENAME_1 <boost/signals2/detail/preprocessed_arg_type_template.hpp>
+#include BOOST_PP_ITERATE()
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ struct std_functional_base
+ {};
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#endif // BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP
--- /dev/null
+// Copyright Frank Mori Hess 2009
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+// This file is included iteratively, and should not be protected from multiple inclusion
+
+#define BOOST_SIGNALS2_NUM_ARGS BOOST_PP_ITERATION()
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<unsigned n BOOST_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+// template<typename T1, typename T2, ... , typename TN> class preprocessed_arg_typeN<n, T1, T2, ..., TN>{...} ...
+#define BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_CLASS_TEMPLATE_SPECIALIZATION(z, n, data) \
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)> \
+ class BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)<n, \
+ BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS)> \
+ { \
+ public: \
+ typedef BOOST_PP_CAT(T, BOOST_PP_INC(n)) type; \
+ };
+ BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_CLASS_TEMPLATE_SPECIALIZATION, ~)
+
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#undef BOOST_SIGNALS2_NUM_ARGS
--- /dev/null
+// Copyright Frank Mori Hess 2007-2009
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_DETAIL_REPLACE_SLOT_FUNCTION_HPP
+#define BOOST_SIGNALS2_DETAIL_REPLACE_SLOT_FUNCTION_HPP
+
+#include <boost/signals2/slot_base.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<typename ResultSlot, typename SlotIn, typename SlotFunction>
+ ResultSlot replace_slot_function(const SlotIn &slot_in, const SlotFunction &fun)
+ {
+ ResultSlot slot(fun);
+ slot.track(slot_in);
+ return slot;
+ }
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#endif // BOOST_SIGNALS2_DETAIL_REPLACE_SLOT_FUNCTION_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Douglas Gregor 2001-2004.
+// Copyright Frank Mori Hess 2007. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_RESULT_TYPE_WRAPPER_HPP
+#define BOOST_SIGNALS2_RESULT_TYPE_WRAPPER_HPP
+
+#include <boost/config.hpp>
+
+namespace boost {
+ namespace signals2 {
+ namespace detail {
+ // A placeholder for void on compilers that don't support void returns
+ struct void_type {};
+
+ // Replaces void with void_type
+ template<typename R>
+ struct nonvoid {
+ typedef R type;
+ };
+ template<>
+ struct nonvoid<void> {
+ typedef void_type type;
+ };
+
+ // Replaces void with void_type only if compiler doesn't support void returns
+ template<typename R>
+ struct result_type_wrapper {
+ typedef R type;
+ };
+#ifdef BOOST_NO_VOID_RETURNS
+ template<>
+ struct result_type_wrapper<void> {
+ typedef void_type type;
+ };
+#endif
+
+ // specialization deals with possible void return from combiners
+ template<typename R> class combiner_invoker
+ {
+ public:
+ typedef R result_type;
+ template<typename Combiner, typename InputIterator>
+ result_type operator()(Combiner &combiner,
+ InputIterator first, InputIterator last) const
+ {
+ return combiner(first, last);
+ }
+ };
+ template<> class combiner_invoker<void>
+ {
+ public:
+ typedef result_type_wrapper<void>::type result_type;
+ template<typename Combiner, typename InputIterator>
+ result_type operator()(Combiner &combiner,
+ InputIterator first, InputIterator last) const
+ {
+ combiner(first, last);
+ return result_type();
+ }
+ };
+ } // end namespace detail
+ } // end namespace signals2
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_RESULT_TYPE_WRAPPER_HPP
--- /dev/null
+/*
+ Template for Signa1, Signal2, ... classes that support signals
+ with 1, 2, ... parameters
+
+ Begin: 2007-01-23
+*/
+// Copyright Frank Mori Hess 2007-2008
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// This file is included iteratively, and should not be protected from multiple inclusion
+
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_SIGNALS2_NUM_ARGS BOOST_PP_ITERATION()
+#else
+#define BOOST_SIGNALS2_NUM_ARGS 1
+#endif
+
+// R, T1, T2, ..., TN, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS), \
+ Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ // helper for bound_extended_slot_function that handles specialization for void return
+ template<typename R>
+ class BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_INVOKER_N(BOOST_SIGNALS2_NUM_ARGS)
+ {
+ public:
+ typedef R result_type;
+ template<typename ExtendedSlotFunction BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ result_type operator()(ExtendedSlotFunction &func, const connection &conn
+ BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_FORWARD_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
+ {
+ return func(conn BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FORWARDED_ARGS(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ };
+#ifdef BOOST_NO_VOID_RETURNS
+ template<>
+ class BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_INVOKER_N(BOOST_SIGNALS2_NUM_ARGS)<void>
+ {
+ public:
+ typedef result_type_wrapper<void>::type result_type;
+ template<typename ExtendedSlotFunction BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ result_type operator()(ExtendedSlotFunction &func, const connection &conn
+ BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FULL_FORWARD_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
+ {
+ func(conn BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FORWARDED_ARGS(BOOST_SIGNALS2_NUM_ARGS));
+ return result_type();
+ }
+ };
+#endif
+// wrapper around an signalN::extended_slot_function which binds the
+// connection argument so it looks like a normal
+// signalN::slot_function
+
+ template<typename ExtendedSlotFunction>
+ class BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)
+ {
+ public:
+ typedef typename result_type_wrapper<typename ExtendedSlotFunction::result_type>::type result_type;
+ BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)(const ExtendedSlotFunction &fun):
+ _fun(fun), _connection(new connection)
+ {}
+ void set_connection(const connection &conn)
+ {
+ *_connection = conn;
+ }
+
+#if BOOST_SIGNALS2_NUM_ARGS > 0
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+#endif // BOOST_SIGNALS2_NUM_ARGS > 0
+ result_type operator()(BOOST_SIGNALS2_FULL_FORWARD_ARGS(BOOST_SIGNALS2_NUM_ARGS))
+ {
+ return BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_INVOKER_N(BOOST_SIGNALS2_NUM_ARGS)
+ <typename ExtendedSlotFunction::result_type>()
+ (_fun, *_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FORWARDED_ARGS(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ // const overload
+#if BOOST_SIGNALS2_NUM_ARGS > 0
+ template<BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+#endif // BOOST_SIGNALS2_NUM_ARGS > 0
+ result_type operator()(BOOST_SIGNALS2_FULL_FORWARD_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
+ {
+ return BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_INVOKER_N(BOOST_SIGNALS2_NUM_ARGS)
+ <typename ExtendedSlotFunction::result_type>()
+ (_fun, *_connection BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_FORWARDED_ARGS(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ template<typename T>
+ bool operator==(const T &other) const
+ {
+ return _fun == other;
+ }
+ private:
+ BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)()
+ {}
+
+ ExtendedSlotFunction _fun;
+ boost::shared_ptr<connection> _connection;
+ };
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
+ {
+ public:
+ typedef SlotFunction slot_function_type;
+ // typedef slotN<Signature, SlotFunction> slot_type;
+ typedef BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS),
+ slot_function_type> slot_type;
+ typedef ExtendedSlotFunction extended_slot_function_type;
+ // typedef slotN+1<R, const connection &, T1, T2, ..., TN, extended_slot_function_type> extended_slot_type;
+ typedef BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(BOOST_SIGNALS2_NUM_ARGS) extended_slot_type;
+ typedef typename nonvoid<typename slot_function_type::result_type>::type nonvoid_slot_result_type;
+ private:
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ class slot_invoker;
+#else // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ typedef variadic_slot_invoker<nonvoid_slot_result_type, Args...> slot_invoker;
+#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ typedef slot_call_iterator_cache<nonvoid_slot_result_type, slot_invoker> slot_call_iterator_cache_type;
+ typedef typename group_key<Group>::type group_key_type;
+ typedef shared_ptr<connection_body<group_key_type, slot_type, Mutex> > connection_body_type;
+ typedef grouped_list<Group, GroupCompare, connection_body_type> connection_list_type;
+ typedef BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS)<extended_slot_function_type>
+ bound_extended_slot_function_type;
+ public:
+ typedef Combiner combiner_type;
+ typedef typename result_type_wrapper<typename combiner_type::result_type>::type result_type;
+ typedef Group group_type;
+ typedef GroupCompare group_compare_type;
+ typedef typename detail::slot_call_iterator_t<slot_invoker,
+ typename connection_list_type::iterator, connection_body<group_key_type, slot_type, Mutex> > slot_call_iterator;
+
+ BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner_arg,
+ const group_compare_type &group_compare):
+ _shared_state(new invocation_state(connection_list_type(group_compare), combiner_arg)),
+ _garbage_collector_it(_shared_state->connection_bodies().end()),
+ _mutex(new mutex_type())
+ {}
+ // connect slot
+ connection connect(const slot_type &slot, connect_position position = at_back)
+ {
+ garbage_collecting_lock<mutex_type> lock(*_mutex);
+ return nolock_connect(lock, slot, position);
+ }
+ connection connect(const group_type &group,
+ const slot_type &slot, connect_position position = at_back)
+ {
+ garbage_collecting_lock<mutex_type> lock(*_mutex);
+ return nolock_connect(lock, group, slot, position);
+ }
+ // connect extended slot
+ connection connect_extended(const extended_slot_type &ext_slot, connect_position position = at_back)
+ {
+ garbage_collecting_lock<mutex_type> lock(*_mutex);
+ bound_extended_slot_function_type bound_slot(ext_slot.slot_function());
+ slot_type slot = replace_slot_function<slot_type>(ext_slot, bound_slot);
+ connection conn = nolock_connect(lock, slot, position);
+ bound_slot.set_connection(conn);
+ return conn;
+ }
+ connection connect_extended(const group_type &group,
+ const extended_slot_type &ext_slot, connect_position position = at_back)
+ {
+ garbage_collecting_lock<Mutex> lock(*_mutex);
+ bound_extended_slot_function_type bound_slot(ext_slot.slot_function());
+ slot_type slot = replace_slot_function<slot_type>(ext_slot, bound_slot);
+ connection conn = nolock_connect(lock, group, slot, position);
+ bound_slot.set_connection(conn);
+ return conn;
+ }
+ // disconnect slot(s)
+ void disconnect_all_slots()
+ {
+ shared_ptr<invocation_state> local_state =
+ get_readable_state();
+ typename connection_list_type::iterator it;
+ for(it = local_state->connection_bodies().begin();
+ it != local_state->connection_bodies().end(); ++it)
+ {
+ (*it)->disconnect();
+ }
+ }
+ void disconnect(const group_type &group)
+ {
+ shared_ptr<invocation_state> local_state =
+ get_readable_state();
+ group_key_type group_key(grouped_slots, group);
+ typename connection_list_type::iterator it;
+ typename connection_list_type::iterator end_it =
+ local_state->connection_bodies().upper_bound(group_key);
+ for(it = local_state->connection_bodies().lower_bound(group_key);
+ it != end_it; ++it)
+ {
+ (*it)->disconnect();
+ }
+ }
+ template <typename T>
+ void disconnect(const T &slot)
+ {
+ typedef mpl::bool_<(is_convertible<T, group_type>::value)> is_group;
+ do_disconnect(slot, is_group());
+ }
+ // emit signal
+ result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS))
+ {
+ shared_ptr<invocation_state> local_state;
+ typename connection_list_type::iterator it;
+ {
+ garbage_collecting_lock<mutex_type> list_lock(*_mutex);
+ // only clean up if it is safe to do so
+ if(_shared_state.unique())
+ nolock_cleanup_connections(list_lock, false, 1);
+ /* Make a local copy of _shared_state while holding mutex, so we are
+ thread safe against the combiner or connection list getting modified
+ during invocation. */
+ local_state = _shared_state;
+ }
+ slot_invoker invoker = slot_invoker(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ slot_call_iterator_cache_type cache(invoker);
+ invocation_janitor janitor(cache, *this, &local_state->connection_bodies());
+ return detail::combiner_invoker<typename combiner_type::result_type>()
+ (
+ local_state->combiner(),
+ slot_call_iterator(local_state->connection_bodies().begin(), local_state->connection_bodies().end(), cache),
+ slot_call_iterator(local_state->connection_bodies().end(), local_state->connection_bodies().end(), cache)
+ );
+ }
+ result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
+ {
+ shared_ptr<invocation_state> local_state;
+ typename connection_list_type::iterator it;
+ {
+ garbage_collecting_lock<mutex_type> list_lock(*_mutex);
+ // only clean up if it is safe to do so
+ if(_shared_state.unique())
+ nolock_cleanup_connections(list_lock, false, 1);
+ /* Make a local copy of _shared_state while holding mutex, so we are
+ thread safe against the combiner or connection list getting modified
+ during invocation. */
+ local_state = _shared_state;
+ }
+ slot_invoker invoker = slot_invoker(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ slot_call_iterator_cache_type cache(invoker);
+ invocation_janitor janitor(cache, *this, &local_state->connection_bodies());
+ return detail::combiner_invoker<typename combiner_type::result_type>()
+ (
+ local_state->combiner(),
+ slot_call_iterator(local_state->connection_bodies().begin(), local_state->connection_bodies().end(), cache),
+ slot_call_iterator(local_state->connection_bodies().end(), local_state->connection_bodies().end(), cache)
+ );
+ }
+ std::size_t num_slots() const
+ {
+ shared_ptr<invocation_state> local_state =
+ get_readable_state();
+ typename connection_list_type::iterator it;
+ std::size_t count = 0;
+ for(it = local_state->connection_bodies().begin();
+ it != local_state->connection_bodies().end(); ++it)
+ {
+ if((*it)->connected()) ++count;
+ }
+ return count;
+ }
+ bool empty() const
+ {
+ shared_ptr<invocation_state> local_state =
+ get_readable_state();
+ typename connection_list_type::iterator it;
+ for(it = local_state->connection_bodies().begin();
+ it != local_state->connection_bodies().end(); ++it)
+ {
+ if((*it)->connected()) return false;
+ }
+ return true;
+ }
+ combiner_type combiner() const
+ {
+ unique_lock<mutex_type> lock(*_mutex);
+ return _shared_state->combiner();
+ }
+ void set_combiner(const combiner_type &combiner_arg)
+ {
+ unique_lock<mutex_type> lock(*_mutex);
+ if(_shared_state.unique())
+ _shared_state->combiner() = combiner_arg;
+ else
+ _shared_state.reset(new invocation_state(*_shared_state, combiner_arg));
+ }
+ private:
+ typedef Mutex mutex_type;
+
+ // slot_invoker is passed to slot_call_iterator_t to run slots
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ class slot_invoker
+ {
+ public:
+ typedef nonvoid_slot_result_type result_type;
+// typename add_reference<Tn>::type
+#define BOOST_SIGNALS2_ADD_REF_TYPE(z, n, data) \
+ typename add_reference<BOOST_PP_CAT(T, BOOST_PP_INC(n))>::type
+// typename add_reference<Tn>::type argn
+#define BOOST_SIGNALS2_ADD_REF_ARG(z, n, data) \
+ BOOST_SIGNALS2_ADD_REF_TYPE(~, n, ~) \
+ BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
+// typename add_reference<T1>::type arg1, typename add_reference<T2>::type arg2, ..., typename add_reference<Tn>::type argn
+#define BOOST_SIGNALS2_ADD_REF_ARGS(arity) \
+ BOOST_PP_ENUM(arity, BOOST_SIGNALS2_ADD_REF_ARG, ~)
+ slot_invoker(BOOST_SIGNALS2_ADD_REF_ARGS(BOOST_SIGNALS2_NUM_ARGS)) BOOST_PP_EXPR_IF(BOOST_SIGNALS2_NUM_ARGS, :)
+#undef BOOST_SIGNALS2_ADD_REF_ARGS
+
+// m_argn
+#define BOOST_SIGNALS2_M_ARG_NAME(z, n, data) BOOST_PP_CAT(m_arg, BOOST_PP_INC(n))
+// m_argn ( argn )
+#define BOOST_SIGNALS2_MISC_STATEMENT(z, n, data) \
+ BOOST_SIGNALS2_M_ARG_NAME(~, n, ~) ( BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~) )
+// m_arg1(arg1), m_arg2(arg2), ..., m_argn(argn)
+ BOOST_PP_ENUM(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_MISC_STATEMENT, ~)
+#undef BOOST_SIGNALS2_MISC_STATEMENT
+ {}
+ result_type operator ()(const connection_body_type &connectionBody) const
+ {
+ return m_invoke<typename slot_type::result_type>(connectionBody);
+ }
+ private:
+ // declare assignment operator private since this class might have reference or const members
+ slot_invoker & operator=(const slot_invoker &);
+
+#define BOOST_SIGNALS2_ADD_REF_M_ARG_STATEMENT(z, n, data) \
+ BOOST_SIGNALS2_ADD_REF_TYPE(~, n, ~) BOOST_SIGNALS2_M_ARG_NAME(~, n, ~) ;
+ BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_ADD_REF_M_ARG_STATEMENT, ~)
+#undef BOOST_SIGNALS2_ADD_REF_M_ARG_STATEMENT
+#undef BOOST_SIGNALS2_ADD_REF_ARG
+#undef BOOST_SIGNALS2_ADD_REF_TYPE
+
+// m_arg1, m_arg2, ..., m_argn
+#define BOOST_SIGNALS2_M_ARG_NAMES(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_M_ARG_NAME, ~)
+ template<typename SlotResultType>
+ result_type m_invoke(const connection_body_type &connectionBody,
+ typename boost::enable_if<boost::is_void<SlotResultType> >::type * = 0) const
+ {
+ connectionBody->slot().slot_function()(BOOST_SIGNALS2_M_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ return void_type();
+ }
+ template<typename SlotResultType>
+ result_type m_invoke(const connection_body_type &connectionBody,
+ typename boost::disable_if<boost::is_void<SlotResultType> >::type * = 0) const
+ {
+ return connectionBody->slot().slot_function()(BOOST_SIGNALS2_M_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ };
+#undef BOOST_SIGNALS2_M_ARG_NAMES
+#undef BOOST_SIGNALS2_M_ARG_NAME
+
+#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ // a struct used to optimize (minimize) the number of shared_ptrs that need to be created
+ // inside operator()
+ class invocation_state
+ {
+ public:
+ invocation_state(const connection_list_type &connections_in,
+ const combiner_type &combiner_in): _connection_bodies(new connection_list_type(connections_in)),
+ _combiner(new combiner_type(combiner_in))
+ {}
+ invocation_state(const invocation_state &other, const connection_list_type &connections_in):
+ _connection_bodies(new connection_list_type(connections_in)),
+ _combiner(other._combiner)
+ {}
+ invocation_state(const invocation_state &other, const combiner_type &combiner_in):
+ _connection_bodies(other._connection_bodies),
+ _combiner(new combiner_type(combiner_in))
+ {}
+ connection_list_type & connection_bodies() { return *_connection_bodies; }
+ const connection_list_type & connection_bodies() const { return *_connection_bodies; }
+ combiner_type & combiner() { return *_combiner; }
+ const combiner_type & combiner() const { return *_combiner; }
+ private:
+ invocation_state(const invocation_state &);
+
+ shared_ptr<connection_list_type> _connection_bodies;
+ shared_ptr<combiner_type> _combiner;
+ };
+ // Destructor of invocation_janitor does some cleanup when a signal invocation completes.
+ // Code can't be put directly in signal's operator() due to complications from void return types.
+ class invocation_janitor: noncopyable
+ {
+ public:
+ typedef BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) signal_type;
+ invocation_janitor
+ (
+ const slot_call_iterator_cache_type &cache,
+ const signal_type &sig,
+ const connection_list_type *connection_bodies
+ ):_cache(cache), _sig(sig), _connection_bodies(connection_bodies)
+ {}
+ ~invocation_janitor()
+ {
+ // force a full cleanup of disconnected slots if there are too many
+ if(_cache.disconnected_slot_count > _cache.connected_slot_count)
+ {
+ _sig.force_cleanup_connections(_connection_bodies);
+ }
+ }
+ private:
+ const slot_call_iterator_cache_type &_cache;
+ const signal_type &_sig;
+ const connection_list_type *_connection_bodies;
+ };
+
+ // clean up disconnected connections
+ void nolock_cleanup_connections_from(garbage_collecting_lock<mutex_type> &lock,
+ bool grab_tracked,
+ const typename connection_list_type::iterator &begin, unsigned count = 0) const
+ {
+ BOOST_ASSERT(_shared_state.unique());
+ typename connection_list_type::iterator it;
+ unsigned i;
+ for(it = begin, i = 0;
+ it != _shared_state->connection_bodies().end() && (count == 0 || i < count);
+ ++i)
+ {
+ bool connected;
+ if(grab_tracked)
+ (*it)->disconnect_expired_slot(lock);
+ connected = (*it)->nolock_nograb_connected();
+ if(connected == false)
+ {
+ it = _shared_state->connection_bodies().erase((*it)->group_key(), it);
+ }else
+ {
+ ++it;
+ }
+ }
+ _garbage_collector_it = it;
+ }
+ // clean up a few connections in constant time
+ void nolock_cleanup_connections(garbage_collecting_lock<mutex_type> &lock,
+ bool grab_tracked, unsigned count) const
+ {
+ BOOST_ASSERT(_shared_state.unique());
+ typename connection_list_type::iterator begin;
+ if(_garbage_collector_it == _shared_state->connection_bodies().end())
+ {
+ begin = _shared_state->connection_bodies().begin();
+ }else
+ {
+ begin = _garbage_collector_it;
+ }
+ nolock_cleanup_connections_from(lock, grab_tracked, begin, count);
+ }
+ /* Make a new copy of the slot list if it is currently being read somewhere else
+ */
+ void nolock_force_unique_connection_list(garbage_collecting_lock<mutex_type> &lock)
+ {
+ if(_shared_state.unique() == false)
+ {
+ _shared_state.reset(new invocation_state(*_shared_state, _shared_state->connection_bodies()));
+ nolock_cleanup_connections_from(lock, true, _shared_state->connection_bodies().begin());
+ }else
+ {
+ /* We need to try and check more than just 1 connection here to avoid corner
+ cases where certain repeated connect/disconnect patterns cause the slot
+ list to grow without limit. */
+ nolock_cleanup_connections(lock, true, 2);
+ }
+ }
+ // force a full cleanup of the connection list
+ void force_cleanup_connections(const connection_list_type *connection_bodies) const
+ {
+ garbage_collecting_lock<mutex_type> list_lock(*_mutex);
+ // if the connection list passed in as a parameter is no longer in use,
+ // we don't need to do any cleanup.
+ if(&_shared_state->connection_bodies() != connection_bodies)
+ {
+ return;
+ }
+ if(_shared_state.unique() == false)
+ {
+ _shared_state.reset(new invocation_state(*_shared_state, _shared_state->connection_bodies()));
+ }
+ nolock_cleanup_connections_from(list_lock, false, _shared_state->connection_bodies().begin());
+ }
+ shared_ptr<invocation_state> get_readable_state() const
+ {
+ unique_lock<mutex_type> list_lock(*_mutex);
+ return _shared_state;
+ }
+ connection_body_type create_new_connection(garbage_collecting_lock<mutex_type> &lock,
+ const slot_type &slot)
+ {
+ nolock_force_unique_connection_list(lock);
+ return connection_body_type(new connection_body<group_key_type, slot_type, Mutex>(slot, _mutex));
+ }
+ void do_disconnect(const group_type &group, mpl::bool_<true> /* is_group */)
+ {
+ disconnect(group);
+ }
+ template<typename T>
+ void do_disconnect(const T &slot, mpl::bool_<false> /* is_group */)
+ {
+ shared_ptr<invocation_state> local_state =
+ get_readable_state();
+ typename connection_list_type::iterator it;
+ for(it = local_state->connection_bodies().begin();
+ it != local_state->connection_bodies().end(); ++it)
+ {
+ garbage_collecting_lock<connection_body_base> lock(**it);
+ if((*it)->nolock_nograb_connected() == false) continue;
+ if((*it)->slot().slot_function() == slot)
+ {
+ (*it)->nolock_disconnect(lock);
+ }else
+ {
+ // check for wrapped extended slot
+ bound_extended_slot_function_type *fp;
+ fp = (*it)->slot().slot_function().template target<bound_extended_slot_function_type>();
+ if(fp && *fp == slot)
+ {
+ (*it)->nolock_disconnect(lock);
+ }
+ }
+ }
+ }
+ // connect slot
+ connection nolock_connect(garbage_collecting_lock<mutex_type> &lock,
+ const slot_type &slot, connect_position position)
+ {
+ connection_body_type newConnectionBody =
+ create_new_connection(lock, slot);
+ group_key_type group_key;
+ if(position == at_back)
+ {
+ group_key.first = back_ungrouped_slots;
+ _shared_state->connection_bodies().push_back(group_key, newConnectionBody);
+ }else
+ {
+ group_key.first = front_ungrouped_slots;
+ _shared_state->connection_bodies().push_front(group_key, newConnectionBody);
+ }
+ newConnectionBody->set_group_key(group_key);
+ return connection(newConnectionBody);
+ }
+ connection nolock_connect(garbage_collecting_lock<mutex_type> &lock,
+ const group_type &group,
+ const slot_type &slot, connect_position position)
+ {
+ connection_body_type newConnectionBody =
+ create_new_connection(lock, slot);
+ // update map to first connection body in group if needed
+ group_key_type group_key(grouped_slots, group);
+ newConnectionBody->set_group_key(group_key);
+ if(position == at_back)
+ {
+ _shared_state->connection_bodies().push_back(group_key, newConnectionBody);
+ }else // at_front
+ {
+ _shared_state->connection_bodies().push_front(group_key, newConnectionBody);
+ }
+ return connection(newConnectionBody);
+ }
+
+ // _shared_state is mutable so we can do force_cleanup_connections during a const invocation
+ mutable shared_ptr<invocation_state> _shared_state;
+ mutable typename connection_list_type::iterator _garbage_collector_it;
+ // connection list mutex must never be locked when attempting a blocking lock on a slot,
+ // or you could deadlock.
+ const boost::shared_ptr<mutex_type> _mutex;
+ };
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+ }
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION: public signal_base,
+ public detail::BOOST_SIGNALS2_STD_FUNCTIONAL_BASE
+ (typename detail::result_type_wrapper<typename Combiner::result_type>::type)
+ {
+ typedef detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> impl_class;
+ public:
+ typedef detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> weak_signal_type;
+ friend class detail::BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>;
+
+ typedef SlotFunction slot_function_type;
+ // typedef slotN<Signature, SlotFunction> slot_type;
+ typedef typename impl_class::slot_type slot_type;
+ typedef typename impl_class::extended_slot_function_type extended_slot_function_type;
+ typedef typename impl_class::extended_slot_type extended_slot_type;
+ typedef typename slot_function_type::result_type slot_result_type;
+ typedef Combiner combiner_type;
+ typedef typename impl_class::result_type result_type;
+ typedef Group group_type;
+ typedef GroupCompare group_compare_type;
+ typedef typename impl_class::slot_call_iterator
+ slot_call_iterator;
+ typedef typename mpl::identity<BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(BOOST_SIGNALS2_NUM_ARGS)>::type signature_type;
+
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+// typedef Tn argn_type;
+#define BOOST_SIGNALS2_MISC_STATEMENT(z, n, data) \
+ typedef BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type);
+ BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_MISC_STATEMENT, ~)
+#undef BOOST_SIGNALS2_MISC_STATEMENT
+#if BOOST_SIGNALS2_NUM_ARGS == 1
+ typedef arg1_type argument_type;
+#elif BOOST_SIGNALS2_NUM_ARGS == 2
+ typedef arg1_type first_argument_type;
+ typedef arg2_type second_argument_type;
+#endif
+
+ template<unsigned n> class arg : public
+ detail::BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <n BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS)>
+ {};
+
+ BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS2_NUM_ARGS);
+
+#else // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+ template<unsigned n> class arg
+ {
+ public:
+ typedef typename detail::variadic_arg_type<n, Args...>::type type;
+ };
+ BOOST_STATIC_CONSTANT(int, arity = sizeof...(Args));
+
+#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+ BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const combiner_type &combiner_arg = combiner_type(),
+ const group_compare_type &group_compare = group_compare_type()):
+ _pimpl(new impl_class(combiner_arg, group_compare))
+ {};
+ virtual ~BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)()
+ {
+ }
+
+ //move support
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(
+ BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) && other)
+ {
+ using std::swap;
+ swap(_pimpl, other._pimpl);
+ };
+
+ BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) &
+ operator=(BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) && rhs)
+ {
+ if(this == &rhs)
+ {
+ return *this;
+ }
+ _pimpl.reset();
+ using std::swap;
+ swap(_pimpl, rhs._pimpl);
+ return *this;
+ }
+#endif // !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+ connection connect(const slot_type &slot, connect_position position = at_back)
+ {
+ return (*_pimpl).connect(slot, position);
+ }
+ connection connect(const group_type &group,
+ const slot_type &slot, connect_position position = at_back)
+ {
+ return (*_pimpl).connect(group, slot, position);
+ }
+ connection connect_extended(const extended_slot_type &slot, connect_position position = at_back)
+ {
+ return (*_pimpl).connect_extended(slot, position);
+ }
+ connection connect_extended(const group_type &group,
+ const extended_slot_type &slot, connect_position position = at_back)
+ {
+ return (*_pimpl).connect_extended(group, slot, position);
+ }
+ void disconnect_all_slots()
+ {
+ (*_pimpl).disconnect_all_slots();
+ }
+ void disconnect(const group_type &group)
+ {
+ (*_pimpl).disconnect(group);
+ }
+ template <typename T>
+ void disconnect(const T &slot)
+ {
+ (*_pimpl).disconnect(slot);
+ }
+ result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS))
+ {
+ return (*_pimpl)(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
+ {
+ return (*_pimpl)(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ std::size_t num_slots() const
+ {
+ return (*_pimpl).num_slots();
+ }
+ bool empty() const
+ {
+ return (*_pimpl).empty();
+ }
+ combiner_type combiner() const
+ {
+ return (*_pimpl).combiner();
+ }
+ void set_combiner(const combiner_type &combiner_arg)
+ {
+ return (*_pimpl).set_combiner(combiner_arg);
+ }
+ void swap(BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) & other)
+ {
+ using std::swap;
+ swap(_pimpl, other._pimpl);
+ }
+ protected:
+ virtual shared_ptr<void> lock_pimpl() const
+ {
+ return _pimpl;
+ }
+ private:
+ shared_ptr<impl_class>
+ _pimpl;
+ };
+
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ // free swap function for signalN classes, findable by ADL
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ void swap(
+ BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> &sig1,
+ BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> &sig2 )
+ {
+ sig1.swap(sig2);
+ }
+#endif
+
+ namespace detail
+ {
+ // wrapper class for storing other signals as slots with automatic lifetime tracking
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ template<BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
+ {
+ public:
+ typedef typename BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>::result_type
+ result_type;
+
+ BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ (const BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION>
+ &signal):
+ _weak_pimpl(signal._pimpl)
+ {}
+ result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS))
+ {
+ shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
+ shared_pimpl(_weak_pimpl.lock());
+ if(shared_pimpl == 0) throw expired_slot();
+ return (*shared_pimpl)(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
+ {
+ shared_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> >
+ shared_pimpl(_weak_pimpl.lock());
+ if(shared_pimpl == 0) throw expired_slot();
+ return (*shared_pimpl)(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ private:
+ boost::weak_ptr<detail::BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION> > _weak_pimpl;
+ };
+
+#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ template<int arity, typename Signature>
+ class extended_signature: public variadic_extended_signature<Signature>
+ {};
+#else // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ template<int arity, typename Signature>
+ class extended_signature;
+ // partial template specialization
+ template<typename Signature>
+ class extended_signature<BOOST_SIGNALS2_NUM_ARGS, Signature>
+ {
+ public:
+// typename function_traits<Signature>::result_type (
+// const boost::signals2::connection &,
+// typename function_traits<Signature>::arg1_type,
+// typename function_traits<Signature>::arg2_type,
+// ...,
+// typename function_traits<Signature>::argn_type)
+#define BOOST_SIGNALS2_EXT_SIGNATURE(arity, Signature) \
+ typename function_traits<Signature>::result_type ( \
+ const boost::signals2::connection & BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS) \
+ BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE, Signature) )
+ typedef function<BOOST_SIGNALS2_EXT_SIGNATURE(BOOST_SIGNALS2_NUM_ARGS, Signature)> function_type;
+#undef BOOST_SIGNALS2_EXT_SIGNATURE
+ };
+
+ template<unsigned arity, typename Signature, typename Combiner,
+ typename Group, typename GroupCompare, typename SlotFunction,
+ typename ExtendedSlotFunction, typename Mutex>
+ class signalN;
+ // partial template specialization
+ template<typename Signature, typename Combiner, typename Group,
+ typename GroupCompare, typename SlotFunction,
+ typename ExtendedSlotFunction, typename Mutex>
+ class signalN<BOOST_SIGNALS2_NUM_ARGS, Signature, Combiner, Group,
+ GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>
+ {
+ public:
+ typedef BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)<
+ BOOST_SIGNALS2_PORTABLE_SIGNATURE(BOOST_SIGNALS2_NUM_ARGS, Signature),
+ Combiner, Group,
+ GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> type;
+ };
+
+#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#undef BOOST_SIGNALS2_NUM_ARGS
+#undef BOOST_SIGNALS2_SIGNAL_TEMPLATE_INSTANTIATION
--- /dev/null
+// Boost.Signals library
+
+// Copyright Douglas Gregor 2001-2004.
+// Copyright Frank Mori Hess 2007. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_SIGNALS_COMMON_HPP
+#define BOOST_SIGNALS2_SIGNALS_COMMON_HPP
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/ref.hpp>
+#include <boost/signals2/signal_base.hpp>
+#include <boost/type_traits/is_base_of.hpp>
+
+namespace boost {
+ namespace signals2 {
+ namespace detail {
+ // Determine if the given type T is a signal
+ template<typename T>
+ class is_signal: public mpl::bool_<is_base_of<signal_base, T>::value>
+ {};
+
+ // A slot can be a signal, a reference to a function object, or a
+ // function object.
+ struct signal_tag {};
+ struct reference_tag {};
+ struct value_tag {};
+
+ // Classify the given slot as a signal, a reference-to-slot, or a
+ // standard slot
+ template<typename S>
+ class get_slot_tag {
+ typedef typename mpl::if_<is_signal<S>,
+ signal_tag, value_tag>::type signal_or_value;
+ public:
+ typedef typename mpl::if_<is_reference_wrapper<S>,
+ reference_tag,
+ signal_or_value>::type type;
+ };
+
+ // Get the slot so that it can be copied
+ template<typename F>
+ typename F::weak_signal_type
+ get_invocable_slot(const F &signal, signal_tag)
+ { return typename F::weak_signal_type(signal); }
+
+ template<typename F>
+ const F&
+ get_invocable_slot(const F& f, reference_tag)
+ { return f; }
+
+ template<typename F>
+ const F&
+ get_invocable_slot(const F& f, value_tag)
+ { return f; }
+
+ // Determines the type of the slot - is it a signal, a reference to a
+ // slot or just a normal slot.
+ template<typename F>
+ typename get_slot_tag<F>::type
+ tag_type(const F&)
+ {
+ typedef typename get_slot_tag<F>::type
+ the_tag_type;
+ the_tag_type tag = the_tag_type();
+ return tag;
+ }
+ } // end namespace detail
+ } // end namespace signals2
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_SIGNALS_COMMON_HPP
--- /dev/null
+/*
+ Author: Frank Mori Hess <fmhess@users.sourceforge.net>
+ Begin: 2007-01-23
+*/
+// Copyright Frank Mori Hess 2007-2008
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
+#define BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
+
+#include <boost/config.hpp>
+
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+#ifndef BOOST_SIGNALS2_MAX_ARGS
+#define BOOST_SIGNALS2_MAX_ARGS 9
+#endif
+
+// signaln
+#define BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity) BOOST_PP_CAT(signal, arity)
+// weak_signaln
+#define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(arity) BOOST_PP_CAT(weak_, BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity))
+// signaln_impl
+#define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(arity) BOOST_PP_CAT(BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity), _impl)
+// argn
+#define BOOST_SIGNALS2_SIGNATURE_ARG_NAME(z, n, data) BOOST_PP_CAT(arg, BOOST_PP_INC(n))
+// Tn argn
+#define BOOST_SIGNALS2_SIGNATURE_FULL_ARG(z, n, data) \
+ BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
+// T1 arg1, T2 arg2, ..., Tn argn
+#define BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(arity) \
+ BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_FULL_ARG, ~)
+// arg1, arg2, ..., argn
+#define BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_ARG_NAME, ~)
+// T1, T2, ..., TN
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
+// R (T1, T2, ..., TN)
+#define BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(arity) \
+ R ( BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) )
+// typename prefixR, typename prefixT1, typename prefixT2, ..., typename prefixTN
+#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity, prefix) \
+ typename BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
+// typename R, typename T1, typename T2, ..., typename TN
+#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) \
+ typename R BOOST_PP_COMMA_IF(arity) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename T)
+// typename prefixT1, typename prefixT2, ..., typename prefixTN
+#define BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(arity, prefix) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
+// typename T1, typename T2, ..., typename TN
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename T)
+// prefixR, prefixT1, prefixT2, ..., prefixTN
+#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity, prefix) \
+ BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), BOOST_PP_CAT(prefix, T))
+// R, T1, T2, ..., TN
+#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) \
+ R BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
+// boost::functionN<R, T1, T2, ..., TN>
+#define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) BOOST_PP_CAT(boost::function, arity)<\
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) >
+// R, const boost::signals2::connection&, T1, T2, ..., TN
+#define BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) \
+ R, const boost::signals2::connection& BOOST_PP_COMMA_IF(arity) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
+// boost::functionN<R, const boost::signals2::connection &, T1, T2, ..., TN>
+#define BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity) BOOST_PP_CAT(boost::function, BOOST_PP_INC(arity))<\
+ BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) >
+// slotN
+#define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) BOOST_PP_CAT(slot, arity)
+// slotN+1<R, const connection &, T1, T2, ..., TN, extended_slot_function_type>
+#define BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(arity) \
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_PP_INC(arity))< \
+ BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity), \
+ extended_slot_function_type>
+// bound_extended_slot_functionN
+#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(arity) BOOST_PP_CAT(bound_extended_slot_function, arity)
+// bound_extended_slot_function_helperN
+#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_INVOKER_N(arity) BOOST_PP_CAT(bound_extended_slot_function_invoker, arity)
+// typename function_traits<Signature>::argn_type
+#define BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE(z, n, Signature) \
+ BOOST_PP_CAT(BOOST_PP_CAT(typename function_traits<Signature>::arg, BOOST_PP_INC(n)), _type)
+// typename function_traits<Signature>::result_type,
+// typename function_traits<Signature>::arg1_type,
+// typename function_traits<Signature>::arg2_type,
+// ...,
+// typename function_traits<Signature>::argn_type
+#define BOOST_SIGNALS2_PORTABLE_SIGNATURE(arity, Signature) \
+ typename function_traits<Signature>::result_type \
+ BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE, Signature)
+// prefixTn & argn
+#define BOOST_SIGNALS2_PREFIXED_FULL_REF_ARG(z, n, prefix) \
+ BOOST_PP_CAT(BOOST_PP_CAT(prefix, T), BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
+// prefixT1 & arg1, prefixT2 & arg2, ..., prefixTn & argn
+#define BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(arity, prefix) \
+ BOOST_PP_ENUM(arity, BOOST_SIGNALS2_PREFIXED_FULL_REF_ARG, prefix)
+// Tn & argn
+#define BOOST_SIGNALS2_FULL_CREF_ARG(z, n, data) \
+ const BOOST_PP_CAT(T, BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
+// const T1 & arg1, const T2 & arg2, ..., const Tn & argn
+#define BOOST_SIGNALS2_FULL_FORWARD_ARGS(arity) \
+ BOOST_PP_ENUM(arity, BOOST_SIGNALS2_FULL_CREF_ARG, ~)
+#define BOOST_SIGNALS2_FORWARDED_ARGS(arity) \
+ BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity)
+// preprocessed_arg_typeN
+#define BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(arity) BOOST_PP_CAT(preprocessed_arg_type, arity)
+
+// typename R, typename T1, typename T2, ..., typename TN, typename SlotFunction
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(arity) \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
+ typename SlotFunction
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION
+
+// typename R, typename T1, typename T2, ..., typename TN, typename Combiner, ...
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity) \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
+ typename Combiner, \
+ typename Group, \
+ typename GroupCompare, \
+ typename SlotFunction, \
+ typename ExtendedSlotFunction, \
+ typename Mutex
+// typename R, typename T1, typename T2, ..., typename TN, typename Combiner = optional_last_value<R>, ...
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(arity) \
+ BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
+ typename Combiner = optional_last_value<R>, \
+ typename Group = int, \
+ typename GroupCompare = std::less<Group>, \
+ typename SlotFunction = BOOST_SIGNALS2_FUNCTION_N_DECL(arity), \
+ typename ExtendedSlotFunction = BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity), \
+ typename Mutex = signals2::mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(arity) BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity)
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
+
+#define BOOST_SIGNALS2_STD_FUNCTIONAL_BASE(result_type) std_functional_base
+
+#define BOOST_SIGNALS2_PP_COMMA_IF(arity) BOOST_PP_COMMA_IF(arity)
+
+#else // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+#define BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity) signal
+#define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(arity) weak_signal
+#define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(arity) signal_impl
+#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) typename Signature
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) Args...
+#define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) R (Args...)
+#define BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(arity) R (Args...)
+#define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) typename ... Args
+#define BOOST_SIGNALS2_FULL_FORWARD_ARGS(arity) Args && ... args
+#define BOOST_SIGNALS2_FORWARDED_ARGS(arity) std::forward<Args>(args)...
+#define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) slot
+#define BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(arity) slot<R (const connection &, Args...), extended_slot_function_type>
+#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(arity) bound_extended_slot_function
+#define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_INVOKER_N(arity) bound_extended_slot_function_invoker
+#define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) boost::function<Signature>
+#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity, prefix) typename prefixSignature
+#define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity, prefix) prefixSignature
+#define BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(arity) Args ... args
+#define BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity) args...
+#define BOOST_SIGNALS2_PORTABLE_SIGNATURE(arity, Signature) Signature
+
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(arity) \
+ typename SlotFunction, \
+ typename R, \
+ typename ... Args
+#define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION \
+ <R (Args...), SlotFunction>
+
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity) \
+ typename Signature, \
+ typename Combiner, \
+ typename Group, \
+ typename GroupCompare, \
+ typename SlotFunction, \
+ typename ExtendedSlotFunction, \
+ typename Mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(arity) \
+ typename Signature, \
+ typename Combiner = optional_last_value<typename boost::function_traits<Signature>::result_type>, \
+ typename Group = int, \
+ typename GroupCompare = std::less<Group>, \
+ typename SlotFunction = boost::function<Signature>, \
+ typename ExtendedSlotFunction = typename detail::variadic_extended_signature<Signature>::function_type, \
+ typename Mutex = signals2::mutex
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(arity) \
+ typename Combiner, \
+ typename Group, \
+ typename GroupCompare, \
+ typename SlotFunction, \
+ typename ExtendedSlotFunction, \
+ typename Mutex, \
+ typename R, \
+ typename ... Args
+#define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION <\
+ R (Args...), \
+ Combiner, \
+ Group, \
+ GroupCompare, \
+ SlotFunction, \
+ ExtendedSlotFunction, \
+ Mutex>
+
+#define BOOST_SIGNALS2_STD_FUNCTIONAL_BASE(result_type) \
+ std_functional_base<result_type , Args...>
+
+#define BOOST_SIGNALS2_PP_COMMA_IF(arity) ,
+
+#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+#endif // BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Douglas Gregor 2001-2004.
+// Copyright Frank Mori Hess 2007-2008.
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_SLOT_CALL_ITERATOR_HPP
+#define BOOST_SIGNALS2_SLOT_CALL_ITERATOR_HPP
+
+#include <boost/assert.hpp>
+#include <boost/aligned_storage.hpp>
+#include <boost/iterator/iterator_facade.hpp>
+#include <boost/optional.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/signals2/connection.hpp>
+#include <boost/signals2/slot_base.hpp>
+#include <boost/signals2/detail/auto_buffer.hpp>
+#include <boost/signals2/detail/unique_lock.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_reference.hpp>
+#include <boost/weak_ptr.hpp>
+
+namespace boost {
+ namespace signals2 {
+ namespace detail {
+ template<typename ResultType, typename Function>
+ class slot_call_iterator_cache
+ {
+ public:
+ slot_call_iterator_cache(const Function &f_arg):
+ f(f_arg),
+ connected_slot_count(0),
+ disconnected_slot_count(0),
+ m_active_slot(0)
+ {}
+
+ ~slot_call_iterator_cache()
+ {
+ if(m_active_slot)
+ {
+ garbage_collecting_lock<connection_body_base> lock(*m_active_slot);
+ m_active_slot->dec_slot_refcount(lock);
+ }
+ }
+
+ template<typename M>
+ void set_active_slot(garbage_collecting_lock<M> &lock,
+ connection_body_base *active_slot)
+ {
+ if(m_active_slot)
+ m_active_slot->dec_slot_refcount(lock);
+ m_active_slot = active_slot;
+ if(m_active_slot)
+ m_active_slot->inc_slot_refcount(lock);
+ }
+
+ optional<ResultType> result;
+ typedef auto_buffer<void_shared_ptr_variant, store_n_objects<10> > tracked_ptrs_type;
+ tracked_ptrs_type tracked_ptrs;
+ Function f;
+ unsigned connected_slot_count;
+ unsigned disconnected_slot_count;
+ connection_body_base *m_active_slot;
+ };
+
+ // Generates a slot call iterator. Essentially, this is an iterator that:
+ // - skips over disconnected slots in the underlying list
+ // - calls the connected slots when dereferenced
+ // - caches the result of calling the slots
+ template<typename Function, typename Iterator, typename ConnectionBody>
+ class slot_call_iterator_t
+ : public boost::iterator_facade<slot_call_iterator_t<Function, Iterator, ConnectionBody>,
+ typename Function::result_type,
+ boost::single_pass_traversal_tag,
+ typename boost::add_const<typename boost::add_reference<typename Function::result_type>::type>::type >
+ {
+ typedef boost::iterator_facade<slot_call_iterator_t<Function, Iterator, ConnectionBody>,
+ typename Function::result_type,
+ boost::single_pass_traversal_tag,
+ typename boost::add_const<typename boost::add_reference<typename Function::result_type>::type>::type >
+ inherited;
+
+ typedef typename Function::result_type result_type;
+
+ typedef slot_call_iterator_cache<result_type, Function> cache_type;
+
+ friend class boost::iterator_core_access;
+
+ public:
+ slot_call_iterator_t(Iterator iter_in, Iterator end_in,
+ cache_type &c):
+ iter(iter_in), end(end_in),
+ cache(&c), callable_iter(end_in)
+ {
+ lock_next_callable();
+ }
+
+ typename inherited::reference
+ dereference() const
+ {
+ if (!cache->result) {
+ try
+ {
+ cache->result.reset(cache->f(*iter));
+ }
+ catch(expired_slot &)
+ {
+ (*iter)->disconnect();
+ throw;
+ }
+ }
+ return cache->result.get();
+ }
+
+ void increment()
+ {
+ ++iter;
+ lock_next_callable();
+ cache->result.reset();
+ }
+
+ bool equal(const slot_call_iterator_t& other) const
+ {
+ return iter == other.iter;
+ }
+
+ private:
+ typedef garbage_collecting_lock<connection_body_base> lock_type;
+
+ void set_callable_iter(lock_type &lock, Iterator newValue) const
+ {
+ callable_iter = newValue;
+ if(callable_iter == end)
+ cache->set_active_slot(lock, 0);
+ else
+ cache->set_active_slot(lock, (*callable_iter).get());
+ }
+
+ void lock_next_callable() const
+ {
+ if(iter == callable_iter)
+ {
+ return;
+ }
+ if(iter == end)
+ {
+ if(callable_iter != end)
+ {
+ lock_type lock(**callable_iter);
+ set_callable_iter(lock, end);
+ return;
+ }
+ }
+ // we're only locking the first connection body,
+ // but it doesn't matter they all use the same mutex
+ lock_type lock(**iter);
+ for(;iter != end; ++iter)
+ {
+ cache->tracked_ptrs.clear();
+ (*iter)->nolock_grab_tracked_objects(lock, std::back_inserter(cache->tracked_ptrs));
+ if((*iter)->nolock_nograb_connected())
+ {
+ ++cache->connected_slot_count;
+ }else
+ {
+ ++cache->disconnected_slot_count;
+ }
+ if((*iter)->nolock_nograb_blocked() == false)
+ {
+ set_callable_iter(lock, iter);
+ break;
+ }
+ }
+ if(iter == end)
+ {
+ set_callable_iter(lock, end);
+ }
+ }
+
+ mutable Iterator iter;
+ Iterator end;
+ cache_type *cache;
+ mutable Iterator callable_iter;
+ };
+ } // end namespace detail
+ } // end namespace BOOST_SIGNALS_NAMESPACE
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_SLOT_CALL_ITERATOR_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2008.
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_SLOT_GROUPS_HPP
+#define BOOST_SIGNALS2_SLOT_GROUPS_HPP
+
+#include <boost/signals2/connection.hpp>
+#include <boost/optional.hpp>
+#include <list>
+#include <map>
+#include <utility>
+
+namespace boost {
+ namespace signals2 {
+ namespace detail {
+ enum slot_meta_group {front_ungrouped_slots, grouped_slots, back_ungrouped_slots};
+ template<typename Group>
+ struct group_key
+ {
+ typedef std::pair<enum slot_meta_group, boost::optional<Group> > type;
+ };
+ template<typename Group, typename GroupCompare>
+ class group_key_less
+ {
+ public:
+ group_key_less()
+ {}
+ group_key_less(const GroupCompare &group_compare): _group_compare(group_compare)
+ {}
+ bool operator ()(const typename group_key<Group>::type &key1, const typename group_key<Group>::type &key2) const
+ {
+ if(key1.first != key2.first) return key1.first < key2.first;
+ if(key1.first != grouped_slots) return false;
+ return _group_compare(key1.second.get(), key2.second.get());
+ }
+ private:
+ GroupCompare _group_compare;
+ };
+ template<typename Group, typename GroupCompare, typename ValueType>
+ class grouped_list
+ {
+ public:
+ typedef group_key_less<Group, GroupCompare> group_key_compare_type;
+ private:
+ typedef std::list<ValueType> list_type;
+ typedef std::map
+ <
+ typename group_key<Group>::type,
+ typename list_type::iterator,
+ group_key_compare_type
+ > map_type;
+ typedef typename map_type::iterator map_iterator;
+ typedef typename map_type::const_iterator const_map_iterator;
+ public:
+ typedef typename list_type::iterator iterator;
+ typedef typename list_type::const_iterator const_iterator;
+ typedef typename group_key<Group>::type group_key_type;
+
+ grouped_list(const group_key_compare_type &group_key_compare):
+ _group_key_compare(group_key_compare)
+ {}
+ grouped_list(const grouped_list &other): _list(other._list),
+ _group_map(other._group_map), _group_key_compare(other._group_key_compare)
+ {
+ // fix up _group_map
+ typename map_type::const_iterator other_map_it;
+ typename list_type::iterator this_list_it = _list.begin();
+ typename map_type::iterator this_map_it = _group_map.begin();
+ for(other_map_it = other._group_map.begin();
+ other_map_it != other._group_map.end();
+ ++other_map_it, ++this_map_it)
+ {
+ BOOST_ASSERT(this_map_it != _group_map.end());
+ this_map_it->second = this_list_it;
+ typename list_type::const_iterator other_list_it = other.get_list_iterator(other_map_it);
+ typename map_type::const_iterator other_next_map_it = other_map_it;
+ ++other_next_map_it;
+ typename list_type::const_iterator other_next_list_it = other.get_list_iterator(other_next_map_it);
+ while(other_list_it != other_next_list_it)
+ {
+ ++other_list_it;
+ ++this_list_it;
+ }
+ }
+ }
+ iterator begin()
+ {
+ return _list.begin();
+ }
+ iterator end()
+ {
+ return _list.end();
+ }
+ iterator lower_bound(const group_key_type &key)
+ {
+ map_iterator map_it = _group_map.lower_bound(key);
+ return get_list_iterator(map_it);
+ }
+ iterator upper_bound(const group_key_type &key)
+ {
+ map_iterator map_it = _group_map.upper_bound(key);
+ return get_list_iterator(map_it);
+ }
+ void push_front(const group_key_type &key, const ValueType &value)
+ {
+ map_iterator map_it;
+ if(key.first == front_ungrouped_slots)
+ {// optimization
+ map_it = _group_map.begin();
+ }else
+ {
+ map_it = _group_map.lower_bound(key);
+ }
+ m_insert(map_it, key, value);
+ }
+ void push_back(const group_key_type &key, const ValueType &value)
+ {
+ map_iterator map_it;
+ if(key.first == back_ungrouped_slots)
+ {// optimization
+ map_it = _group_map.end();
+ }else
+ {
+ map_it = _group_map.upper_bound(key);
+ }
+ m_insert(map_it, key, value);
+ }
+ void erase(const group_key_type &key)
+ {
+ map_iterator map_it = _group_map.lower_bound(key);
+ iterator begin_list_it = get_list_iterator(map_it);
+ iterator end_list_it = upper_bound(key);
+ if(begin_list_it != end_list_it)
+ {
+ _list.erase(begin_list_it, end_list_it);
+ _group_map.erase(map_it);
+ }
+ }
+ iterator erase(const group_key_type &key, const iterator &it)
+ {
+ BOOST_ASSERT(it != _list.end());
+ map_iterator map_it = _group_map.lower_bound(key);
+ BOOST_ASSERT(map_it != _group_map.end());
+ BOOST_ASSERT(weakly_equivalent(map_it->first, key));
+ if(map_it->second == it)
+ {
+ iterator next = it;
+ ++next;
+ // if next is in same group
+ if(next != upper_bound(key))
+ {
+ _group_map[key] = next;
+ }else
+ {
+ _group_map.erase(map_it);
+ }
+ }
+ return _list.erase(it);
+ }
+ void clear()
+ {
+ _list.clear();
+ _group_map.clear();
+ }
+ private:
+ /* Suppress default assignment operator, since it has the wrong semantics. */
+ grouped_list& operator=(const grouped_list &other);
+
+ bool weakly_equivalent(const group_key_type &arg1, const group_key_type &arg2)
+ {
+ if(_group_key_compare(arg1, arg2)) return false;
+ if(_group_key_compare(arg2, arg1)) return false;
+ return true;
+ }
+ void m_insert(const map_iterator &map_it, const group_key_type &key, const ValueType &value)
+ {
+ iterator list_it = get_list_iterator(map_it);
+ iterator new_it = _list.insert(list_it, value);
+ if(map_it != _group_map.end() && weakly_equivalent(key, map_it->first))
+ {
+ _group_map.erase(map_it);
+ }
+ map_iterator lower_bound_it = _group_map.lower_bound(key);
+ if(lower_bound_it == _group_map.end() ||
+ weakly_equivalent(lower_bound_it->first, key) == false)
+ {
+ /* doing the following instead of just
+ _group_map[key] = new_it;
+ to avoid bogus error when enabling checked iterators with g++ */
+ _group_map.insert(typename map_type::value_type(key, new_it));
+ }
+ }
+ iterator get_list_iterator(const const_map_iterator &map_it)
+ {
+ iterator list_it;
+ if(map_it == _group_map.end())
+ {
+ list_it = _list.end();
+ }else
+ {
+ list_it = map_it->second;
+ }
+ return list_it;
+ }
+ const_iterator get_list_iterator(const const_map_iterator &map_it) const
+ {
+ const_iterator list_it;
+ if(map_it == _group_map.end())
+ {
+ list_it = _list.end();
+ }else
+ {
+ list_it = map_it->second;
+ }
+ return list_it;
+ }
+
+ list_type _list;
+ // holds iterators to first list item in each group
+ map_type _group_map;
+ group_key_compare_type _group_key_compare;
+ };
+ } // end namespace detail
+ enum connect_position { at_back, at_front };
+ } // end namespace signals2
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_SLOT_GROUPS_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2008.
+// Copyright Timmo Stange 2007.
+// Copyright Douglas Gregor 2001-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+// This file is included iteratively, and should not be protected from multiple inclusion
+
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_SIGNALS2_NUM_ARGS BOOST_PP_ITERATION()
+#else
+#define BOOST_SIGNALS2_NUM_ARGS 1
+#endif
+
+
+namespace boost
+{
+ namespace signals2
+ {
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ template<typename Signature, typename SlotFunction> class slot;
+#else
+ template<typename Signature, typename SlotFunction = boost::function<Signature> >
+ class slot;
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1900)
+ template<typename Signature, typename SlotFunction> class slot{};
+#endif
+#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+ template<BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(BOOST_SIGNALS2_NUM_ARGS)>
+ class BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS) BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION
+ : public slot_base, public detail::BOOST_SIGNALS2_STD_FUNCTIONAL_BASE(R)
+
+ {
+ public:
+ template<BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS, Other), typename OtherSlotFunction>
+ friend class BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS);
+
+ typedef SlotFunction slot_function_type;
+ typedef R result_type;
+ typedef typename mpl::identity<BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(BOOST_SIGNALS2_NUM_ARGS)>::type signature_type;
+
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+// typedef Tn argn_type;
+#define BOOST_SIGNALS2_MISC_STATEMENT(z, n, data) \
+ typedef BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type);
+ BOOST_PP_REPEAT(BOOST_SIGNALS2_NUM_ARGS, BOOST_SIGNALS2_MISC_STATEMENT, ~)
+#undef BOOST_SIGNALS2_MISC_STATEMENT
+#if BOOST_SIGNALS2_NUM_ARGS == 1
+ typedef arg1_type argument_type;
+#elif BOOST_SIGNALS2_NUM_ARGS == 2
+ typedef arg1_type first_argument_type;
+ typedef arg2_type second_argument_type;
+#endif
+
+ template<unsigned n> class arg : public
+ detail::BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <n BOOST_SIGNALS2_PP_COMMA_IF(BOOST_SIGNALS2_NUM_ARGS)
+ BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS)>
+ {};
+
+ BOOST_STATIC_CONSTANT(int, arity = BOOST_SIGNALS2_NUM_ARGS);
+
+#else // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+ template<unsigned n> class arg
+ {
+ public:
+ typedef typename detail::variadic_arg_type<n, Args...>::type type;
+ };
+ BOOST_STATIC_CONSTANT(int, arity = sizeof...(Args));
+
+#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+ template<typename F>
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const F& f)
+ {
+ init_slot_function(f);
+ }
+ // copy constructors
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ template<BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(BOOST_SIGNALS2_NUM_ARGS, Other), typename OtherSlotFunction>
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)
+ <BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(BOOST_SIGNALS2_NUM_ARGS, Other), OtherSlotFunction> &other_slot):
+ slot_base(other_slot), _slot_function(other_slot._slot_function)
+ {
+ }
+#endif
+ template<typename Signature, typename OtherSlotFunction>
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)(const slot<Signature, OtherSlotFunction> &other_slot):
+ slot_base(other_slot), _slot_function(other_slot._slot_function)
+ {
+ }
+ // bind syntactic sugar
+ BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS
+ // invocation
+ R operator()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS))
+ {
+ locked_container_type locked_objects = lock();
+ return _slot_function(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ R operator()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const
+ {
+ locked_container_type locked_objects = lock();
+ return _slot_function(BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(BOOST_SIGNALS2_NUM_ARGS));
+ }
+ // tracking
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)& track(const weak_ptr<void> &tracked) {
+ _tracked_objects.push_back(tracked);
+ return *this;
+ }
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)& track(const signal_base &signal)
+ {
+ track_signal(signal);
+ return *this;
+ }
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)& track(const slot_base &slot)
+ {
+ tracked_container_type::const_iterator it;
+ for(it = slot.tracked_objects().begin(); it != slot.tracked_objects().end(); ++it)
+ {
+ _tracked_objects.push_back(*it);
+ }
+ return *this;
+ }
+ template<typename ForeignWeakPtr>
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)& track_foreign(const ForeignWeakPtr &tracked,
+ typename weak_ptr_traits<ForeignWeakPtr>::shared_type * /*SFINAE*/ = 0)
+ {
+ _tracked_objects.push_back(detail::foreign_void_weak_ptr(tracked));
+ return *this;
+ }
+ template<typename ForeignSharedPtr>
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)& track_foreign(const ForeignSharedPtr &tracked,
+ typename shared_ptr_traits<ForeignSharedPtr>::weak_type * /*SFINAE*/ = 0)
+ {
+ _tracked_objects.push_back
+ (
+ detail::foreign_void_weak_ptr
+ (
+ typename shared_ptr_traits<ForeignSharedPtr>::weak_type(tracked)
+ )
+ );
+ return *this;
+ }
+
+ const slot_function_type& slot_function() const {return _slot_function;}
+ slot_function_type& slot_function() {return _slot_function;}
+ private:
+ template<typename F>
+ void init_slot_function(const F& f)
+ {
+ _slot_function = detail::get_invocable_slot(f, detail::tag_type(f));
+ signals2::detail::tracked_objects_visitor visitor(this);
+ boost::visit_each(visitor, f);
+ }
+
+ SlotFunction _slot_function;
+ };
+
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+ namespace detail
+ {
+ template<unsigned arity, typename Signature, typename SlotFunction>
+ class slotN;
+ // partial template specialization
+ template<typename Signature, typename SlotFunction>
+ class slotN<BOOST_SIGNALS2_NUM_ARGS, Signature, SlotFunction>
+ {
+ public:
+ typedef BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)<
+ BOOST_SIGNALS2_PORTABLE_SIGNATURE(BOOST_SIGNALS2_NUM_ARGS, Signature),
+ SlotFunction> type;
+ };
+ }
+#endif
+ } // end namespace signals2
+} // end namespace boost
+
+#undef BOOST_SIGNALS2_NUM_ARGS
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2008.
+// Copyright Timmo Stange 2007.
+// Copyright Douglas Gregor 2001-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_TRACKED_OBJECTS_VISITOR_HPP
+#define BOOST_SIGNALS2_TRACKED_OBJECTS_VISITOR_HPP
+
+#include <boost/mpl/bool.hpp>
+#include <boost/ref.hpp>
+#include <boost/signals2/detail/signals_common.hpp>
+#include <boost/signals2/slot_base.hpp>
+#include <boost/signals2/trackable.hpp>
+#include <boost/type_traits/is_function.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/utility/addressof.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ // Visitor to collect tracked objects from a bound function.
+ class tracked_objects_visitor
+ {
+ public:
+ tracked_objects_visitor(slot_base *slot) : slot_(slot)
+ {}
+ template<typename T>
+ void operator()(const T& t) const
+ {
+ m_visit_reference_wrapper(t, mpl::bool_<is_reference_wrapper<T>::value>());
+ }
+ private:
+ template<typename T>
+ void m_visit_reference_wrapper(const reference_wrapper<T> &t, const mpl::bool_<true> &) const
+ {
+ m_visit_pointer(t.get_pointer(), mpl::bool_<true>());
+ }
+ template<typename T>
+ void m_visit_reference_wrapper(const T &t, const mpl::bool_<false> &) const
+ {
+ m_visit_pointer(t, mpl::bool_<is_pointer<T>::value>());
+ }
+ template<typename T>
+ void m_visit_pointer(const T &t, const mpl::bool_<true> &) const
+ {
+ m_visit_not_function_pointer(t, mpl::bool_<!is_function<typename remove_pointer<T>::type>::value>());
+ }
+ template<typename T>
+ void m_visit_pointer(const T &t, const mpl::bool_<false> &) const
+ {
+ m_visit_pointer(boost::addressof(t), mpl::bool_<true>());
+ }
+ template<typename T>
+ void m_visit_not_function_pointer(const T *t, const mpl::bool_<true> &) const
+ {
+ m_visit_signal(t, mpl::bool_<is_signal<T>::value>());
+ }
+ template<typename T>
+ void m_visit_not_function_pointer(const T &, const mpl::bool_<false> &) const
+ {}
+ template<typename T>
+ void m_visit_signal(const T *signal, const mpl::bool_<true> &) const
+ {
+ if(signal)
+ slot_->track_signal(*signal);
+ }
+ template<typename T>
+ void m_visit_signal(const T &t, const mpl::bool_<false> &) const
+ {
+ add_if_trackable(t);
+ }
+ void add_if_trackable(const trackable *trackable) const
+ {
+ if(trackable)
+ slot_->_tracked_objects.push_back(trackable->get_weak_ptr());
+ }
+ void add_if_trackable(const void *) const {}
+
+ mutable slot_base * slot_;
+ };
+
+
+ } // end namespace detail
+ } // end namespace signals2
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_TRACKED_OBJECTS_VISITOR_HPP
+
--- /dev/null
+/*
+ Provides a basic subset of boost::unique_lock functionality. Provided only because
+ including boost/thread/locks.hpp requires linking to thread library
+*/
+// Copyright Frank Mori Hess 2008.
+// 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/signals2 for library home page.
+
+#ifndef BOOST_SIGNALS2_UNIQUE_LOCK_HPP
+#define BOOST_SIGNALS2_UNIQUE_LOCK_HPP
+
+#include <boost/noncopyable.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<typename Mutex>
+ class unique_lock: public noncopyable
+ {
+ public:
+ unique_lock(Mutex &m): _mutex(m)
+ {
+ _mutex.lock();
+ }
+ ~unique_lock()
+ {
+ _mutex.unlock();
+ }
+ private:
+ Mutex &_mutex;
+ };
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#endif // BOOST_SIGNALS2_UNIQUE_LOCK_HPP
--- /dev/null
+// Copyright Frank Mori Hess 2009
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_DETAIL_VARIADIC_ARG_TYPE_HPP
+#define BOOST_SIGNALS2_DETAIL_VARIADIC_ARG_TYPE_HPP
+
+#include <functional>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<unsigned, typename ... Args> class variadic_arg_type;
+
+ template<typename T, typename ... Args> class variadic_arg_type<0, T, Args...>
+ {
+ public:
+ typedef T type;
+ };
+
+ template<unsigned n, typename T, typename ... Args> class variadic_arg_type<n, T, Args...>
+ {
+ public:
+ typedef typename variadic_arg_type<n - 1, Args...>::type type;
+ };
+
+ template <typename R, typename ... Args>
+ struct std_functional_base
+ {};
+ template <typename R, typename T1>
+ struct std_functional_base<R, T1>: public std::unary_function<T1, R>
+ {};
+ template <typename R, typename T1, typename T2>
+ struct std_functional_base<R, T1, T2>: public std::binary_function<T1, T2, R>
+ {};
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+
+#endif // BOOST_SIGNALS2_DETAIL_VARIADIC_ARG_TYPE_HPP
--- /dev/null
+/*
+ Helper class used by variadic implementation of variadic boost::signals2::signal.
+
+ Author: Frank Mori Hess <fmhess@users.sourceforge.net>
+ Begin: 2009-05-27
+*/
+// Copyright Frank Mori Hess 2009
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_DETAIL_VARIADIC_SLOT_INVOKER_HPP
+#define BOOST_SIGNALS2_DETAIL_VARIADIC_SLOT_INVOKER_HPP
+
+#include <boost/mpl/size_t.hpp>
+#include <boost/signals2/detail/variadic_arg_type.hpp>
+
+// if compiler has std::tuple use it instead of boost::tuple
+// because boost::tuple does not have variadic template support at present.
+#ifdef BOOST_NO_CXX11_HDR_TUPLE
+#include <boost/tuple/tuple.hpp>
+#define BOOST_SIGNALS2_TUPLE boost::tuple
+#define BOOST_SIGNALS2_GET boost::get
+#else
+#include <tuple>
+#define BOOST_SIGNALS2_TUPLE std::tuple
+#define BOOST_SIGNALS2_GET std::get
+#endif
+
+// vc12 seems to erroneously report formal parameters as unreferenced (warning C4100)
+// if parameters of variadic template functions are only referenced by calling
+// other varadic template functions. silence these warnings:
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#if BOOST_MSVC >= 1800
+#pragma warning(disable:4100)
+#endif
+#endif
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<unsigned ... values> class unsigned_meta_array {};
+
+ template<typename UnsignedMetaArray, unsigned n> class unsigned_meta_array_appender;
+
+ template<unsigned n, unsigned ... Args>
+ class unsigned_meta_array_appender<unsigned_meta_array<Args...>, n>
+ {
+ public:
+ typedef unsigned_meta_array<Args..., n> type;
+ };
+
+ template<unsigned n> class make_unsigned_meta_array;
+
+ template<> class make_unsigned_meta_array<0>
+ {
+ public:
+ typedef unsigned_meta_array<> type;
+ };
+
+ template<> class make_unsigned_meta_array<1>
+ {
+ public:
+ typedef unsigned_meta_array<0> type;
+ };
+
+ template<unsigned n> class make_unsigned_meta_array
+ {
+ public:
+ typedef typename unsigned_meta_array_appender<typename make_unsigned_meta_array<n-1>::type, n - 1>::type type;
+ };
+
+ template<typename R>
+ class call_with_tuple_args
+ {
+ public:
+ typedef R result_type;
+
+ template<typename Func, typename ... Args, std::size_t N>
+ R operator()(Func &func, const BOOST_SIGNALS2_TUPLE<Args...> & args, mpl::size_t<N>) const
+ {
+ typedef typename make_unsigned_meta_array<N>::type indices_type;
+ return m_invoke<Func>(func, indices_type(), args);
+ }
+ private:
+ template<typename Func, unsigned ... indices, typename ... Args>
+ R m_invoke(Func &func, unsigned_meta_array<indices...>, const BOOST_SIGNALS2_TUPLE<Args...> & args,
+ typename boost::disable_if<boost::is_void<typename Func::result_type> >::type * = 0
+ ) const
+ {
+ return func(BOOST_SIGNALS2_GET<indices>(args)...);
+ }
+ template<typename Func, unsigned ... indices, typename ... Args>
+ R m_invoke(Func &func, unsigned_meta_array<indices...>, const BOOST_SIGNALS2_TUPLE<Args...> & args,
+ typename boost::enable_if<boost::is_void<typename Func::result_type> >::type * = 0
+ ) const
+ {
+ func(BOOST_SIGNALS2_GET<indices>(args)...);
+ return R();
+ }
+ // This overload is redundant, as it is the same as the previous variadic method when
+ // it has zero "indices" or "Args" variadic template parameters. This overload
+ // only exists to quiet some unused parameter warnings
+ // on certain compilers (some versions of gcc and msvc)
+ template<typename Func>
+ R m_invoke(Func &func, unsigned_meta_array<>, const BOOST_SIGNALS2_TUPLE<> &,
+ typename boost::enable_if<boost::is_void<typename Func::result_type> >::type * = 0
+ ) const
+ {
+ func();
+ return R();
+ }
+ };
+
+ template<typename R, typename ... Args>
+ class variadic_slot_invoker
+ {
+ public:
+ typedef R result_type;
+
+ variadic_slot_invoker(Args & ... args): _args(args...)
+ {}
+ template<typename ConnectionBodyType>
+ result_type operator ()(const ConnectionBodyType &connectionBody) const
+ {
+ return call_with_tuple_args<result_type>()(connectionBody->slot().slot_function(),
+ _args, mpl::size_t<sizeof...(Args)>());
+ }
+ private:
+ BOOST_SIGNALS2_TUPLE<Args& ...> _args;
+ };
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
+
+#endif // BOOST_SIGNALS2_DETAIL_VARIADIC_SLOT_INVOKER_HPP
--- /dev/null
+// A model of the Lockable concept from Boost.Thread which
+// does nothing. It can be passed as the Mutex template parameter
+// for a signal, if the user wishes to disable thread-safety
+// (presumably for performance reasons).
+
+// Copyright Frank Mori Hess 2008.
+// 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/signals2 for library home page.
+
+#ifndef BOOST_SIGNALS2_DUMMY_MUTEX_HPP
+#define BOOST_SIGNALS2_DUMMY_MUTEX_HPP
+
+namespace boost {
+ namespace signals2 {
+ class dummy_mutex
+ {
+ public:
+ void lock() {}
+ bool try_lock() {return true;}
+ void unlock() {}
+ };
+ } // end namespace signals2
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_DUMMY_MUTEX_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2010.
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_EXPIRED_SLOT_HPP
+#define BOOST_SIGNALS2_EXPIRED_SLOT_HPP
+
+#include <boost/smart_ptr/bad_weak_ptr.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ class expired_slot: public bad_weak_ptr
+ {
+ public:
+ virtual char const * what() const throw()
+ {
+ return "boost::signals2::expired_slot";
+ }
+ };
+ }
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_EXPIRED_SLOT_HPP
--- /dev/null
+// last_value function object (documented as part of Boost.Signals)
+
+// Copyright Frank Mori Hess 2007.
+// Copyright Douglas Gregor 2001-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_LAST_VALUE_HPP
+#define BOOST_SIGNALS2_LAST_VALUE_HPP
+
+#include <boost/optional.hpp>
+#include <boost/signals2/expired_slot.hpp>
+#include <stdexcept>
+
+namespace boost {
+ namespace signals2 {
+
+ // no_slots_error is thrown when we are unable to generate a return value
+ // due to no slots being connected to the signal.
+ class no_slots_error: public std::exception
+ {
+ public:
+ virtual const char* what() const throw() {return "boost::signals2::no_slots_error";}
+ };
+
+ template<typename T>
+ class last_value {
+ public:
+ typedef T result_type;
+
+ template<typename InputIterator>
+ T operator()(InputIterator first, InputIterator last) const
+ {
+ if(first == last)
+ {
+ throw no_slots_error();
+ }
+ optional<T> value;
+ while (first != last)
+ {
+ try
+ {
+ value = *first;
+ }
+ catch(const expired_slot &) {}
+ ++first;
+ }
+ if(value) return value.get();
+ throw no_slots_error();
+ }
+ };
+
+ template<>
+ class last_value<void> {
+ public:
+ typedef void result_type;
+ template<typename InputIterator>
+ result_type operator()(InputIterator first, InputIterator last) const
+ {
+ while (first != last)
+ {
+ try
+ {
+ *first;
+ }
+ catch(const expired_slot &) {}
+ ++first;
+ }
+ return;
+ }
+ };
+ } // namespace signals2
+} // namespace boost
+#endif // BOOST_SIGNALS2_LAST_VALUE_HPP
--- /dev/null
+//
+// boost/signals2/mutex.hpp - header-only mutex
+//
+// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2008 Frank Mori Hess
+//
+// 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)
+//
+// boost::signals2::mutex is a modification of
+// boost::detail::lightweight_mutex to follow the newer Lockable
+// concept of Boost.Thread.
+//
+
+#ifndef BOOST_SIGNALS2_MUTEX_HPP
+#define BOOST_SIGNALS2_MUTEX_HPP
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#include <boost/config.hpp>
+
+#if !defined(BOOST_HAS_THREADS)
+# include <boost/signals2/detail/lwm_nop.hpp>
+#elif defined(BOOST_HAS_PTHREADS)
+# include <boost/signals2/detail/lwm_pthreads.hpp>
+#elif defined(BOOST_HAS_WINTHREADS)
+# include <boost/signals2/detail/lwm_win32_cs.hpp>
+#else
+// Use #define BOOST_DISABLE_THREADS to avoid the error
+# error Unrecognized threading platform
+#endif
+
+#endif // #ifndef BOOST_SIGNALS2_MUTEX_HPP
--- /dev/null
+// optional_last_value function object (documented as part of Boost.Signals2)
+
+// Copyright Frank Mori Hess 2007-2008.
+// Copyright Douglas Gregor 2001-2003.
+// 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/signals2 for library home page.
+
+#ifndef BOOST_SIGNALS2_OPTIONAL_LAST_VALUE_HPP
+#define BOOST_SIGNALS2_OPTIONAL_LAST_VALUE_HPP
+
+#include <boost/optional.hpp>
+#include <boost/signals2/expired_slot.hpp>
+
+namespace boost {
+ namespace signals2 {
+
+ template<typename T>
+ class optional_last_value
+ {
+ public:
+ typedef optional<T> result_type;
+
+ template<typename InputIterator>
+ optional<T> operator()(InputIterator first, InputIterator last) const
+ {
+ optional<T> value;
+ while (first != last)
+ {
+ try
+ {
+ value = *first;
+ }
+ catch(const expired_slot &) {}
+ ++first;
+ }
+ return value;
+ }
+ };
+
+ template<>
+ class optional_last_value<void>
+ {
+ public:
+ typedef void result_type;
+ template<typename InputIterator>
+ result_type operator()(InputIterator first, InputIterator last) const
+ {
+ while (first != last)
+ {
+ try
+ {
+ *first;
+ }
+ catch(const expired_slot &) {}
+ ++first;
+ }
+ return;
+ }
+ };
+ } // namespace signals2
+} // namespace boost
+#endif // BOOST_SIGNALS2_OPTIONAL_LAST_VALUE_HPP
--- /dev/null
+// DEPRECATED in favor of adl_postconstruct with deconstruct<T>().
+// A simple framework for creating objects with postconstructors.
+// The objects must inherit from boost::signals2::postconstructible, and
+// have their lifetimes managed by
+// boost::shared_ptr created with the boost::signals2::deconstruct_ptr()
+// function.
+//
+// Copyright Frank Mori Hess 2007-2008.
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP
+#define BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP
+
+namespace boost
+{
+ template<typename T> class shared_ptr;
+
+ namespace signals2
+ {
+ namespace postconstructible_adl_barrier
+ {
+ class postconstructible;
+ }
+ namespace detail
+ {
+ void do_postconstruct(const boost::signals2::postconstructible_adl_barrier::postconstructible *ptr);
+ } // namespace detail
+
+ namespace postconstructible_adl_barrier
+ {
+ class postconstructible
+ {
+ public:
+ friend void detail::do_postconstruct(const postconstructible *ptr);
+ template<typename T>
+ friend void adl_postconstruct(const shared_ptr<T> &, postconstructible *p)
+ {
+ p->postconstruct();
+ }
+ protected:
+ postconstructible() {}
+ virtual ~postconstructible() {}
+ virtual void postconstruct() = 0;
+ };
+ } // namespace postconstructible_adl_barrier
+ using postconstructible_adl_barrier::postconstructible;
+
+ }
+}
+
+#endif // BOOST_SIGNALS2_POSTCONSTRUCTIBLE_HPP
--- /dev/null
+// DEPRECATED in favor of adl_predestruct with deconstruct<T>().
+// A simple framework for creating objects with predestructors.
+// The objects must inherit from boost::signals2::predestructible, and
+// have their lifetimes managed by
+// boost::shared_ptr created with the boost::signals2::deconstruct_ptr()
+// function.
+//
+// Copyright Frank Mori Hess 2007-2008.
+//
+//Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_SIGNALS2_PREDESTRUCTIBLE_HPP
+#define BOOST_SIGNALS2_PREDESTRUCTIBLE_HPP
+
+namespace boost
+{
+ namespace signals2
+ {
+ template<typename T> class predestructing_deleter;
+
+ namespace predestructible_adl_barrier
+ {
+ class predestructible
+ {
+ protected:
+ predestructible() {}
+ public:
+ template<typename T>
+ friend void adl_postconstruct(const shared_ptr<T> &, ...)
+ {}
+ friend void adl_predestruct(predestructible *p)
+ {
+ p->predestruct();
+ }
+ virtual ~predestructible() {}
+ virtual void predestruct() = 0;
+ };
+ } // namespace predestructible_adl_barrier
+ using predestructible_adl_barrier::predestructible;
+ }
+}
+
+#endif // BOOST_SIGNALS2_PREDESTRUCTIBLE_HPP
--- /dev/null
+/*
+ A thread-safe version of Boost.Signals.
+
+ Author: Frank Mori Hess <fmhess@users.sourceforge.net>
+ Begin: 2007-01-23
+*/
+// Copyright Frank Mori Hess 2007-2008
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_PREPROCESSED_SIGNAL_HPP
+#define BOOST_SIGNALS2_PREPROCESSED_SIGNAL_HPP
+
+#include <boost/preprocessor/arithmetic.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/control/expr_if.hpp>
+#include <boost/preprocessor/iteration.hpp>
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/signals2/detail/preprocessed_arg_type.hpp>
+#include <boost/type_traits/add_reference.hpp>
+#include <boost/type_traits/is_void.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#define BOOST_PP_ITERATION_LIMITS (0, BOOST_SIGNALS2_MAX_ARGS)
+#define BOOST_PP_FILENAME_1 <boost/signals2/detail/signal_template.hpp>
+#include BOOST_PP_ITERATE()
+
+namespace boost
+{
+ namespace signals2
+ {
+ template<typename Signature,
+ typename Combiner = optional_last_value<typename boost::function_traits<Signature>::result_type>,
+ typename Group = int,
+ typename GroupCompare = std::less<Group>,
+ typename SlotFunction = function<Signature>,
+ typename ExtendedSlotFunction = typename detail::extended_signature<function_traits<Signature>::arity, Signature>::function_type,
+ typename Mutex = mutex >
+ class signal: public detail::signalN<function_traits<Signature>::arity,
+ Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::type
+ {
+ private:
+ typedef typename detail::signalN<boost::function_traits<Signature>::arity,
+ Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::type base_type;
+ public:
+ signal(const Combiner &combiner_arg = Combiner(), const GroupCompare &group_compare = GroupCompare()):
+ base_type(combiner_arg, group_compare)
+ {}
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && BOOST_WORKAROUND(BOOST_MSVC, < 1800)
+ signal(signal && other) : base_type(std::move(other)) {}
+ signal & operator=(signal && other) { base_type::operator=(std::move(other)); return *this; }
+#endif
+ };
+ }
+}
+
+#endif // BOOST_SIGNALS2_PREPROCESSED_SIGNAL_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2009.
+// Copyright Timmo Stange 2007.
+// Copyright Douglas Gregor 2001-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_PREPROCESSED_SLOT_HPP
+#define BOOST_SIGNALS2_PREPROCESSED_SLOT_HPP
+
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/signals2/detail/preprocessed_arg_type.hpp>
+#include <boost/type_traits/function_traits.hpp>
+
+#ifndef BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS
+#define BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS 10
+#endif
+
+
+// template<typename Func, typename BindArgT0, typename BindArgT1, ..., typename BindArgTN-1> slotN(...
+#define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR(z, n, data) \
+ template<typename Func, BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(n, BindArg)> \
+ BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)( \
+ const Func &func, BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(n, const BindArg)) \
+ { \
+ init_slot_function(boost::bind(func, BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(n))); \
+ }
+#define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS \
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS, BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR, ~)
+
+
+#define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_INC(BOOST_SIGNALS2_MAX_ARGS))
+#define BOOST_PP_FILENAME_1 <boost/signals2/detail/slot_template.hpp>
+#include BOOST_PP_ITERATE()
+
+#undef BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTOR
+#undef BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS
+
+namespace boost
+{
+ namespace signals2
+ {
+ template<typename Signature,
+ typename SlotFunction = boost::function<Signature> >
+ class slot: public detail::slotN<function_traits<Signature>::arity,
+ Signature, SlotFunction>::type
+ {
+ private:
+ typedef typename detail::slotN<boost::function_traits<Signature>::arity,
+ Signature, SlotFunction>::type base_type;
+ public:
+ template<typename F>
+ slot(const F& f): base_type(f)
+ {}
+ // bind syntactic sugar
+// template<typename F, typename BindArgT0, typename BindArgT1, ..., typename BindArgTn-1> slot(...
+#define BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR(z, n, data) \
+ template<typename Func, BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(n, BindArg)> \
+ slot(const Func &func, BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(n, const BindArg)): \
+ base_type(func, BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(n)) \
+ {}
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_SIGNALS2_SLOT_MAX_BINDING_ARGS, BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR, ~)
+#undef BOOST_SIGNALS2_SLOT_BINDING_CONSTRUCTOR
+ };
+ } // namespace signals2
+}
+
+#endif // BOOST_SIGNALS2_PREPROCESSED_SLOT_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2008.
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_SHARED_CONNECTION_BLOCK_HPP
+#define BOOST_SIGNALS2_SHARED_CONNECTION_BLOCK_HPP
+
+#include <boost/shared_ptr.hpp>
+#include <boost/signals2/connection.hpp>
+#include <boost/weak_ptr.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ class shared_connection_block
+ {
+ public:
+ shared_connection_block(const signals2::connection &conn = signals2::connection(),
+ bool initially_blocked = true):
+ _weak_connection_body(conn._weak_connection_body)
+ {
+ if(initially_blocked) block();
+ }
+ void block()
+ {
+ if(blocking()) return;
+ boost::shared_ptr<detail::connection_body_base> connection_body(_weak_connection_body.lock());
+ if(connection_body == 0)
+ {
+ // Make _blocker non-empty so the blocking() method still returns the correct value
+ // after the connection has expired.
+ _blocker.reset(static_cast<int*>(0));
+ return;
+ }
+ _blocker = connection_body->get_blocker();
+ }
+ void unblock()
+ {
+ _blocker.reset();
+ }
+ bool blocking() const
+ {
+ shared_ptr<void> empty;
+ return _blocker < empty || empty < _blocker;
+ }
+ signals2::connection connection() const
+ {
+ return signals2::connection(_weak_connection_body);
+ }
+ private:
+ boost::weak_ptr<detail::connection_body_base> _weak_connection_body;
+ shared_ptr<void> _blocker;
+ };
+ }
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_SHARED_CONNECTION_BLOCK_HPP
--- /dev/null
+// A thread-safe version of Boost.Signals.
+
+// Copyright Frank Mori Hess 2007-2009
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_SIGNAL_HPP
+#define BOOST_SIGNALS2_SIGNAL_HPP
+
+#include <algorithm>
+#include <boost/assert.hpp>
+#include <boost/config.hpp>
+#include <boost/function.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/signals2/connection.hpp>
+#include <boost/signals2/detail/unique_lock.hpp>
+#include <boost/signals2/detail/replace_slot_function.hpp>
+#include <boost/signals2/detail/result_type_wrapper.hpp>
+#include <boost/signals2/detail/signals_common.hpp>
+#include <boost/signals2/detail/signals_common_macros.hpp>
+#include <boost/signals2/detail/slot_groups.hpp>
+#include <boost/signals2/detail/slot_call_iterator.hpp>
+#include <boost/signals2/optional_last_value.hpp>
+#include <boost/signals2/mutex.hpp>
+#include <boost/signals2/slot.hpp>
+#include <functional>
+
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#include <boost/signals2/preprocessed_signal.hpp>
+#else
+#include <boost/signals2/variadic_signal.hpp>
+#endif
+
+namespace boost
+{
+ namespace signals2
+ {
+ // free swap function, findable by ADL
+ template<typename Signature,
+ typename Combiner,
+ typename Group,
+ typename GroupCompare,
+ typename SlotFunction,
+ typename ExtendedSlotFunction,
+ typename Mutex>
+ void swap(
+ signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> &sig1,
+ signal<Signature, Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex> &sig2)
+ {
+ sig1.swap(sig2);
+ }
+ }
+}
+
+#endif // BOOST_SIGNALS2_SIGNAL_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2008.
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_SIGNAL_BASE_HPP
+#define BOOST_SIGNALS2_SIGNAL_BASE_HPP
+
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+
+namespace boost {
+ namespace signals2 {
+ class slot_base;
+
+ class signal_base : public noncopyable
+ {
+ public:
+ friend class slot_base;
+
+ virtual ~signal_base() {}
+ protected:
+ virtual shared_ptr<void> lock_pimpl() const = 0;
+ };
+ } // end namespace signals2
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_SIGNAL_BASE_HPP
--- /dev/null
+/*
+ A meta function which supports using named template type parameters
+ via Boost.Parameter to specify the template type parameters for
+ the boost::signals2::signal class.
+
+ Author: Frank Mori Hess <fmhess@users.sourceforge.net>
+ Begin: 2009-01-22
+*/
+// Copyright Frank Mori Hess 2009
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_SIGNAL_TYPE_HPP
+#define BOOST_SIGNALS2_SIGNAL_TYPE_HPP
+
+// support for function types is currently broken in Boost.Parameter
+// #define BOOST_SIGNALS2_NAMED_SIGNATURE_PARAMETER
+
+#include <boost/signals2/signal.hpp>
+
+#if !defined(BOOST_PARAMETER_MAX_ARITY)
+#define BOOST_PARAMETER_MAX_ARITY 7
+#else
+#if BOOST_PARAMETER_MAX_ARITY < 7
+#error This header requires BOOST_PARAMETER_MAX_ARITY to be defined as 7 or greater prior to including Boost.Parameter headers
+#endif // BOOST_PARAMETER_MAX_ARITY < 7
+#endif // !defined(BOOST_PARAMETER_MAX_ARITY)
+#include <boost/parameter.hpp>
+
+#include <boost/type_traits/is_function.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace keywords
+ {
+#ifdef BOOST_SIGNALS2_NAMED_SIGNATURE_PARAMETER
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(signature_type)
+#endif
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(combiner_type)
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(group_type)
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(group_compare_type)
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(slot_function_type)
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(extended_slot_function_type)
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(mutex_type)
+ } // namespace keywords
+
+ template <
+#ifdef BOOST_SIGNALS2_NAMED_SIGNATURE_PARAMETER
+ typename A0,
+#else
+ typename Signature,
+#endif
+ typename A1 = parameter::void_,
+ typename A2 = parameter::void_,
+ typename A3 = parameter::void_,
+ typename A4 = parameter::void_,
+ typename A5 = parameter::void_,
+ typename A6 = parameter::void_
+ >
+ class signal_type
+ {
+ typedef parameter::parameters<
+#ifdef BOOST_SIGNALS2_NAMED_SIGNATURE_PARAMETER
+ parameter::required<keywords::tag::signature_type, is_function<boost::mpl::_> >,
+#endif
+ parameter::optional<keywords::tag::combiner_type>,
+ parameter::optional<keywords::tag::group_type>,
+ parameter::optional<keywords::tag::group_compare_type>,
+ parameter::optional<keywords::tag::slot_function_type>,
+ parameter::optional<keywords::tag::extended_slot_function_type>,
+ parameter::optional<keywords::tag::mutex_type>
+ > parameter_spec;
+
+ public:
+ // ArgumentPack
+ typedef typename
+ parameter_spec::bind<
+#ifdef BOOST_SIGNALS2_NAMED_SIGNATURE_PARAMETER
+ A0,
+#endif
+ A1, A2, A3, A4, A5, A6>::type
+ args;
+
+#ifdef BOOST_SIGNALS2_NAMED_SIGNATURE_PARAMETER
+ typedef typename parameter::value_type<args, keywords::tag::signature_type>::type
+ signature_type;
+#else
+ typedef Signature signature_type;
+#endif
+
+ typedef typename parameter::value_type
+ <
+ args,
+ keywords::tag::combiner_type,
+ optional_last_value
+ <
+ typename boost::function_traits<signature_type>::result_type
+ >
+ >::type combiner_type;
+
+ typedef typename
+ parameter::value_type<args, keywords::tag::group_type, int>::type group_type;
+
+ typedef typename
+ parameter::value_type<args, keywords::tag::group_compare_type, std::less<group_type> >::type
+ group_compare_type;
+
+ typedef typename
+ parameter::value_type<args, keywords::tag::slot_function_type, function<signature_type> >::type
+ slot_function_type;
+
+ typedef typename
+ parameter::value_type
+ <
+ args,
+ keywords::tag::extended_slot_function_type,
+ typename detail::extended_signature<function_traits<signature_type>::arity, signature_type>::function_type
+ >::type
+ extended_slot_function_type;
+
+ typedef typename
+ parameter::value_type<args, keywords::tag::mutex_type, mutex>::type mutex_type;
+
+ typedef signal
+ <
+ signature_type,
+ combiner_type,
+ group_type,
+ group_compare_type,
+ slot_function_type,
+ extended_slot_function_type,
+ mutex_type
+ > type;
+ };
+ } // namespace signals2
+} // namespace boost
+
+#endif // BOOST_SIGNALS2_SIGNAL_TYPE_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2009.
+//
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_SLOT_HPP
+#define BOOST_SIGNALS2_SLOT_HPP
+
+#include <boost/bind.hpp>
+#include <boost/config.hpp>
+#include <boost/function.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/ref.hpp>
+#include <boost/signals2/detail/signals_common.hpp>
+#include <boost/signals2/detail/signals_common_macros.hpp>
+#include <boost/signals2/detail/tracked_objects_visitor.hpp>
+#include <boost/signals2/slot_base.hpp>
+#include <boost/visit_each.hpp>
+#include <boost/weak_ptr.hpp>
+
+#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#include <boost/signals2/preprocessed_slot.hpp>
+#else
+#include <boost/signals2/variadic_slot.hpp>
+#endif
+
+#endif // BOOST_SIGNALS2_SLOT_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007-2008.
+// Copyright Timmo Stange 2007.
+// Copyright Douglas Gregor 2001-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_SLOT_BASE_HPP
+#define BOOST_SIGNALS2_SLOT_BASE_HPP
+
+#include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
+#include <boost/signals2/detail/foreign_ptr.hpp>
+#include <boost/signals2/expired_slot.hpp>
+#include <boost/signals2/signal_base.hpp>
+#include <boost/variant/apply_visitor.hpp>
+#include <boost/variant/variant.hpp>
+#include <vector>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ class tracked_objects_visitor;
+ class trackable_pointee;
+
+ typedef boost::variant<boost::weak_ptr<trackable_pointee>, boost::weak_ptr<void>, detail::foreign_void_weak_ptr > void_weak_ptr_variant;
+ typedef boost::variant<boost::shared_ptr<void>, detail::foreign_void_shared_ptr > void_shared_ptr_variant;
+ class lock_weak_ptr_visitor
+ {
+ public:
+ typedef void_shared_ptr_variant result_type;
+ template<typename WeakPtr>
+ result_type operator()(const WeakPtr &wp) const
+ {
+ return wp.lock();
+ }
+ // overload to prevent incrementing use count of shared_ptr associated
+ // with signals2::trackable objects
+ result_type operator()(const weak_ptr<trackable_pointee> &) const
+ {
+ return boost::shared_ptr<void>();
+ }
+ };
+ class expired_weak_ptr_visitor
+ {
+ public:
+ typedef bool result_type;
+ template<typename WeakPtr>
+ bool operator()(const WeakPtr &wp) const
+ {
+ return wp.expired();
+ }
+ };
+ }
+
+ class slot_base
+ {
+ public:
+ typedef std::vector<detail::void_weak_ptr_variant> tracked_container_type;
+ typedef std::vector<detail::void_shared_ptr_variant> locked_container_type;
+
+ const tracked_container_type& tracked_objects() const {return _tracked_objects;}
+ locked_container_type lock() const
+ {
+ locked_container_type locked_objects;
+ tracked_container_type::const_iterator it;
+ for(it = tracked_objects().begin(); it != tracked_objects().end(); ++it)
+ {
+ locked_objects.push_back(apply_visitor(detail::lock_weak_ptr_visitor(), *it));
+ if(apply_visitor(detail::expired_weak_ptr_visitor(), *it))
+ {
+ throw expired_slot();
+ }
+ }
+ return locked_objects;
+ }
+ bool expired() const
+ {
+ tracked_container_type::const_iterator it;
+ for(it = tracked_objects().begin(); it != tracked_objects().end(); ++it)
+ {
+ if(apply_visitor(detail::expired_weak_ptr_visitor(), *it)) return true;
+ }
+ return false;
+ }
+ protected:
+ friend class detail::tracked_objects_visitor;
+
+ void track_signal(const signal_base &signal)
+ {
+ _tracked_objects.push_back(signal.lock_pimpl());
+ }
+
+ tracked_container_type _tracked_objects;
+ };
+ }
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_SLOT_BASE_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2007,2009.
+// Copyright Timmo Stange 2007.
+// Copyright Douglas Gregor 2001-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Compatibility class to ease porting from the original
+// Boost.Signals library. However,
+// boost::signals2::trackable is NOT thread-safe.
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_TRACKABLE_HPP
+#define BOOST_SIGNALS2_TRACKABLE_HPP
+
+#include <boost/assert.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
+
+namespace boost {
+ namespace signals2 {
+ namespace detail
+ {
+ class tracked_objects_visitor;
+
+ // trackable_pointee is used to identify the tracked shared_ptr
+ // originating from the signals2::trackable class. These tracked
+ // shared_ptr are special in that we shouldn't bother to
+ // increment their use count during signal invocation, since
+ // they don't actually control the lifetime of the
+ // signals2::trackable object they are associated with.
+ class trackable_pointee
+ {};
+ }
+ class trackable {
+ protected:
+ trackable(): _tracked_ptr(static_cast<detail::trackable_pointee*>(0)) {}
+ trackable(const trackable &): _tracked_ptr(static_cast<detail::trackable_pointee*>(0)) {}
+ trackable& operator=(const trackable &)
+ {
+ return *this;
+ }
+ ~trackable() {}
+ private:
+ friend class detail::tracked_objects_visitor;
+ weak_ptr<detail::trackable_pointee> get_weak_ptr() const
+ {
+ return _tracked_ptr;
+ }
+
+ shared_ptr<detail::trackable_pointee> _tracked_ptr;
+ };
+ } // end namespace signals2
+} // end namespace boost
+
+#endif // BOOST_SIGNALS2_TRACKABLE_HPP
--- /dev/null
+/*
+ A variadic implementation of variadic boost::signals2::signal, used when variadic
+ template support is detected in the compiler.
+
+ Author: Frank Mori Hess <fmhess@users.sourceforge.net>
+ Begin: 2009-05-26
+*/
+// Copyright Frank Mori Hess 2009
+// Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
+#define BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
+
+#include <boost/preprocessor/control/expr_if.hpp>
+#include <boost/signals2/detail/variadic_arg_type.hpp>
+#include <boost/signals2/detail/variadic_slot_invoker.hpp>
+#include <boost/type_traits/function_traits.hpp>
+#include <boost/type_traits/is_void.hpp>
+#include <boost/utility/enable_if.hpp>
+
+namespace boost
+{
+ namespace signals2
+ {
+ namespace detail
+ {
+ template<typename Signature> class variadic_extended_signature;
+ // partial template specialization
+ template<typename R, typename ... Args>
+ class variadic_extended_signature<R (Args...)>
+ {
+ public:
+ typedef boost::function<R (const boost::signals2::connection &, Args...)> function_type;
+ };
+ } // namespace detail
+ } // namespace signals2
+} // namespace boost
+
+#include <boost/signals2/detail/signal_template.hpp>
+
+#endif // BOOST_SIGNALS2_VARIADIC_SIGNAL_HPP
--- /dev/null
+// Boost.Signals2 library
+
+// Copyright Frank Mori Hess 2009.
+//
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS2_VARIADIC_SLOT_HPP
+#define BOOST_SIGNALS2_VARIADIC_SLOT_HPP
+
+#include <boost/signals2/detail/variadic_arg_type.hpp>
+
+#define BOOST_SIGNALS2_SLOT_N_BINDING_CONSTRUCTORS \
+ template<typename A1, typename A2, typename ... BindArgs> \
+ slot(const A1 &arg1, const A2 &arg2, const BindArgs & ... args) \
+ { \
+ init_slot_function(boost::bind(arg1, arg2, args...)); \
+ }
+
+
+#include <boost/signals2/detail/slot_template.hpp>
+#endif // BOOST_SIGNALS2_VARIADIC_SLOT_HPP
+++ /dev/null
-#ifndef BOOST_SMART_PTR_HPP_INCLUDED
-#define BOOST_SMART_PTR_HPP_INCLUDED
-
-//
-// smart_ptr.hpp
-//
-// For convenience, this header includes the rest of the smart
-// pointer library headers.
-//
-// Copyright (c) 2003 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)
-//
-// http://www.boost.org/libs/smart_ptr/smart_ptr.htm
-//
-
-#include <boost/config.hpp>
-
-#include <boost/scoped_ptr.hpp>
-#include <boost/scoped_array.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/shared_array.hpp>
-
-#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES)
-# include <boost/weak_ptr.hpp>
-# include <boost/intrusive_ptr.hpp>
-# include <boost/enable_shared_from_this.hpp>
-# include <boost/make_shared.hpp>
-#endif
-
-#endif // #ifndef BOOST_SMART_PTR_HPP_INCLUDED
+++ /dev/null
-/*
- * Copyright (c) 2012-2014 Glen Joseph Fernandes
- * glenfe at live dot com
- *
- * Distributed under the Boost Software License,
- * Version 1.0. (See accompanying file LICENSE_1_0.txt
- * or copy at http://boost.org/LICENSE_1_0.txt)
- */
-#ifndef BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
-#define BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
-
-#include <boost/smart_ptr/detail/array_count_impl.hpp>
-#include <boost/smart_ptr/detail/sp_if_array.hpp>
-
-namespace boost {
- template<class T, class A>
- inline typename boost::detail::sp_if_array<T>::type
- allocate_shared(const A& allocator, std::size_t size) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef boost::detail::ms_init_tag R1;
- typedef boost::detail::as_allocator<A, T, R1> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- std::size_t n1 = size * boost::detail::array_total<T1>::size;
- T1* p1 = 0;
- T2* p2 = 0;
- D1 d1;
- A1 a1(allocator, size, &p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- boost::detail::as_init(allocator, p2, n1);
-#else
- boost::detail::ms_init(p2, n1);
-#endif
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T, class A>
- inline typename boost::detail::sp_if_size_array<T>::type
- allocate_shared(const A& allocator) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef boost::detail::ms_init_tag R1;
- typedef boost::detail::as_allocator<A, T, R1> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- enum {
- N = boost::detail::array_total<T>::size
- };
- T1* p1 = 0;
- T2* p2 = 0;
- D1 d1;
- A1 a1(allocator, &p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- boost::detail::as_init(allocator, p2, N);
-#else
- boost::detail::ms_init(p2, N);
-#endif
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T, class A>
- inline typename boost::detail::sp_if_array<T>::type
- allocate_shared(const A& allocator, std::size_t size,
- const typename boost::detail::array_inner<T>::type& value) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef const T2 T3;
- typedef boost::detail::ms_init_tag R1;
- typedef boost::detail::as_allocator<A, T, R1> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- enum {
- M = boost::detail::array_total<T1>::size
- };
- std::size_t n1 = M * size;
- T1* p1 = 0;
- T2* p2 = 0;
- T3* p3 = reinterpret_cast<T3*>(&value);
- D1 d1;
- A1 a1(allocator, size, &p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- boost::detail::as_init<T2, A, M>(allocator, p2, n1, p3);
-#else
- boost::detail::ms_init<T2, M>(p2, n1, p3);
-#endif
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T, class A>
- inline typename boost::detail::sp_if_size_array<T>::type
- allocate_shared(const A& allocator,
- const typename boost::detail::array_inner<T>::type& value) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef const T2 T3;
- typedef boost::detail::ms_init_tag R1;
- typedef boost::detail::as_allocator<A, T, R1> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- enum {
- N = boost::detail::array_total<T>::size,
- M = boost::detail::array_total<T1>::size
- };
- T1* p1 = 0;
- T2* p2 = 0;
- T3* p3 = reinterpret_cast<T3*>(&value);
- D1 d1;
- A1 a1(allocator, &p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- boost::detail::as_init<T2, A, M>(allocator, p2, N, p3);
-#else
- boost::detail::ms_init<T2, M>(p2, N, p3);
-#endif
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T, class A>
- inline typename boost::detail::sp_if_array<T>::type
- allocate_shared_noinit(const A& allocator, std::size_t size) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef boost::detail::ms_noinit_tag R1;
- typedef boost::detail::as_allocator<A, T, R1> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- std::size_t n1 = size * boost::detail::array_total<T1>::size;
- T1* p1 = 0;
- T2* p2 = 0;
- D1 d1;
- A1 a1(allocator, size, &p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
- boost::detail::ms_noinit(p2, n1);
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T, class A>
- inline typename boost::detail::sp_if_size_array<T>::type
- allocate_shared_noinit(const A& allocator) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef boost::detail::ms_noinit_tag R1;
- typedef boost::detail::as_allocator<A, T, R1> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- enum {
- N = boost::detail::array_total<T>::size
- };
- T1* p1 = 0;
- T2* p2 = 0;
- D1 d1;
- A1 a1(allocator, &p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
- boost::detail::ms_noinit(p2, N);
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-}
-
-#endif
+++ /dev/null
-/*
- * Copyright (c) 2012-2014 Glen Joseph Fernandes
- * glenfe at live dot com
- *
- * Distributed under the Boost Software License,
- * Version 1.0. (See accompanying file LICENSE_1_0.txt
- * or copy at http://boost.org/LICENSE_1_0.txt)
- */
-#ifndef BOOST_SMART_PTR_DETAIL_ARRAY_ALLOCATOR_HPP
-#define BOOST_SMART_PTR_DETAIL_ARRAY_ALLOCATOR_HPP
-
-#include <boost/align/align.hpp>
-#include <boost/smart_ptr/detail/array_traits.hpp>
-#include <boost/smart_ptr/detail/array_utility.hpp>
-#include <boost/type_traits/alignment_of.hpp>
-
-namespace boost {
- namespace detail {
- struct ms_init_tag { };
- struct ms_noinit_tag { };
-
- template<class T>
- struct ms_allocator_state;
-
- template<class T>
- struct ms_allocator_state<T[]> {
- typedef typename array_base<T>::type type;
-
- ms_allocator_state(std::size_t size_,
- type** result_)
- : size(size_ * array_total<T>::size),
- result(result_) {
- }
-
- std::size_t size;
-
- union {
- type** result;
- type* object;
- };
- };
-
- template<class T, std::size_t N>
- struct ms_allocator_state<T[N]> {
- typedef typename array_base<T>::type type;
-
- ms_allocator_state(type** result_)
- : result(result_) {
- }
-
- enum {
- size = array_total<T[N]>::size
- };
-
- union {
- type** result;
- type* object;
- };
- };
-
- template<class A, class T, class R>
- class as_allocator
- : public A {
- template<class A_, class T_, class R_>
- friend class as_allocator;
-
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- typedef std::allocator_traits<A> AT;
- typedef typename AT::template rebind_alloc<char> CA;
- typedef typename AT::template rebind_traits<char> CT;
-#else
- typedef typename A::template rebind<char>::other CA;
-#endif
-
- public:
- typedef A allocator_type;
-
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- typedef typename AT::value_type value_type;
- typedef typename AT::pointer pointer;
- typedef typename AT::const_pointer const_pointer;
- typedef typename AT::void_pointer void_pointer;
- typedef typename AT::const_void_pointer const_void_pointer;
- typedef typename AT::size_type size_type;
- typedef typename AT::difference_type difference_type;
-#else
- typedef typename A::value_type value_type;
- typedef typename A::pointer pointer;
- typedef typename A::const_pointer const_pointer;
- typedef typename A::size_type size_type;
- typedef typename A::difference_type difference_type;
- typedef typename A::reference reference;
- typedef typename A::const_reference const_reference;
- typedef void* void_pointer;
- typedef const void* const_void_pointer;
-#endif
-
- template<class U>
- struct rebind {
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- typedef as_allocator<typename AT::
- template rebind_alloc<U>, T, R> other;
-#else
- typedef as_allocator<typename A::
- template rebind<U>::other, T, R> other;
-#endif
- };
-
- typedef typename array_base<T>::type type;
-
- as_allocator(const A& allocator_, type** result)
- : A(allocator_),
- data(result) {
- }
-
- as_allocator(const A& allocator_, std::size_t size,
- type** result)
- : A(allocator_),
- data(size, result) {
- }
-
- template<class U>
- as_allocator(const as_allocator<U, T, R>& other)
- : A(other.allocator()),
- data(other.data) {
- }
-
- pointer allocate(size_type count, const_void_pointer = 0) {
- enum {
- M = boost::alignment_of<type>::value
- };
- std::size_t n1 = count * sizeof(value_type);
- std::size_t n2 = data.size * sizeof(type);
- std::size_t n3 = n2 + M;
- CA ca(allocator());
- void* p1 = ca.allocate(n1 + n3);
- void* p2 = static_cast<char*>(p1) + n1;
- (void)boost::alignment::align(M, n2, p2, n3);
- *data.result = static_cast<type*>(p2);
- return static_cast<value_type*>(p1);
- }
-
- void deallocate(pointer memory, size_type count) {
- enum {
- M = boost::alignment_of<type>::value
- };
- std::size_t n1 = count * sizeof(value_type);
- std::size_t n2 = data.size * sizeof(type) + M;
- char* p1 = reinterpret_cast<char*>(memory);
- CA ca(allocator());
- ca.deallocate(p1, n1 + n2);
- }
-
- const A& allocator() const {
- return static_cast<const A&>(*this);
- }
-
- A& allocator() {
- return static_cast<A&>(*this);
- }
-
- void set(type* memory) {
- data.object = memory;
- }
-
- void operator()() {
- if (data.object) {
- R tag;
- release(tag);
- }
- }
-
- private:
- void release(ms_init_tag) {
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- as_destroy(allocator(), data.object, data.size);
-#else
- ms_destroy(data.object, data.size);
-#endif
- }
-
- void release(ms_noinit_tag) {
- ms_destroy(data.object, data.size);
- }
-
- ms_allocator_state<T> data;
- };
-
- template<class A1, class A2, class T, class R>
- bool operator==(const as_allocator<A1, T, R>& a1,
- const as_allocator<A2, T, R>& a2) {
- return a1.allocator() == a2.allocator();
- }
-
- template<class A1, class A2, class T, class R>
- bool operator!=(const as_allocator<A1, T, R>& a1,
- const as_allocator<A2, T, R>& a2) {
- return a1.allocator() != a2.allocator();
- }
-
- template<class T, class Y = char>
- class ms_allocator;
-
- template<class T, class Y>
- class ms_allocator {
- template<class T_, class Y_>
- friend class ms_allocator;
-
- public:
- typedef typename array_base<T>::type type;
-
- typedef Y value_type;
- typedef Y* pointer;
- typedef const Y* const_pointer;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
- typedef Y& reference;
- typedef const Y& const_reference;
-
- template<class U>
- struct rebind {
- typedef ms_allocator<T, U> other;
- };
-
- ms_allocator(type** result)
- : data(result) {
- }
-
- ms_allocator(std::size_t size, type** result)
- : data(size, result) {
- }
-
- template<class U>
- ms_allocator(const ms_allocator<T, U>& other)
- : data(other.data) {
- }
-
- pointer allocate(size_type count, const void* = 0) {
- enum {
- M = boost::alignment_of<type>::value
- };
- std::size_t n1 = count * sizeof(Y);
- std::size_t n2 = data.size * sizeof(type);
- std::size_t n3 = n2 + M;
- void* p1 = ::operator new(n1 + n3);
- void* p2 = static_cast<char*>(p1) + n1;
- (void)boost::alignment::align(M, n2, p2, n3);
- *data.result = static_cast<type*>(p2);
- return static_cast<Y*>(p1);
- }
-
- void deallocate(pointer memory, size_type) {
- void* p1 = memory;
- ::operator delete(p1);
- }
-
-#if defined(BOOST_NO_CXX11_ALLOCATOR)
- pointer address(reference value) const {
- return &value;
- }
-
- const_pointer address(const_reference value) const {
- return &value;
- }
-
- size_type max_size() const {
- enum {
- N = static_cast<std::size_t>(-1) / sizeof(Y)
- };
- return N;
- }
-
- void construct(pointer memory, const_reference value) {
- void* p1 = memory;
- ::new(p1) Y(value);
- }
-
- void destroy(pointer memory) {
- (void)memory;
- memory->~Y();
- }
-#endif
-
- void set(type* memory) {
- data.object = memory;
- }
-
- void operator()() {
- if (data.object) {
- ms_destroy(data.object, data.size);
- }
- }
-
- private:
- ms_allocator_state<T> data;
- };
-
- template<class T, class Y1, class Y2>
- bool operator==(const ms_allocator<T, Y1>&,
- const ms_allocator<T, Y2>&) {
- return true;
- }
-
- template<class T, class Y1, class Y2>
- bool operator!=(const ms_allocator<T, Y1>&,
- const ms_allocator<T, Y2>&) {
- return false;
- }
-
- class ms_in_allocator_tag {
- public:
- void operator()(const void*) {
- }
- };
- }
-}
-
-#endif
+++ /dev/null
-/*
- * Copyright (c) 2014 Glen Joseph Fernandes
- * glenfe at live dot com
- *
- * Distributed under the Boost Software License,
- * Version 1.0. (See accompanying file LICENSE_1_0.txt
- * or copy at http://boost.org/LICENSE_1_0.txt)
- */
-#ifndef BOOST_SMART_PTR_DETAIL_ARRAY_COUNT_IMPL_HPP
-#define BOOST_SMART_PTR_DETAIL_ARRAY_COUNT_IMPL_HPP
-
-#include <boost/smart_ptr/detail/array_allocator.hpp>
-#include <boost/smart_ptr/detail/sp_counted_impl.hpp>
-
-namespace boost {
- namespace detail {
- template<class P, class A>
- class sp_counted_impl_pda<P, ms_in_allocator_tag, A>
- : public sp_counted_base {
- typedef ms_in_allocator_tag D;
- typedef sp_counted_impl_pda<P, D, A> Y;
- public:
- sp_counted_impl_pda(P, D, const A& allocator_)
- : allocator(allocator_) {
- }
-
- virtual void dispose() {
- allocator();
- }
-
- virtual void destroy() {
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- typedef typename std::allocator_traits<A>::
- template rebind_alloc<Y> YA;
- typedef typename std::allocator_traits<A>::
- template rebind_traits<Y> YT;
-#else
- typedef typename A::template rebind<Y>::other YA;
-#endif
- YA a1(allocator);
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- YT::destroy(a1, this);
- YT::deallocate(a1, this, 1);
-#else
- this->~Y();
- a1.deallocate(this, 1);
-#endif
- }
-
- virtual void* get_deleter(const sp_typeinfo&) {
- return &reinterpret_cast<char&>(allocator);
- }
-
- virtual void* get_untyped_deleter() {
- return &reinterpret_cast<char&>(allocator);
- }
-
- private:
- sp_counted_impl_pda(const sp_counted_impl_pda&);
- sp_counted_impl_pda& operator=(const sp_counted_impl_pda&);
-
- A allocator;
- };
- }
-}
-
-#endif
+++ /dev/null
-/*
- * Copyright (c) 2012-2014 Glen Joseph Fernandes
- * glenfe at live dot com
- *
- * Distributed under the Boost Software License,
- * Version 1.0. (See accompanying file LICENSE_1_0.txt
- * or copy at http://boost.org/LICENSE_1_0.txt)
- */
-#ifndef BOOST_SMART_PTR_DETAIL_ARRAY_TRAITS_HPP
-#define BOOST_SMART_PTR_DETAIL_ARRAY_TRAITS_HPP
-
-#include <boost/type_traits/remove_cv.hpp>
-
-namespace boost {
- namespace detail {
- template<class T>
- struct array_base {
- typedef typename boost::remove_cv<T>::type type;
- };
-
- template<class T>
- struct array_base<T[]> {
- typedef typename array_base<T>::type type;
- };
-
- template<class T, std::size_t N>
- struct array_base<T[N]> {
- typedef typename array_base<T>::type type;
- };
-
- template<class T>
- struct array_total {
- enum {
- size = 1
- };
- };
-
- template<class T, std::size_t N>
- struct array_total<T[N]> {
- enum {
- size = N * array_total<T>::size
- };
- };
-
- template<class T>
- struct array_inner;
-
- template<class T>
- struct array_inner<T[]> {
- typedef T type;
- };
-
- template<class T, std::size_t N>
- struct array_inner<T[N]> {
- typedef T type;
- };
- }
-}
-
-#endif
+++ /dev/null
-/*
- * Copyright (c) 2012-2014 Glen Joseph Fernandes
- * glenfe at live dot com
- *
- * Distributed under the Boost Software License,
- * Version 1.0. (See accompanying file LICENSE_1_0.txt
- * or copy at http://boost.org/LICENSE_1_0.txt)
- */
-#ifndef BOOST_SMART_PTR_DETAIL_ARRAY_UTILITY_HPP
-#define BOOST_SMART_PTR_DETAIL_ARRAY_UTILITY_HPP
-
-#include <boost/config.hpp>
-#include <boost/type_traits/has_trivial_constructor.hpp>
-#include <boost/type_traits/has_trivial_destructor.hpp>
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
-#include <memory>
-#endif
-
-namespace boost {
- namespace detail {
- typedef boost::true_type ms_is_trivial;
- typedef boost::false_type ms_no_trivial;
-
- template<class T>
- inline void ms_destroy(T*, std::size_t, ms_is_trivial) {
- }
-
- template<class T>
- inline void ms_destroy(T* memory, std::size_t size, ms_no_trivial) {
- for (std::size_t i = size; i > 0;) {
- memory[--i].~T();
- }
- }
-
- template<class T>
- inline void ms_destroy(T* memory, std::size_t size) {
- boost::has_trivial_destructor<T> trivial;
- ms_destroy(memory, size, trivial);
- }
-
- template<class T>
- inline void ms_init(T* memory, std::size_t size, ms_is_trivial) {
- for (std::size_t i = 0; i < size; i++) {
- void* p1 = memory + i;
- ::new(p1) T();
- }
- }
-
- template<class T>
- inline void ms_init(T* memory, std::size_t size, ms_no_trivial) {
-#if !defined(BOOST_NO_EXCEPTIONS)
- std::size_t i = 0;
- try {
- for (; i < size; i++) {
- void* p1 = memory + i;
- ::new(p1) T();
- }
- } catch (...) {
- ms_destroy(memory, i);
- throw;
- }
-#else
- for (std::size_t i = 0; i < size; i++) {
- void* p1 = memory + i;
- ::new(p1) T();
- }
-#endif
- }
-
- template<class T>
- inline void ms_init(T* memory, std::size_t size) {
- boost::has_trivial_default_constructor<T> trivial;
- ms_init(memory, size, trivial);
- }
-
- template<class T, std::size_t N>
- inline void ms_init(T* memory, std::size_t size, const T* list) {
-#if !defined(BOOST_NO_EXCEPTIONS)
- std::size_t i = 0;
- try {
- for (; i < size; i++) {
- void* p1 = memory + i;
- ::new(p1) T(list[i % N]);
- }
- } catch (...) {
- ms_destroy(memory, i);
- throw;
- }
-#else
- for (std::size_t i = 0; i < size; i++) {
- void* p1 = memory + i;
- ::new(p1) T(list[i % N]);
- }
-#endif
- }
-
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
- template<class T, class A>
- inline void as_destroy(const A& allocator, T* memory,
- std::size_t size) {
- typedef typename std::allocator_traits<A>::
- template rebind_alloc<T> TA;
- typedef typename std::allocator_traits<A>::
- template rebind_traits<T> TT;
- TA a2(allocator);
- for (std::size_t i = size; i > 0;) {
- TT::destroy(a2, &memory[--i]);
- }
- }
-
- template<class T, class A>
- inline void as_init(const A& allocator, T* memory, std::size_t size,
- ms_is_trivial) {
- typedef typename std::allocator_traits<A>::
- template rebind_alloc<T> TA;
- typedef typename std::allocator_traits<A>::
- template rebind_traits<T> TT;
- TA a2(allocator);
- for (std::size_t i = 0; i < size; i++) {
- TT::construct(a2, memory + i);
- }
- }
-
- template<class T, class A>
- inline void as_init(const A& allocator, T* memory, std::size_t size,
- ms_no_trivial) {
- typedef typename std::allocator_traits<A>::
- template rebind_alloc<T> TA;
- typedef typename std::allocator_traits<A>::
- template rebind_traits<T> TT;
- TA a2(allocator);
-#if !defined(BOOST_NO_EXCEPTIONS)
- std::size_t i = 0;
- try {
- for (; i < size; i++) {
- TT::construct(a2, memory + i);
- }
- } catch (...) {
- as_destroy(a2, memory, i);
- throw;
- }
-#else
- for (std::size_t i = 0; i < size; i++) {
- TT::construct(a2, memory + i);
- }
-#endif
- }
-
- template<class T, class A>
- inline void as_init(const A& allocator, T* memory, std::size_t size) {
- boost::has_trivial_default_constructor<T> trivial;
- as_init(allocator, memory, size, trivial);
- }
-
- template<class T, class A, std::size_t N>
- inline void as_init(const A& allocator, T* memory, std::size_t size,
- const T* list) {
- typedef typename std::allocator_traits<A>::
- template rebind_alloc<T> TA;
- typedef typename std::allocator_traits<A>::
- template rebind_traits<T> TT;
- TA a2(allocator);
-#if !defined(BOOST_NO_EXCEPTIONS)
- std::size_t i = 0;
- try {
- for (; i < size; i++) {
- TT::construct(a2, memory + i, list[i % N]);
- }
- } catch (...) {
- as_destroy(a2, memory, i);
- throw;
- }
-#else
- for (std::size_t i = 0; i < size; i++) {
- TT::construct(a2, memory + i, list[i % N]);
- }
-#endif
- }
-#endif
-
- template<class T>
- inline void ms_noinit(T*, std::size_t, ms_is_trivial) {
- }
-
- template<class T>
- inline void ms_noinit(T* memory, std::size_t size, ms_no_trivial) {
-#if !defined(BOOST_NO_EXCEPTIONS)
- std::size_t i = 0;
- try {
- for (; i < size; i++) {
- void* p1 = memory + i;
- ::new(p1) T;
- }
- } catch (...) {
- ms_destroy(memory, i);
- throw;
- }
-#else
- for (std::size_t i = 0; i < size; i++) {
- void* p1 = memory + i;
- ::new(p1) T;
- }
-#endif
- }
-
- template<class T>
- inline void ms_noinit(T* memory, std::size_t size) {
- boost::has_trivial_default_constructor<T> trivial;
- ms_noinit(memory, size, trivial);
- }
- }
-}
-
-#endif
+++ /dev/null
-#ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
-#define BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
-
-// MS compatible compilers support #pragma once
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-// detail/sp_forward.hpp
-//
-// Copyright 2008,2012 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 detail
-{
-
-#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
-#if defined( BOOST_GCC ) && __GNUC__ * 100 + __GNUC_MINOR__ <= 404
-
-// GCC 4.4 supports an outdated version of rvalue references and creates a copy of the forwarded object.
-// This results in warnings 'returning reference to temporary'. Therefore we use a special version similar to std::forward.
-template< class T > T&& sp_forward( T && t ) BOOST_NOEXCEPT
-{
- return t;
-}
-
-#else
-
-template< class T > T&& sp_forward( T & t ) BOOST_NOEXCEPT
-{
- return static_cast< T&& >( t );
-}
-
-#endif
-
-#endif
-
-} // namespace detail
-
-} // namespace boost
-
-#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
+++ /dev/null
-/*
- * Copyright (c) 2012-2014 Glen Joseph Fernandes
- * glenfe at live dot com
- *
- * Distributed under the Boost Software License,
- * Version 1.0. (See accompanying file LICENSE_1_0.txt
- * or copy at http://boost.org/LICENSE_1_0.txt)
- */
-#ifndef BOOST_SMART_PTR_DETAIL_SP_IF_ARRAY_HPP
-#define BOOST_SMART_PTR_DETAIL_SP_IF_ARRAY_HPP
-
-#include <boost/smart_ptr/shared_ptr.hpp>
-
-namespace boost {
- namespace detail {
- template<class T>
- struct sp_if_array;
-
- template<class T>
- struct sp_if_array<T[]> {
- typedef boost::shared_ptr<T[]> type;
- };
-
- template<class T>
- struct sp_if_size_array;
-
- template<class T, std::size_t N>
- struct sp_if_size_array<T[N]> {
- typedef boost::shared_ptr<T[N]> type;
- };
- }
-}
-
-#endif
+++ /dev/null
-#ifndef BOOST_SMART_PTR_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
-#define BOOST_SMART_PTR_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
-
-//
-// enable_shared_from_this.hpp
-//
-// Copyright 2002, 2009 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
-//
-// http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
-//
-
-#include <boost/smart_ptr/weak_ptr.hpp>
-#include <boost/smart_ptr/shared_ptr.hpp>
-#include <boost/assert.hpp>
-#include <boost/config.hpp>
-
-namespace boost
-{
-
-template<class T> class enable_shared_from_this
-{
-protected:
-
- enable_shared_from_this() BOOST_NOEXCEPT
- {
- }
-
- enable_shared_from_this(enable_shared_from_this const &) BOOST_NOEXCEPT
- {
- }
-
- enable_shared_from_this & operator=(enable_shared_from_this const &) BOOST_NOEXCEPT
- {
- return *this;
- }
-
- ~enable_shared_from_this() BOOST_NOEXCEPT // ~weak_ptr<T> newer throws, so this call also must not throw
- {
- }
-
-public:
-
- shared_ptr<T> shared_from_this()
- {
- shared_ptr<T> p( weak_this_ );
- BOOST_ASSERT( p.get() == this );
- return p;
- }
-
- shared_ptr<T const> shared_from_this() const
- {
- shared_ptr<T const> p( weak_this_ );
- BOOST_ASSERT( p.get() == this );
- return p;
- }
-
- weak_ptr<T> weak_from_this() BOOST_NOEXCEPT
- {
- return weak_this_;
- }
-
- weak_ptr<T const> weak_from_this() const BOOST_NOEXCEPT
- {
- return weak_this_;
- }
-
-public: // actually private, but avoids compiler template friendship issues
-
- // Note: invoked automatically by shared_ptr; do not call
- template<class X, class Y> void _internal_accept_owner( shared_ptr<X> const * ppx, Y * py ) const
- {
- if( weak_this_.expired() )
- {
- weak_this_ = shared_ptr<T>( *ppx, py );
- }
- }
-
-private:
-
- mutable weak_ptr<T> weak_this_;
-};
-
-} // namespace boost
-
-#endif // #ifndef BOOST_SMART_PTR_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
+++ /dev/null
-#ifndef BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED
-#define BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED
-
-//
-// intrusive_ptr.hpp
-//
-// Copyright (c) 2001, 2002 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)
-//
-// See http://www.boost.org/libs/smart_ptr/intrusive_ptr.html for documentation.
-//
-
-#include <boost/config.hpp>
-
-#include <boost/assert.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/smart_ptr/detail/sp_convertible.hpp>
-#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
-
-#include <boost/config/no_tr1/functional.hpp> // for std::less
-
-#if !defined(BOOST_NO_IOSTREAM)
-#if !defined(BOOST_NO_IOSFWD)
-#include <iosfwd> // for std::basic_ostream
-#else
-#include <ostream>
-#endif
-#endif
-
-
-namespace boost
-{
-
-//
-// intrusive_ptr
-//
-// A smart pointer that uses intrusive reference counting.
-//
-// Relies on unqualified calls to
-//
-// void intrusive_ptr_add_ref(T * p);
-// void intrusive_ptr_release(T * p);
-//
-// (p != 0)
-//
-// The object is responsible for destroying itself.
-//
-
-template<class T> class intrusive_ptr
-{
-private:
-
- typedef intrusive_ptr this_type;
-
-public:
-
- typedef T element_type;
-
- intrusive_ptr() BOOST_NOEXCEPT : px( 0 )
- {
- }
-
- intrusive_ptr( T * p, bool add_ref = true ): px( p )
- {
- if( px != 0 && add_ref ) intrusive_ptr_add_ref( px );
- }
-
-#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES)
-
- template<class U>
-#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
-
- intrusive_ptr( intrusive_ptr<U> const & rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty() )
-
-#else
-
- intrusive_ptr( intrusive_ptr<U> const & rhs )
-
-#endif
- : px( rhs.get() )
- {
- if( px != 0 ) intrusive_ptr_add_ref( px );
- }
-
-#endif
-
- intrusive_ptr(intrusive_ptr const & rhs): px( rhs.px )
- {
- if( px != 0 ) intrusive_ptr_add_ref( px );
- }
-
- ~intrusive_ptr()
- {
- if( px != 0 ) intrusive_ptr_release( px );
- }
-
-#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES)
-
- template<class U> intrusive_ptr & operator=(intrusive_ptr<U> const & rhs)
- {
- this_type(rhs).swap(*this);
- return *this;
- }
-
-#endif
-
-// Move support
-
-#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
- intrusive_ptr(intrusive_ptr && rhs) BOOST_NOEXCEPT : px( rhs.px )
- {
- rhs.px = 0;
- }
-
- intrusive_ptr & operator=(intrusive_ptr && rhs) BOOST_NOEXCEPT
- {
- this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this);
- return *this;
- }
-
-#endif
-
- intrusive_ptr & operator=(intrusive_ptr const & rhs)
- {
- this_type(rhs).swap(*this);
- return *this;
- }
-
- intrusive_ptr & operator=(T * rhs)
- {
- this_type(rhs).swap(*this);
- return *this;
- }
-
- void reset() BOOST_NOEXCEPT
- {
- this_type().swap( *this );
- }
-
- void reset( T * rhs )
- {
- this_type( rhs ).swap( *this );
- }
-
- void reset( T * rhs, bool add_ref )
- {
- this_type( rhs, add_ref ).swap( *this );
- }
-
- T * get() const BOOST_NOEXCEPT
- {
- return px;
- }
-
- T * detach() BOOST_NOEXCEPT
- {
- T * ret = px;
- px = 0;
- return ret;
- }
-
- T & operator*() const
- {
- BOOST_ASSERT( px != 0 );
- return *px;
- }
-
- T * operator->() const
- {
- BOOST_ASSERT( px != 0 );
- return px;
- }
-
-// implicit conversion to "bool"
-#include <boost/smart_ptr/detail/operator_bool.hpp>
-
- void swap(intrusive_ptr & rhs) BOOST_NOEXCEPT
- {
- T * tmp = px;
- px = rhs.px;
- rhs.px = tmp;
- }
-
-private:
-
- T * px;
-};
-
-template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b)
-{
- return a.get() == b.get();
-}
-
-template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b)
-{
- return a.get() != b.get();
-}
-
-template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, U * b)
-{
- return a.get() == b;
-}
-
-template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, U * b)
-{
- return a.get() != b;
-}
-
-template<class T, class U> inline bool operator==(T * a, intrusive_ptr<U> const & b)
-{
- return a == b.get();
-}
-
-template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const & b)
-{
- return a != b.get();
-}
-
-#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
-
-// Resolve the ambiguity between our op!= and the one in rel_ops
-
-template<class T> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b)
-{
- return a.get() != b.get();
-}
-
-#endif
-
-#if !defined( BOOST_NO_CXX11_NULLPTR )
-
-template<class T> inline bool operator==( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
-{
- return p.get() == 0;
-}
-
-template<class T> inline bool operator==( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_NOEXCEPT
-{
- return p.get() == 0;
-}
-
-template<class T> inline bool operator!=( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
-{
- return p.get() != 0;
-}
-
-template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_NOEXCEPT
-{
- return p.get() != 0;
-}
-
-#endif
-
-template<class T> inline bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b)
-{
- return std::less<T *>()(a.get(), b.get());
-}
-
-template<class T> void swap(intrusive_ptr<T> & lhs, intrusive_ptr<T> & rhs)
-{
- lhs.swap(rhs);
-}
-
-// mem_fn support
-
-template<class T> T * get_pointer(intrusive_ptr<T> const & p)
-{
- return p.get();
-}
-
-template<class T, class U> intrusive_ptr<T> static_pointer_cast(intrusive_ptr<U> const & p)
-{
- return static_cast<T *>(p.get());
-}
-
-template<class T, class U> intrusive_ptr<T> const_pointer_cast(intrusive_ptr<U> const & p)
-{
- return const_cast<T *>(p.get());
-}
-
-template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast(intrusive_ptr<U> const & p)
-{
- return dynamic_cast<T *>(p.get());
-}
-
-// operator<<
-
-#if !defined(BOOST_NO_IOSTREAM)
-
-#if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) )
-
-template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y> const & p)
-{
- os << p.get();
- return os;
-}
-
-#else
-
-// in STLport's no-iostreams mode no iostream symbols can be used
-#ifndef _STLP_NO_IOSTREAMS
-
-# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT)
-// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL
-using std::basic_ostream;
-template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, intrusive_ptr<Y> const & p)
-# else
-template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, intrusive_ptr<Y> const & p)
-# endif
-{
- os << p.get();
- return os;
-}
-
-#endif // _STLP_NO_IOSTREAMS
-
-#endif // __GNUC__ < 3
-
-#endif // !defined(BOOST_NO_IOSTREAM)
-
-// hash_value
-
-template< class T > struct hash;
-
-template< class T > std::size_t hash_value( boost::intrusive_ptr<T> const & p )
-{
- return boost::hash< T* >()( p.get() );
-}
-
-} // namespace boost
-
-#endif // #ifndef BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED
+++ /dev/null
-#ifndef BOOST_SMART_PTR_MAKE_SHARED_HPP_INCLUDED
-#define BOOST_SMART_PTR_MAKE_SHARED_HPP_INCLUDED
-
-// make_shared.hpp
-//
-// Copyright (c) 2007, 2008, 2012 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
-//
-// See http://www.boost.org/libs/smart_ptr/make_shared.html
-// for documentation.
-
-#include <boost/smart_ptr/make_shared_object.hpp>
-
-#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_SFINAE )
-# include <boost/smart_ptr/make_shared_array.hpp>
-# include <boost/smart_ptr/allocate_shared_array.hpp>
-#endif
-
-#endif // #ifndef BOOST_SMART_PTR_MAKE_SHARED_HPP_INCLUDED
+++ /dev/null
-/*
- * Copyright (c) 2012-2014 Glen Joseph Fernandes
- * glenfe at live dot com
- *
- * Distributed under the Boost Software License,
- * Version 1.0. (See accompanying file LICENSE_1_0.txt
- * or copy at http://boost.org/LICENSE_1_0.txt)
- */
-#ifndef BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
-#define BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
-
-#include <boost/smart_ptr/detail/array_count_impl.hpp>
-#include <boost/smart_ptr/detail/sp_if_array.hpp>
-
-namespace boost {
- template<class T>
- inline typename boost::detail::sp_if_array<T>::type
- make_shared(std::size_t size) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef boost::detail::ms_allocator<T> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- std::size_t n1 = size * boost::detail::array_total<T1>::size;
- T1* p1 = 0;
- T2* p2 = 0;
- D1 d1;
- A1 a1(size, &p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
- boost::detail::ms_init(p2, n1);
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T>
- inline typename boost::detail::sp_if_size_array<T>::type
- make_shared() {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef boost::detail::ms_allocator<T> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- enum {
- N = boost::detail::array_total<T>::size
- };
- T1* p1 = 0;
- T2* p2 = 0;
- D1 d1;
- A1 a1(&p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
- boost::detail::ms_init(p2, N);
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T>
- inline typename boost::detail::sp_if_array<T>::type
- make_shared(std::size_t size,
- const typename boost::detail::array_inner<T>::type& value) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef const T2 T3;
- typedef boost::detail::ms_allocator<T> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- enum {
- M = boost::detail::array_total<T1>::size
- };
- std::size_t n1 = M * size;
- T1* p1 = 0;
- T2* p2 = 0;
- T3* p3 = reinterpret_cast<T3*>(&value);
- D1 d1;
- A1 a1(size, &p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
- boost::detail::ms_init<T2, M>(p2, n1, p3);
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T>
- inline typename boost::detail::sp_if_size_array<T>::type
- make_shared(const typename boost::detail::array_inner<T>::type& value) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef const T2 T3;
- typedef boost::detail::ms_allocator<T> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- enum {
- M = boost::detail::array_total<T1>::size,
- N = boost::detail::array_total<T>::size
- };
- T1* p1 = 0;
- T2* p2 = 0;
- T3* p3 = reinterpret_cast<T3*>(&value);
- D1 d1;
- A1 a1(&p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
- boost::detail::ms_init<T2, M>(p2, N, p3);
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T>
- inline typename boost::detail::sp_if_array<T>::type
- make_shared_noinit(std::size_t size) {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef boost::detail::ms_allocator<T> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- std::size_t n1 = size * boost::detail::array_total<T1>::size;
- T1* p1 = 0;
- T2* p2 = 0;
- D1 d1;
- A1 a1(size, &p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
- boost::detail::ms_noinit(p2, n1);
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-
- template<class T>
- inline typename boost::detail::sp_if_size_array<T>::type
- make_shared_noinit() {
- typedef typename boost::detail::array_inner<T>::type T1;
- typedef typename boost::detail::array_base<T1>::type T2;
- typedef boost::detail::ms_allocator<T> A1;
- typedef boost::detail::ms_in_allocator_tag D1;
- enum {
- N = boost::detail::array_total<T>::size
- };
- T1* p1 = 0;
- T2* p2 = 0;
- D1 d1;
- A1 a1(&p2);
- shared_ptr<T> s1(p1, d1, a1);
- A1* a2 = static_cast<A1*>(s1._internal_get_untyped_deleter());
- a2->set(0);
- boost::detail::ms_noinit(p2, N);
- a2->set(p2);
- p1 = reinterpret_cast<T1*>(p2);
- return shared_ptr<T>(s1, p1);
- }
-}
-
-#endif
+++ /dev/null
-#ifndef BOOST_SMART_PTR_MAKE_SHARED_OBJECT_HPP_INCLUDED
-#define BOOST_SMART_PTR_MAKE_SHARED_OBJECT_HPP_INCLUDED
-
-// make_shared_object.hpp
-//
-// Copyright (c) 2007, 2008, 2012 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
-//
-// See http://www.boost.org/libs/smart_ptr/make_shared.html
-// for documentation.
-
-#include <boost/config.hpp>
-#include <boost/smart_ptr/shared_ptr.hpp>
-#include <boost/smart_ptr/detail/sp_forward.hpp>
-#include <boost/type_traits/type_with_alignment.hpp>
-#include <boost/type_traits/alignment_of.hpp>
-#include <cstddef>
-#include <new>
-
-namespace boost
-{
-
-namespace detail
-{
-
-template< std::size_t N, std::size_t A > struct sp_aligned_storage
-{
- union type
- {
- char data_[ N ];
- typename boost::type_with_alignment< A >::type align_;
- };
-};
-
-template< class T > class sp_ms_deleter
-{
-private:
-
- typedef typename sp_aligned_storage< sizeof( T ), ::boost::alignment_of< T >::value >::type storage_type;
-
- bool initialized_;
- storage_type storage_;
-
-private:
-
- void destroy()
- {
- if( initialized_ )
- {
-#if defined( __GNUC__ )
-
- // fixes incorrect aliasing warning
- T * p = reinterpret_cast< T* >( storage_.data_ );
- p->~T();
-
-#else
-
- reinterpret_cast< T* >( storage_.data_ )->~T();
-
-#endif
-
- initialized_ = false;
- }
- }
-
-public:
-
- sp_ms_deleter() BOOST_NOEXCEPT : initialized_( false )
- {
- }
-
- template<class A> explicit sp_ms_deleter( A const & ) BOOST_NOEXCEPT : initialized_( false )
- {
- }
-
- // optimization: do not copy storage_
- sp_ms_deleter( sp_ms_deleter const & ) BOOST_NOEXCEPT : initialized_( false )
- {
- }
-
- ~sp_ms_deleter()
- {
- destroy();
- }
-
- void operator()( T * )
- {
- destroy();
- }
-
- static void operator_fn( T* ) // operator() can't be static
- {
- }
-
- void * address() BOOST_NOEXCEPT
- {
- return storage_.data_;
- }
-
- void set_initialized() BOOST_NOEXCEPT
- {
- initialized_ = true;
- }
-};
-
-template< class T, class A > class sp_as_deleter
-{
-private:
-
- typedef typename sp_aligned_storage< sizeof( T ), ::boost::alignment_of< T >::value >::type storage_type;
-
- storage_type storage_;
- A a_;
- bool initialized_;
-
-private:
-
- void destroy()
- {
- if( initialized_ )
- {
- T * p = reinterpret_cast< T* >( storage_.data_ );
-
-#if !defined( BOOST_NO_CXX11_ALLOCATOR )
-
- std::allocator_traits<A>::destroy( a_, p );
-
-#else
-
- p->~T();
-
-#endif
-
- initialized_ = false;
- }
- }
-
-public:
-
- sp_as_deleter( A const & a ) BOOST_NOEXCEPT : a_( a ), initialized_( false )
- {
- }
-
- // optimization: do not copy storage_
- sp_as_deleter( sp_as_deleter const & r ) BOOST_NOEXCEPT : a_( r.a_), initialized_( false )
- {
- }
-
- ~sp_as_deleter()
- {
- destroy();
- }
-
- void operator()( T * )
- {
- destroy();
- }
-
- static void operator_fn( T* ) // operator() can't be static
- {
- }
-
- void * address() BOOST_NOEXCEPT
- {
- return storage_.data_;
- }
-
- void set_initialized() BOOST_NOEXCEPT
- {
- initialized_ = true;
- }
-};
-
-template< class T > struct sp_if_not_array
-{
- typedef boost::shared_ptr< T > type;
-};
-
-#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
-
-template< class T > struct sp_if_not_array< T[] >
-{
-};
-
-#if !defined( __BORLANDC__ ) || !BOOST_WORKAROUND( __BORLANDC__, < 0x600 )
-
-template< class T, std::size_t N > struct sp_if_not_array< T[N] >
-{
-};
-
-#endif
-
-#endif
-
-} // namespace detail
-
-#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
-# define BOOST_SP_MSD( T ) boost::detail::sp_inplace_tag< boost::detail::sp_ms_deleter< T > >()
-#else
-# define BOOST_SP_MSD( T ) boost::detail::sp_ms_deleter< T >()
-#endif
-
-// _noinit versions
-
-template< class T > typename boost::detail::sp_if_not_array< T >::type make_shared_noinit()
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T;
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A > typename boost::detail::sp_if_not_array< T >::type allocate_shared_noinit( A const & a )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T;
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-#if !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
-// Variadic templates, rvalue reference
-
-template< class T, class... Args > typename boost::detail::sp_if_not_array< T >::type make_shared( Args && ... args )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( boost::detail::sp_forward<Args>( args )... );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class... Args > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, Args && ... args )
-{
-#if !defined( BOOST_NO_CXX11_ALLOCATOR )
-
- typedef typename std::allocator_traits<A>::template rebind_alloc<T> A2;
- A2 a2( a );
-
- typedef boost::detail::sp_as_deleter< T, A2 > D;
-
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_inplace_tag<D>(), a2 );
-
-#else
-
- typedef boost::detail::sp_ms_deleter< T > D;
-
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_inplace_tag<D>(), a );
-
-#endif
-
- D * pd = static_cast< D* >( pt._internal_get_untyped_deleter() );
- void * pv = pd->address();
-
-#if !defined( BOOST_NO_CXX11_ALLOCATOR )
-
- std::allocator_traits<A2>::construct( a2, static_cast< T* >( pv ), boost::detail::sp_forward<Args>( args )... );
-
-#else
-
- ::new( pv ) T( boost::detail::sp_forward<Args>( args )... );
-
-#endif
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-#else // !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
-// Common zero-argument versions
-
-template< class T > typename boost::detail::sp_if_not_array< T >::type make_shared()
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T();
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T();
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
-// For example MSVC 10.0
-
-template< class T, class A1 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5, class A6 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 ),
- boost::detail::sp_forward<A6>( a6 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 ),
- boost::detail::sp_forward<A6>( a6 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 ),
- boost::detail::sp_forward<A6>( a6 ),
- boost::detail::sp_forward<A7>( a7 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 ),
- boost::detail::sp_forward<A6>( a6 ),
- boost::detail::sp_forward<A7>( a7 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 ),
- boost::detail::sp_forward<A6>( a6 ),
- boost::detail::sp_forward<A7>( a7 ),
- boost::detail::sp_forward<A8>( a8 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 ),
- boost::detail::sp_forward<A6>( a6 ),
- boost::detail::sp_forward<A7>( a7 ),
- boost::detail::sp_forward<A8>( a8 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 ),
- boost::detail::sp_forward<A6>( a6 ),
- boost::detail::sp_forward<A7>( a7 ),
- boost::detail::sp_forward<A8>( a8 ),
- boost::detail::sp_forward<A9>( a9 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T(
- boost::detail::sp_forward<A1>( a1 ),
- boost::detail::sp_forward<A2>( a2 ),
- boost::detail::sp_forward<A3>( a3 ),
- boost::detail::sp_forward<A4>( a4 ),
- boost::detail::sp_forward<A5>( a5 ),
- boost::detail::sp_forward<A6>( a6 ),
- boost::detail::sp_forward<A7>( a7 ),
- boost::detail::sp_forward<A8>( a8 ),
- boost::detail::sp_forward<A9>( a9 )
- );
-
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-#else // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
-// C++03 version
-
-template< class T, class A1 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5, class A6 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5, a6 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5, a6 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5, a6, a7 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5, a6, a7 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
-typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
-typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
-{
- boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
-
- boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
-
- void * pv = pd->address();
-
- ::new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
- pd->set_initialized();
-
- T * pt2 = static_cast< T* >( pv );
-
- boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
- return boost::shared_ptr< T >( pt, pt2 );
-}
-
-#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
-#endif // !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
-#undef BOOST_SP_MSD
-
-} // namespace boost
-
-#endif // #ifndef BOOST_SMART_PTR_MAKE_SHARED_OBJECT_HPP_INCLUDED
+++ /dev/null
-#ifndef BOOST_SMART_PTR_SHARED_ARRAY_HPP_INCLUDED
-#define BOOST_SMART_PTR_SHARED_ARRAY_HPP_INCLUDED
-
-//
-// shared_array.hpp
-//
-// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
-// Copyright (c) 2001, 2002, 2012 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)
-//
-// See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
-//
-
-#include <boost/config.hpp> // for broken compiler workarounds
-
-#include <memory> // TR1 cyclic inclusion fix
-
-#include <boost/assert.hpp>
-#include <boost/checked_delete.hpp>
-
-#include <boost/smart_ptr/shared_ptr.hpp>
-#include <boost/smart_ptr/detail/shared_count.hpp>
-#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
-#include <boost/detail/workaround.hpp>
-
-#include <cstddef> // for std::ptrdiff_t
-#include <algorithm> // for std::swap
-#include <functional> // for std::less
-
-namespace boost
-{
-
-//
-// shared_array
-//
-// shared_array extends shared_ptr to arrays.
-// The array pointed to is deleted when the last shared_array pointing to it
-// is destroyed or reset.
-//
-
-template<class T> class shared_array
-{
-private:
-
- // Borland 5.5.1 specific workarounds
- typedef checked_array_deleter<T> deleter;
- typedef shared_array<T> this_type;
-
-public:
-
- typedef T element_type;
-
- shared_array() BOOST_NOEXCEPT : px( 0 ), pn()
- {
- }
-
-#if !defined( BOOST_NO_CXX11_NULLPTR )
-
- shared_array( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT : px( 0 ), pn()
- {
- }
-
-#endif
-
- template<class Y>
- explicit shared_array( Y * p ): px( p ), pn( p, checked_array_deleter<Y>() )
- {
- boost::detail::sp_assert_convertible< Y[], T[] >();
- }
-
- //
- // Requirements: D's copy constructor must not throw
- //
- // shared_array will release p by calling d(p)
- //
-
- template<class Y, class D> shared_array( Y * p, D d ): px( p ), pn( p, d )
- {
- boost::detail::sp_assert_convertible< Y[], T[] >();
- }
-
- // As above, but with allocator. A's copy constructor shall not throw.
-
- template<class Y, class D, class A> shared_array( Y * p, D d, A a ): px( p ), pn( p, d, a )
- {
- boost::detail::sp_assert_convertible< Y[], T[] >();
- }
-
-// generated copy constructor, destructor are fine...
-
-#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
-// ... except in C++0x, move disables the implicit copy
-
- shared_array( shared_array const & r ) BOOST_NOEXCEPT : px( r.px ), pn( r.pn )
- {
- }
-
- shared_array( shared_array && r ) BOOST_NOEXCEPT : px( r.px ), pn()
- {
- pn.swap( r.pn );
- r.px = 0;
- }
-
-#endif
-
- // conversion
-
- template<class Y>
-#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
-
- shared_array( shared_array<Y> const & r, typename boost::detail::sp_enable_if_convertible< Y[], T[] >::type = boost::detail::sp_empty() )
-
-#else
-
- shared_array( shared_array<Y> const & r )
-
-#endif
- BOOST_NOEXCEPT : px( r.px ), pn( r.pn ) // never throws
- {
- boost::detail::sp_assert_convertible< Y[], T[] >();
- }
-
- // aliasing
-
- template< class Y >
- shared_array( shared_array<Y> const & r, element_type * p ) BOOST_NOEXCEPT : px( p ), pn( r.pn )
- {
- }
-
- // assignment
-
- shared_array & operator=( shared_array const & r ) BOOST_NOEXCEPT
- {
- this_type( r ).swap( *this );
- return *this;
- }
-
-#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1400)
-
- template<class Y>
- shared_array & operator=( shared_array<Y> const & r ) BOOST_NOEXCEPT
- {
- this_type( r ).swap( *this );
- return *this;
- }
-
-#endif
-
-#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
-
- shared_array & operator=( shared_array && r ) BOOST_NOEXCEPT
- {
- this_type( static_cast< shared_array && >( r ) ).swap( *this );
- return *this;
- }
-
- template<class Y>
- shared_array & operator=( shared_array<Y> && r ) BOOST_NOEXCEPT
- {
- this_type( static_cast< shared_array<Y> && >( r ) ).swap( *this );
- return *this;
- }
-
-#endif
-
- void reset() BOOST_NOEXCEPT
- {
- this_type().swap( *this );
- }
-
- template<class Y> void reset( Y * p ) // Y must be complete
- {
- BOOST_ASSERT( p == 0 || p != px ); // catch self-reset errors
- this_type( p ).swap( *this );
- }
-
- template<class Y, class D> void reset( Y * p, D d )
- {
- this_type( p, d ).swap( *this );
- }
-
- template<class Y, class D, class A> void reset( Y * p, D d, A a )
- {
- this_type( p, d, a ).swap( *this );
- }
-
- template<class Y> void reset( shared_array<Y> const & r, element_type * p )
- {
- this_type( r, p ).swap( *this );
- }
-
- T & operator[] (std::ptrdiff_t i) const // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
- {
- BOOST_ASSERT(px != 0);
- BOOST_ASSERT(i >= 0);
- return px[i];
- }
-
- T * get() const BOOST_NOEXCEPT
- {
- return px;
- }
-
-// implicit conversion to "bool"
-#include <boost/smart_ptr/detail/operator_bool.hpp>
-
- bool unique() const BOOST_NOEXCEPT
- {
- return pn.unique();
- }
-
- long use_count() const BOOST_NOEXCEPT
- {
- return pn.use_count();
- }
-
- void swap(shared_array<T> & other) BOOST_NOEXCEPT
- {
- std::swap(px, other.px);
- pn.swap(other.pn);
- }
-
- void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const
- {
- return pn.get_deleter( ti );
- }
-
-private:
-
- template<class Y> friend class shared_array;
-
- T * px; // contained pointer
- detail::shared_count pn; // reference counter
-
-}; // shared_array
-
-template<class T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
-{
- return a.get() == b.get();
-}
-
-template<class T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
-{
- return a.get() != b.get();
-}
-
-#if !defined( BOOST_NO_CXX11_NULLPTR )
-
-template<class T> inline bool operator==( shared_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
-{
- return p.get() == 0;
-}
-
-template<class T> inline bool operator==( boost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
-{
- return p.get() == 0;
-}
-
-template<class T> inline bool operator!=( shared_array<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
-{
- return p.get() != 0;
-}
-
-template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
-{
- return p.get() != 0;
-}
-
-#endif
-
-template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
-{
- return std::less<T*>()(a.get(), b.get());
-}
-
-template<class T> void swap(shared_array<T> & a, shared_array<T> & b) BOOST_NOEXCEPT
-{
- a.swap(b);
-}
-
-template< class D, class T > D * get_deleter( shared_array<T> const & p )
-{
- return static_cast< D * >( p._internal_get_deleter( BOOST_SP_TYPEID(D) ) );
-}
-
-} // namespace boost
-
-#endif // #ifndef BOOST_SMART_PTR_SHARED_ARRAY_HPP_INCLUDED
--- /dev/null
+// tuple_basic.hpp -----------------------------------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+// Outside help:
+// This and that, Gary Powell.
+// Fixed return types for get_head/get_tail
+// ( and other bugs ) per suggestion of Jens Maurer
+// simplified element type accessors + bug fix (Jeremy Siek)
+// Several changes/additions according to suggestions by Douglas Gregor,
+// William Kempf, Vesa Karvonen, John Max Skaller, Ed Brey, Beman Dawes,
+// David Abrahams.
+
+// Revision history:
+// 2002 05 01 Hugo Duncan: Fix for Borland after Jaakko's previous changes
+// 2002 04 18 Jaakko: tuple element types can be void or plain function
+// types, as long as no object is created.
+// Tuple objects can no hold even noncopyable types
+// such as arrays.
+// 2001 10 22 John Maddock
+// Fixes for Borland C++
+// 2001 08 30 David Abrahams
+// Added default constructor for cons<>.
+// -----------------------------------------------------------------
+
+#ifndef BOOST_TUPLE_BASIC_HPP
+#define BOOST_TUPLE_BASIC_HPP
+
+
+#include <utility> // needed for the assignment from pair to tuple
+
+#include "boost/type_traits/cv_traits.hpp"
+#include "boost/type_traits/function_traits.hpp"
+#include "boost/utility/swap.hpp"
+
+#include "boost/detail/workaround.hpp" // needed for BOOST_WORKAROUND
+
+#if BOOST_GCC >= 40700
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
+#endif
+
+namespace boost {
+namespace tuples {
+
+// -- null_type --------------------------------------------------------
+struct null_type {};
+
+// a helper function to provide a const null_type type temporary
+namespace detail {
+ inline const null_type cnull() { return null_type(); }
+
+
+// -- if construct ------------------------------------------------
+// Proposed by Krzysztof Czarnecki and Ulrich Eisenecker
+
+template <bool If, class Then, class Else> struct IF { typedef Then RET; };
+
+template <class Then, class Else> struct IF<false, Then, Else> {
+ typedef Else RET;
+};
+
+} // end detail
+
+// - cons forward declaration -----------------------------------------------
+template <class HT, class TT> struct cons;
+
+
+// - tuple forward declaration -----------------------------------------------
+template <
+ class T0 = null_type, class T1 = null_type, class T2 = null_type,
+ class T3 = null_type, class T4 = null_type, class T5 = null_type,
+ class T6 = null_type, class T7 = null_type, class T8 = null_type,
+ class T9 = null_type>
+class tuple;
+
+// tuple_length forward declaration
+template<class T> struct length;
+
+
+
+namespace detail {
+
+// -- generate error template, referencing to non-existing members of this
+// template is used to produce compilation errors intentionally
+template<class T>
+class generate_error;
+
+template<int N>
+struct drop_front {
+ template<class Tuple>
+ struct apply {
+ typedef BOOST_DEDUCED_TYPENAME drop_front<N-1>::BOOST_NESTED_TEMPLATE
+ apply<Tuple> next;
+ typedef BOOST_DEDUCED_TYPENAME next::type::tail_type type;
+ static const type& call(const Tuple& tup) {
+ return next::call(tup).tail;
+ }
+ };
+};
+
+template<>
+struct drop_front<0> {
+ template<class Tuple>
+ struct apply {
+ typedef Tuple type;
+ static const type& call(const Tuple& tup) {
+ return tup;
+ }
+ };
+};
+
+} // end of namespace detail
+
+
+// -cons type accessors ----------------------------------------
+// typename tuples::element<N,T>::type gets the type of the
+// Nth element ot T, first element is at index 0
+// -------------------------------------------------------
+
+#ifndef BOOST_NO_CV_SPECIALIZATIONS
+
+template<int N, class T>
+struct element
+{
+ typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
+ apply<T>::type::head_type type;
+};
+
+template<int N, class T>
+struct element<N, const T>
+{
+private:
+ typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
+ apply<T>::type::head_type unqualified_type;
+public:
+#if BOOST_WORKAROUND(__BORLANDC__,<0x600)
+ typedef const unqualified_type type;
+#else
+ typedef BOOST_DEDUCED_TYPENAME boost::add_const<unqualified_type>::type type;
+#endif
+};
+#else // def BOOST_NO_CV_SPECIALIZATIONS
+
+namespace detail {
+
+template<int N, class T, bool IsConst>
+struct element_impl
+{
+ typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
+ apply<T>::type::head_type type;
+};
+
+template<int N, class T>
+struct element_impl<N, T, true /* IsConst */>
+{
+ typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
+ apply<T>::type::head_type unqualified_type;
+ typedef const unqualified_type type;
+};
+
+} // end of namespace detail
+
+
+template<int N, class T>
+struct element:
+ public detail::element_impl<N, T, ::boost::is_const<T>::value>
+{
+};
+
+#endif
+
+
+// -get function templates -----------------------------------------------
+// Usage: get<N>(aTuple)
+
+// -- some traits classes for get functions
+
+// access traits lifted from detail namespace to be part of the interface,
+// (Joel de Guzman's suggestion). Rationale: get functions are part of the
+// interface, so should the way to express their return types be.
+
+template <class T> struct access_traits {
+ typedef const T& const_type;
+ typedef T& non_const_type;
+
+ typedef const typename boost::remove_cv<T>::type& parameter_type;
+
+// used as the tuple constructors parameter types
+// Rationale: non-reference tuple element types can be cv-qualified.
+// It should be possible to initialize such types with temporaries,
+// and when binding temporaries to references, the reference must
+// be non-volatile and const. 8.5.3. (5)
+};
+
+template <class T> struct access_traits<T&> {
+
+ typedef T& const_type;
+ typedef T& non_const_type;
+
+ typedef T& parameter_type;
+};
+
+// get function for non-const cons-lists, returns a reference to the element
+
+template<int N, class HT, class TT>
+inline typename access_traits<
+ typename element<N, cons<HT, TT> >::type
+ >::non_const_type
+get(cons<HT, TT>& c) {
+ typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
+ apply<cons<HT, TT> > impl;
+ typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
+ return const_cast<cons_element&>(impl::call(c)).head;
+}
+
+// get function for const cons-lists, returns a const reference to
+// the element. If the element is a reference, returns the reference
+// as such (that is, can return a non-const reference)
+template<int N, class HT, class TT>
+inline typename access_traits<
+ typename element<N, cons<HT, TT> >::type
+ >::const_type
+get(const cons<HT, TT>& c) {
+ typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
+ apply<cons<HT, TT> > impl;
+ return impl::call(c).head;
+}
+
+// -- the cons template --------------------------------------------------
+namespace detail {
+
+// These helper templates wrap void types and plain function types.
+// The reationale is to allow one to write tuple types with those types
+// as elements, even though it is not possible to instantiate such object.
+// E.g: typedef tuple<void> some_type; // ok
+// but: some_type x; // fails
+
+template <class T> class non_storeable_type {
+ non_storeable_type();
+};
+
+template <class T> struct wrap_non_storeable_type {
+ typedef typename IF<
+ ::boost::is_function<T>::value, non_storeable_type<T>, T
+ >::RET type;
+};
+template <> struct wrap_non_storeable_type<void> {
+ typedef non_storeable_type<void> type;
+};
+
+} // detail
+
+template <class HT, class TT>
+struct cons {
+
+ typedef HT head_type;
+ typedef TT tail_type;
+
+ typedef typename
+ detail::wrap_non_storeable_type<head_type>::type stored_head_type;
+
+ stored_head_type head;
+ tail_type tail;
+
+ typename access_traits<stored_head_type>::non_const_type
+ get_head() { return head; }
+
+ typename access_traits<tail_type>::non_const_type
+ get_tail() { return tail; }
+
+ typename access_traits<stored_head_type>::const_type
+ get_head() const { return head; }
+
+ typename access_traits<tail_type>::const_type
+ get_tail() const { return tail; }
+
+ cons() : head(), tail() {}
+ // cons() : head(detail::default_arg<HT>::f()), tail() {}
+
+ // the argument for head is not strictly needed, but it prevents
+ // array type elements. This is good, since array type elements
+ // cannot be supported properly in any case (no assignment,
+ // copy works only if the tails are exactly the same type, ...)
+
+ cons(typename access_traits<stored_head_type>::parameter_type h,
+ const tail_type& t)
+ : head (h), tail(t) {}
+
+ template <class T1, class T2, class T3, class T4, class T5,
+ class T6, class T7, class T8, class T9, class T10>
+ cons( T1& t1, T2& t2, T3& t3, T4& t4, T5& t5,
+ T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 )
+ : head (t1),
+ tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, detail::cnull())
+ {}
+
+ template <class T2, class T3, class T4, class T5,
+ class T6, class T7, class T8, class T9, class T10>
+ cons( const null_type& /*t1*/, T2& t2, T3& t3, T4& t4, T5& t5,
+ T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 )
+ : head (),
+ tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, detail::cnull())
+ {}
+
+
+ template <class HT2, class TT2>
+ cons( const cons<HT2, TT2>& u ) : head(u.head), tail(u.tail) {}
+
+ template <class HT2, class TT2>
+ cons& operator=( const cons<HT2, TT2>& u ) {
+ head=u.head; tail=u.tail; return *this;
+ }
+
+ // must define assignment operator explicitly, implicit version is
+ // illformed if HT is a reference (12.8. (12))
+ cons& operator=(const cons& u) {
+ head = u.head; tail = u.tail; return *this;
+ }
+
+ template <class T1, class T2>
+ cons& operator=( const std::pair<T1, T2>& u ) {
+ BOOST_STATIC_ASSERT(length<cons>::value == 2); // check length = 2
+ head = u.first; tail.head = u.second; return *this;
+ }
+
+ // get member functions (non-const and const)
+ template <int N>
+ typename access_traits<
+ typename element<N, cons<HT, TT> >::type
+ >::non_const_type
+ get() {
+ return boost::tuples::get<N>(*this); // delegate to non-member get
+ }
+
+ template <int N>
+ typename access_traits<
+ typename element<N, cons<HT, TT> >::type
+ >::const_type
+ get() const {
+ return boost::tuples::get<N>(*this); // delegate to non-member get
+ }
+};
+
+template <class HT>
+struct cons<HT, null_type> {
+
+ typedef HT head_type;
+ typedef null_type tail_type;
+ typedef cons<HT, null_type> self_type;
+
+ typedef typename
+ detail::wrap_non_storeable_type<head_type>::type stored_head_type;
+ stored_head_type head;
+
+ typename access_traits<stored_head_type>::non_const_type
+ get_head() { return head; }
+
+ null_type get_tail() { return null_type(); }
+
+ typename access_traits<stored_head_type>::const_type
+ get_head() const { return head; }
+
+ const null_type get_tail() const { return null_type(); }
+
+ // cons() : head(detail::default_arg<HT>::f()) {}
+ cons() : head() {}
+
+ cons(typename access_traits<stored_head_type>::parameter_type h,
+ const null_type& = null_type())
+ : head (h) {}
+
+ template<class T1>
+ cons(T1& t1, const null_type&, const null_type&, const null_type&,
+ const null_type&, const null_type&, const null_type&,
+ const null_type&, const null_type&, const null_type&)
+ : head (t1) {}
+
+ cons(const null_type&,
+ const null_type&, const null_type&, const null_type&,
+ const null_type&, const null_type&, const null_type&,
+ const null_type&, const null_type&, const null_type&)
+ : head () {}
+
+ template <class HT2>
+ cons( const cons<HT2, null_type>& u ) : head(u.head) {}
+
+ template <class HT2>
+ cons& operator=(const cons<HT2, null_type>& u )
+ { head = u.head; return *this; }
+
+ // must define assignment operator explicitely, implicit version
+ // is illformed if HT is a reference
+ cons& operator=(const cons& u) { head = u.head; return *this; }
+
+ template <int N>
+ typename access_traits<
+ typename element<N, self_type>::type
+ >::non_const_type
+ get() {
+ return boost::tuples::get<N>(*this);
+ }
+
+ template <int N>
+ typename access_traits<
+ typename element<N, self_type>::type
+ >::const_type
+ get() const {
+ return boost::tuples::get<N>(*this);
+ }
+
+};
+
+// templates for finding out the length of the tuple -------------------
+
+template<class T>
+struct length {
+ BOOST_STATIC_CONSTANT(int, value = 1 + length<typename T::tail_type>::value);
+};
+
+template<>
+struct length<tuple<> > {
+ BOOST_STATIC_CONSTANT(int, value = 0);
+};
+
+template<>
+struct length<tuple<> const> {
+ BOOST_STATIC_CONSTANT(int, value = 0);
+};
+
+template<>
+struct length<null_type> {
+ BOOST_STATIC_CONSTANT(int, value = 0);
+};
+
+template<>
+struct length<null_type const> {
+ BOOST_STATIC_CONSTANT(int, value = 0);
+};
+
+namespace detail {
+
+// Tuple to cons mapper --------------------------------------------------
+template <class T0, class T1, class T2, class T3, class T4,
+ class T5, class T6, class T7, class T8, class T9>
+struct map_tuple_to_cons
+{
+ typedef cons<T0,
+ typename map_tuple_to_cons<T1, T2, T3, T4, T5,
+ T6, T7, T8, T9, null_type>::type
+ > type;
+};
+
+// The empty tuple is a null_type
+template <>
+struct map_tuple_to_cons<null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type>
+{
+ typedef null_type type;
+};
+
+} // end detail
+
+// -------------------------------------------------------------------
+// -- tuple ------------------------------------------------------
+template <class T0, class T1, class T2, class T3, class T4,
+ class T5, class T6, class T7, class T8, class T9>
+
+class tuple :
+ public detail::map_tuple_to_cons<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
+{
+public:
+ typedef typename
+ detail::map_tuple_to_cons<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type inherited;
+ typedef typename inherited::head_type head_type;
+ typedef typename inherited::tail_type tail_type;
+
+
+// access_traits<T>::parameter_type takes non-reference types as const T&
+ tuple() {}
+
+ tuple(typename access_traits<T0>::parameter_type t0)
+ : inherited(t0, detail::cnull(), detail::cnull(), detail::cnull(),
+ detail::cnull(), detail::cnull(), detail::cnull(),
+ detail::cnull(), detail::cnull(), detail::cnull()) {}
+
+ tuple(typename access_traits<T0>::parameter_type t0,
+ typename access_traits<T1>::parameter_type t1)
+ : inherited(t0, t1, detail::cnull(), detail::cnull(),
+ detail::cnull(), detail::cnull(), detail::cnull(),
+ detail::cnull(), detail::cnull(), detail::cnull()) {}
+
+ tuple(typename access_traits<T0>::parameter_type t0,
+ typename access_traits<T1>::parameter_type t1,
+ typename access_traits<T2>::parameter_type t2)
+ : inherited(t0, t1, t2, detail::cnull(), detail::cnull(),
+ detail::cnull(), detail::cnull(), detail::cnull(),
+ detail::cnull(), detail::cnull()) {}
+
+ tuple(typename access_traits<T0>::parameter_type t0,
+ typename access_traits<T1>::parameter_type t1,
+ typename access_traits<T2>::parameter_type t2,
+ typename access_traits<T3>::parameter_type t3)
+ : inherited(t0, t1, t2, t3, detail::cnull(), detail::cnull(),
+ detail::cnull(), detail::cnull(), detail::cnull(),
+ detail::cnull()) {}
+
+ tuple(typename access_traits<T0>::parameter_type t0,
+ typename access_traits<T1>::parameter_type t1,
+ typename access_traits<T2>::parameter_type t2,
+ typename access_traits<T3>::parameter_type t3,
+ typename access_traits<T4>::parameter_type t4)
+ : inherited(t0, t1, t2, t3, t4, detail::cnull(), detail::cnull(),
+ detail::cnull(), detail::cnull(), detail::cnull()) {}
+
+ tuple(typename access_traits<T0>::parameter_type t0,
+ typename access_traits<T1>::parameter_type t1,
+ typename access_traits<T2>::parameter_type t2,
+ typename access_traits<T3>::parameter_type t3,
+ typename access_traits<T4>::parameter_type t4,
+ typename access_traits<T5>::parameter_type t5)
+ : inherited(t0, t1, t2, t3, t4, t5, detail::cnull(), detail::cnull(),
+ detail::cnull(), detail::cnull()) {}
+
+ tuple(typename access_traits<T0>::parameter_type t0,
+ typename access_traits<T1>::parameter_type t1,
+ typename access_traits<T2>::parameter_type t2,
+ typename access_traits<T3>::parameter_type t3,
+ typename access_traits<T4>::parameter_type t4,
+ typename access_traits<T5>::parameter_type t5,
+ typename access_traits<T6>::parameter_type t6)
+ : inherited(t0, t1, t2, t3, t4, t5, t6, detail::cnull(),
+ detail::cnull(), detail::cnull()) {}
+
+ tuple(typename access_traits<T0>::parameter_type t0,
+ typename access_traits<T1>::parameter_type t1,
+ typename access_traits<T2>::parameter_type t2,
+ typename access_traits<T3>::parameter_type t3,
+ typename access_traits<T4>::parameter_type t4,
+ typename access_traits<T5>::parameter_type t5,
+ typename access_traits<T6>::parameter_type t6,
+ typename access_traits<T7>::parameter_type t7)
+ : inherited(t0, t1, t2, t3, t4, t5, t6, t7, detail::cnull(),
+ detail::cnull()) {}
+
+ tuple(typename access_traits<T0>::parameter_type t0,
+ typename access_traits<T1>::parameter_type t1,
+ typename access_traits<T2>::parameter_type t2,
+ typename access_traits<T3>::parameter_type t3,
+ typename access_traits<T4>::parameter_type t4,
+ typename access_traits<T5>::parameter_type t5,
+ typename access_traits<T6>::parameter_type t6,
+ typename access_traits<T7>::parameter_type t7,
+ typename access_traits<T8>::parameter_type t8)
+ : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, detail::cnull()) {}
+
+ tuple(typename access_traits<T0>::parameter_type t0,
+ typename access_traits<T1>::parameter_type t1,
+ typename access_traits<T2>::parameter_type t2,
+ typename access_traits<T3>::parameter_type t3,
+ typename access_traits<T4>::parameter_type t4,
+ typename access_traits<T5>::parameter_type t5,
+ typename access_traits<T6>::parameter_type t6,
+ typename access_traits<T7>::parameter_type t7,
+ typename access_traits<T8>::parameter_type t8,
+ typename access_traits<T9>::parameter_type t9)
+ : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) {}
+
+
+ template<class U1, class U2>
+ tuple(const cons<U1, U2>& p) : inherited(p) {}
+
+ template <class U1, class U2>
+ tuple& operator=(const cons<U1, U2>& k) {
+ inherited::operator=(k);
+ return *this;
+ }
+
+ template <class U1, class U2>
+ tuple& operator=(const std::pair<U1, U2>& k) {
+ BOOST_STATIC_ASSERT(length<tuple>::value == 2);// check_length = 2
+ this->head = k.first;
+ this->tail.head = k.second;
+ return *this;
+ }
+
+};
+
+// The empty tuple
+template <>
+class tuple<null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type, null_type> :
+ public null_type
+{
+public:
+ typedef null_type inherited;
+};
+
+
+// Swallows any assignment (by Doug Gregor)
+namespace detail {
+
+struct swallow_assign;
+typedef void (detail::swallow_assign::*ignore_t)();
+struct swallow_assign {
+ swallow_assign(ignore_t(*)(ignore_t)) {}
+ template<typename T>
+ swallow_assign const& operator=(const T&) const {
+ return *this;
+ }
+};
+
+
+} // namespace detail
+
+// "ignore" allows tuple positions to be ignored when using "tie".
+inline detail::ignore_t ignore(detail::ignore_t) { return 0; }
+
+// ---------------------------------------------------------------------------
+// The call_traits for make_tuple
+// Honours the reference_wrapper class.
+
+// Must be instantiated with plain or const plain types (not with references)
+
+// from template<class T> foo(const T& t) : make_tuple_traits<const T>::type
+// from template<class T> foo(T& t) : make_tuple_traits<T>::type
+
+// Conversions:
+// T -> T,
+// references -> compile_time_error
+// reference_wrapper<T> -> T&
+// const reference_wrapper<T> -> T&
+// array -> const ref array
+
+
+template<class T>
+struct make_tuple_traits {
+ typedef T type;
+
+ // commented away, see below (JJ)
+ // typedef typename IF<
+ // boost::is_function<T>::value,
+ // T&,
+ // T>::RET type;
+
+};
+
+// The is_function test was there originally for plain function types,
+// which can't be stored as such (we must either store them as references or
+// pointers). Such a type could be formed if make_tuple was called with a
+// reference to a function.
+// But this would mean that a const qualified function type was formed in
+// the make_tuple function and hence make_tuple can't take a function
+// reference as a parameter, and thus T can't be a function type.
+// So is_function test was removed.
+// (14.8.3. says that type deduction fails if a cv-qualified function type
+// is created. (It only applies for the case of explicitly specifying template
+// args, though?)) (JJ)
+
+template<class T>
+struct make_tuple_traits<T&> {
+ typedef typename
+ detail::generate_error<T&>::
+ do_not_use_with_reference_type error;
+};
+
+// Arrays can't be stored as plain types; convert them to references.
+// All arrays are converted to const. This is because make_tuple takes its
+// parameters as const T& and thus the knowledge of the potential
+// non-constness of actual argument is lost.
+template<class T, int n> struct make_tuple_traits <T[n]> {
+ typedef const T (&type)[n];
+};
+
+template<class T, int n>
+struct make_tuple_traits<const T[n]> {
+ typedef const T (&type)[n];
+};
+
+template<class T, int n> struct make_tuple_traits<volatile T[n]> {
+ typedef const volatile T (&type)[n];
+};
+
+template<class T, int n>
+struct make_tuple_traits<const volatile T[n]> {
+ typedef const volatile T (&type)[n];
+};
+
+template<class T>
+struct make_tuple_traits<reference_wrapper<T> >{
+ typedef T& type;
+};
+
+template<class T>
+struct make_tuple_traits<const reference_wrapper<T> >{
+ typedef T& type;
+};
+
+template<>
+struct make_tuple_traits<detail::ignore_t(detail::ignore_t)> {
+ typedef detail::swallow_assign type;
+};
+
+
+
+namespace detail {
+
+// a helper traits to make the make_tuple functions shorter (Vesa Karvonen's
+// suggestion)
+template <
+ class T0 = null_type, class T1 = null_type, class T2 = null_type,
+ class T3 = null_type, class T4 = null_type, class T5 = null_type,
+ class T6 = null_type, class T7 = null_type, class T8 = null_type,
+ class T9 = null_type
+>
+struct make_tuple_mapper {
+ typedef
+ tuple<typename make_tuple_traits<T0>::type,
+ typename make_tuple_traits<T1>::type,
+ typename make_tuple_traits<T2>::type,
+ typename make_tuple_traits<T3>::type,
+ typename make_tuple_traits<T4>::type,
+ typename make_tuple_traits<T5>::type,
+ typename make_tuple_traits<T6>::type,
+ typename make_tuple_traits<T7>::type,
+ typename make_tuple_traits<T8>::type,
+ typename make_tuple_traits<T9>::type> type;
+};
+
+} // end detail
+
+// -make_tuple function templates -----------------------------------
+inline tuple<> make_tuple() {
+ return tuple<>();
+}
+
+template<class T0>
+inline typename detail::make_tuple_mapper<T0>::type
+make_tuple(const T0& t0) {
+ typedef typename detail::make_tuple_mapper<T0>::type t;
+ return t(t0);
+}
+
+template<class T0, class T1>
+inline typename detail::make_tuple_mapper<T0, T1>::type
+make_tuple(const T0& t0, const T1& t1) {
+ typedef typename detail::make_tuple_mapper<T0, T1>::type t;
+ return t(t0, t1);
+}
+
+template<class T0, class T1, class T2>
+inline typename detail::make_tuple_mapper<T0, T1, T2>::type
+make_tuple(const T0& t0, const T1& t1, const T2& t2) {
+ typedef typename detail::make_tuple_mapper<T0, T1, T2>::type t;
+ return t(t0, t1, t2);
+}
+
+template<class T0, class T1, class T2, class T3>
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3>::type
+make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3) {
+ typedef typename detail::make_tuple_mapper<T0, T1, T2, T3>::type t;
+ return t(t0, t1, t2, t3);
+}
+
+template<class T0, class T1, class T2, class T3, class T4>
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4>::type
+make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
+ const T4& t4) {
+ typedef typename detail::make_tuple_mapper<T0, T1, T2, T3, T4>::type t;
+ return t(t0, t1, t2, t3, t4);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5>
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5>::type
+make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
+ const T4& t4, const T5& t5) {
+ typedef typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5>::type t;
+ return t(t0, t1, t2, t3, t4, t5);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6>
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5, T6>::type
+make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
+ const T4& t4, const T5& t5, const T6& t6) {
+ typedef typename detail::make_tuple_mapper
+ <T0, T1, T2, T3, T4, T5, T6>::type t;
+ return t(t0, t1, t2, t3, t4, t5, t6);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
+ class T7>
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5, T6, T7>::type
+make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
+ const T4& t4, const T5& t5, const T6& t6, const T7& t7) {
+ typedef typename detail::make_tuple_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7>::type t;
+ return t(t0, t1, t2, t3, t4, t5, t6, t7);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
+ class T7, class T8>
+inline typename detail::make_tuple_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7, T8>::type
+make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
+ const T4& t4, const T5& t5, const T6& t6, const T7& t7,
+ const T8& t8) {
+ typedef typename detail::make_tuple_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7, T8>::type t;
+ return t(t0, t1, t2, t3, t4, t5, t6, t7, t8);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
+ class T7, class T8, class T9>
+inline typename detail::make_tuple_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
+make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
+ const T4& t4, const T5& t5, const T6& t6, const T7& t7,
+ const T8& t8, const T9& t9) {
+ typedef typename detail::make_tuple_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type t;
+ return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9);
+}
+
+namespace detail {
+
+template<class T>
+struct tie_traits {
+ typedef T& type;
+};
+
+template<>
+struct tie_traits<ignore_t(ignore_t)> {
+ typedef swallow_assign type;
+};
+
+template<>
+struct tie_traits<void> {
+ typedef null_type type;
+};
+
+template <
+ class T0 = void, 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 tie_mapper {
+ typedef
+ tuple<typename tie_traits<T0>::type,
+ typename tie_traits<T1>::type,
+ typename tie_traits<T2>::type,
+ typename tie_traits<T3>::type,
+ typename tie_traits<T4>::type,
+ typename tie_traits<T5>::type,
+ typename tie_traits<T6>::type,
+ typename tie_traits<T7>::type,
+ typename tie_traits<T8>::type,
+ typename tie_traits<T9>::type> type;
+};
+
+}
+
+// Tie function templates -------------------------------------------------
+template<class T0>
+inline typename detail::tie_mapper<T0>::type
+tie(T0& t0) {
+ typedef typename detail::tie_mapper<T0>::type t;
+ return t(t0);
+}
+
+template<class T0, class T1>
+inline typename detail::tie_mapper<T0, T1>::type
+tie(T0& t0, T1& t1) {
+ typedef typename detail::tie_mapper<T0, T1>::type t;
+ return t(t0, t1);
+}
+
+template<class T0, class T1, class T2>
+inline typename detail::tie_mapper<T0, T1, T2>::type
+tie(T0& t0, T1& t1, T2& t2) {
+ typedef typename detail::tie_mapper<T0, T1, T2>::type t;
+ return t(t0, t1, t2);
+}
+
+template<class T0, class T1, class T2, class T3>
+inline typename detail::tie_mapper<T0, T1, T2, T3>::type
+tie(T0& t0, T1& t1, T2& t2, T3& t3) {
+ typedef typename detail::tie_mapper<T0, T1, T2, T3>::type t;
+ return t(t0, t1, t2, t3);
+}
+
+template<class T0, class T1, class T2, class T3, class T4>
+inline typename detail::tie_mapper<T0, T1, T2, T3, T4>::type
+tie(T0& t0, T1& t1, T2& t2, T3& t3,
+ T4& t4) {
+ typedef typename detail::tie_mapper<T0, T1, T2, T3, T4>::type t;
+ return t(t0, t1, t2, t3, t4);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5>
+inline typename detail::tie_mapper<T0, T1, T2, T3, T4, T5>::type
+tie(T0& t0, T1& t1, T2& t2, T3& t3,
+ T4& t4, T5& t5) {
+ typedef typename detail::tie_mapper<T0, T1, T2, T3, T4, T5>::type t;
+ return t(t0, t1, t2, t3, t4, t5);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6>
+inline typename detail::tie_mapper<T0, T1, T2, T3, T4, T5, T6>::type
+tie(T0& t0, T1& t1, T2& t2, T3& t3,
+ T4& t4, T5& t5, T6& t6) {
+ typedef typename detail::tie_mapper
+ <T0, T1, T2, T3, T4, T5, T6>::type t;
+ return t(t0, t1, t2, t3, t4, t5, t6);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
+ class T7>
+inline typename detail::tie_mapper<T0, T1, T2, T3, T4, T5, T6, T7>::type
+tie(T0& t0, T1& t1, T2& t2, T3& t3,
+ T4& t4, T5& t5, T6& t6, T7& t7) {
+ typedef typename detail::tie_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7>::type t;
+ return t(t0, t1, t2, t3, t4, t5, t6, t7);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
+ class T7, class T8>
+inline typename detail::tie_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7, T8>::type
+tie(T0& t0, T1& t1, T2& t2, T3& t3,
+ T4& t4, T5& t5, T6& t6, T7& t7,
+ T8& t8) {
+ typedef typename detail::tie_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7, T8>::type t;
+ return t(t0, t1, t2, t3, t4, t5, t6, t7, t8);
+}
+
+template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
+ class T7, class T8, class T9>
+inline typename detail::tie_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
+tie(T0& t0, T1& t1, T2& t2, T3& t3,
+ T4& t4, T5& t5, T6& t6, T7& t7,
+ T8& t8, T9& t9) {
+ typedef typename detail::tie_mapper
+ <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type t;
+ return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9);
+}
+
+template <class T0, class T1, class T2, class T3, class T4,
+ class T5, class T6, class T7, class T8, class T9>
+void swap(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& lhs,
+ tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& rhs);
+inline void swap(null_type&, null_type&) {}
+template<class HH>
+inline void swap(cons<HH, null_type>& lhs, cons<HH, null_type>& rhs) {
+ ::boost::swap(lhs.head, rhs.head);
+}
+template<class HH, class TT>
+inline void swap(cons<HH, TT>& lhs, cons<HH, TT>& rhs) {
+ ::boost::swap(lhs.head, rhs.head);
+ ::boost::tuples::swap(lhs.tail, rhs.tail);
+}
+template <class T0, class T1, class T2, class T3, class T4,
+ class T5, class T6, class T7, class T8, class T9>
+inline void swap(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& lhs,
+ tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& rhs) {
+ typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> tuple_type;
+ typedef typename tuple_type::inherited base;
+ ::boost::tuples::swap(static_cast<base&>(lhs), static_cast<base&>(rhs));
+}
+
+} // end of namespace tuples
+} // end of namespace boost
+
+
+#if BOOST_GCC >= 40700
+#pragma GCC diagnostic pop
+#endif
+
+
+#endif // BOOST_TUPLE_BASIC_HPP
+
+
--- /dev/null
+// tuple.hpp - Boost Tuple Library --------------------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org
+
+// -----------------------------------------------------------------
+
+#ifndef BOOST_TUPLE_HPP
+#define BOOST_TUPLE_HPP
+
+#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730
+// Work around a compiler bug.
+// boost::python::tuple has to be seen by the compiler before the
+// boost::tuple class template.
+namespace boost { namespace python { class tuple; }}
+#endif
+
+#include "boost/config.hpp"
+#include "boost/static_assert.hpp"
+
+// other compilers
+#include "boost/ref.hpp"
+#include "boost/tuple/detail/tuple_basic.hpp"
+
+
+namespace boost {
+
+using tuples::tuple;
+using tuples::make_tuple;
+using tuples::tie;
+#if !defined(BOOST_NO_USING_TEMPLATE)
+using tuples::get;
+#else
+//
+// The "using tuples::get" statement causes the
+// Borland compiler to ICE, use forwarding
+// functions instead:
+//
+template<int N, class HT, class TT>
+inline typename tuples::access_traits<
+ typename tuples::element<N, tuples::cons<HT, TT> >::type
+ >::non_const_type
+get(tuples::cons<HT, TT>& c) {
+ return tuples::get<N,HT,TT>(c);
+}
+// get function for const cons-lists, returns a const reference to
+// the element. If the element is a reference, returns the reference
+// as such (that is, can return a non-const reference)
+template<int N, class HT, class TT>
+inline typename tuples::access_traits<
+ typename tuples::element<N, tuples::cons<HT, TT> >::type
+ >::const_type
+get(const tuples::cons<HT, TT>& c) {
+ return tuples::get<N,HT,TT>(c);
+}
+
+#endif // BOOST_NO_USING_TEMPLATE
+
+} // end namespace boost
+
+
+#endif // BOOST_TUPLE_HPP
+++ /dev/null
-// (C) Copyright John Maddock 2000.
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-// See boost/type_traits/*.hpp for full copyright notices.
-
-#ifndef BOOST_TYPE_TRAITS_HPP
-#define BOOST_TYPE_TRAITS_HPP
-
-#include <boost/type_traits/add_const.hpp>
-#include <boost/type_traits/add_cv.hpp>
-#include <boost/type_traits/add_lvalue_reference.hpp>
-#include <boost/type_traits/add_pointer.hpp>
-#include <boost/type_traits/add_reference.hpp>
-#include <boost/type_traits/add_rvalue_reference.hpp>
-#include <boost/type_traits/add_volatile.hpp>
-#include <boost/type_traits/aligned_storage.hpp>
-#include <boost/type_traits/alignment_of.hpp>
-#include <boost/type_traits/common_type.hpp>
-#include <boost/type_traits/conditional.hpp>
-#include <boost/type_traits/copy_cv.hpp>
-#include <boost/type_traits/decay.hpp>
-#include <boost/type_traits/declval.hpp>
-#include <boost/type_traits/extent.hpp>
-#include <boost/type_traits/floating_point_promotion.hpp>
-#include <boost/type_traits/function_traits.hpp>
-
-#include <boost/type_traits/has_bit_and.hpp>
-#include <boost/type_traits/has_bit_and_assign.hpp>
-#include <boost/type_traits/has_bit_or.hpp>
-#include <boost/type_traits/has_bit_or_assign.hpp>
-#include <boost/type_traits/has_bit_xor.hpp>
-#include <boost/type_traits/has_bit_xor_assign.hpp>
-#include <boost/type_traits/has_complement.hpp>
-#include <boost/type_traits/has_dereference.hpp>
-#include <boost/type_traits/has_divides.hpp>
-#include <boost/type_traits/has_divides_assign.hpp>
-#include <boost/type_traits/has_equal_to.hpp>
-#include <boost/type_traits/has_greater.hpp>
-#include <boost/type_traits/has_greater_equal.hpp>
-#include <boost/type_traits/has_left_shift.hpp>
-#include <boost/type_traits/has_left_shift_assign.hpp>
-#include <boost/type_traits/has_less.hpp>
-#include <boost/type_traits/has_less_equal.hpp>
-#include <boost/type_traits/has_logical_and.hpp>
-#include <boost/type_traits/has_logical_not.hpp>
-#include <boost/type_traits/has_logical_or.hpp>
-#include <boost/type_traits/has_minus.hpp>
-#include <boost/type_traits/has_minus_assign.hpp>
-#include <boost/type_traits/has_modulus.hpp>
-#include <boost/type_traits/has_modulus_assign.hpp>
-#include <boost/type_traits/has_multiplies.hpp>
-#include <boost/type_traits/has_multiplies_assign.hpp>
-#include <boost/type_traits/has_negate.hpp>
-#if !defined(__BORLANDC__) && !defined(__CUDACC__)
-#include <boost/type_traits/has_new_operator.hpp>
-#endif
-#include <boost/type_traits/has_not_equal_to.hpp>
-#include <boost/type_traits/has_nothrow_assign.hpp>
-#include <boost/type_traits/has_nothrow_constructor.hpp>
-#include <boost/type_traits/has_nothrow_copy.hpp>
-#include <boost/type_traits/has_nothrow_destructor.hpp>
-#include <boost/type_traits/has_plus.hpp>
-#include <boost/type_traits/has_plus_assign.hpp>
-#include <boost/type_traits/has_post_decrement.hpp>
-#include <boost/type_traits/has_post_increment.hpp>
-#include <boost/type_traits/has_pre_decrement.hpp>
-#include <boost/type_traits/has_pre_increment.hpp>
-#include <boost/type_traits/has_right_shift.hpp>
-#include <boost/type_traits/has_right_shift_assign.hpp>
-#include <boost/type_traits/has_trivial_assign.hpp>
-#include <boost/type_traits/has_trivial_constructor.hpp>
-#include <boost/type_traits/has_trivial_copy.hpp>
-#include <boost/type_traits/has_trivial_destructor.hpp>
-#include <boost/type_traits/has_trivial_move_assign.hpp>
-#include <boost/type_traits/has_trivial_move_constructor.hpp>
-#include <boost/type_traits/has_unary_minus.hpp>
-#include <boost/type_traits/has_unary_plus.hpp>
-#include <boost/type_traits/has_virtual_destructor.hpp>
-
-#include <boost/type_traits/integral_constant.hpp>
-
-#include <boost/type_traits/is_abstract.hpp>
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/type_traits/is_array.hpp>
-#include <boost/type_traits/is_assignable.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/is_complex.hpp>
-#include <boost/type_traits/is_compound.hpp>
-#include <boost/type_traits/is_const.hpp>
-#include <boost/type_traits/is_constructible.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-#include <boost/type_traits/is_copy_assignable.hpp>
-#include <boost/type_traits/is_copy_constructible.hpp>
-#include <boost/type_traits/is_default_constructible.hpp>
-#include <boost/type_traits/is_destructible.hpp>
-#include <boost/type_traits/is_empty.hpp>
-#include <boost/type_traits/is_enum.hpp>
-#include <boost/type_traits/is_final.hpp>
-#include <boost/type_traits/is_float.hpp>
-#include <boost/type_traits/is_floating_point.hpp>
-#include <boost/type_traits/is_function.hpp>
-#include <boost/type_traits/is_fundamental.hpp>
-#include <boost/type_traits/is_integral.hpp>
-#include <boost/type_traits/is_lvalue_reference.hpp>
-#include <boost/type_traits/is_member_function_pointer.hpp>
-#include <boost/type_traits/is_member_object_pointer.hpp>
-#include <boost/type_traits/is_member_pointer.hpp>
-#include <boost/type_traits/is_nothrow_move_assignable.hpp>
-#include <boost/type_traits/is_nothrow_move_constructible.hpp>
-#include <boost/type_traits/is_object.hpp>
-#include <boost/type_traits/is_pod.hpp>
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/type_traits/is_polymorphic.hpp>
-#include <boost/type_traits/is_reference.hpp>
-#include <boost/type_traits/is_rvalue_reference.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/is_scalar.hpp>
-#include <boost/type_traits/is_signed.hpp>
-#include <boost/type_traits/is_stateless.hpp>
-#include <boost/type_traits/is_union.hpp>
-#include <boost/type_traits/is_unsigned.hpp>
-#include <boost/type_traits/is_virtual_base_of.hpp>
-#include <boost/type_traits/is_void.hpp>
-#include <boost/type_traits/is_volatile.hpp>
-#include <boost/type_traits/make_signed.hpp>
-#include <boost/type_traits/make_unsigned.hpp>
-#include <boost/type_traits/rank.hpp>
-#include <boost/type_traits/remove_all_extents.hpp>
-#include <boost/type_traits/remove_bounds.hpp>
-#include <boost/type_traits/remove_const.hpp>
-#include <boost/type_traits/remove_cv.hpp>
-#include <boost/type_traits/remove_extent.hpp>
-#include <boost/type_traits/remove_pointer.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-#include <boost/type_traits/remove_volatile.hpp>
-#include <boost/type_traits/type_identity.hpp>
-#include <boost/type_traits/type_with_alignment.hpp>
-
-#if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238))
-#include <boost/type_traits/integral_promotion.hpp>
-#include <boost/type_traits/promote.hpp>
-#endif
-
-#endif // BOOST_TYPE_TRAITS_HPP
+++ /dev/null
-#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 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>
-#include <boost/detail/workaround.hpp>
-
-#if defined(BOOST_NO_CXX11_DECLTYPE)
-#include <boost/type_traits/detail/common_type_impl.hpp>
-#endif
-
-#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
-#include <boost/type_traits/detail/mp_defer.hpp>
-#endif
-
-namespace boost
-{
-
-// variadic common_type
-
-#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
-
-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...>
-{
-};
-
-#else
-
-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)
-
-#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
-
-template<class T1, class T2> using builtin_common_type = decltype( boost::declval<bool>()? boost::declval<T1>(): boost::declval<T2>() );
-
-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
-
-#else
-
-template<class T1, class T2> struct common_type_impl: boost::decay<decltype( boost::declval<bool>()? boost::declval<T1>(): boost::declval<T2>() )>
-{
-};
-
-#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 // #ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_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
--- /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.
+//
+// defines traits classes for cv-qualified types:
+// is_const, is_volatile, remove_const, remove_volatile, remove_cv.
+
+#ifndef BOOST_TT_CV_TRAITS_HPP_INCLUDED
+#define BOOST_TT_CV_TRAITS_HPP_INCLUDED
+
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_volatile.hpp>
+#include <boost/type_traits/add_cv.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_volatile.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/type_traits/remove_volatile.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+
+#endif // BOOST_TT_CV_TRAITS_HPP_INCLUDED
+++ /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];
-};
-
-#ifndef BOOST_NO_INTRINSIC_WCHAR_T
-
-template<> struct arithmetic_type<3>
-{
- typedef wchar_t type;
- typedef char (&result_type) [3];
-};
-
-#endif
-
-// 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 );
-#ifndef BOOST_NO_INTRINSIC_WCHAR_T
- static arithmetic_type<3>::result_type select( arithmetic_type<3>::type );
-#endif
- 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
-#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 2009-2011 Frederic Bron, Robert Stewart, Steven Watanabe & Roman Perepelitsa.
-//
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-#include <boost/config.hpp>
-#include <boost/type_traits/detail/yes_no_type.hpp>
-#include <boost/type_traits/integral_constant.hpp>
-#include <boost/type_traits/is_const.hpp>
-#include <boost/type_traits/is_fundamental.hpp>
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/is_void.hpp>
-#include <boost/type_traits/remove_cv.hpp>
-#include <boost/type_traits/remove_pointer.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-
-// avoid warnings
-#if defined(__GNUC__)
-# pragma GCC system_header
-#elif defined(BOOST_MSVC)
-# pragma warning ( push )
-# pragma warning ( disable : 4244 4913)
-# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
-# pragma warning ( disable : 6334)
-# endif
-#endif
-
-namespace boost {
-namespace detail {
-
-// This namespace ensures that argument-dependent name lookup does not mess things up.
-namespace BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) {
-
-// 1. a function to have an instance of type T without requiring T to be default
-// constructible
-template <typename T> T &make();
-
-
-// 2. we provide our operator definition for types that do not have one already
-
-// a type returned from operator BOOST_TT_TRAIT_OP when no such operator is
-// found in the type's own namespace (our own operator is used) so that we have
-// a means to know that our operator was used
-struct no_operator { };
-
-// this class allows implicit conversions and makes the following operator
-// definition less-preferred than any other such operators that might be found
-// via argument-dependent name lookup
-struct any { template <class T> any(T const&); };
-
-// when operator BOOST_TT_TRAIT_OP is not available, this one is used
-no_operator operator BOOST_TT_TRAIT_OP (const any&, int);
-
-
-// 3. checks if the operator returns void or not
-// conditions: Lhs!=void
-
-// we first redefine "operator," so that we have no compilation error if
-// operator BOOST_TT_TRAIT_OP returns void and we can use the return type of
-// (lhs BOOST_TT_TRAIT_OP, returns_void_t()) to deduce if
-// operator BOOST_TT_TRAIT_OP returns void or not:
-// - operator BOOST_TT_TRAIT_OP returns void -> (lhs BOOST_TT_TRAIT_OP, returns_void_t()) returns returns_void_t
-// - operator BOOST_TT_TRAIT_OP returns !=void -> (lhs BOOST_TT_TRAIT_OP, returns_void_t()) returns int
-struct returns_void_t { };
-template <typename T> int operator,(const T&, returns_void_t);
-template <typename T> int operator,(const volatile T&, returns_void_t);
-
-// this intermediate trait has member value of type bool:
-// - value==true -> operator BOOST_TT_TRAIT_OP returns void
-// - value==false -> operator BOOST_TT_TRAIT_OP does not return void
-template < typename Lhs >
-struct operator_returns_void {
- // overloads of function returns_void make the difference
- // yes_type and no_type have different size by construction
- static ::boost::type_traits::yes_type returns_void(returns_void_t);
- static ::boost::type_traits::no_type returns_void(int);
- BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((make<Lhs>() BOOST_TT_TRAIT_OP,returns_void_t())))));
-};
-
-
-// 4. checks if the return type is Ret or Ret==dont_care
-// conditions: Lhs!=void
-
-struct dont_care { };
-
-template < typename Lhs, typename Ret, bool Returns_void >
-struct operator_returns_Ret;
-
-template < typename Lhs >
-struct operator_returns_Ret < Lhs, dont_care, true > {
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template < typename Lhs >
-struct operator_returns_Ret < Lhs, dont_care, false > {
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template < typename Lhs >
-struct operator_returns_Ret < Lhs, void, true > {
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template < typename Lhs >
-struct operator_returns_Ret < Lhs, void, false > {
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-template < typename Lhs, typename Ret >
-struct operator_returns_Ret < Lhs, Ret, true > {
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-// otherwise checks if it is convertible to Ret using the sizeof trick
-// based on overload resolution
-// condition: Ret!=void and Ret!=dont_care and the operator does not return void
-template < typename Lhs, typename Ret >
-struct operator_returns_Ret < Lhs, Ret, false > {
- static ::boost::type_traits::yes_type is_convertible_to_Ret(Ret); // this version is preferred for types convertible to Ret
- static ::boost::type_traits::no_type is_convertible_to_Ret(...); // this version is used otherwise
-
- BOOST_STATIC_CONSTANT(bool, value = (sizeof(is_convertible_to_Ret(make<Lhs>() BOOST_TT_TRAIT_OP))==sizeof(::boost::type_traits::yes_type)));
-};
-
-
-// 5. checks for operator existence
-// condition: Lhs!=void
-
-// checks if our definition of operator BOOST_TT_TRAIT_OP is used or an other
-// existing one;
-// this is done with redefinition of "operator," that returns no_operator or has_operator
-struct has_operator { };
-no_operator operator,(no_operator, has_operator);
-
-template < typename Lhs >
-struct operator_exists {
- static ::boost::type_traits::yes_type s_check(has_operator); // this version is preferred when operator exists
- static ::boost::type_traits::no_type s_check(no_operator); // this version is used otherwise
-
- BOOST_STATIC_CONSTANT(bool, value = (sizeof(s_check(((make<Lhs>() BOOST_TT_TRAIT_OP),make<has_operator>())))==sizeof(::boost::type_traits::yes_type)));
-};
-
-
-// 6. main trait: to avoid any compilation error, this class behaves
-// differently when operator BOOST_TT_TRAIT_OP(Lhs) is forbidden by the
-// standard.
-// Forbidden_if is a bool that is:
-// - true when the operator BOOST_TT_TRAIT_OP(Lhs) is forbidden by the standard
-// (would yield compilation error if used)
-// - false otherwise
-template < typename Lhs, typename Ret, bool Forbidden_if >
-struct trait_impl1;
-
-template < typename Lhs, typename Ret >
-struct trait_impl1 < Lhs, Ret, true > {
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-template < typename Lhs, typename Ret >
-struct trait_impl1 < Lhs, Ret, false > {
- BOOST_STATIC_CONSTANT(bool,
- value = (operator_exists < Lhs >::value && operator_returns_Ret < Lhs, Ret, operator_returns_void < Lhs >::value >::value));
-};
-
-// specialization needs to be declared for the special void case
-template < typename Ret >
-struct trait_impl1 < void, Ret, false > {
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-// defines some typedef for convenience
-template < typename Lhs, typename Ret >
-struct trait_impl {
- typedef typename ::boost::remove_reference<Lhs>::type Lhs_noref;
- typedef typename ::boost::remove_cv<Lhs_noref>::type Lhs_nocv;
- typedef typename ::boost::remove_cv< typename ::boost::remove_reference< typename ::boost::remove_pointer<Lhs_noref>::type >::type >::type Lhs_noptr;
- BOOST_STATIC_CONSTANT(bool, value = (trait_impl1 < Lhs_noref, Ret, BOOST_TT_FORBIDDEN_IF >::value));
-};
-
-} // namespace impl
-} // namespace detail
-
-// this is the accessible definition of the trait to end user
-template <class Lhs, class Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care>
-struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _impl)::trait_impl< Lhs, Ret >::value)>{};
-
-} // namespace boost
-
-#if defined(BOOST_MSVC)
-# pragma warning ( pop )
-#endif
+++ /dev/null
-// (C) Copyright 2009-2011 Frederic Bron, Robert Stewart, Steven Watanabe & Roman Perepelitsa.
-//
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-#include <boost/config.hpp>
-#include <boost/type_traits/detail/yes_no_type.hpp>
-#include <boost/type_traits/integral_constant.hpp>
-#include <boost/type_traits/is_const.hpp>
-#include <boost/type_traits/is_fundamental.hpp>
-#include <boost/type_traits/is_integral.hpp>
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/is_void.hpp>
-#include <boost/type_traits/remove_cv.hpp>
-#include <boost/type_traits/remove_pointer.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-
-// cannot include this header without getting warnings of the kind:
-// gcc:
-// warning: value computed is not used
-// warning: comparison between signed and unsigned integer expressions
-// msvc:
-// warning C4146: unary minus operator applied to unsigned type, result still unsigned
-// warning C4804: '-' : unsafe use of type 'bool' in operation
-// cannot find another implementation -> declared as system header to suppress these warnings.
-#if defined(__GNUC__)
-# pragma GCC system_header
-#elif defined(BOOST_MSVC)
-# pragma warning ( push )
-# pragma warning ( disable : 4146 4804 4913 4244)
-# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
-# pragma warning ( disable : 6334)
-# endif
-#endif
-
-
-
-namespace boost {
-namespace detail {
-
-// This namespace ensures that argument-dependent name lookup does not mess things up.
-namespace BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) {
-
-// 1. a function to have an instance of type T without requiring T to be default
-// constructible
-template <typename T> T &make();
-
-
-// 2. we provide our operator definition for types that do not have one already
-
-// a type returned from operator BOOST_TT_TRAIT_OP when no such operator is
-// found in the type's own namespace (our own operator is used) so that we have
-// a means to know that our operator was used
-struct no_operator { };
-
-// this class allows implicit conversions and makes the following operator
-// definition less-preferred than any other such operators that might be found
-// via argument-dependent name lookup
-struct any { template <class T> any(T const&); };
-
-// when operator BOOST_TT_TRAIT_OP is not available, this one is used
-no_operator operator BOOST_TT_TRAIT_OP (const any&);
-
-
-// 3. checks if the operator returns void or not
-// conditions: Rhs!=void
-
-// we first redefine "operator," so that we have no compilation error if
-// operator BOOST_TT_TRAIT_OP returns void and we can use the return type of
-// (BOOST_TT_TRAIT_OP rhs, returns_void_t()) to deduce if
-// operator BOOST_TT_TRAIT_OP returns void or not:
-// - operator BOOST_TT_TRAIT_OP returns void -> (BOOST_TT_TRAIT_OP rhs, returns_void_t()) returns returns_void_t
-// - operator BOOST_TT_TRAIT_OP returns !=void -> (BOOST_TT_TRAIT_OP rhs, returns_void_t()) returns int
-struct returns_void_t { };
-template <typename T> int operator,(const T&, returns_void_t);
-template <typename T> int operator,(const volatile T&, returns_void_t);
-
-// this intermediate trait has member value of type bool:
-// - value==true -> operator BOOST_TT_TRAIT_OP returns void
-// - value==false -> operator BOOST_TT_TRAIT_OP does not return void
-template < typename Rhs >
-struct operator_returns_void {
- // overloads of function returns_void make the difference
- // yes_type and no_type have different size by construction
- static ::boost::type_traits::yes_type returns_void(returns_void_t);
- static ::boost::type_traits::no_type returns_void(int);
- BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((BOOST_TT_TRAIT_OP make<Rhs>(),returns_void_t())))));
-};
-
-
-// 4. checks if the return type is Ret or Ret==dont_care
-// conditions: Rhs!=void
-
-struct dont_care { };
-
-template < typename Rhs, typename Ret, bool Returns_void >
-struct operator_returns_Ret;
-
-template < typename Rhs >
-struct operator_returns_Ret < Rhs, dont_care, true > {
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template < typename Rhs >
-struct operator_returns_Ret < Rhs, dont_care, false > {
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template < typename Rhs >
-struct operator_returns_Ret < Rhs, void, true > {
- BOOST_STATIC_CONSTANT(bool, value = true);
-};
-
-template < typename Rhs >
-struct operator_returns_Ret < Rhs, void, false > {
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-template < typename Rhs, typename Ret >
-struct operator_returns_Ret < Rhs, Ret, true > {
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-// otherwise checks if it is convertible to Ret using the sizeof trick
-// based on overload resolution
-// condition: Ret!=void and Ret!=dont_care and the operator does not return void
-template < typename Rhs, typename Ret >
-struct operator_returns_Ret < Rhs, Ret, false > {
- static ::boost::type_traits::yes_type is_convertible_to_Ret(Ret); // this version is preferred for types convertible to Ret
- static ::boost::type_traits::no_type is_convertible_to_Ret(...); // this version is used otherwise
-
- BOOST_STATIC_CONSTANT(bool, value = (sizeof(is_convertible_to_Ret(BOOST_TT_TRAIT_OP make<Rhs>()))==sizeof(::boost::type_traits::yes_type)));
-};
-
-
-// 5. checks for operator existence
-// condition: Rhs!=void
-
-// checks if our definition of operator BOOST_TT_TRAIT_OP is used or an other
-// existing one;
-// this is done with redefinition of "operator," that returns no_operator or has_operator
-struct has_operator { };
-no_operator operator,(no_operator, has_operator);
-
-template < typename Rhs >
-struct operator_exists {
- static ::boost::type_traits::yes_type s_check(has_operator); // this version is preferred when operator exists
- static ::boost::type_traits::no_type s_check(no_operator); // this version is used otherwise
-
- BOOST_STATIC_CONSTANT(bool, value = (sizeof(s_check(((BOOST_TT_TRAIT_OP make<Rhs>()),make<has_operator>())))==sizeof(::boost::type_traits::yes_type)));
-};
-
-
-// 6. main trait: to avoid any compilation error, this class behaves
-// differently when operator BOOST_TT_TRAIT_OP(Rhs) is forbidden by the
-// standard.
-// Forbidden_if is a bool that is:
-// - true when the operator BOOST_TT_TRAIT_OP(Rhs) is forbidden by the standard
-// (would yield compilation error if used)
-// - false otherwise
-template < typename Rhs, typename Ret, bool Forbidden_if >
-struct trait_impl1;
-
-template < typename Rhs, typename Ret >
-struct trait_impl1 < Rhs, Ret, true > {
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-template < typename Rhs, typename Ret >
-struct trait_impl1 < Rhs, Ret, false > {
- BOOST_STATIC_CONSTANT(bool,
- value = (operator_exists < Rhs >::value && operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::value));
-};
-
-// specialization needs to be declared for the special void case
-template < typename Ret >
-struct trait_impl1 < void, Ret, false > {
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-// defines some typedef for convenience
-template < typename Rhs, typename Ret >
-struct trait_impl {
- typedef typename ::boost::remove_reference<Rhs>::type Rhs_noref;
- typedef typename ::boost::remove_cv<Rhs_noref>::type Rhs_nocv;
- typedef typename ::boost::remove_cv< typename ::boost::remove_reference< typename ::boost::remove_pointer<Rhs_noref>::type >::type >::type Rhs_noptr;
- BOOST_STATIC_CONSTANT(bool, value = (trait_impl1 < Rhs_noref, Ret, BOOST_TT_FORBIDDEN_IF >::value));
-};
-
-} // namespace impl
-} // namespace detail
-
-// this is the accessible definition of the trait to end user
-template <class Rhs, class Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care>
-struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _impl)::trait_impl < Rhs, Ret >::value)>{};
-
-} // namespace boost
-
-#if defined(BOOST_MSVC)
-# pragma warning ( pop )
-#endif
+++ /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_s(int);
-
- template<template<class...> class>
- static boost::false_type check_s(...);
-
- using type = decltype(check_s<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
-
-// (C) Copyright John Maddock 2005.
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-
-#ifndef BOOST_TT_EXTENT_HPP_INCLUDED
-#define BOOST_TT_EXTENT_HPP_INCLUDED
-
-#include <boost/type_traits/integral_constant.hpp>
-#include <boost/detail/workaround.hpp>
-
-namespace boost {
-
-namespace detail{
-
-#if defined( __CODEGEARC__ )
- // wrap the impl as main trait provides additional MPL lambda support
- template < typename T, std::size_t N >
- struct extent_imp {
- static const std::size_t value = __array_extent(T, N);
- };
-
-#else
-
-template <class T, std::size_t N>
-struct extent_imp
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = 0);
-};
-#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-template <class T, std::size_t R, std::size_t N>
-struct extent_imp<T[R], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
-};
-
-template <class T, std::size_t R, std::size_t N>
-struct extent_imp<T const[R], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
-};
-
-template <class T, std::size_t R, std::size_t N>
-struct extent_imp<T volatile[R], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
-};
-
-template <class T, std::size_t R, std::size_t N>
-struct extent_imp<T const volatile[R], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
-};
-
-template <class T, std::size_t R>
-struct extent_imp<T[R],0>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = R);
-};
-
-template <class T, std::size_t R>
-struct extent_imp<T const[R], 0>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = R);
-};
-
-template <class T, std::size_t R>
-struct extent_imp<T volatile[R], 0>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = R);
-};
-
-template <class T, std::size_t R>
-struct extent_imp<T const volatile[R], 0>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = R);
-};
-
-#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) && !defined(__MWERKS__)
-template <class T, std::size_t N>
-struct extent_imp<T[], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
-};
-template <class T, std::size_t N>
-struct extent_imp<T const[], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
-};
-template <class T, std::size_t N>
-struct extent_imp<T volatile[], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
-};
-template <class T, std::size_t N>
-struct extent_imp<T const volatile[], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::extent_imp<T, N-1>::value));
-};
-template <class T>
-struct extent_imp<T[], 0>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = 0);
-};
-template <class T>
-struct extent_imp<T const[], 0>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = 0);
-};
-template <class T>
-struct extent_imp<T volatile[], 0>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = 0);
-};
-template <class T>
-struct extent_imp<T const volatile[], 0>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = 0);
-};
-#endif
-#endif
-
-#endif // non-CodeGear implementation
-} // ::boost::detail
-
-template <class T, std::size_t N = 0>
-struct extent
- : public ::boost::integral_constant<std::size_t, ::boost::detail::extent_imp<T,N>::value>
-{
-};
-
-} // namespace boost
-
-#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
+++ /dev/null
-// Copyright 2005 Alexander Nasonov.
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED
-#define FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED
-
-namespace boost {
-
- template<class T> struct floating_point_promotion { typedef T type; };
- template<> struct floating_point_promotion<float> { typedef double type; };
- template<> struct floating_point_promotion<float const> { typedef double const type; };
- template<> struct floating_point_promotion<float volatile>{ typedef double volatile type; };
- template<> struct floating_point_promotion<float const volatile> { typedef double const volatile type; };
-
-}
-
-#endif // #ifndef FILE_boost_type_traits_floating_point_promotion_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_BIT_AND_HPP_INCLUDED
-#define BOOST_TT_HAS_BIT_AND_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_bit_and
-#define BOOST_TT_TRAIT_OP &
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ( \
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_BIT_AND_ASSIGN_HPP_INCLUDED
-#define BOOST_TT_HAS_BIT_AND_ASSIGN_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_bit_and_assign
-#define BOOST_TT_TRAIT_OP &=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- (\
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_const< Lhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_BIT_OR_HPP_INCLUDED
-#define BOOST_TT_HAS_BIT_OR_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_bit_or
-#define BOOST_TT_TRAIT_OP |
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ( \
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_BIT_OR_ASSIGN_HPP_INCLUDED
-#define BOOST_TT_HAS_BIT_OR_ASSIGN_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_bit_or_assign
-#define BOOST_TT_TRAIT_OP |=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ( \
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_const< Lhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_BIT_XOR_HPP_INCLUDED
-#define BOOST_TT_HAS_BIT_XOR_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_bit_xor
-#define BOOST_TT_TRAIT_OP ^
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ( \
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_BIT_XOR_ASSIGN_HPP_INCLUDED
-#define BOOST_TT_HAS_BIT_XOR_ASSIGN_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_bit_xor_assign
-#define BOOST_TT_TRAIT_OP ^=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ( \
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_const< Lhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_COMPLEMENT_HPP_INCLUDED
-#define BOOST_TT_HAS_COMPLEMENT_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_complement
-#define BOOST_TT_TRAIT_OP ~
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* pointer */\
- ::boost::is_pointer< Rhs_noref >::value || \
- /* fundamental non integral */\
- (\
- ::boost::is_fundamental< Rhs_noref >::value && \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_prefix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_DEREFERENCE_HPP_INCLUDED
-#define BOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_dereference
-#define BOOST_TT_TRAIT_OP *
-#define BOOST_TT_FORBIDDEN_IF\
- /* void* or fundamental */\
- (\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ::boost::is_void< Rhs_noptr >::value\
- ) || \
- ::boost::is_fundamental< Rhs_nocv >::value\
- )
-
-
-#include <boost/type_traits/detail/has_prefix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_DIVIDES_HPP_INCLUDED
-#define BOOST_TT_HAS_DIVIDES_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_divides
-#define BOOST_TT_TRAIT_OP /
-#define BOOST_TT_FORBIDDEN_IF\
- /* pointer with pointer or fundamental */\
- (\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ( \
- ::boost::is_fundamental< Rhs_nocv >::value || \
- ::boost::is_pointer< Rhs_noref >::value\
- )\
- )||\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ( \
- ::boost::is_fundamental< Lhs_nocv >::value || \
- ::boost::is_pointer< Lhs_noref >::value\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_DIVIDES_ASSIGN_HPP_INCLUDED
-#define BOOST_TT_HAS_DIVIDES_ASSIGN_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_divides_assign
-#define BOOST_TT_TRAIT_OP /=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Lhs==const and Rhs==fundamental */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_const< Lhs_noref >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value\
- ) || \
- /* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ( \
- ::boost::is_fundamental< Rhs_nocv >::value || \
- ::boost::is_pointer< Rhs_noref >::value\
- )\
- )||\
- /* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ( \
- ::boost::is_fundamental< Lhs_nocv >::value || \
- ::boost::is_pointer< Lhs_noref >::value\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_EQUAL_TO_HPP_INCLUDED
-#define BOOST_TT_HAS_EQUAL_TO_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_equal_to
-#define BOOST_TT_TRAIT_OP ==
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==pointer and Rhs==fundamental */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value\
- ) || \
- /* Rhs==pointer and Lhs==fundamental */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ::boost::is_fundamental< Lhs_nocv >::value\
- ) || \
- /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value && \
- (! \
- (\
- ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
- ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_void< Lhs_noptr >::value || \
- ::boost::is_void< Rhs_noptr >::value\
- )\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_GREATER_HPP_INCLUDED
-#define BOOST_TT_HAS_GREATER_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_greater
-#define BOOST_TT_TRAIT_OP >
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==pointer and Rhs==fundamental */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value\
- ) || \
- /* Rhs==pointer and Lhs==fundamental */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ::boost::is_fundamental< Lhs_nocv >::value\
- ) || \
- /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value && \
- (! \
- ( \
- ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
- ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_void< Lhs_noptr >::value || \
- ::boost::is_void< Rhs_noptr >::value\
- )\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_GREATER_EQUAL_HPP_INCLUDED
-#define BOOST_TT_HAS_GREATER_EQUAL_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_greater_equal
-#define BOOST_TT_TRAIT_OP >=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==pointer and Rhs==fundamental */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value\
- ) || \
- /* Rhs==pointer and Lhs==fundamental */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ::boost::is_fundamental< Lhs_nocv >::value\
- ) || \
- /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value && \
- (! \
- ( \
- ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
- ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_void< Lhs_noptr >::value || \
- ::boost::is_void< Rhs_noptr >::value\
- )\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_LEFT_SHIFT_ASSIGN_HPP_INCLUDED
-#define BOOST_TT_HAS_LEFT_SHIFT_ASSIGN_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_left_shift_assign
-#define BOOST_TT_TRAIT_OP <<=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ( \
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_const< Lhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_LESS_HPP_INCLUDED
-#define BOOST_TT_HAS_LESS_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_less
-#define BOOST_TT_TRAIT_OP <
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==pointer and Rhs==fundamental */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value\
- ) || \
- /* Rhs==pointer and Lhs==fundamental */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ::boost::is_fundamental< Lhs_nocv >::value\
- ) || \
- /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value && \
- (! \
- ( \
- ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
- ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_void< Lhs_noptr >::value || \
- ::boost::is_void< Rhs_noptr >::value\
- )\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_LESS_EQUAL_HPP_INCLUDED
-#define BOOST_TT_HAS_LESS_EQUAL_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_less_equal
-#define BOOST_TT_TRAIT_OP <=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==pointer and Rhs==fundamental */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value\
- ) || \
- /* Rhs==pointer and Lhs==fundamental */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ::boost::is_fundamental< Lhs_nocv >::value\
- ) || \
- /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value && \
- (! \
- ( \
- ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
- ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_void< Lhs_noptr >::value || \
- ::boost::is_void< Rhs_noptr >::value\
- )\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_LOGICAL_AND_HPP_INCLUDED
-#define BOOST_TT_HAS_LOGICAL_AND_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_logical_and
-#define BOOST_TT_TRAIT_OP &&
-#define BOOST_TT_FORBIDDEN_IF\
- /* pointer with fundamental non convertible to bool */\
- (\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ( \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- (! ::boost::is_convertible< Rhs_nocv, bool >::value )\
- )\
- )||\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ( \
- ::boost::is_fundamental< Lhs_nocv >::value && \
- (! ::boost::is_convertible< Lhs_nocv, bool >::value )\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_LOGICAL_NOT_HPP_INCLUDED
-#define BOOST_TT_HAS_LOGICAL_NOT_HPP_INCLUDED
-
-#if defined(__GNUC__) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ > 40800)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-value"
-#endif
-
-#define BOOST_TT_TRAIT_NAME has_logical_not
-#define BOOST_TT_TRAIT_OP !
-#define BOOST_TT_FORBIDDEN_IF\
- false
-
-#include <boost/type_traits/detail/has_prefix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#if defined(__GNUC__) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ > 40800)
-#pragma GCC diagnostic pop
-#endif
-
-#endif
+++ /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_LOGICAL_OR_HPP_INCLUDED
-#define BOOST_TT_HAS_LOGICAL_OR_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_logical_or
-#define BOOST_TT_TRAIT_OP ||
-#define BOOST_TT_FORBIDDEN_IF\
- /* pointer with fundamental non convertible to bool */\
- (\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- (! ::boost::is_convertible< Rhs_nocv, bool >::value )\
- )\
- )||\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- (! ::boost::is_convertible< Lhs_nocv, bool >::value )\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_MODULUS_HPP_INCLUDED
-#define BOOST_TT_HAS_MODULUS_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_modulus
-#define BOOST_TT_TRAIT_OP %
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- (\
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_MODULUS_ASSIGN_HPP_INCLUDED
-#define BOOST_TT_HAS_MODULUS_ASSIGN_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_modulus_assign
-#define BOOST_TT_TRAIT_OP %=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ( \
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_const< Lhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_MULTIPLIES_HPP_INCLUDED
-#define BOOST_TT_HAS_MULTIPLIES_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_multiplies
-#define BOOST_TT_TRAIT_OP *
-#define BOOST_TT_FORBIDDEN_IF\
- /* pointer with pointer or fundamental */\
- (\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- (\
- ::boost::is_fundamental< Rhs_nocv >::value || \
- ::boost::is_pointer< Rhs_noref >::value\
- )\
- )||\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- (\
- ::boost::is_fundamental< Lhs_nocv >::value || \
- ::boost::is_pointer< Lhs_noref >::value\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_MULTIPLIES_ASSIGN_HPP_INCLUDED
-#define BOOST_TT_HAS_MULTIPLIES_ASSIGN_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_multiplies_assign
-#define BOOST_TT_TRAIT_OP *=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Lhs==const and Rhs==fundamental */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_const< Lhs_noref >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value\
- ) || \
- /* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ( \
- ::boost::is_fundamental< Rhs_nocv >::value || \
- ::boost::is_pointer< Rhs_noref >::value\
- )\
- )||\
- /* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ( \
- ::boost::is_fundamental< Lhs_nocv >::value || \
- ::boost::is_pointer< Lhs_noref >::value\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_NEGATE_HPP_INCLUDED
-#define BOOST_TT_HAS_NEGATE_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_negate
-#define BOOST_TT_TRAIT_OP -
-#define BOOST_TT_FORBIDDEN_IF\
- /* pointer */\
- ::boost::is_pointer< Rhs_noref >::value
-
-
-#include <boost/type_traits/detail/has_prefix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /dev/null
-
-// (C) Copyright Runar Undheim, Robert Ramey & John Maddock 2008.
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-#ifndef BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED
-#define BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED
-
-#include <new> // std::nothrow_t
-#include <cstddef> // std::size_t
-#include <boost/type_traits/integral_constant.hpp>
-#include <boost/type_traits/detail/yes_no_type.hpp>
-#include <boost/detail/workaround.hpp>
-
-#if defined(new)
-# if BOOST_WORKAROUND(BOOST_MSVC, >= 1310)
-# define BOOST_TT_AUX_MACRO_NEW_DEFINED
-# pragma push_macro("new")
-# undef new
-# else
-# error "Sorry but you can't include this header if 'new' is defined as a macro."
-# endif
-#endif
-
-namespace boost {
-namespace detail {
- template <class U, U x>
- struct test;
-
- template <typename T>
- struct has_new_operator_impl {
- template<class U>
- static type_traits::yes_type check_sig1(
- U*,
- test<
- void *(*)(std::size_t),
- &U::operator new
- >* = NULL
- );
- template<class U>
- static type_traits::no_type check_sig1(...);
-
- template<class U>
- static type_traits::yes_type check_sig2(
- U*,
- test<
- void *(*)(std::size_t, const std::nothrow_t&),
- &U::operator new
- >* = NULL
- );
- template<class U>
- static type_traits::no_type check_sig2(...);
-
- template<class U>
- static type_traits::yes_type check_sig3(
- U*,
- test<
- void *(*)(std::size_t, void*),
- &U::operator new
- >* = NULL
- );
- template<class U>
- static type_traits::no_type check_sig3(...);
-
-
- template<class U>
- static type_traits::yes_type check_sig4(
- U*,
- test<
- void *(*)(std::size_t),
- &U::operator new[]
- >* = NULL
- );
- template<class U>
- static type_traits::no_type check_sig4(...);
-
- template<class U>
- static type_traits::yes_type check_sig5(
- U*,
- test<
- void *(*)(std::size_t, const std::nothrow_t&),
- &U::operator new[]
- >* = NULL
- );
- template<class U>
- static type_traits::no_type check_sig5(...);
-
- template<class U>
- static type_traits::yes_type check_sig6(
- U*,
- test<
- void *(*)(std::size_t, void*),
- &U::operator new[]
- >* = NULL
- );
- template<class U>
- static type_traits::no_type check_sig6(...);
-
- // GCC2 won't even parse this template if we embed the computation
- // of s1 in the computation of value.
- #ifdef __GNUC__
- BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(has_new_operator_impl<T>::template check_sig1<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(has_new_operator_impl<T>::template check_sig2<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s3 = sizeof(has_new_operator_impl<T>::template check_sig3<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s4 = sizeof(has_new_operator_impl<T>::template check_sig4<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s5 = sizeof(has_new_operator_impl<T>::template check_sig5<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s6 = sizeof(has_new_operator_impl<T>::template check_sig6<T>(0)));
- #else
- #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
- #pragma warning(push)
- #pragma warning(disable:6334)
- #endif
-
- BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig1<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(check_sig2<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s3 = sizeof(check_sig3<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s4 = sizeof(check_sig4<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s5 = sizeof(check_sig5<T>(0)));
- BOOST_STATIC_CONSTANT(unsigned, s6 = sizeof(check_sig6<T>(0)));
-
- #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
- #pragma warning(pop)
- #endif
- #endif
- BOOST_STATIC_CONSTANT(bool, value =
- (s1 == sizeof(type_traits::yes_type)) ||
- (s2 == sizeof(type_traits::yes_type)) ||
- (s3 == sizeof(type_traits::yes_type)) ||
- (s4 == sizeof(type_traits::yes_type)) ||
- (s5 == sizeof(type_traits::yes_type)) ||
- (s6 == sizeof(type_traits::yes_type))
- );
- };
-} // namespace detail
-
-template <class T> struct has_new_operator : public integral_constant<bool, ::boost::detail::has_new_operator_impl<T>::value>{};
-
-} // namespace boost
-
-#if defined(BOOST_TT_AUX_MACRO_NEW_DEFINED)
-# pragma pop_macro("new")
-#endif
-
-#endif // BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED
+++ /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_NOT_EQUAL_TO_HPP_INCLUDED
-#define BOOST_TT_HAS_NOT_EQUAL_TO_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_not_equal_to
-#define BOOST_TT_TRAIT_OP !=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==pointer and Rhs==fundamental */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value\
- ) || \
- /* Rhs==pointer and Lhs==fundamental */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ::boost::is_fundamental< Lhs_nocv >::value\
- ) || \
- /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value && \
- (! \
- (\
- ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \
- ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \
- ::boost::is_void< Lhs_noptr >::value || \
- ::boost::is_void< Rhs_noptr >::value\
- )\
- )\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
-#define BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
-
-#include <boost/type_traits/has_trivial_destructor.hpp>
-
-#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(__SUNPRO_CC) && !defined(BOOST_MSVC)
-
-#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 {
-
-template <class T> struct has_nothrow_destructor : public ::boost::has_trivial_destructor<T> {};
-
-} // namespace boost
-
-#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_POST_DECREMENT_HPP_INCLUDED
-#define BOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED
-
-#include <boost/type_traits/is_array.hpp>
-
-#define BOOST_TT_TRAIT_NAME has_post_decrement
-#define BOOST_TT_TRAIT_OP --
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* bool */\
- ::boost::is_same< bool, Lhs_nocv >::value || \
- /* void* */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_void< Lhs_noptr >::value\
- ) || \
- /* (fundamental or pointer) and const */\
- (\
- ( \
- ::boost::is_fundamental< Lhs_nocv >::value || \
- ::boost::is_pointer< Lhs_noref >::value\
- ) && \
- ::boost::is_const< Lhs_noref >::value\
- )||\
- /* Arrays */ \
- ::boost::is_array<Lhs_noref>::value\
- )
-
-
-#include <boost/type_traits/detail/has_postfix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_POST_INCREMENT_HPP_INCLUDED
-#define BOOST_TT_HAS_POST_INCREMENT_HPP_INCLUDED
-
-#include <boost/type_traits/is_array.hpp>
-
-#define BOOST_TT_TRAIT_NAME has_post_increment
-#define BOOST_TT_TRAIT_OP ++
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* bool */\
- ::boost::is_same< bool, Lhs_nocv >::value || \
- /* void* */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_void< Lhs_noptr >::value\
- ) || \
- /* (fundamental or pointer) and const */\
- (\
- ( \
- ::boost::is_fundamental< Lhs_nocv >::value || \
- ::boost::is_pointer< Lhs_noref >::value\
- ) && \
- ::boost::is_const< Lhs_noref >::value\
- )||\
- /* Arrays */ \
- ::boost::is_array<Lhs_noref>::value\
- )
-
-
-#include <boost/type_traits/detail/has_postfix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_PRE_DECREMENT_HPP_INCLUDED
-#define BOOST_TT_HAS_PRE_DECREMENT_HPP_INCLUDED
-
-#include <boost/type_traits/is_array.hpp>
-
-#define BOOST_TT_TRAIT_NAME has_pre_decrement
-#define BOOST_TT_TRAIT_OP --
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* bool */\
- ::boost::is_same< bool, Rhs_nocv >::value || \
- /* void* */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ::boost::is_void< Rhs_noptr >::value\
- ) || \
- /* (fundamental or pointer) and const */\
- (\
- ( \
- ::boost::is_fundamental< Rhs_nocv >::value || \
- ::boost::is_pointer< Rhs_noref >::value\
- ) && \
- ::boost::is_const< Rhs_noref >::value\
- )||\
- /* Arrays */ \
- ::boost::is_array<Rhs_noref>::value\
- )
-
-
-#include <boost/type_traits/detail/has_prefix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_PRE_INCREMENT_HPP_INCLUDED
-#define BOOST_TT_HAS_PRE_INCREMENT_HPP_INCLUDED
-
-#include <boost/type_traits/is_array.hpp>
-
-#define BOOST_TT_TRAIT_NAME has_pre_increment
-#define BOOST_TT_TRAIT_OP ++
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* bool */\
- ::boost::is_same< bool, Rhs_nocv >::value || \
- /* void* */\
- (\
- ::boost::is_pointer< Rhs_noref >::value && \
- ::boost::is_void< Rhs_noptr >::value\
- ) || \
- /* (fundamental or pointer) and const */\
- (\
- ( \
- ::boost::is_fundamental< Rhs_nocv >::value || \
- ::boost::is_pointer< Rhs_noref >::value\
- ) && \
- ::boost::is_const< Rhs_noref >::value\
- )||\
- /* Arrays */ \
- ::boost::is_array<Rhs_noref>::value\
- )
-
-
-#include <boost/type_traits/detail/has_prefix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_RIGHT_SHIFT_ASSIGN_HPP_INCLUDED
-#define BOOST_TT_HAS_RIGHT_SHIFT_ASSIGN_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_right_shift_assign
-#define BOOST_TT_TRAIT_OP >>=
-#define BOOST_TT_FORBIDDEN_IF\
- (\
- /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ( \
- (! ::boost::is_integral< Lhs_noref >::value ) || \
- (! ::boost::is_integral< Rhs_noref >::value )\
- )\
- )||\
- /* Lhs==fundamental and Rhs==pointer */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Rhs==fundamental and Lhs==pointer */\
- (\
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_pointer< Lhs_noref >::value\
- )||\
- /* Lhs==pointer and Rhs==pointer */\
- (\
- ::boost::is_pointer< Lhs_noref >::value && \
- ::boost::is_pointer< Rhs_noref >::value\
- )||\
- /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\
- (\
- ::boost::is_fundamental< Lhs_nocv >::value && \
- ::boost::is_fundamental< Rhs_nocv >::value && \
- ::boost::is_const< Lhs_noref >::value\
- )\
- )
-
-
-#include <boost/type_traits/detail/has_binary_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_UNARY_MINUS_HPP_INCLUDED
-#define BOOST_TT_HAS_UNARY_MINUS_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_unary_minus
-#define BOOST_TT_TRAIT_OP -
-#define BOOST_TT_FORBIDDEN_IF\
- /* pointer */\
- ::boost::is_pointer< Rhs_noref >::value
-
-
-#include <boost/type_traits/detail/has_prefix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /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_UNARY_PLUS_HPP_INCLUDED
-#define BOOST_TT_HAS_UNARY_PLUS_HPP_INCLUDED
-
-#define BOOST_TT_TRAIT_NAME has_unary_plus
-#define BOOST_TT_TRAIT_OP +
-#define BOOST_TT_FORBIDDEN_IF\
- false
-
-#include <boost/type_traits/detail/has_prefix_operator.hpp>
-
-#undef BOOST_TT_TRAIT_NAME
-#undef BOOST_TT_TRAIT_OP
-#undef BOOST_TT_FORBIDDEN_IF
-
-#endif
+++ /dev/null
-
-// (C) Copyright John Maddock 2005.
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-
-#ifndef BOOST_TT_HAS_VIRTUAL_DESTRUCTOR_HPP_INCLUDED
-#define BOOST_TT_HAS_VIRTUAL_DESTRUCTOR_HPP_INCLUDED
-
-#include <boost/type_traits/intrinsics.hpp>
-#include <boost/type_traits/integral_constant.hpp>
-
-namespace boost {
-
-#ifdef BOOST_HAS_VIRTUAL_DESTRUCTOR
- template <class T> struct has_virtual_destructor : public integral_constant<bool, BOOST_HAS_VIRTUAL_DESTRUCTOR(T)>{};
-#else
- template <class T> struct has_virtual_destructor : public integral_constant<bool, false>{};
-#endif
-
-} // namespace boost
-
-#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
+++ /dev/null
-// (C) Copyright John Maddock 2007.
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-#ifndef BOOST_TT_IS_COMPLEX_HPP
-#define BOOST_TT_IS_COMPLEX_HPP
-
-#include <complex>
-#include <boost/type_traits/integral_constant.hpp>
-
-namespace boost {
-
- template <class T> struct is_complex : public false_type {};
- template <class T> struct is_complex<const T > : public is_complex<T>{};
- template <class T> struct is_complex<volatile const T > : public is_complex<T>{};
- template <class T> struct is_complex<volatile T > : public is_complex<T>{};
- template <class T> struct is_complex<std::complex<T> > : public true_type{};
-
-} // namespace boost
-
-#endif //BOOST_TT_IS_COMPLEX_HPP
+++ /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_IS_COMPOUND_HPP_INCLUDED
-#define BOOST_TT_IS_COMPOUND_HPP_INCLUDED
-
-#include <boost/type_traits/is_fundamental.hpp>
-
-namespace boost {
-
-#if defined( __CODEGEARC__ )
- template <class T> struct is_compound : public integral_constant<bool, __is_compound(T)> {};
-#else
- template <class T> struct is_compound : public integral_constant<bool, ! ::boost::is_fundamental<T>::value> {};
-#endif
-
-} // namespace boost
-
-#endif // BOOST_TT_IS_COMPOUND_HPP_INCLUDED
+++ /dev/null
-// (C) Copyright Ion Gaztanaga 2014.
-//
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-#ifndef BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
-#define BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
-
-#include <boost/config.hpp>
-#include <boost/type_traits/detail/yes_no_type.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/noncopyable.hpp>
-
-#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_NO_CXX11_DECLTYPE) \
- && !defined(BOOST_INTEL_CXX_VERSION) && \
- !(defined(BOOST_MSVC) && _MSC_VER == 1800)
-#define BOOST_TT_CXX11_IS_COPY_ASSIGNABLE
-#include <boost/type_traits/declval.hpp>
-#else
- //For compilers without decltype
- #include <boost/type_traits/is_const.hpp>
- #include <boost/type_traits/is_array.hpp>
- #include <boost/type_traits/add_reference.hpp>
- #include <boost/type_traits/remove_reference.hpp>
-#endif
-
-namespace boost {
-
-namespace detail{
-
-template <bool DerivedFromNoncopyable, class T>
-struct is_copy_assignable_impl2 {
-
-// Intel compiler has problems with SFINAE for copy constructors and deleted functions:
-//
-// error: function *function_name* cannot be referenced -- it is a deleted function
-// static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval<T1&>()))* = 0);
-// ^
-//
-// MSVC 12.0 (Visual 2013) has problems when the copy constructor has been deleted. See:
-// https://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken
-#if defined(BOOST_TT_CXX11_IS_COPY_ASSIGNABLE)
- typedef boost::type_traits::yes_type yes_type;
- typedef boost::type_traits::no_type no_type;
-
- template <class U>
- static decltype(::boost::declval<U&>() = ::boost::declval<const U&>(), yes_type() ) test(int);
-
- template <class>
- static no_type test(...);
-
- static const bool value = sizeof(test<T>(0)) == sizeof(yes_type);
-
-#else
- static BOOST_DEDUCED_TYPENAME boost::add_reference<T>::type produce();
-
- template <class T1>
- static boost::type_traits::no_type test(T1&, typename T1::boost_move_no_copy_constructor_or_assign* = 0);
-
- static boost::type_traits::yes_type test(...);
- // If you see errors like this:
- //
- // `'T::operator=(const T&)' is private`
- // `boost/type_traits/is_copy_assignable.hpp:NN:M: error: within this context`
- //
- // then you are trying to call that macro for a structure defined like that:
- //
- // struct T {
- // ...
- // private:
- // T & operator=(const T &);
- // ...
- // };
- //
- // To fix that you must modify your structure:
- //
- // // C++03 and C++11 version
- // struct T: private boost::noncopyable {
- // ...
- // private:
- // T & operator=(const T &);
- // ...
- // };
- //
- // // C++11 version
- // struct T {
- // ...
- // private:
- // T& operator=(const T &) = delete;
- // ...
- // };
- BOOST_STATIC_CONSTANT(bool, value = (
- sizeof(test(produce())) == sizeof(boost::type_traits::yes_type)
- ));
- #endif
-};
-
-template <class T>
-struct is_copy_assignable_impl2<true, T> {
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-template <class T>
-struct is_copy_assignable_impl {
-
-#if !defined(BOOST_TT_CXX11_IS_COPY_ASSIGNABLE)
- //For compilers without decltype, at least return false on const types, arrays
- //types derived from boost::noncopyable and types defined as BOOST_MOVEABLE_BUT_NOT_COPYABLE
- typedef BOOST_DEDUCED_TYPENAME boost::remove_reference<T>::type unreferenced_t;
- BOOST_STATIC_CONSTANT(bool, value = (
- boost::detail::is_copy_assignable_impl2<
- boost::is_base_and_derived<boost::noncopyable, T>::value
- || boost::is_const<unreferenced_t>::value || boost::is_array<unreferenced_t>::value
- ,T
- >::value
- ));
- #else
- BOOST_STATIC_CONSTANT(bool, value = (
- boost::detail::is_copy_assignable_impl2<
- boost::is_base_and_derived<boost::noncopyable, T>::value,T
- >::value
- ));
- #endif
-};
-
-} // namespace detail
-
-template <class T> struct is_copy_assignable : public integral_constant<bool, ::boost::detail::is_copy_assignable_impl<T>::value>{};
-template <> struct is_copy_assignable<void> : public false_type{};
-#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-template <> struct is_copy_assignable<void const> : public false_type{};
-template <> struct is_copy_assignable<void const volatile> : public false_type{};
-template <> struct is_copy_assignable<void volatile> : public false_type{};
-#endif
-
-} // namespace boost
-
-#endif // BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED
+++ /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
+++ /dev/null
-
-// (C) Copyright John Maddock 2005.
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-
-#ifndef BOOST_TT_IS_MEMBER_OBJECT_POINTER_HPP_INCLUDED
-#define BOOST_TT_IS_MEMBER_OBJECT_POINTER_HPP_INCLUDED
-
-#include <boost/type_traits/is_member_pointer.hpp>
-#include <boost/type_traits/is_member_function_pointer.hpp>
-
-namespace boost {
-
-template <class T> struct is_member_object_pointer
- : public integral_constant<bool,
- ::boost::is_member_pointer<T>::value && !::boost::is_member_function_pointer<T>::value>{};
-
-} // namespace boost
-
-#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
+++ /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_IS_OBJECT_HPP_INCLUDED
-#define BOOST_TT_IS_OBJECT_HPP_INCLUDED
-
-#include <boost/config.hpp>
-#include <boost/type_traits/is_reference.hpp>
-#include <boost/type_traits/is_void.hpp>
-#include <boost/type_traits/is_function.hpp>
-
-namespace boost {
-
-template <class T> struct is_object
- : public
- integral_constant<
- bool,
- ! ::boost::is_reference<T>::value && ! ::boost::is_void<T>::value && ! ::boost::is_function<T>::value >
-{};
-
-} // namespace boost
-
-#endif // BOOST_TT_IS_OBJECT_HPP_INCLUDED
+++ /dev/null
-// (C) Copyright Daniel Frey and Robert Ramey 2009.
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-#ifndef BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED
-#define BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED
-
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/type_traits/is_same.hpp>
-
-namespace boost {
-namespace detail {
-
-
-#ifdef BOOST_MSVC
-#pragma warning( push )
-#pragma warning( disable : 4584 4250)
-#elif defined(__GNUC__) && (__GNUC__ >= 4)
-#pragma GCC system_header
-#endif
-
-template<typename Base, typename Derived, typename tag>
-struct is_virtual_base_of_impl
-{
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-template<typename Base, typename Derived>
-struct is_virtual_base_of_impl<Base, Derived, true_type>
-{
- union max_align
- {
- unsigned u;
- unsigned long ul;
- void* v;
- double d;
- long double ld;
-#ifndef BOOST_NO_LONG_LONG
- long long ll;
-#endif
- };
-#ifdef __BORLANDC__
- struct boost_type_traits_internal_struct_X : public virtual Derived, public virtual Base
- {
- boost_type_traits_internal_struct_X();
- boost_type_traits_internal_struct_X(const boost_type_traits_internal_struct_X&);
- boost_type_traits_internal_struct_X& operator=(const boost_type_traits_internal_struct_X&);
- ~boost_type_traits_internal_struct_X()throw();
- max_align data[4];
- };
- struct boost_type_traits_internal_struct_Y : public virtual Derived
- {
- boost_type_traits_internal_struct_Y();
- boost_type_traits_internal_struct_Y(const boost_type_traits_internal_struct_Y&);
- boost_type_traits_internal_struct_Y& operator=(const boost_type_traits_internal_struct_Y&);
- ~boost_type_traits_internal_struct_Y()throw();
- max_align data[4];
- };
-#else
- struct boost_type_traits_internal_struct_X : public Derived, virtual Base
- {
- boost_type_traits_internal_struct_X();
- boost_type_traits_internal_struct_X(const boost_type_traits_internal_struct_X&);
- boost_type_traits_internal_struct_X& operator=(const boost_type_traits_internal_struct_X&);
- ~boost_type_traits_internal_struct_X()throw();
- max_align data[16];
- };
- struct boost_type_traits_internal_struct_Y : public Derived
- {
- boost_type_traits_internal_struct_Y();
- boost_type_traits_internal_struct_Y(const boost_type_traits_internal_struct_Y&);
- boost_type_traits_internal_struct_Y& operator=(const boost_type_traits_internal_struct_Y&);
- ~boost_type_traits_internal_struct_Y()throw();
- max_align data[16];
- };
-#endif
- BOOST_STATIC_CONSTANT(bool, value = (sizeof(boost_type_traits_internal_struct_X)==sizeof(boost_type_traits_internal_struct_Y)));
-};
-
-template<typename Base, typename Derived>
-struct is_virtual_base_of_impl2
-{
- typedef boost::integral_constant<bool, (boost::is_base_of<Base, Derived>::value && ! boost::is_same<Base, Derived>::value)> tag_type;
- typedef is_virtual_base_of_impl<Base, Derived, tag_type> imp;
- BOOST_STATIC_CONSTANT(bool, value = imp::value);
-};
-
-#ifdef BOOST_MSVC
-#pragma warning( pop )
-#endif
-
-} // namespace detail
-
-template <class Base, class Derived> struct is_virtual_base_of : public integral_constant<bool, (::boost::detail::is_virtual_base_of_impl2<Base, Derived>::value)>{};
-
-template <class Base, class Derived> struct is_virtual_base_of<Base&, Derived> : public false_type{};
-template <class Base, class Derived> struct is_virtual_base_of<Base, Derived&> : public false_type{};
-template <class Base, class Derived> struct is_virtual_base_of<Base&, Derived&> : public false_type{};
-
-} // namespace boost
-
-#endif
+++ /dev/null
-// Copyright 2005 Alexander Nasonov.
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef FILE_boost_type_traits_promote_hpp_INCLUDED
-#define FILE_boost_type_traits_promote_hpp_INCLUDED
-
-#include <boost/config.hpp>
-#include <boost/type_traits/integral_promotion.hpp>
-#include <boost/type_traits/floating_point_promotion.hpp>
-
-namespace boost {
-
-template<class T> struct promote : public integral_promotion<typename floating_point_promotion<T>::type>{};
-
-}
-
-#endif // #ifndef FILE_boost_type_traits_promote_hpp_INCLUDED
-
+++ /dev/null
-
-// (C) Copyright John Maddock 2005.
-// Use, modification and distribution are subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt).
-//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-
-
-#ifndef BOOST_TT_RANK_HPP_INCLUDED
-#define BOOST_TT_RANK_HPP_INCLUDED
-
-#include <boost/type_traits/integral_constant.hpp>
-
-namespace boost {
-
-#if !defined( __CODEGEARC__ )
-
-namespace detail{
-
-template <class T, std::size_t N>
-struct rank_imp
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = N);
-};
-#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
-template <class T, std::size_t R, std::size_t N>
-struct rank_imp<T[R], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
-};
-
-template <class T, std::size_t R, std::size_t N>
-struct rank_imp<T const[R], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
-};
-
-template <class T, std::size_t R, std::size_t N>
-struct rank_imp<T volatile[R], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
-};
-
-template <class T, std::size_t R, std::size_t N>
-struct rank_imp<T const volatile[R], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
-};
-
-#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
-template <class T, std::size_t N>
-struct rank_imp<T[], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
-};
-template <class T, std::size_t N>
-struct rank_imp<T const[], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
-};
-template <class T, std::size_t N>
-struct rank_imp<T volatile[], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
-};
-template <class T, std::size_t N>
-struct rank_imp<T const volatile[], N>
-{
- BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::rank_imp<T, N+1>::value));
-};
-#endif
-#endif
-}
-
-#endif // !defined( __CODEGEARC__ )
-
-#if defined( __CODEGEARC__ )
-template <class T> struct rank : public integral_constant<std::size_t, __array_rank(T)>{};
-#else
-template <class T> struct rank : public integral_constant<std::size_t, (::boost::detail::rank_imp<T, 0>::value)>{};
-#endif
-
-} // namespace boost
-
-#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
+++ /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
--- /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/type_traits/declval.hpp>
+
+#endif // BOOST_UTILITY_DECLVAL_HPP
--- /dev/null
+// Boost result_of library
+
+// Copyright Douglas Gregor 2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Copyright Daniel Walker, Eric Niebler, Michel Morin 2008-2012.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org/libs/utility
+#if !defined(BOOST_PP_IS_ITERATING)
+# error Boost result_of - do not include this file!
+#endif
+
+// CWPro8 requires an argument in a function type specialization
+#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3002)) && BOOST_PP_ITERATION() == 0
+# define BOOST_RESULT_OF_ARGS void
+#else
+# define BOOST_RESULT_OF_ARGS BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)
+#endif
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of<F(BOOST_RESULT_OF_ARGS)>
+ : mpl::if_<
+ mpl::or_< is_pointer<F>, is_member_function_pointer<F> >
+ , boost::detail::tr1_result_of_impl<
+ typename remove_cv<F>::type,
+ typename remove_cv<F>::type(BOOST_RESULT_OF_ARGS),
+ (boost::detail::has_result_type<F>::value)>
+ , boost::detail::tr1_result_of_impl<
+ F,
+ F(BOOST_RESULT_OF_ARGS),
+ (boost::detail::has_result_type<F>::value)> >::type { };
+#endif
+
+#ifdef BOOST_RESULT_OF_USE_DECLTYPE
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct result_of<F(BOOST_RESULT_OF_ARGS)>
+ : detail::cpp0x_result_of<F(BOOST_RESULT_OF_ARGS)> { };
+#endif // BOOST_RESULT_OF_USE_DECLTYPE
+
+#ifdef BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct result_of<F(BOOST_RESULT_OF_ARGS)>
+ : mpl::if_<mpl::or_<detail::has_result_type<F>, detail::has_result<F> >,
+ tr1_result_of<F(BOOST_RESULT_OF_ARGS)>,
+ detail::cpp0x_result_of<F(BOOST_RESULT_OF_ARGS)> >::type { };
+#endif // BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK
+
+#if defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK)
+
+namespace detail {
+
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct cpp0x_result_of<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))>
+ : mpl::if_<
+ is_member_function_pointer<F>
+ , detail::tr1_result_of_impl<
+ typename remove_cv<F>::type,
+ typename remove_cv<F>::type(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), false
+ >
+ , detail::cpp0x_result_of_impl<
+ F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))
+ >
+ >::type
+{};
+
+#ifdef BOOST_NO_SFINAE_EXPR
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION());
+
+template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename T)>
+struct BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<R(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T))> {
+ R operator()(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T)) const;
+ typedef result_of_private_type const &(*pfn_t)(...);
+ operator pfn_t() const volatile;
+};
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION());
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F *>
+ : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F>
+{};
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F &>
+ : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F>
+{};
+
+template<typename F>
+struct BOOST_PP_CAT(result_of_select_call_wrapper_type_, BOOST_PP_ITERATION())
+ : mpl::eval_if<
+ is_class<typename remove_reference<F>::type>,
+ result_of_wrap_callable_class<F>,
+ mpl::identity<BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<typename remove_cv<F>::type> >
+ >
+{};
+
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename T)>
+struct BOOST_PP_CAT(result_of_is_callable_, BOOST_PP_ITERATION()) {
+ typedef typename BOOST_PP_CAT(result_of_select_call_wrapper_type_, BOOST_PP_ITERATION())<F>::type wrapper_t;
+ static const bool value = (
+ sizeof(result_of_no_type) == sizeof(detail::result_of_is_private_type(
+ (boost::declval<wrapper_t>()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), boost::declval<T, >() BOOST_PP_INTERCEPT)), result_of_weird_type())
+ ))
+ );
+ typedef mpl::bool_<value> type;
+};
+
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), true>
+ : lazy_enable_if<
+ BOOST_PP_CAT(result_of_is_callable_, BOOST_PP_ITERATION())<F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), T)>
+ , cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), false>
+ >
+{};
+
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), false>
+{
+ typedef decltype(
+ boost::declval<F>()(
+ BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), boost::declval<T, >() BOOST_PP_INTERCEPT)
+ )
+ ) type;
+};
+
+#else // BOOST_NO_SFINAE_EXPR
+
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)),
+ typename result_of_always_void<decltype(
+ boost::declval<F>()(
+ BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), boost::declval<T, >() BOOST_PP_INTERCEPT)
+ )
+ )>::type> {
+ typedef decltype(
+ boost::declval<F>()(
+ BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), boost::declval<T, >() BOOST_PP_INTERCEPT)
+ )
+ ) type;
+};
+
+#endif // BOOST_NO_SFINAE_EXPR
+
+} // namespace detail
+
+#else // defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK)
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct result_of<F(BOOST_RESULT_OF_ARGS)>
+ : tr1_result_of<F(BOOST_RESULT_OF_ARGS)> { };
+#endif
+
+#endif // defined(BOOST_RESULT_OF_USE_DECLTYPE)
+
+#undef BOOST_RESULT_OF_ARGS
+
+#if BOOST_PP_ITERATION() >= 1
+
+namespace detail {
+
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
+{
+ typedef R type;
+};
+
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (&)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
+{
+ typedef R type;
+};
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (T0::*)
+ (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)),
+ FArgs, false>
+{
+ typedef R type;
+};
+
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (T0::*)
+ (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
+ const,
+ FArgs, false>
+{
+ typedef R type;
+};
+
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (T0::*)
+ (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
+ volatile,
+ FArgs, false>
+{
+ typedef R type;
+};
+
+template<typename R, typename FArgs BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
+struct tr1_result_of_impl<R (T0::*)
+ (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
+ const volatile,
+ FArgs, false>
+{
+ typedef R type;
+};
+#endif
+
+}
+#endif
--- /dev/null
+// Boost result_of library
+
+// Copyright Douglas Gregor 2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org/libs/utility
+#ifndef BOOST_RESULT_OF_HPP
+#define BOOST_RESULT_OF_HPP
+
+#include <boost/config.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
+#include <boost/preprocessor/facilities/intercept.hpp>
+#include <boost/detail/workaround.hpp>
+#include <boost/mpl/has_xxx.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_member_function_pointer.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/utility/declval.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#ifndef BOOST_RESULT_OF_NUM_ARGS
+# define BOOST_RESULT_OF_NUM_ARGS 16
+#endif
+
+// Use the decltype-based version of result_of by default if the compiler
+// supports N3276 <http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2011/n3276.pdf>.
+// The user can force the choice by defining BOOST_RESULT_OF_USE_DECLTYPE,
+// BOOST_RESULT_OF_USE_TR1, or BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK but not more than one!
+#if (defined(BOOST_RESULT_OF_USE_DECLTYPE) && defined(BOOST_RESULT_OF_USE_TR1)) || \
+ (defined(BOOST_RESULT_OF_USE_DECLTYPE) && defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK)) || \
+ (defined(BOOST_RESULT_OF_USE_TR1) && defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK))
+# error More than one of BOOST_RESULT_OF_USE_DECLTYPE, BOOST_RESULT_OF_USE_TR1 and \
+ BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK cannot be defined at the same time.
+#endif
+
+#if defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) && defined(BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE)
+# error Cannot fallback to decltype if BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE is not defined.
+#endif
+
+#ifndef BOOST_RESULT_OF_USE_TR1
+# ifndef BOOST_RESULT_OF_USE_DECLTYPE
+# ifndef BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK
+# ifndef BOOST_NO_CXX11_DECLTYPE_N3276 // this implies !defined(BOOST_NO_CXX11_DECLTYPE)
+# define BOOST_RESULT_OF_USE_DECLTYPE
+# else
+# define BOOST_RESULT_OF_USE_TR1
+# endif
+# endif
+# endif
+#endif
+
+namespace boost {
+
+template<typename F> struct result_of;
+template<typename F> struct tr1_result_of; // a TR1-style implementation of result_of
+
+#if !defined(BOOST_NO_SFINAE)
+namespace detail {
+
+BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
+
+// Work around a nvcc bug by only defining has_result when it's needed.
+#ifdef BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK
+BOOST_MPL_HAS_XXX_TEMPLATE_DEF(result)
+#endif
+
+template<typename F, typename FArgs, bool HasResultType> struct tr1_result_of_impl;
+
+template<typename F> struct cpp0x_result_of;
+
+#ifdef BOOST_NO_SFINAE_EXPR
+
+// There doesn't seem to be any other way to turn this off such that the presence of
+// the user-defined operator,() below doesn't cause spurious warning all over the place,
+// so unconditionally turn it off.
+#if BOOST_MSVC
+# pragma warning(disable: 4913) // user defined binary operator ',' exists but no overload could convert all operands, default built-in binary operator ',' used
+#endif
+
+struct result_of_private_type {};
+
+struct result_of_weird_type {
+ friend result_of_private_type operator,(result_of_private_type, result_of_weird_type);
+};
+
+typedef char result_of_yes_type; // sizeof(result_of_yes_type) == 1
+typedef char (&result_of_no_type)[2]; // sizeof(result_of_no_type) == 2
+
+template<typename T>
+result_of_no_type result_of_is_private_type(T const &);
+result_of_yes_type result_of_is_private_type(result_of_private_type);
+
+template<typename C>
+struct result_of_callable_class : C {
+ result_of_callable_class();
+ typedef result_of_private_type const &(*pfn_t)(...);
+ operator pfn_t() const volatile;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class {
+ typedef result_of_callable_class<C> type;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class<C const> {
+ typedef result_of_callable_class<C> const type;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class<C volatile> {
+ typedef result_of_callable_class<C> volatile type;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class<C const volatile> {
+ typedef result_of_callable_class<C> const volatile type;
+};
+
+template<typename C>
+struct result_of_wrap_callable_class<C &> {
+ typedef typename result_of_wrap_callable_class<C>::type &type;
+};
+
+template<typename F, bool TestCallability = true> struct cpp0x_result_of_impl;
+
+#else // BOOST_NO_SFINAE_EXPR
+
+template<typename T>
+struct result_of_always_void
+{
+ typedef void type;
+};
+
+template<typename F, typename Enable = void> struct cpp0x_result_of_impl {};
+
+#endif // BOOST_NO_SFINAE_EXPR
+
+template<typename F>
+struct result_of_void_impl
+{
+ typedef void type;
+};
+
+template<typename R>
+struct result_of_void_impl<R (*)(void)>
+{
+ typedef R type;
+};
+
+template<typename R>
+struct result_of_void_impl<R (&)(void)>
+{
+ typedef R type;
+};
+
+// Determine the return type of a function pointer or pointer to member.
+template<typename F, typename FArgs>
+struct result_of_pointer
+ : tr1_result_of_impl<typename remove_cv<F>::type, FArgs, false> { };
+
+template<typename F, typename FArgs>
+struct tr1_result_of_impl<F, FArgs, true>
+{
+ typedef typename F::result_type type;
+};
+
+template<typename FArgs>
+struct is_function_with_no_args : mpl::false_ {};
+
+template<typename F>
+struct is_function_with_no_args<F(void)> : mpl::true_ {};
+
+template<typename F, typename FArgs>
+struct result_of_nested_result : F::template result<FArgs>
+{};
+
+template<typename F, typename FArgs>
+struct tr1_result_of_impl<F, FArgs, false>
+ : mpl::if_<is_function_with_no_args<FArgs>,
+ result_of_void_impl<F>,
+ result_of_nested_result<F, FArgs> >::type
+{};
+
+} // end namespace detail
+
+#define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_RESULT_OF_NUM_ARGS,<boost/utility/detail/result_of_iterate.hpp>))
+#include BOOST_PP_ITERATE()
+
+#else
+# define BOOST_NO_RESULT_OF 1
+#endif
+
+}
+
+#endif // BOOST_RESULT_OF_HPP
--- /dev/null
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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_UTILITY_SWAP_HPP
+#define BOOST_UTILITY_SWAP_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/swap.hpp instead.
+
+#include <boost/core/swap.hpp>
+
+#endif
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/apply_visitor.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_APPLY_VISITOR_HPP
+#define BOOST_VARIANT_APPLY_VISITOR_HPP
+
+#include "boost/variant/detail/apply_visitor_unary.hpp"
+#include "boost/variant/detail/apply_visitor_binary.hpp"
+#include "boost/variant/detail/apply_visitor_delayed.hpp"
+
+#endif // BOOST_VARIANT_APPLY_VISITOR_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/apply_visitor_binary.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002-2003 Eric Friedman
+// Copyright (c) 2014 Antony Polukhin
+//
+// 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_VARIANT_DETAIL_APPLY_VISITOR_BINARY_HPP
+#define BOOST_VARIANT_DETAIL_APPLY_VISITOR_BINARY_HPP
+
+#include "boost/config.hpp"
+#include "boost/detail/workaround.hpp"
+#include "boost/variant/detail/generic_result_type.hpp"
+
+#include "boost/variant/detail/apply_visitor_unary.hpp"
+
+#if BOOST_WORKAROUND(__EDG__, BOOST_TESTED_AT(302))
+#include "boost/utility/enable_if.hpp"
+#include "boost/mpl/not.hpp"
+#include "boost/type_traits/is_const.hpp"
+#endif
+
+
+#if !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
+# include "boost/variant/detail/has_result_type.hpp"
+#endif
+
+namespace boost {
+
+//////////////////////////////////////////////////////////////////////////
+// function template apply_visitor(visitor, visitable1, visitable2)
+//
+// Visits visitable1 and visitable2 such that their values (which we
+// shall call x and y, respectively) are used as arguments in the
+// expression visitor(x, y).
+//
+
+namespace detail { namespace variant {
+
+template <typename Visitor, typename Value1>
+class apply_visitor_binary_invoke
+{
+public: // visitor typedefs
+
+ typedef typename Visitor::result_type
+ result_type;
+
+private: // representation
+
+ Visitor& visitor_;
+ Value1& value1_;
+
+public: // structors
+
+ apply_visitor_binary_invoke(Visitor& visitor, Value1& value1) BOOST_NOEXCEPT
+ : visitor_(visitor)
+ , value1_(value1)
+ {
+ }
+
+public: // visitor interfaces
+
+ template <typename Value2>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ operator()(Value2& value2)
+ {
+ return visitor_(value1_, value2);
+ }
+
+private:
+ apply_visitor_binary_invoke& operator=(const apply_visitor_binary_invoke&);
+};
+
+template <typename Visitor, typename Visitable2>
+class apply_visitor_binary_unwrap
+{
+public: // visitor typedefs
+
+ typedef typename Visitor::result_type
+ result_type;
+
+private: // representation
+
+ Visitor& visitor_;
+ Visitable2& visitable2_;
+
+public: // structors
+
+ apply_visitor_binary_unwrap(Visitor& visitor, Visitable2& visitable2) BOOST_NOEXCEPT
+ : visitor_(visitor)
+ , visitable2_(visitable2)
+ {
+ }
+
+public: // visitor interfaces
+
+ template <typename Value1>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ operator()(Value1& value1)
+ {
+ apply_visitor_binary_invoke<
+ Visitor
+ , Value1
+ > invoker(visitor_, value1);
+
+ return boost::apply_visitor(invoker, visitable2_);
+ }
+
+private:
+ apply_visitor_binary_unwrap& operator=(const apply_visitor_binary_unwrap&);
+
+};
+
+}} // namespace detail::variant
+
+//
+// nonconst-visitor version:
+//
+
+#if !BOOST_WORKAROUND(__EDG__, BOOST_TESTED_AT(302))
+
+# define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \
+ /**/
+
+#else // EDG-based compilers
+
+# define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \
+ typename enable_if< \
+ mpl::not_< is_const< V > > \
+ , BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \
+ >::type \
+ /**/
+
+#endif // EDG-based compilers workaround
+
+template <typename Visitor, typename Visitable1, typename Visitable2>
+inline
+ BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(Visitor)
+apply_visitor(
+ Visitor& visitor
+ , Visitable1& visitable1, Visitable2& visitable2
+ )
+{
+ ::boost::detail::variant::apply_visitor_binary_unwrap<
+ Visitor, Visitable2
+ > unwrapper(visitor, visitable2);
+
+ return boost::apply_visitor(unwrapper, visitable1);
+}
+
+#undef BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE
+
+//
+// const-visitor version:
+//
+
+template <typename Visitor, typename Visitable1, typename Visitable2>
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(
+ typename Visitor::result_type
+ )
+apply_visitor(
+ const Visitor& visitor
+ , Visitable1& visitable1, Visitable2& visitable2
+ )
+{
+ ::boost::detail::variant::apply_visitor_binary_unwrap<
+ const Visitor, Visitable2
+ > unwrapper(visitor, visitable2);
+
+ return boost::apply_visitor(unwrapper, visitable1);
+}
+
+
+#if !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
+
+//////////////////////////////////////////////////////////////////////////
+// function template apply_visitor(visitor, visitable1, visitable2)
+//
+// C++14 part.
+//
+
+namespace detail { namespace variant {
+
+template <typename Visitor, typename Value1>
+class apply_visitor_binary_invoke_cpp14
+{
+ Visitor& visitor_;
+ Value1& value1_;
+
+public: // structors
+
+ apply_visitor_binary_invoke_cpp14(Visitor& visitor, Value1& value1) BOOST_NOEXCEPT
+ : visitor_(visitor)
+ , value1_(value1)
+ {
+ }
+
+public: // visitor interfaces
+
+ template <typename Value2>
+ decltype(auto) operator()(Value2& value2)
+ {
+ return visitor_(value1_, value2);
+ }
+
+private:
+ apply_visitor_binary_invoke_cpp14& operator=(const apply_visitor_binary_invoke_cpp14&);
+};
+
+template <typename Visitor, typename Visitable2>
+class apply_visitor_binary_unwrap_cpp14
+{
+ Visitor& visitor_;
+ Visitable2& visitable2_;
+
+public: // structors
+
+ apply_visitor_binary_unwrap_cpp14(Visitor& visitor, Visitable2& visitable2) BOOST_NOEXCEPT
+ : visitor_(visitor)
+ , visitable2_(visitable2)
+ {
+ }
+
+public: // visitor interfaces
+
+ template <typename Value1>
+ decltype(auto) operator()(Value1& value1)
+ {
+ apply_visitor_binary_invoke_cpp14<
+ Visitor
+ , Value1
+ > invoker(visitor_, value1);
+
+ return boost::apply_visitor(invoker, visitable2_);
+ }
+
+private:
+ apply_visitor_binary_unwrap_cpp14& operator=(const apply_visitor_binary_unwrap_cpp14&);
+};
+
+}} // namespace detail::variant
+
+template <typename Visitor, typename Visitable1, typename Visitable2>
+inline decltype(auto) apply_visitor(Visitor& visitor, Visitable1& visitable1, Visitable2& visitable2,
+ typename boost::disable_if<
+ boost::detail::variant::has_result_type<Visitor>
+ >::type* = 0)
+{
+ ::boost::detail::variant::apply_visitor_binary_unwrap_cpp14<
+ Visitor, Visitable2
+ > unwrapper(visitor, visitable2);
+
+ return boost::apply_visitor(unwrapper, visitable1);
+}
+
+template <typename Visitor, typename Visitable1, typename Visitable2>
+inline decltype(auto) apply_visitor(const Visitor& visitor, Visitable1& visitable1, Visitable2& visitable2,
+ typename boost::disable_if<
+ boost::detail::variant::has_result_type<Visitor>
+ >::type* = 0)
+{
+ ::boost::detail::variant::apply_visitor_binary_unwrap_cpp14<
+ const Visitor, Visitable2
+ > unwrapper(visitor, visitable2);
+
+ return boost::apply_visitor(unwrapper, visitable1);
+}
+
+#endif // !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
+
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_APPLY_VISITOR_BINARY_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/apply_visitor_delayed.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002-2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_DETAIL_APPLY_VISITOR_DELAYED_HPP
+#define BOOST_VARIANT_DETAIL_APPLY_VISITOR_DELAYED_HPP
+
+#include "boost/variant/detail/generic_result_type.hpp"
+
+#include "boost/variant/detail/apply_visitor_unary.hpp"
+#include "boost/variant/detail/apply_visitor_binary.hpp"
+#include "boost/variant/variant_fwd.hpp" // for BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
+
+
+#include "boost/variant/detail/has_result_type.hpp"
+#include <boost/core/enable_if.hpp>
+
+namespace boost {
+
+//////////////////////////////////////////////////////////////////////////
+// function template apply_visitor(visitor)
+//
+// Returns a function object, overloaded for unary and binary usage, that
+// visits its arguments using visitor (or a copy of visitor) via
+// * apply_visitor( visitor, [argument] )
+// under unary invocation, or
+// * apply_visitor( visitor, [argument1], [argument2] )
+// under binary invocation.
+//
+// NOTE: Unlike other apply_visitor forms, the visitor object must be
+// non-const; this prevents user from giving temporary, to disastrous
+// effect (i.e., returned function object would have dead reference).
+//
+
+template <typename Visitor>
+class apply_visitor_delayed_t
+{
+public: // visitor typedefs
+
+ typedef typename Visitor::result_type
+ result_type;
+
+private: // representation
+
+ Visitor& visitor_;
+
+public: // structors
+
+ explicit apply_visitor_delayed_t(Visitor& visitor) BOOST_NOEXCEPT
+ : visitor_(visitor)
+ {
+ }
+
+#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+public: // N-ary visitor interface
+ template <typename... Visitables>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ operator()(Visitables&... visitables) const
+ {
+ return apply_visitor(visitor_, visitables...);
+ }
+
+#else // !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+public: // unary visitor interface
+
+ template <typename Visitable>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ operator()(Visitable& visitable) const
+ {
+ return apply_visitor(visitor_, visitable);
+ }
+
+public: // binary visitor interface
+
+ template <typename Visitable1, typename Visitable2>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ operator()(Visitable1& visitable1, Visitable2& visitable2) const
+ {
+ return apply_visitor(visitor_, visitable1, visitable2);
+ }
+
+#endif // !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+private:
+ apply_visitor_delayed_t& operator=(const apply_visitor_delayed_t&);
+
+};
+
+template <typename Visitor>
+inline typename boost::enable_if<
+ boost::detail::variant::has_result_type<Visitor>,
+ apply_visitor_delayed_t<Visitor>
+ >::type apply_visitor(Visitor& visitor)
+{
+ return apply_visitor_delayed_t<Visitor>(visitor);
+}
+
+#if !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276) \
+ && !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+template <typename Visitor>
+class apply_visitor_delayed_cpp14_t
+{
+private: // representation
+ Visitor& visitor_;
+
+public: // structors
+
+ explicit apply_visitor_delayed_cpp14_t(Visitor& visitor) BOOST_NOEXCEPT
+ : visitor_(visitor)
+ {
+ }
+
+public: // N-ary visitor interface
+ template <typename... Visitables>
+ decltype(auto) operator()(Visitables&... visitables) const
+ {
+ return apply_visitor(visitor_, visitables...);
+ }
+
+private:
+ apply_visitor_delayed_cpp14_t& operator=(const apply_visitor_delayed_cpp14_t&);
+
+};
+
+template <typename Visitor>
+inline typename boost::disable_if<
+ boost::detail::variant::has_result_type<Visitor>,
+ apply_visitor_delayed_cpp14_t<Visitor>
+ >::type apply_visitor(Visitor& visitor)
+{
+ return apply_visitor_delayed_cpp14_t<Visitor>(visitor);
+}
+
+#endif // !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
+ // && !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_APPLY_VISITOR_DELAYED_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/apply_visitor_unary.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002-2003 Eric Friedman
+// Copyright (c) 2014 Antony Polukhin
+//
+// 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_VARIANT_DETAIL_APPLY_VISITOR_UNARY_HPP
+#define BOOST_VARIANT_DETAIL_APPLY_VISITOR_UNARY_HPP
+
+#include "boost/config.hpp"
+#include "boost/detail/workaround.hpp"
+#include "boost/variant/detail/generic_result_type.hpp"
+
+#if BOOST_WORKAROUND(__EDG__, BOOST_TESTED_AT(302))
+#include "boost/core/enable_if.hpp"
+#include "boost/mpl/not.hpp"
+#include "boost/type_traits/is_const.hpp"
+#endif
+
+#if !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
+# include <boost/mpl/distance.hpp>
+# include <boost/mpl/advance.hpp>
+# include <boost/mpl/deref.hpp>
+# include <boost/mpl/size.hpp>
+# include <boost/utility/declval.hpp>
+# include <boost/core/enable_if.hpp>
+# include "boost/variant/detail/has_result_type.hpp"
+#endif
+
+namespace boost {
+
+//////////////////////////////////////////////////////////////////////////
+// function template apply_visitor(visitor, visitable)
+//
+// Visits visitable with visitor.
+//
+
+//
+// nonconst-visitor version:
+//
+
+#if !BOOST_WORKAROUND(__EDG__, BOOST_TESTED_AT(302))
+
+# define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \
+ /**/
+
+#else // EDG-based compilers
+
+# define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \
+ typename enable_if< \
+ mpl::not_< is_const< V > > \
+ , BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \
+ >::type \
+ /**/
+
+#endif // EDG-based compilers workaround
+
+template <typename Visitor, typename Visitable>
+inline
+ BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(Visitor)
+apply_visitor(Visitor& visitor, Visitable& visitable)
+{
+ return visitable.apply_visitor(visitor);
+}
+
+#undef BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE
+
+//
+// const-visitor version:
+//
+
+template <typename Visitor, typename Visitable>
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+apply_visitor(const Visitor& visitor, Visitable& visitable)
+{
+ return visitable.apply_visitor(visitor);
+}
+
+
+#if !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
+
+// C++14
+namespace detail { namespace variant {
+
+// This class serves only metaprogramming purposes. none of its methods must be called at runtime!
+template <class Visitor, class Variant>
+struct result_multideduce1 {
+ typedef typename Variant::types types;
+ typedef typename boost::mpl::begin<types>::type begin_it;
+ typedef typename boost::mpl::advance<
+ begin_it, boost::mpl::int_<boost::mpl::size<types>::type::value - 1>
+ >::type last_it;
+
+ // For metaprogramming purposes ONLY! Do not use this method (and class) at runtime!
+ static Visitor& vis() BOOST_NOEXCEPT {
+ // Functions that work with lambdas must be defined in same translation unit.
+ // Because of that, we can not use `boost::decval<Visitor&>()` here.
+ Visitor&(*f)() = 0; // pointer to function
+ return f();
+ }
+
+ static decltype(auto) deduce_impl(last_it, unsigned /*helper*/) {
+ typedef typename boost::mpl::deref<last_it>::type value_t;
+ return vis()( boost::declval< value_t& >() );
+ }
+
+ template <class It>
+ static decltype(auto) deduce_impl(It, unsigned helper) {
+ typedef typename boost::mpl::next<It>::type next_t;
+ typedef typename boost::mpl::deref<It>::type value_t;
+ if (helper == boost::mpl::distance<begin_it, It>::type::value) {
+ return deduce_impl(next_t(), ++helper);
+ }
+
+ return vis()( boost::declval< value_t& >() );
+ }
+
+ static decltype(auto) deduce() {
+ return deduce_impl(begin_it(), 0);
+ }
+};
+
+template <class Visitor, class Variant>
+struct result_wrapper1
+{
+ typedef decltype(result_multideduce1<Visitor, Variant>::deduce()) result_type;
+
+ Visitor& visitor_;
+ explicit result_wrapper1(Visitor& visitor) BOOST_NOEXCEPT
+ : visitor_(visitor)
+ {}
+
+ template <class T>
+ result_type operator()(T& val) const {
+ return visitor_(val);
+ }
+};
+
+}} // namespace detail::variant
+
+template <typename Visitor, typename Visitable>
+inline decltype(auto) apply_visitor(Visitor& visitor, Visitable& visitable,
+ typename boost::disable_if<
+ boost::detail::variant::has_result_type<Visitor>
+ >::type* = 0)
+{
+ boost::detail::variant::result_wrapper1<Visitor, Visitable> cpp14_vis(visitor);
+ return visitable.apply_visitor(cpp14_vis);
+}
+
+template <typename Visitor, typename Visitable>
+inline decltype(auto) apply_visitor(const Visitor& visitor, Visitable& visitable,
+ typename boost::disable_if<
+ boost::detail::variant::has_result_type<Visitor>
+ >::type* = 0)
+{
+ boost::detail::variant::result_wrapper1<const Visitor, Visitable> cpp14_vis(visitor);
+ return visitable.apply_visitor(cpp14_vis);
+}
+
+#endif // !defined(BOOST_NO_CXX14_DECLTYPE_AUTO) && !defined(BOOST_NO_CXX11_DECLTYPE_N3276)
+
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_APPLY_VISITOR_UNARY_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/backup_holder.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_DETAIL_BACKUP_HOLDER_HPP
+#define BOOST_VARIANT_DETAIL_BACKUP_HOLDER_HPP
+
+#include "boost/config.hpp"
+#include "boost/assert.hpp"
+
+namespace boost {
+namespace detail { namespace variant {
+
+template <typename T>
+class backup_holder
+{
+private: // representation
+
+ T* backup_;
+
+public: // structors
+
+ ~backup_holder() BOOST_NOEXCEPT
+ {
+ delete backup_;
+ }
+
+ explicit backup_holder(T* backup) BOOST_NOEXCEPT
+ : backup_(backup)
+ {
+ }
+
+ backup_holder(const backup_holder&);
+
+public: // modifiers
+
+ backup_holder& operator=(const backup_holder& rhs)
+ {
+ *backup_ = rhs.get();
+ return *this;
+ }
+
+ backup_holder& operator=(const T& rhs)
+ {
+ *backup_ = rhs;
+ return *this;
+ }
+
+ void swap(backup_holder& rhs) BOOST_NOEXCEPT
+ {
+ T* tmp = rhs.backup_;
+ rhs.backup_ = this->backup_;
+ this->backup_ = tmp;
+ }
+
+public: // queries
+
+ T& get() BOOST_NOEXCEPT
+ {
+ return *backup_;
+ }
+
+ const T& get() const BOOST_NOEXCEPT
+ {
+ return *backup_;
+ }
+
+};
+
+template <typename T>
+backup_holder<T>::backup_holder(const backup_holder&)
+ : backup_(0)
+{
+ // not intended for copy, but do not want to prohibit syntactically
+ BOOST_ASSERT(false);
+}
+
+template <typename T>
+void swap(backup_holder<T>& lhs, backup_holder<T>& rhs) BOOST_NOEXCEPT
+{
+ lhs.swap(rhs);
+}
+
+}} // namespace detail::variant
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_BACKUP_HOLDER_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/cast_storage.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP
+#define BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP
+
+#include "boost/config.hpp"
+
+namespace boost {
+namespace detail { namespace variant {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) function template cast_storage
+//
+// Casts the given storage to the specified type, but with qualification.
+//
+
+template <typename T>
+inline T& cast_storage(void* storage)
+{
+ return *static_cast<T*>(storage);
+}
+
+template <typename T>
+inline const T& cast_storage(const void* storage)
+{
+ return *static_cast<const T*>(storage);
+}
+
+}} // namespace detail::variant
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/config.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_DETAIL_CONFIG_HPP
+#define BOOST_VARIANT_DETAIL_CONFIG_HPP
+
+#include "boost/config.hpp"
+#include "boost/detail/workaround.hpp"
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_AUX_BROKEN_CONSTRUCTOR_TEMPLATE_ORDERING
+//
+#if BOOST_WORKAROUND(__MWERKS__, <= 0x3201) \
+ || BOOST_WORKAROUND(BOOST_INTEL, <= 700) \
+ && !defined(BOOST_VARIANT_AUX_BROKEN_CONSTRUCTOR_TEMPLATE_ORDERING)
+# define BOOST_VARIANT_AUX_BROKEN_CONSTRUCTOR_TEMPLATE_ORDERING
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_AUX_HAS_CONSTRUCTOR_TEMPLATE_ORDERING_SFINAE_WKND
+//
+#if !defined(BOOST_NO_SFINAE) \
+ && !BOOST_WORKAROUND(BOOST_INTEL, <= 700) \
+ && !defined(BOOST_VARIANT_AUX_HAS_CONSTRUCTOR_TEMPLATE_ORDERING_SFINAE_WKND)
+# define BOOST_VARIANT_AUX_HAS_CONSTRUCTOR_TEMPLATE_ORDERING_SFINAE_WKND
+#endif
+
+#endif // BOOST_VARIANT_DETAIL_CONFIG_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/enable_recursive_fwd.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_DETAIL_ENABLE_RECURSIVE_FWD_HPP
+#define BOOST_VARIANT_DETAIL_ENABLE_RECURSIVE_FWD_HPP
+
+#include "boost/mpl/aux_/config/ctps.hpp"
+
+#include "boost/mpl/bool_fwd.hpp"
+
+# include "boost/mpl/bool.hpp"
+
+namespace boost {
+namespace detail { namespace variant {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) tag recursive_flag
+//
+// Signifies that the variant should perform recursive substituion.
+//
+
+
+template <typename T>
+struct recursive_flag
+{
+ typedef T type;
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction is_recursive_flag
+//
+// Signifies that the variant should perform recursive substituion.
+//
+
+
+template <typename T>
+struct is_recursive_flag
+ : mpl::false_
+{
+};
+
+template <typename T>
+struct is_recursive_flag< recursive_flag<T> >
+ : mpl::true_
+{
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction enable_recursive
+//
+// Attempts recursive_variant_ tag substitution, wrapping with
+// boost::recursive_wrapper if substituion occurs w/ non-indirect result
+// (i.e., not a reference or pointer) *and* NoWrapper is false_.
+//
+template <
+ typename T
+ , typename RecursiveVariant
+ , typename NoWrapper = mpl::false_
+ >
+struct enable_recursive;
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction class quoted_enable_recursive
+//
+// Same behavior as enable_recursive metafunction (see above).
+//
+template <
+ typename RecursiveVariant
+ , typename NoWrapper = mpl::false_
+ >
+struct quoted_enable_recursive;
+
+}} // namespace detail::variant
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_ENABLE_RECURSIVE_FWD_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/forced_return.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_DETAIL_FORCED_RETURN_HPP
+#define BOOST_VARIANT_DETAIL_FORCED_RETURN_HPP
+
+#include "boost/config.hpp"
+#include "boost/variant/detail/generic_result_type.hpp"
+#include "boost/assert.hpp"
+
+namespace boost {
+namespace detail { namespace variant {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) function template forced_return
+//
+// Logical error to permit invocation at runtime, but (artificially) satisfies
+// compile-time requirement of returning a result value.
+//
+
+#if !defined(BOOST_MSVC) \
+ && !defined(BOOST_NO_VOID_RETURNS)
+
+// "standard" implementation:
+
+template <typename T>
+inline T forced_return()
+{
+ // logical error: should never be here! (see above)
+ BOOST_ASSERT(false);
+
+ T (*dummy_function_ptr)() = 0;
+ return dummy_function_ptr();
+}
+
+template <>
+inline void forced_return<void>()
+{
+ // logical error: should never be here! (see above)
+ BOOST_ASSERT(false);
+}
+
+#elif !defined(BOOST_MSVC)
+
+// workaround implementation
+//
+// TODO: Determine the most efficient way to handle this -- as below? by
+// throwing? by recursive call to forced_return itself? etc.
+//
+
+template <typename T>
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(T)
+forced_return()
+{
+ // logical error: should never be here! (see above)
+ BOOST_ASSERT(false);
+
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(T) (*dummy)() = 0;
+ return dummy();
+}
+
+#else // defined(BOOST_MSVC)
+
+# pragma warning( push )
+# pragma warning( disable : 4702 ) // unreachable code
+// msvc-specific implementation
+//
+// Leverages __declspec(noreturn) for optimized implementation.
+//
+
+__declspec(noreturn)
+inline void forced_return_no_return() {};
+
+template <typename T>
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(T)
+forced_return()
+{
+ // logical error: should never be here! (see above)
+ BOOST_ASSERT(false);
+
+ forced_return_no_return();
+}
+
+# pragma warning( pop )
+
+#endif // BOOST_MSVC optimization
+
+}} // namespace detail::variant
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_FORCED_RETURN_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/generic_result_type.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_DETAIL_GENERIC_RESULT_TYPE_HPP
+#define BOOST_VARIANT_DETAIL_GENERIC_RESULT_TYPE_HPP
+
+#include "boost/config.hpp"
+
+//////////////////////////////////////////////////////////////////////////
+// (workaround) macro BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE
+//
+// On compilers with BOOST_NO_VOID_RETURNS, this macro provides a route
+// to a single syntax for dealing with template functions that may (but
+// not necessarily) return nothing (i.e. void).
+//
+// BOOST_VARIANT_AUX_RETURN_VOID provided for compilers w/ (erroneous?)
+// warnings about non-void functions not returning a value.
+//
+
+#if !defined(BOOST_NO_VOID_RETURNS)
+
+#define BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(T) \
+ T \
+ /**/
+
+#define BOOST_VARIANT_AUX_RETURN_VOID \
+ /**/
+
+#define BOOST_VARIANT_AUX_RETURN_VOID_TYPE \
+ void \
+ /**/
+
+#else // defined(BOOST_NO_VOID_RETURNS)
+
+namespace boost {
+namespace detail { namespace variant {
+
+struct fake_return_void
+{
+ fake_return_void()
+ {
+ }
+
+ template <typename T>
+ fake_return_void(const T&)
+ {
+ }
+};
+
+template <typename T>
+struct no_void_returns_helper
+{
+ typedef T type;
+};
+
+template <>
+struct no_void_returns_helper<void>
+{
+ typedef fake_return_void type;
+};
+
+}} // namespace detail::variant
+} // namespace boost
+
+#define BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(T) \
+ BOOST_DEDUCED_TYPENAME \
+ ::boost::detail::variant::no_void_returns_helper< T >::type \
+ /**/
+
+#define BOOST_VARIANT_AUX_RETURN_VOID \
+ return ::boost::detail::variant::fake_return_void() \
+ /**/
+
+#define BOOST_VARIANT_AUX_RETURN_VOID_TYPE \
+ ::boost::detail::variant::fake_return_void
+
+#endif // BOOST_NO_VOID_RETURNS workaround
+
+#endif // BOOST_VARIANT_DETAIL_GENERIC_RESULT_TYPE_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/has_result_type.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2014-2015 Antony Polukhin
+//
+// 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_VARIANT_DETAIL_HAS_RESULT_TYPE_HPP
+#define BOOST_VARIANT_DETAIL_HAS_RESULT_TYPE_HPP
+
+#include "boost/config.hpp"
+#include "boost/type_traits/remove_reference.hpp"
+
+
+namespace boost { namespace detail { namespace variant {
+
+template <typename T >
+struct has_result_type {
+private:
+ typedef char yes;
+ typedef struct { char array[2]; } no;
+
+ template<typename C> static yes test(typename boost::remove_reference<typename C::result_type>::type*);
+ template<typename C> static no test(...);
+
+public:
+ BOOST_STATIC_CONSTANT(bool, value = sizeof(test<T>(0)) == sizeof(yes));
+};
+
+}}} // namespace boost::detail::variant
+
+#endif // BOOST_VARIANT_DETAIL_HAS_RESULT_TYPE_HPP
+
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/hash_variant.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2011
+// Antony Polukhin
+//
+// 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_HASH_VARIANT_FUNCTION_HPP
+#define BOOST_HASH_VARIANT_FUNCTION_HPP
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#include <boost/variant/variant_fwd.hpp>
+#include <boost/variant/static_visitor.hpp>
+#include <boost/variant/apply_visitor.hpp>
+#include <boost/functional/hash_fwd.hpp>
+
+namespace boost {
+
+ namespace detail { namespace variant {
+ struct variant_hasher: public boost::static_visitor<std::size_t> {
+ template <class T>
+ std::size_t operator()(T const& val) const {
+ boost::hash<T> hasher;
+ return hasher(val);
+ }
+ };
+ }}
+
+ template < BOOST_VARIANT_ENUM_PARAMS(typename T) >
+ std::size_t hash_value(variant< BOOST_VARIANT_ENUM_PARAMS(T) > const& val) {
+ std::size_t seed = boost::apply_visitor(detail::variant::variant_hasher(), val);
+ hash_combine(seed, val.which());
+ return seed;
+ }
+}
+
+#endif
+
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/initializer.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_VARIANT_DETAIL_INITIALIZER_HPP
+#define BOOST_VARIANT_DETAIL_INITIALIZER_HPP
+
+#include <new> // for placement new
+
+#include "boost/config.hpp"
+
+#include "boost/call_traits.hpp"
+#include "boost/detail/reference_content.hpp"
+#include "boost/variant/recursive_wrapper_fwd.hpp"
+#include "boost/variant/detail/move.hpp"
+
+#if !defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
+# include "boost/mpl/aux_/value_wknd.hpp"
+# include "boost/mpl/int.hpp"
+# include "boost/mpl/iter_fold.hpp"
+# include "boost/mpl/next.hpp"
+# include "boost/mpl/deref.hpp"
+# include "boost/mpl/pair.hpp"
+# include "boost/mpl/protect.hpp"
+#else
+# include "boost/variant/variant_fwd.hpp"
+# include "boost/preprocessor/cat.hpp"
+# include "boost/preprocessor/enum.hpp"
+# include "boost/preprocessor/repeat.hpp"
+#endif
+
+namespace boost {
+namespace detail { namespace variant {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) support to simulate standard overload resolution rules
+//
+// The below initializers allows variant to follow standard overload
+// resolution rules over the specified set of bounded types.
+//
+// On compilers where using declarations in class templates can correctly
+// avoid name hiding, use an optimal solution based on the variant's typelist.
+//
+// Otherwise, use a preprocessor workaround based on knowledge of the fixed
+// size of the variant's psuedo-variadic template parameter list.
+//
+
+#if !defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
+
+// (detail) quoted metafunction make_initializer_node
+//
+// Exposes a pair whose first type is a node in the initializer hierarchy.
+//
+struct make_initializer_node
+{
+ template <typename BaseIndexPair, typename Iterator>
+ struct apply
+ {
+ private: // helpers, for metafunction result (below)
+
+ typedef typename BaseIndexPair::first
+ base;
+ typedef typename BaseIndexPair::second
+ index;
+
+ class initializer_node
+ : public base
+ {
+ private: // helpers, for static functions (below)
+
+ typedef typename mpl::deref<Iterator>::type
+ recursive_enabled_T;
+ typedef typename unwrap_recursive<recursive_enabled_T>::type
+ public_T;
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ typedef boost::is_reference<public_T>
+ is_reference_content_t;
+
+ typedef typename boost::mpl::if_<is_reference_content_t, public_T, const public_T& >::type
+ param_T;
+
+ template <class T> struct disable_overload{};
+
+ typedef typename boost::mpl::if_<is_reference_content_t, disable_overload<public_T>, public_T&& >::type
+ param2_T;
+#else
+ typedef typename call_traits<public_T>::param_type
+ param_T;
+#endif
+
+ public: // static functions
+
+ using base::initialize;
+
+ static int initialize(void* dest, param_T operand)
+ {
+ typedef typename boost::detail::make_reference_content<
+ recursive_enabled_T
+ >::type internal_T;
+
+ new(dest) internal_T(operand);
+ return BOOST_MPL_AUX_VALUE_WKND(index)::value; // which
+ }
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ static int initialize(void* dest, param2_T operand)
+ {
+ // This assert must newer trigger, because all the reference contents are
+ // handled by the initilize(void* dest, param_T operand) function above
+ BOOST_ASSERT(!is_reference_content_t::value);
+
+ typedef typename boost::mpl::if_<is_reference_content_t, param2_T, recursive_enabled_T>::type value_T;
+ new(dest) value_T( boost::detail::variant::move(operand) );
+ return BOOST_MPL_AUX_VALUE_WKND(index)::value; // which
+ }
+#endif
+ };
+
+ friend class initializer_node;
+
+ public: // metafunction result
+
+ typedef mpl::pair<
+ initializer_node
+ , typename mpl::next< index >::type
+ > type;
+
+ };
+};
+
+// (detail) class initializer_root
+//
+// Every level of the initializer hierarchy must expose the name
+// "initialize," so initializer_root provides a dummy function:
+//
+class initializer_root
+{
+public: // static functions
+
+ static void initialize();
+
+};
+
+#else // defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
+
+ // Obsolete. Remove.
+ #define BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_PARAMS \
+ BOOST_VARIANT_ENUM_PARAMS(typename recursive_enabled_T) \
+ /**/
+
+ // Obsolete. Remove.
+ #define BOOST_VARIANT_AUX_PP_INITIALIZER_DEFINE_PARAM_T(N) \
+ typedef typename unwrap_recursive< \
+ BOOST_PP_CAT(recursive_enabled_T,N) \
+ >::type BOOST_PP_CAT(public_T,N); \
+ typedef typename call_traits< \
+ BOOST_PP_CAT(public_T,N) \
+ >::param_type BOOST_PP_CAT(param_T,N); \
+ /**/
+
+template < BOOST_VARIANT_ENUM_PARAMS(typename recursive_enabled_T) >
+struct preprocessor_list_initializer
+{
+public: // static functions
+
+ #define BOOST_VARIANT_AUX_PP_INITIALIZE_FUNCTION(z,N,_) \
+ typedef typename unwrap_recursive< \
+ BOOST_PP_CAT(recursive_enabled_T,N) \
+ >::type BOOST_PP_CAT(public_T,N); \
+ typedef typename call_traits< \
+ BOOST_PP_CAT(public_T,N) \
+ >::param_type BOOST_PP_CAT(param_T,N); \
+ static int initialize( \
+ void* dest \
+ , BOOST_PP_CAT(param_T,N) operand \
+ ) \
+ { \
+ typedef typename boost::detail::make_reference_content< \
+ BOOST_PP_CAT(recursive_enabled_T,N) \
+ >::type internal_T; \
+ \
+ new(dest) internal_T(operand); \
+ return (N); /*which*/ \
+ } \
+ /**/
+
+ BOOST_PP_REPEAT(
+ BOOST_VARIANT_LIMIT_TYPES
+ , BOOST_VARIANT_AUX_PP_INITIALIZE_FUNCTION
+ , _
+ )
+
+ #undef BOOST_VARIANT_AUX_PP_INITIALIZE_FUNCTION
+
+};
+
+#endif // BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE workaround
+
+}} // namespace detail::variant
+} // namespace boost
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_AUX_INITIALIZER_T
+//
+// Given both the variant's typelist and a basename for forming the list of
+// bounded types (i.e., T becomes T1, T2, etc.), exposes the initializer
+// most appropriate to the current compiler.
+//
+
+#if !defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
+
+#define BOOST_VARIANT_AUX_INITIALIZER_T( mpl_seq, typename_base ) \
+ ::boost::mpl::iter_fold< \
+ mpl_seq \
+ , ::boost::mpl::pair< \
+ ::boost::detail::variant::initializer_root \
+ , ::boost::mpl::int_<0> \
+ > \
+ , ::boost::mpl::protect< \
+ ::boost::detail::variant::make_initializer_node \
+ > \
+ >::type::first \
+ /**/
+
+#else // defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
+
+ // Obsolete. Remove.
+ #define BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_ARGS(typename_base) \
+ BOOST_VARIANT_ENUM_PARAMS(typename_base) \
+ /**/
+
+#define BOOST_VARIANT_AUX_INITIALIZER_T( mpl_seq, typename_base ) \
+ ::boost::detail::variant::preprocessor_list_initializer< \
+ BOOST_VARIANT_ENUM_PARAMS(typename_base) \
+ > \
+ /**/
+
+#endif // BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE workaround
+
+#endif // BOOST_VARIANT_DETAIL_INITIALIZER_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/make_variant_list.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002-2003 Eric Friedman, Itay Maman
+// Copyright (c) 2013 Antony Polukhin
+//
+// 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_VARIANT_DETAIL_MAKE_VARIANT_LIST_HPP
+#define BOOST_VARIANT_DETAIL_MAKE_VARIANT_LIST_HPP
+
+#include "boost/variant/variant_fwd.hpp"
+
+#include "boost/mpl/list.hpp"
+#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/enum.hpp"
+
+namespace boost {
+namespace detail { namespace variant {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction make_variant_list
+//
+// Provides a MPL-compatible sequence with the specified non-void types
+// as arguments.
+//
+// Rationale: see class template convert_void (variant_fwd.hpp) and using-
+// declaration workaround (below).
+//
+
+#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+template < typename... T >
+struct make_variant_list
+{
+ typedef typename mpl::list< T... >::type type;
+};
+
+#else // defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+template < BOOST_VARIANT_ENUM_PARAMS(typename T) >
+struct make_variant_list
+{
+public: // metafunction result
+
+ // [Define a macro to convert any void(NN) tags to mpl::void...]
+# define BOOST_VARIANT_AUX_CONVERT_VOID(z, N,_) \
+ typename convert_void< BOOST_PP_CAT(T,N) >::type
+
+ // [...so that the specified types can be passed to mpl::list...]
+ typedef typename mpl::list<
+ BOOST_PP_ENUM(
+ BOOST_VARIANT_LIMIT_TYPES
+ , BOOST_VARIANT_AUX_CONVERT_VOID
+ , _
+ )
+ >::type type;
+
+ // [...and, finally, the conversion macro can be undefined:]
+# undef BOOST_VARIANT_AUX_CONVERT_VOID
+
+};
+
+#endif // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES workaround
+
+}} // namespace detail::variant
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_MAKE_VARIANT_LIST_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/move.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002-2003 Eric Friedman
+// Copyright (c) 2002 by Andrei Alexandrescu
+// Copyright (c) 2013-2014 Antony Polukhin
+//
+// 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)
+//
+// This file derivative of MoJO. Much thanks to Andrei for his initial work.
+// See <http://www.cuj.com/experts/2102/alexandr.htm> for information on MOJO.
+// Re-issued here under the Boost Software License, with permission of the original
+// author (Andrei Alexandrescu).
+
+
+#ifndef BOOST_VARIANT_DETAIL_MOVE_HPP
+#define BOOST_VARIANT_DETAIL_MOVE_HPP
+
+#include <iterator> // for iterator_traits
+#include <new> // for placement new
+
+#include "boost/config.hpp"
+#include "boost/detail/workaround.hpp"
+#include "boost/move/move.hpp"
+#include "boost/move/adl_move_swap.hpp"
+
+namespace boost { namespace detail { namespace variant {
+
+using boost::move;
+
+//////////////////////////////////////////////////////////////////////////
+// function template move_swap
+//
+// Swaps using Koenig lookup but falls back to move-swap for primitive
+// types and on non-conforming compilers.
+//
+
+template <typename T>
+inline void move_swap(T& lhs, T& rhs)
+{
+ ::boost::adl_move_swap(lhs, rhs);
+}
+
+}}} // namespace boost::detail::variant
+
+#endif // BOOST_VARIANT_DETAIL_MOVE_HPP
+
+
+
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/over_sequence.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Portions Copyright (C) 2002 David Abrahams
+//
+// 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_VARIANT_DETAIL_OVER_SEQUENCE_HPP
+#define BOOST_VARIANT_DETAIL_OVER_SEQUENCE_HPP
+
+#include "boost/mpl/aux_/config/ctps.hpp"
+
+
+namespace boost {
+namespace detail { namespace variant {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class over_sequence
+//
+// Wrapper used to indicate bounded types for variant are from type sequence.
+//
+template <typename Types>
+struct over_sequence
+{
+ typedef Types type;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction is_over_sequence (modeled on code by David Abrahams)
+//
+// Indicates whether the specified type is of form over_sequence<...> or not.
+//
+
+
+template <typename T>
+struct is_over_sequence
+ : mpl::false_
+{
+};
+
+template <typename Types>
+struct is_over_sequence< over_sequence<Types> >
+ : mpl::true_
+{
+};
+
+
+}} // namespace detail::variant
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_OVER_SEQUENCE_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/substitute_fwd.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_DETAIL_SUBSTITUTE_FWD_HPP
+#define BOOST_VARIANT_DETAIL_SUBSTITUTE_FWD_HPP
+
+#include "boost/mpl/aux_/lambda_arity_param.hpp"
+#include "boost/mpl/aux_/template_arity.hpp"
+#include "boost/mpl/int_fwd.hpp"
+
+
+///////////////////////////////////////////////////////////////////////////////
+// BOOST_VARIANT_DETAIL_NO_SUBSTITUTE
+//
+// Defined if 'substitute' is not implementable on the current compiler.
+//
+
+#include "boost/mpl/aux_/config/ctps.hpp"
+#include "boost/mpl/aux_/config/ttp.hpp"
+
+#if defined(BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS) \
+ && !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
+# define BOOST_VARIANT_DETAIL_NO_SUBSTITUTE
+#endif
+
+namespace boost {
+namespace detail { namespace variant {
+
+#if !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
+
+///////////////////////////////////////////////////////////////////////////////
+// metafunction substitute
+//
+// Substitutes one type for another in the given type expression.
+//
+template <
+ typename T, typename Dest, typename Source
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(
+ typename Arity = mpl::int_< mpl::aux::template_arity<T>::value >
+ )
+ >
+struct substitute;
+
+#endif // !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
+
+}} // namespace detail::variant
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_SUBSTITUTE_FWD_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/variant_io.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_VARIANT_DETAIL_VARIANT_IO_HPP
+#define BOOST_VARIANT_DETAIL_VARIANT_IO_HPP
+
+#include <iosfwd> // for std::basic_ostream forward declare
+
+#include "boost/variant/variant_fwd.hpp"
+
+#include "boost/detail/templated_streams.hpp"
+#include "boost/variant/static_visitor.hpp"
+
+namespace boost {
+
+///////////////////////////////////////////////////////////////////////////////
+// function template operator<<
+//
+// Outputs the content of the given variant to the given ostream.
+//
+
+// forward declare (allows output of embedded variant< variant< ... >, ... >)
+template <
+ BOOST_TEMPLATED_STREAM_ARGS(E,T)
+ BOOST_TEMPLATED_STREAM_COMMA
+ BOOST_VARIANT_ENUM_PARAMS(typename U)
+ >
+inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
+ BOOST_TEMPLATED_STREAM(ostream, E,T)& out
+ , const variant< BOOST_VARIANT_ENUM_PARAMS(U) >& rhs
+ );
+
+namespace detail { namespace variant {
+
+template <typename OStream>
+class printer
+ : public boost::static_visitor<>
+{
+private: // representation
+
+ OStream& out_;
+
+public: // structors
+
+ explicit printer(OStream& out)
+ : out_( out )
+ {
+ }
+
+public: // visitor interface
+
+ template <typename T>
+ void operator()(const T& operand) const
+ {
+ out_ << operand;
+ }
+
+private:
+ printer& operator=(const printer&);
+
+};
+
+}} // namespace detail::variant
+
+template <
+ BOOST_TEMPLATED_STREAM_ARGS(E,T)
+ BOOST_TEMPLATED_STREAM_COMMA
+ BOOST_VARIANT_ENUM_PARAMS(typename U)
+ >
+inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
+ BOOST_TEMPLATED_STREAM(ostream, E,T)& out
+ , const variant< BOOST_VARIANT_ENUM_PARAMS(U) >& rhs
+ )
+{
+ detail::variant::printer<
+ BOOST_TEMPLATED_STREAM(ostream, E,T)
+ > visitor(out);
+
+ rhs.apply_visitor(visitor);
+
+ return out;
+}
+
+} // namespace boost
+
+#endif // BOOST_VARIANT_DETAIL_VARIANT_IO_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/detail/visitation_impl.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_DETAIL_VISITATION_IMPL_HPP
+#define BOOST_VARIANT_DETAIL_VISITATION_IMPL_HPP
+
+#include "boost/config.hpp"
+
+#include "boost/variant/detail/backup_holder.hpp"
+#include "boost/variant/detail/cast_storage.hpp"
+#include "boost/variant/detail/forced_return.hpp"
+#include "boost/variant/detail/generic_result_type.hpp"
+#include "boost/variant/variant_fwd.hpp" // for BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
+
+#include "boost/mpl/eval_if.hpp"
+#include "boost/mpl/bool.hpp"
+#include "boost/mpl/identity.hpp"
+#include "boost/mpl/int.hpp"
+#include "boost/mpl/next.hpp"
+#include "boost/mpl/deref.hpp"
+#include "boost/mpl/or.hpp"
+#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/inc.hpp"
+#include "boost/preprocessor/repeat.hpp"
+#include "boost/type_traits/is_same.hpp"
+#include "boost/type_traits/has_nothrow_copy.hpp"
+#include "boost/type_traits/is_nothrow_move_constructible.hpp"
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning (push)
+# pragma warning (disable : 4702) //unreachable code
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// BOOST_VARIANT_VISITATION_UNROLLING_LIMIT
+//
+// Unrolls variant's visitation mechanism to reduce template instantiation
+// and potentially increase runtime performance. (TODO: Investigate further.)
+//
+#if !defined(BOOST_VARIANT_VISITATION_UNROLLING_LIMIT)
+
+#ifndef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
+# include "boost/mpl/limits/list.hpp"
+# define BOOST_VARIANT_VISITATION_UNROLLING_LIMIT \
+ BOOST_MPL_LIMIT_LIST_SIZE
+#else
+# define BOOST_VARIANT_VISITATION_UNROLLING_LIMIT \
+ BOOST_VARIANT_LIMIT_TYPES
+#endif
+
+#endif
+
+namespace boost {
+namespace detail { namespace variant {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class apply_visitor_unrolled
+//
+// Tag type indicates when visitation_impl is unrolled.
+//
+struct apply_visitor_unrolled {};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class template visitation_impl_step
+//
+// "Never ending" iterator range facilitates visitation_impl unrolling.
+//
+
+
+template <typename Iter, typename LastIter>
+struct visitation_impl_step
+{
+ typedef typename mpl::deref<Iter>::type type;
+
+ typedef typename mpl::next<Iter>::type next_iter;
+ typedef visitation_impl_step<
+ next_iter, LastIter
+ > next;
+};
+
+template <typename LastIter>
+struct visitation_impl_step< LastIter,LastIter >
+{
+ typedef apply_visitor_unrolled type;
+ typedef visitation_impl_step next;
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) function template visitation_impl_invoke
+//
+// Invokes the given visitor on the specified type in the given storage.
+//
+
+template <typename Visitor, typename VoidPtrCV, typename T>
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+visitation_impl_invoke_impl(
+ int, Visitor& visitor, VoidPtrCV storage, T*
+ , mpl::true_// never_uses_backup
+ )
+{
+ return visitor.internal_visit(
+ cast_storage<T>(storage), 1L
+ );
+}
+
+template <typename Visitor, typename VoidPtrCV, typename T>
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+visitation_impl_invoke_impl(
+ int internal_which, Visitor& visitor, VoidPtrCV storage, T*
+ , mpl::false_// never_uses_backup
+ )
+{
+ if (internal_which >= 0)
+ {
+ return visitor.internal_visit(
+ cast_storage<T>(storage), 1L
+ );
+ }
+ else
+ {
+ return visitor.internal_visit(
+ cast_storage< backup_holder<T> >(storage), 1L
+ );
+ }
+}
+
+template <typename Visitor, typename VoidPtrCV, typename T, typename NoBackupFlag>
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+visitation_impl_invoke(
+ int internal_which, Visitor& visitor, VoidPtrCV storage, T* t
+ , NoBackupFlag
+ , int
+ )
+{
+ typedef typename mpl::or_<
+ NoBackupFlag
+ , is_nothrow_move_constructible<T>
+ , has_nothrow_copy<T>
+ >::type never_uses_backup;
+
+ return (visitation_impl_invoke_impl)(
+ internal_which, visitor, storage, t
+ , never_uses_backup()
+ );
+}
+
+template <typename Visitor, typename VoidPtrCV, typename NBF>
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+visitation_impl_invoke(int, Visitor&, VoidPtrCV, apply_visitor_unrolled*, NBF, long)
+{
+ // should never be here at runtime!
+ typedef typename Visitor::result_type result_type;
+ return ::boost::detail::variant::forced_return< result_type >();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) function template visitation_impl
+//
+// Invokes the given visitor on the type in the given variant storage.
+//
+
+template <
+ typename W, typename S
+ , typename Visitor, typename VPCV
+ , typename NBF
+ >
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+visitation_impl(
+ int, int, Visitor&, VPCV
+ , mpl::true_ // is_apply_visitor_unrolled
+ , NBF, W* = 0, S* = 0
+ )
+{
+ // should never be here at runtime!
+ typedef typename Visitor::result_type result_type;
+ return ::boost::detail::variant::forced_return< result_type >();
+}
+
+template <
+ typename Which, typename step0
+ , typename Visitor, typename VoidPtrCV
+ , typename NoBackupFlag
+ >
+inline
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type)
+visitation_impl(
+ const int internal_which, const int logical_which
+ , Visitor& visitor, VoidPtrCV storage
+ , mpl::false_ // is_apply_visitor_unrolled
+ , NoBackupFlag no_backup_flag
+ , Which* = 0, step0* = 0
+ )
+{
+ // Typedef apply_visitor_unrolled steps and associated types...
+# define BOOST_VARIANT_AUX_APPLY_VISITOR_STEP_TYPEDEF(z, N, _) \
+ typedef typename BOOST_PP_CAT(step,N)::type BOOST_PP_CAT(T,N); \
+ typedef typename BOOST_PP_CAT(step,N)::next \
+ BOOST_PP_CAT(step, BOOST_PP_INC(N)); \
+ /**/
+
+ BOOST_PP_REPEAT(
+ BOOST_VARIANT_VISITATION_UNROLLING_LIMIT
+ , BOOST_VARIANT_AUX_APPLY_VISITOR_STEP_TYPEDEF
+ , _
+ )
+
+# undef BOOST_VARIANT_AUX_APPLY_VISITOR_STEP_TYPEDEF
+
+ // ...switch on the target which-index value...
+ switch (logical_which)
+ {
+
+ // ...applying the appropriate case:
+# define BOOST_VARIANT_AUX_APPLY_VISITOR_STEP_CASE(z, N, _) \
+ case (Which::value + (N)): \
+ return (visitation_impl_invoke)( \
+ internal_which, visitor, storage \
+ , static_cast<BOOST_PP_CAT(T,N)*>(0) \
+ , no_backup_flag, 1L \
+ ); \
+ /**/
+
+ BOOST_PP_REPEAT(
+ BOOST_VARIANT_VISITATION_UNROLLING_LIMIT
+ , BOOST_VARIANT_AUX_APPLY_VISITOR_STEP_CASE
+ , _
+ )
+
+# undef BOOST_VARIANT_AUX_APPLY_VISITOR_STEP_CASE
+
+ default: break;
+ }
+
+ // If not handled in this iteration, continue unrolling:
+ typedef mpl::int_<
+ Which::value + (BOOST_VARIANT_VISITATION_UNROLLING_LIMIT)
+ > next_which;
+
+ typedef BOOST_PP_CAT(step, BOOST_VARIANT_VISITATION_UNROLLING_LIMIT)
+ next_step;
+
+ typedef typename next_step::type next_type;
+ typedef typename is_same< next_type,apply_visitor_unrolled >::type
+ is_apply_visitor_unrolled;
+
+ return visitation_impl(
+ internal_which, logical_which
+ , visitor, storage
+ , is_apply_visitor_unrolled()
+ , no_backup_flag
+ , static_cast<next_which*>(0), static_cast<next_step*>(0)
+ );
+}
+
+}} // namespace detail::variant
+} // namespace boost
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(pop)
+#endif
+
+#endif // BOOST_VARIANT_DETAIL_VISITATION_IMPL_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/recursive_wrapper_fwd.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002
+// Eric Friedman, Itay Maman
+//
+// Portions Copyright (C) 2002 David Abrahams
+//
+// 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_VARIANT_RECURSIVE_WRAPPER_FWD_HPP
+#define BOOST_VARIANT_RECURSIVE_WRAPPER_FWD_HPP
+
+#include <boost/mpl/bool.hpp>
+#include "boost/mpl/aux_/config/ctps.hpp"
+#include "boost/mpl/aux_/lambda_support.hpp"
+#include <boost/type_traits/integral_constant.hpp>
+
+namespace boost {
+
+//////////////////////////////////////////////////////////////////////////
+// class template recursive_wrapper
+//
+// Enables recursive types in templates by breaking cyclic dependencies.
+//
+// For example:
+//
+// class my;
+//
+// typedef variant< int, recursive_wrapper<my> > var;
+//
+// class my {
+// var var_;
+// ...
+// };
+//
+template <typename T> class recursive_wrapper;
+
+///////////////////////////////////////////////////////////////////////////////
+// metafunction is_recursive_wrapper (modeled on code by David Abrahams)
+//
+// True iff specified type matches recursive_wrapper<T>.
+//
+
+namespace detail {
+
+
+template <typename T>
+struct is_recursive_wrapper_impl
+ : mpl::false_
+{
+};
+
+template <typename T>
+struct is_recursive_wrapper_impl< recursive_wrapper<T> >
+ : mpl::true_
+{
+};
+
+
+} // namespace detail
+
+template< typename T > struct is_recursive_wrapper
+ : public ::boost::integral_constant<bool,(::boost::detail::is_recursive_wrapper_impl<T>::value)>
+{
+public:
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_recursive_wrapper,(T))
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// metafunction unwrap_recursive
+//
+// If specified type T matches recursive_wrapper<U>, then U; else T.
+//
+
+
+template <typename T>
+struct unwrap_recursive
+{
+ typedef T type;
+
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,unwrap_recursive,(T))
+};
+
+template <typename T>
+struct unwrap_recursive< recursive_wrapper<T> >
+{
+ typedef T type;
+
+ BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,unwrap_recursive,(T))
+};
+
+
+} // namespace boost
+
+#endif // BOOST_VARIANT_RECURSIVE_WRAPPER_FWD_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/static_visitor.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002-2003
+// Eric Friedman
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_VARIANT_STATIC_VISITOR_HPP
+#define BOOST_VARIANT_STATIC_VISITOR_HPP
+
+#include "boost/config.hpp"
+#include "boost/detail/workaround.hpp"
+
+#include "boost/mpl/if.hpp"
+#include "boost/type_traits/is_base_and_derived.hpp"
+
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost {
+
+//////////////////////////////////////////////////////////////////////////
+// class template static_visitor
+//
+// An empty base class that typedefs the return type of a deriving static
+// visitor. The class is analogous to std::unary_function in this role.
+//
+
+namespace detail {
+
+ struct is_static_visitor_tag { };
+
+ typedef void static_visitor_default_return;
+
+} // namespace detail
+
+template <typename R = ::boost::detail::static_visitor_default_return>
+class static_visitor
+ : public detail::is_static_visitor_tag
+{
+public: // typedefs
+
+ typedef R result_type;
+
+protected: // for use as base class only
+#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)
+ static_visitor() = default;
+ ~static_visitor() = default;
+#else
+ static_visitor() BOOST_NOEXCEPT { }
+ ~static_visitor() BOOST_NOEXCEPT { }
+#endif
+};
+
+//////////////////////////////////////////////////////////////////////////
+// metafunction is_static_visitor
+//
+// Value metafunction indicates whether the specified type derives from
+// static_visitor<...>.
+//
+// NOTE #1: This metafunction does NOT check whether the specified type
+// fulfills the requirements of the StaticVisitor concept.
+//
+// NOTE #2: This template never needs to be specialized!
+//
+
+namespace detail {
+
+template <typename T>
+struct is_static_visitor_impl
+{
+ BOOST_STATIC_CONSTANT(bool, value =
+ (::boost::is_base_and_derived<
+ detail::is_static_visitor_tag,
+ T
+ >::value));
+};
+
+} // namespace detail
+
+template< typename T > struct is_static_visitor
+ : public ::boost::integral_constant<bool,(::boost::detail::is_static_visitor_impl<T>::value)>
+{
+public:
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_static_visitor,(T))
+};
+
+} // namespace boost
+
+#endif // BOOST_VARIANT_STATIC_VISITOR_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/variant.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002-2003 Eric Friedman, Itay Maman
+// Copyright (c) 2012-2014 Antony Polukhin
+//
+// 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)
+
+// Thanks to Adam Romanek for providing patches for exception-disabled env.
+
+#ifndef BOOST_VARIANT_VARIANT_HPP
+#define BOOST_VARIANT_VARIANT_HPP
+
+#include <cstddef> // for std::size_t
+#include <new> // for placement new
+
+#include "boost/type_index.hpp"
+
+#include "boost/variant/detail/config.hpp"
+#include "boost/mpl/aux_/value_wknd.hpp"
+
+#include "boost/variant/variant_fwd.hpp"
+#include "boost/variant/detail/backup_holder.hpp"
+#include "boost/variant/detail/enable_recursive_fwd.hpp"
+#include "boost/variant/detail/forced_return.hpp"
+#include "boost/variant/detail/initializer.hpp"
+#include "boost/variant/detail/make_variant_list.hpp"
+#include "boost/variant/detail/over_sequence.hpp"
+#include "boost/variant/detail/visitation_impl.hpp"
+#include "boost/variant/detail/hash_variant.hpp"
+
+#include "boost/variant/detail/generic_result_type.hpp"
+#include "boost/variant/detail/move.hpp"
+
+#include "boost/detail/no_exceptions_support.hpp"
+#include "boost/detail/reference_content.hpp"
+#include "boost/aligned_storage.hpp"
+#include "boost/blank.hpp"
+#include "boost/math/common_factor_ct.hpp"
+#include "boost/static_assert.hpp"
+#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/repeat.hpp"
+#include "boost/type_traits/alignment_of.hpp"
+#include "boost/type_traits/add_const.hpp"
+#include "boost/type_traits/has_nothrow_constructor.hpp"
+#include "boost/type_traits/has_nothrow_copy.hpp"
+#include "boost/type_traits/is_nothrow_move_assignable.hpp"
+#include "boost/type_traits/is_nothrow_move_constructible.hpp"
+#include "boost/type_traits/is_const.hpp"
+#include "boost/type_traits/is_same.hpp"
+#include "boost/type_traits/is_rvalue_reference.hpp"
+#include "boost/utility/enable_if.hpp"
+#include "boost/utility/declval.hpp"
+#include "boost/variant/recursive_wrapper_fwd.hpp"
+#include "boost/variant/static_visitor.hpp"
+
+#include "boost/mpl/assert.hpp"
+#include "boost/mpl/begin_end.hpp"
+#include "boost/mpl/bool.hpp"
+#include "boost/mpl/deref.hpp"
+#include "boost/mpl/empty.hpp"
+#include "boost/mpl/eval_if.hpp"
+#include "boost/mpl/find_if.hpp"
+#include "boost/mpl/fold.hpp"
+#include "boost/mpl/front.hpp"
+#include "boost/mpl/identity.hpp"
+#include "boost/mpl/if.hpp"
+#include "boost/mpl/int.hpp"
+#include "boost/mpl/is_sequence.hpp"
+#include "boost/mpl/iterator_range.hpp"
+#include "boost/mpl/iter_fold_if.hpp"
+#include "boost/mpl/logical.hpp"
+#include "boost/mpl/max_element.hpp"
+#include "boost/mpl/next.hpp"
+#include "boost/mpl/not.hpp"
+#include "boost/mpl/pair.hpp"
+#include "boost/mpl/protect.hpp"
+#include "boost/mpl/push_front.hpp"
+#include "boost/mpl/same_as.hpp"
+#include "boost/mpl/size_t.hpp"
+#include "boost/mpl/sizeof.hpp"
+#include "boost/mpl/transform.hpp"
+
+///////////////////////////////////////////////////////////////////////////////
+// Implementation Macros:
+//
+// BOOST_VARIANT_VISITATION_UNROLLING_LIMIT
+// Defined in boost/variant/detail/visitation_impl.hpp.
+//
+// BOOST_VARIANT_MINIMIZE_SIZE
+// When #defined, implementation employs all known means to minimize the
+// size of variant obje cts. However, often unsuccessful due to alignment
+// issues, and potentially harmful to runtime speed, so not enabled by
+// default. (TODO: Investigate further.)
+
+#if defined(BOOST_VARIANT_MINIMIZE_SIZE)
+# include <climits> // for SCHAR_MAX
+# include "boost/mpl/eval_if.hpp"
+# include "boost/mpl/equal_to.hpp"
+# include "boost/mpl/identity.hpp"
+# include "boost/mpl/int.hpp"
+# include "boost/mpl/if.hpp"
+# include "boost/mpl/less.hpp"
+# include "boost/mpl/long.hpp"
+# include "boost/mpl/O1_size.hpp"
+#endif
+
+
+namespace boost {
+
+namespace detail { namespace variant {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction max_value
+//
+// Finds the maximum value of the unary metafunction F over Sequence.
+//
+template <typename Sequence, typename F>
+struct max_value
+{
+private: // helpers, for metafunction result (below)
+
+ typedef typename mpl::transform1<Sequence, F>::type transformed_;
+ typedef typename mpl::max_element<transformed_
+
+ >::type max_it;
+
+public: // metafunction result
+
+ typedef typename mpl::deref<max_it>::type
+ type;
+
+};
+
+struct add_alignment
+{
+ template <typename State, typename Item>
+ struct apply
+ : mpl::size_t<
+ ::boost::math::static_lcm<
+ BOOST_MPL_AUX_VALUE_WKND(State)::value
+ , ::boost::alignment_of<Item>::value
+ >::value
+ >
+ {};
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction find_fallback_type
+//
+// Provides a fallback (i.e., nothrow default-constructible) type from the
+// specified sequence, or no_fallback_type if not found.
+//
+// This implementation is designed to prefer boost::blank over other potential
+// fallback types, regardless of its position in the specified sequence.
+//
+
+class no_fallback_type;
+
+struct find_fallback_type_pred
+{
+ template <typename Iterator>
+ struct apply
+ {
+ private:
+ typedef typename mpl::deref<Iterator>::type t_;
+
+ public:
+ typedef mpl::not_< has_nothrow_constructor<t_> > type;
+ };
+};
+
+template <typename Types>
+struct find_fallback_type
+{
+private: // helpers, for metafunction result (below)
+
+ typedef typename mpl::end<Types>::type end_it;
+
+ // [Find the first suitable fallback type...]
+
+ typedef typename mpl::iter_fold_if<
+ Types
+ , mpl::int_<0>, mpl::protect< mpl::next<> >
+ , mpl::protect< find_fallback_type_pred >
+ >::type first_result_;
+
+ typedef typename first_result_::first first_result_index;
+ typedef typename first_result_::second first_result_it;
+
+ // [...now search the rest of the sequence for boost::blank...]
+
+ typedef typename mpl::iter_fold_if<
+ mpl::iterator_range< first_result_it,end_it >
+ , first_result_index, mpl::protect< mpl::next<> >
+ , mpl::protect< mpl::not_same_as<boost::blank> >
+ >::type second_result_;
+
+ typedef typename second_result_::second second_result_it;
+
+public: // metafunction result
+
+ // [...and return the results of the search:]
+ typedef typename mpl::eval_if<
+ is_same< second_result_it,end_it >
+ , mpl::if_<
+ is_same< first_result_it,end_it >
+ , mpl::pair< no_fallback_type,no_fallback_type >
+ , first_result_
+ >
+ , mpl::identity< second_result_ >
+ >::type type;
+
+};
+
+#ifndef BOOST_NO_CXX11_NOEXCEPT
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction is_variant_move_noexcept_constructible
+//
+// Returns true_type if all the types are nothrow move constructible.
+//
+template <class Types>
+struct is_variant_move_noexcept_constructible {
+ typedef typename boost::mpl::find_if<
+ Types, mpl::not_<boost::is_nothrow_move_constructible<boost::mpl::_1> >
+ >::type iterator_t;
+
+ typedef typename boost::mpl::end<Types>::type end_t;
+ typedef typename boost::is_same<
+ iterator_t, end_t
+ >::type type;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction is_variant_move_noexcept_assignable
+//
+// Returns true_type if all the types are nothrow move constructible.
+//
+template <class Types>
+struct is_variant_move_noexcept_assignable {
+ typedef typename boost::mpl::find_if<
+ Types, mpl::not_<boost::is_nothrow_move_assignable<boost::mpl::_1> >
+ >::type iterator_t;
+
+ typedef typename boost::mpl::end<Types>::type end_t;
+ typedef typename boost::is_same<
+ iterator_t, end_t
+ >::type type;
+};
+#endif // BOOST_NO_CXX11_NOEXCEPT
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction make_storage
+//
+// Provides an aligned storage type capable of holding any of the types
+// specified in the given type-sequence.
+//
+
+template <typename Types, typename NeverUsesBackupFlag>
+struct make_storage
+{
+private: // helpers, for metafunction result (below)
+
+ typedef typename mpl::eval_if<
+ NeverUsesBackupFlag
+ , mpl::identity< Types >
+ , mpl::push_front<
+ Types, backup_holder<void*>
+ >
+ >::type types;
+
+ typedef typename max_value<
+ types, mpl::sizeof_<mpl::_1>
+ >::type max_size;
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0551))
+
+ typedef typename mpl::fold<
+ types
+ , mpl::size_t<1>
+ , add_alignment
+ >::type max_alignment;
+
+#else // borland
+
+ // temporary workaround -- use maximal alignment
+ typedef mpl::size_t< -1 > max_alignment;
+
+#endif // borland workaround
+
+public: // metafunction result
+
+ typedef ::boost::aligned_storage<
+ BOOST_MPL_AUX_VALUE_WKND(max_size)::value
+ , BOOST_MPL_AUX_VALUE_WKND(max_alignment)::value
+ > type;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class destroyer
+//
+// Internal visitor that destroys the value it visits.
+//
+struct destroyer
+ : public static_visitor<>
+{
+public: // visitor interfaces
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(T& operand, int) const BOOST_NOEXCEPT
+ {
+ operand.~T(); // must be noexcept
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0551)) || \
+ BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
+ operand; // suppresses warnings
+#endif
+
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class template known_get
+//
+// Visitor that returns a reference to content of the specified type.
+//
+// Precondition: visited variant MUST contain logical content of type T.
+//
+template <typename T>
+class known_get
+ : public static_visitor<T&>
+{
+
+public: // visitor interface
+
+ T& operator()(T& operand) const BOOST_NOEXCEPT
+ {
+ return operand;
+ }
+
+ template <typename U>
+ T& operator()(U&) const
+ {
+ // logical error to be here: see precondition above
+ return ::boost::detail::variant::forced_return< T& >();
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class copy_into
+//
+// Internal visitor that copies the value it visits into the given buffer.
+//
+class copy_into
+ : public static_visitor<>
+{
+private: // representation
+
+ void* storage_;
+
+public: // structors
+
+ explicit copy_into(void* storage) BOOST_NOEXCEPT
+ : storage_(storage)
+ {
+ }
+
+public: // internal visitor interface
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(boost::detail::variant::backup_holder<T>& operand, long) const
+ {
+ new(storage_) T( operand.get() );
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(const boost::detail::variant::backup_holder<T>& operand, long) const
+ {
+ new(storage_) T( operand.get() );
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(const T& operand, int) const
+ {
+ new(storage_) T(operand);
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class move_into
+//
+// Internal visitor that moves the value it visits into the given buffer.
+//
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+class move_into
+ : public static_visitor<>
+{
+private: // representation
+
+ void* storage_;
+
+public: // structors
+
+ explicit move_into(void* storage) BOOST_NOEXCEPT
+ : storage_(storage)
+ {
+ }
+
+public: // internal visitor interface
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(boost::detail::variant::backup_holder<T>& operand, long) const
+ {
+ new(storage_) T( ::boost::detail::variant::move(operand.get()) );
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(T& operand, int) const BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(T(boost::declval<T>())))
+ {
+ new(storage_) T(::boost::detail::variant::move(operand));
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+};
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class assign_storage
+//
+// Internal visitor that assigns the given storage (which must be a
+// constructed value of the same type) to the value it visits.
+//
+struct assign_storage
+ : public static_visitor<>
+{
+private: // representation
+
+ const void* rhs_storage_;
+
+public: // structors
+
+ explicit assign_storage(const void* rhs_storage) BOOST_NOEXCEPT
+ : rhs_storage_(rhs_storage)
+ {
+ }
+
+public: // internal visitor interfaces
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(backup_holder<T>& lhs_content, long) const
+ {
+ lhs_content.get()
+ = static_cast< const backup_holder<T>* >(rhs_storage_)->get();
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(const backup_holder<T>& lhs_content, long) const
+ {
+ lhs_content.get()
+ = static_cast< const backup_holder<T>* >(rhs_storage_)->get();
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(T& lhs_content, int) const
+ {
+ // NOTE TO USER :
+ // Compile error here indicates one of variant's bounded types does
+ // not meet the requirements of the Assignable concept. Thus,
+ // variant is not Assignable.
+ //
+ // Hint: Are any of the bounded types const-qualified or references?
+ //
+ lhs_content = *static_cast< const T* >(rhs_storage_);
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class move_storage
+//
+// Internal visitor that moves the given storage (which must be a
+// constructed value of the same type) to the value it visits.
+//
+struct move_storage
+ : public static_visitor<>
+{
+private: // representation
+
+ void* rhs_storage_;
+
+public: // structors
+
+ explicit move_storage(void* rhs_storage) BOOST_NOEXCEPT
+ : rhs_storage_(rhs_storage)
+ {
+ }
+
+public: // internal visitor interfaces
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(backup_holder<T>& lhs_content, long) const
+ {
+ lhs_content.get()
+ = ::boost::detail::variant::move(static_cast<backup_holder<T>* >(rhs_storage_)->get());
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(const backup_holder<T>& lhs_content, long) const
+ {
+ lhs_content.get()
+ = ::boost::detail::variant::move(static_cast<backup_holder<T>* >(rhs_storage_)->get());
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(T& lhs_content, int) const
+ {
+ // NOTE TO USER :
+ // Compile error here indicates one of variant's bounded types does
+ // not meet the requirements of the Assignable concept. Thus,
+ // variant is not Assignable.
+ //
+ // Hint: Are any of the bounded types const-qualified or references?
+ //
+ lhs_content = ::boost::detail::variant::move(*static_cast<T* >(rhs_storage_));
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class direct_assigner
+//
+// Generic static visitor that: if and only if the visited value is of the
+// specified type, assigns the given value to the visited value and returns
+// true; else returns false.
+//
+template <typename T>
+class direct_assigner
+ : public static_visitor<bool>
+{
+private: // representation
+
+ const T& rhs_;
+
+public: // structors
+
+ explicit direct_assigner(const T& rhs) BOOST_NOEXCEPT
+ : rhs_(rhs)
+ {
+ }
+
+public: // visitor interface
+
+ bool operator()(T& lhs)
+ {
+ lhs = rhs_;
+ return true;
+ }
+
+ template <typename U>
+ bool operator()(U&) BOOST_NOEXCEPT
+ {
+ return false;
+ }
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
+private:
+ // silence MSVC warning C4512: assignment operator could not be generated
+ direct_assigner& operator= (direct_assigner const&);
+#endif
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class direct_mover
+//
+// Generic static visitor that: if and only if the visited value is of the
+// specified type, move assigns the given value to the visited value and returns
+// true; else returns false.
+//
+template <typename T>
+class direct_mover
+ : public static_visitor<bool>
+{
+private: // representation
+
+ T& rhs_;
+
+public: // structors
+
+ explicit direct_mover(T& rhs) BOOST_NOEXCEPT
+ : rhs_(rhs)
+ {
+ }
+
+public: // visitor interface
+
+ bool operator()(T& lhs)
+ {
+ lhs = ::boost::detail::variant::move(rhs_);
+ return true;
+ }
+
+ template <typename U>
+ bool operator()(U&) BOOST_NOEXCEPT
+ {
+ return false;
+ }
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
+private:
+ // silence MSVC warning C4512: assignment operator could not be generated
+ direct_mover& operator= (direct_mover const&);
+#endif
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class backup_assigner
+//
+// Internal visitor that "assigns" the given value to the visited value,
+// using backup to recover if the destroy-copy sequence fails.
+//
+// NOTE: This needs to be a friend of variant, as it needs access to
+// indicate_which, indicate_backup_which, etc.
+//
+template <typename Variant>
+class backup_assigner
+ : public static_visitor<>
+{
+private: // representation
+
+ Variant& lhs_;
+ int rhs_which_;
+ const void* rhs_content_;
+ void (*copy_rhs_content_)(void*, const void*);
+
+public: // structors
+
+ template<class RhsT>
+ backup_assigner(Variant& lhs, int rhs_which, const RhsT& rhs_content)
+ : lhs_(lhs)
+ , rhs_which_(rhs_which)
+ , rhs_content_(&rhs_content)
+ , copy_rhs_content_(&construct_impl<RhsT>)
+ {
+ }
+
+private: // helpers, for visitor interface (below)
+
+ template<class RhsT>
+ static void construct_impl(void* addr, const void* obj)
+ {
+ new(addr) RhsT(*static_cast<const RhsT*>(obj));
+ }
+
+ template <typename LhsT>
+ void backup_assign_impl(
+ backup_holder<LhsT>& lhs_content
+ , mpl::false_ // is_nothrow_move_constructible
+ , long
+ )
+ {
+ // Move lhs content to backup...
+ backup_holder<LhsT> backup_lhs_content(0);
+ backup_lhs_content.swap(lhs_content); // nothrow
+
+ // ...destroy lhs content...
+ lhs_content.~backup_holder<LhsT>(); // nothrow
+
+ BOOST_TRY
+ {
+ // ...and attempt to copy rhs content into lhs storage:
+ copy_rhs_content_(lhs_.storage_.address(), rhs_content_);
+ }
+ BOOST_CATCH (...)
+ {
+ // In case of failure, copy backup pointer to lhs storage...
+ new(lhs_.storage_.address())
+ backup_holder<LhsT>( 0 ); // nothrow
+
+ static_cast<backup_holder<LhsT>* >(lhs_.storage_.address())
+ ->swap(backup_lhs_content); // nothrow
+
+ // ...and rethrow:
+ BOOST_RETHROW;
+ }
+ BOOST_CATCH_END
+
+ // In case of success, indicate new content type:
+ lhs_.indicate_which(rhs_which_); // nothrow
+ }
+
+ template <typename LhsT>
+ void backup_assign_impl(
+ LhsT& lhs_content
+ , mpl::true_ // is_nothrow_move_constructible
+ , int
+ )
+ {
+ // Move lhs content to backup...
+ LhsT backup_lhs_content(
+ ::boost::detail::variant::move(lhs_content)
+ ); // nothrow
+
+ // ...destroy lhs content...
+ lhs_content.~LhsT(); // nothrow
+
+ BOOST_TRY
+ {
+ // ...and attempt to copy rhs content into lhs storage:
+ copy_rhs_content_(lhs_.storage_.address(), rhs_content_);
+ }
+ BOOST_CATCH (...)
+ {
+ // In case of failure, restore backup content to lhs storage...
+ new(lhs_.storage_.address())
+ LhsT(
+ ::boost::detail::variant::move(backup_lhs_content)
+ ); // nothrow
+
+ // ...and rethrow:
+ BOOST_RETHROW;
+ }
+ BOOST_CATCH_END
+
+ // In case of success, indicate new content type:
+ lhs_.indicate_which(rhs_which_); // nothrow
+ }
+
+ template <typename LhsT>
+ void backup_assign_impl(
+ LhsT& lhs_content
+ , mpl::false_ // is_nothrow_move_constructible
+ , int
+ )
+ {
+ // Backup lhs content...
+ LhsT* backup_lhs_ptr = new LhsT(lhs_content);
+
+ // ...destroy lhs content...
+ lhs_content.~LhsT(); // nothrow
+
+ BOOST_TRY
+ {
+ // ...and attempt to copy rhs content into lhs storage:
+ copy_rhs_content_(lhs_.storage_.address(), rhs_content_);
+ }
+ BOOST_CATCH (...)
+ {
+ // In case of failure, copy backup pointer to lhs storage...
+ new(lhs_.storage_.address())
+ backup_holder<LhsT>( backup_lhs_ptr ); // nothrow
+
+ // ...indicate now using backup...
+ lhs_.indicate_backup_which( lhs_.which() ); // nothrow
+
+ // ...and rethrow:
+ BOOST_RETHROW;
+ }
+ BOOST_CATCH_END
+
+ // In case of success, indicate new content type...
+ lhs_.indicate_which(rhs_which_); // nothrow
+
+ // ...and delete backup:
+ delete backup_lhs_ptr; // nothrow
+ }
+
+public: // visitor interface
+
+ template <typename LhsT>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(LhsT& lhs_content, int)
+ {
+ typedef typename is_nothrow_move_constructible<LhsT>::type
+ nothrow_move;
+
+ backup_assign_impl( lhs_content, nothrow_move(), 1L);
+
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
+private:
+ // silence MSVC warning C4512: assignment operator could not be generated
+ backup_assigner& operator= (backup_assigner const&);
+#endif
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class swap_with
+//
+// Visitor that swaps visited value with content of given variant.
+//
+// Precondition: Given variant MUST have same logical type as visited value.
+//
+template <typename Variant>
+struct swap_with
+ : public static_visitor<>
+{
+private: // representation
+
+ Variant& toswap_;
+
+public: // structors
+
+ explicit swap_with(Variant& toswap) BOOST_NOEXCEPT
+ : toswap_(toswap)
+ {
+ }
+
+public: // internal visitor interfaces
+
+ template <typename T>
+ void operator()(T& operand) const
+ {
+ // Since the precondition ensures types are same, get T...
+ known_get<T> getter;
+ T& other = toswap_.apply_visitor(getter);
+
+ // ...and swap:
+ ::boost::detail::variant::move_swap( operand, other );
+ }
+
+private:
+ swap_with& operator=(const swap_with&);
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class reflect
+//
+// Generic static visitor that performs a typeid on the value it visits.
+//
+
+class reflect
+ : public static_visitor<const boost::typeindex::type_info&>
+{
+public: // visitor interfaces
+
+ template <typename T>
+ const boost::typeindex::type_info& operator()(const T&) const BOOST_NOEXCEPT
+ {
+ return boost::typeindex::type_id<T>().type_info();
+ }
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class comparer
+//
+// Generic static visitor that compares the content of the given lhs variant
+// with the visited rhs content using Comp.
+//
+// Precondition: lhs.which() == rhs.which()
+//
+template <typename Variant, typename Comp>
+class comparer
+ : public static_visitor<bool>
+{
+private: // representation
+
+ const Variant& lhs_;
+
+public: // structors
+
+ explicit comparer(const Variant& lhs) BOOST_NOEXCEPT
+ : lhs_(lhs)
+ {
+ }
+
+public: // visitor interfaces
+
+ template <typename T>
+ bool operator()(const T& rhs_content) const
+ {
+ // Since the precondition ensures lhs and rhs types are same, get T...
+ known_get<const T> getter;
+ const T& lhs_content = lhs_.apply_visitor(getter);
+
+ // ...and compare lhs and rhs contents:
+ return Comp()(lhs_content, rhs_content);
+ }
+
+private:
+ comparer& operator=(const comparer&);
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class equal_comp
+//
+// Generic function object compares lhs with rhs using operator==.
+//
+struct equal_comp
+{
+ template <typename T>
+ bool operator()(const T& lhs, const T& rhs) const
+ {
+ return lhs == rhs;
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class less_comp
+//
+// Generic function object compares lhs with rhs using operator<.
+//
+struct less_comp
+{
+ template <typename T>
+ bool operator()(const T& lhs, const T& rhs) const
+ {
+ return lhs < rhs;
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class template invoke_visitor
+//
+// Internal visitor that invokes the given visitor using:
+// * for wrappers (e.g., recursive_wrapper), the wrapper's held value.
+// * for all other values, the value itself.
+//
+template <typename Visitor>
+class invoke_visitor
+{
+private: // representation
+
+ Visitor& visitor_;
+
+public: // visitor typedefs
+
+ typedef typename Visitor::result_type
+ result_type;
+
+public: // structors
+
+ explicit invoke_visitor(Visitor& visitor) BOOST_NOEXCEPT
+ : visitor_(visitor)
+ {
+ }
+
+#if !defined(BOOST_NO_VOID_RETURNS)
+
+public: // internal visitor interfaces
+
+ template <typename T>
+ result_type internal_visit(T& operand, int)
+ {
+ return visitor_(operand);
+ }
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0564))
+ template <typename T>
+ result_type internal_visit(const T& operand, int)
+ {
+ return visitor_(operand);
+ }
+# endif
+
+#else // defined(BOOST_NO_VOID_RETURNS)
+
+private: // helpers, for internal visitor interfaces (below)
+
+ template <typename T>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ visit_impl(T& operand, mpl::false_)
+ {
+ return visitor_(operand);
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ visit_impl(T& operand, mpl::true_)
+ {
+ visitor_(operand);
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+public: // internal visitor interfaces
+
+ template <typename T>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ internal_visit(T& operand, int)
+ {
+ typedef typename is_same<result_type, void>::type
+ has_void_result_type;
+
+ return visit_impl(operand, has_void_result_type());
+ }
+
+#endif // BOOST_NO_VOID_RETURNS) workaround
+
+public: // internal visitor interfaces, cont.
+
+ template <typename T>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ internal_visit(boost::recursive_wrapper<T>& operand, long)
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ internal_visit(const boost::recursive_wrapper<T>& operand, long)
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ internal_visit(boost::detail::reference_content<T>& operand, long)
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ internal_visit(const boost::detail::reference_content<T>& operand, long)
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ internal_visit(boost::detail::variant::backup_holder<T>& operand, long)
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
+ internal_visit(const boost::detail::variant::backup_holder<T>& operand, long)
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
+private:
+ // silence MSVC warning C4512: assignment operator could not be generated
+ invoke_visitor& operator= (invoke_visitor const&);
+#endif
+};
+
+}} // namespace detail::variant
+
+///////////////////////////////////////////////////////////////////////////////
+// class template variant (concept inspired by Andrei Alexandrescu)
+//
+// See docs and boost/variant/variant_fwd.hpp for more information.
+//
+template <
+ typename T0_
+ , BOOST_VARIANT_ENUM_SHIFTED_PARAMS(typename T)
+ >
+class variant
+{
+private: // helpers, for typedefs (below)
+
+ typedef variant wknd_self_t;
+
+ struct is_recursive_
+ : detail::variant::is_recursive_flag<T0_>
+ {
+ };
+
+ typedef typename mpl::eval_if<
+ is_recursive_
+ , T0_
+ , mpl::identity< T0_ >
+ >::type unwrapped_T0_;
+
+ struct is_sequence_based_
+ : detail::variant::is_over_sequence<unwrapped_T0_>
+ {
+ };
+
+#if !defined(BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT)
+
+private: // helpers, for typedefs (below)
+
+ typedef typename mpl::eval_if<
+ is_sequence_based_
+ , unwrapped_T0_ // over_sequence<...>::type
+ , detail::variant::make_variant_list<
+ unwrapped_T0_
+ , BOOST_VARIANT_ENUM_SHIFTED_PARAMS(T)
+ >
+ >::type specified_types;
+
+ BOOST_STATIC_ASSERT((
+ ::boost::mpl::not_< mpl::empty<specified_types> >::value
+ ));
+
+ typedef typename mpl::eval_if<
+ is_recursive_
+ , mpl::transform<
+ specified_types
+ , mpl::protect<
+ detail::variant::quoted_enable_recursive<wknd_self_t>
+ >
+ >
+ , mpl::identity< specified_types >
+ >::type recursive_enabled_types;
+
+public: // public typedefs
+
+ typedef typename mpl::transform<
+ recursive_enabled_types
+ , unwrap_recursive<mpl::_1>
+ >::type types;
+
+private: // internal typedefs
+
+ typedef typename mpl::transform<
+ recursive_enabled_types
+ , mpl::protect< detail::make_reference_content<> >
+ >::type internal_types;
+
+ typedef typename mpl::front<
+ internal_types
+ >::type internal_T0;
+
+#else // defined(BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT)
+
+private: // helpers, for typedefs (below)
+
+ typedef unwrapped_T0_ T0;
+
+ #define BOOST_VARIANT_AUX_ENABLE_RECURSIVE_TYPEDEFS(z,N,_) \
+ typedef typename mpl::eval_if< \
+ is_recursive_ \
+ , detail::variant::enable_recursive< \
+ BOOST_PP_CAT(T,N) \
+ , wknd_self_t \
+ > \
+ , mpl::identity< BOOST_PP_CAT(T,N) > \
+ >::type BOOST_PP_CAT(recursive_enabled_T,N); \
+ /**/
+
+ BOOST_PP_REPEAT(
+ BOOST_VARIANT_LIMIT_TYPES
+ , BOOST_VARIANT_AUX_ENABLE_RECURSIVE_TYPEDEFS
+ , _
+ )
+
+ #undef BOOST_VARIANT_AUX_ENABLE_RECURSIVE_TYPEDEFS
+
+ #define BOOST_VARIANT_AUX_UNWRAP_RECURSIVE_TYPEDEFS(z,N,_) \
+ typedef typename unwrap_recursive< \
+ BOOST_PP_CAT(recursive_enabled_T,N) \
+ >::type BOOST_PP_CAT(public_T,N); \
+ /**/
+
+ BOOST_PP_REPEAT(
+ BOOST_VARIANT_LIMIT_TYPES
+ , BOOST_VARIANT_AUX_UNWRAP_RECURSIVE_TYPEDEFS
+ , _
+ )
+
+ #undef BOOST_VARIANT_AUX_UNWRAP_RECURSIVE_TYPEDEFS
+
+public: // public typedefs
+
+ typedef typename detail::variant::make_variant_list<
+ BOOST_VARIANT_ENUM_PARAMS(public_T)
+ >::type types;
+
+private: // helpers, for internal typedefs (below)
+
+ #define BOOST_VARIANT_AUX_MAKE_REFERENCE_CONTENT_TYPEDEFS(z,N,_) \
+ typedef detail::make_reference_content< \
+ BOOST_PP_CAT(recursive_enabled_T,N) \
+ >::type BOOST_PP_CAT(internal_T,N); \
+ /**/
+
+ BOOST_PP_REPEAT(
+ BOOST_VARIANT_LIMIT_TYPES
+ , BOOST_VARIANT_AUX_MAKE_REFERENCE_CONTENT_TYPEDEFS
+ , _
+ )
+
+ #undef BOOST_VARIANT_AUX_MAKE_REFERENCE_CONTENT_TYPEDEFS
+
+private: // internal typedefs
+
+ typedef typename detail::variant::make_variant_list<
+ BOOST_VARIANT_ENUM_PARAMS(internal_T)
+ >::type internal_types;
+
+private: // static precondition assertions
+
+ // NOTE TO USER :
+ // variant< type-sequence > syntax is not supported on this compiler!
+ //
+ BOOST_MPL_ASSERT_NOT(( is_sequence_based_ ));
+
+#endif // BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT workaround
+
+private: // helpers, for representation (below)
+
+ typedef typename detail::variant::find_fallback_type<
+ internal_types
+ >::type fallback_type_result_;
+
+ typedef typename fallback_type_result_::first
+ fallback_type_index_;
+ typedef typename fallback_type_result_::second
+ fallback_type_;
+
+ struct has_fallback_type_
+ : mpl::not_<
+ is_same< fallback_type_, detail::variant::no_fallback_type >
+ >
+ {
+ };
+
+ typedef has_fallback_type_
+ never_uses_backup_flag;
+
+ typedef typename detail::variant::make_storage<
+ internal_types, never_uses_backup_flag
+ >::type storage_t;
+
+#ifndef BOOST_NO_CXX11_NOEXCEPT
+ typedef typename detail::variant::is_variant_move_noexcept_constructible<
+ internal_types
+ > variant_move_noexcept_constructible;
+
+ typedef typename detail::variant::is_variant_move_noexcept_assignable<
+ internal_types
+ > variant_move_noexcept_assignable;
+
+#endif
+
+private: // helpers, for representation (below)
+
+ // which_ on:
+ // * [0, size<internal_types>) indicates stack content
+ // * [-size<internal_types>, 0) indicates pointer to heap backup
+ // if which_ >= 0:
+ // * then which() -> which_
+ // * else which() -> -(which_ + 1)
+
+#if !defined(BOOST_VARIANT_MINIMIZE_SIZE)
+
+ typedef int which_t;
+
+#else // defined(BOOST_VARIANT_MINIMIZE_SIZE)
+
+ // [if O1_size available, then attempt which_t size optimization...]
+ // [select signed char if fewer than SCHAR_MAX types, else signed int:]
+ typedef typename mpl::eval_if<
+ mpl::equal_to< mpl::O1_size<internal_types>, mpl::long_<-1> >
+ , mpl::identity< int >
+ , mpl::if_<
+ mpl::less< mpl::O1_size<internal_types>, mpl::int_<SCHAR_MAX> >
+ , signed char
+ , int
+ >
+ >::type which_t;
+
+#endif // BOOST_VARIANT_MINIMIZE_SIZE switch
+
+// representation -- private when possible
+#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
+ private:
+#else
+ public:
+#endif
+
+ which_t which_;
+ storage_t storage_;
+
+ void indicate_which(int which_arg) BOOST_NOEXCEPT
+ {
+ which_ = static_cast<which_t>( which_arg );
+ }
+
+ void indicate_backup_which(int which_arg) BOOST_NOEXCEPT
+ {
+ which_ = static_cast<which_t>( -(which_arg + 1) );
+ }
+
+private: // helpers, for queries (below)
+
+ bool using_backup() const BOOST_NOEXCEPT
+ {
+ return which_ < 0;
+ }
+
+public: // queries
+
+ int which() const BOOST_NOEXCEPT
+ {
+ // If using heap backup...
+ if (using_backup())
+ // ...then return adjusted which_:
+ return -(which_ + 1);
+
+ // Otherwise, return which_ directly:
+ return which_;
+ }
+
+private: // helpers, for structors (below)
+
+ struct initializer
+ : BOOST_VARIANT_AUX_INITIALIZER_T(
+ recursive_enabled_types, recursive_enabled_T
+ )
+ {
+ };
+
+ void destroy_content() BOOST_NOEXCEPT
+ {
+ detail::variant::destroyer visitor;
+ this->internal_apply_visitor(visitor);
+ }
+
+public: // structors
+
+ ~variant() BOOST_NOEXCEPT
+ {
+ destroy_content();
+ }
+
+ variant()
+#if !(defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x5130))
+ BOOST_NOEXCEPT_IF(boost::has_nothrow_constructor<internal_T0>::value)
+#endif
+ {
+#ifdef _MSC_VER
+#pragma warning( push )
+// behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized
+#pragma warning( disable : 4345 )
+#endif
+ // NOTE TO USER :
+ // Compile error from here indicates that the first bound
+ // type is not default-constructible, and so variant cannot
+ // support its own default-construction.
+ //
+ new( storage_.address() ) internal_T0();
+ indicate_which(0); // zero is the index of the first bounded type
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
+ }
+
+private: // helpers, for structors, cont. (below)
+
+ class convert_copy_into
+ : public static_visitor<int>
+ {
+ private: // representation
+
+ void* storage_;
+
+ public: // structors
+
+ explicit convert_copy_into(void* storage) BOOST_NOEXCEPT
+ : storage_(storage)
+ {
+ }
+
+ public: // internal visitor interfaces (below)
+
+ template <typename T>
+ int internal_visit(T& operand, int) const
+ {
+ // NOTE TO USER :
+ // Compile error here indicates one of the source variant's types
+ // cannot be unambiguously converted to the destination variant's
+ // types (or that no conversion exists).
+ //
+ return initializer::initialize(storage_, operand);
+ }
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0564))
+ template <typename T>
+ result_type internal_visit(const T& operand, int) const
+ {
+ return initializer::initialize(storage_, operand);
+ }
+# endif
+
+ template <typename T>
+ int internal_visit(boost::detail::reference_content<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(const boost::detail::reference_content<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(boost::detail::variant::backup_holder<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(const boost::detail::variant::backup_holder<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(boost::recursive_wrapper<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(const boost::recursive_wrapper<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ };
+
+ friend class convert_copy_into;
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ class convert_move_into
+ : public static_visitor<int>
+ {
+ private: // representation
+
+ void* storage_;
+
+ public: // structors
+
+ explicit convert_move_into(void* storage) BOOST_NOEXCEPT
+ : storage_(storage)
+ {
+ }
+
+ public: // internal visitor interfaces (below)
+
+ template <typename T>
+ int internal_visit(T& operand, int) const
+ {
+ // NOTE TO USER :
+ // Compile error here indicates one of the source variant's types
+ // cannot be unambiguously converted to the destination variant's
+ // types (or that no conversion exists).
+ //
+ return initializer::initialize(storage_, detail::variant::move(operand) );
+ }
+
+ template <typename T>
+ int internal_visit(boost::detail::reference_content<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(const boost::detail::reference_content<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(boost::detail::variant::backup_holder<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(const boost::detail::variant::backup_holder<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(boost::recursive_wrapper<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+
+ template <typename T>
+ int internal_visit(const boost::recursive_wrapper<T>& operand, long) const
+ {
+ return internal_visit( operand.get(), 1L );
+ }
+ };
+
+ friend class convert_move_into;
+#endif
+
+private: // helpers, for structors, below
+
+ template <typename T>
+ void convert_construct(
+ T& operand
+ , int
+ , mpl::false_ = mpl::false_() // is_foreign_variant
+ )
+ {
+ // NOTE TO USER :
+ // Compile error here indicates that the given type is not
+ // unambiguously convertible to one of the variant's types
+ // (or that no conversion exists).
+ //
+ indicate_which(
+ initializer::initialize(
+ storage_.address()
+ , operand
+ )
+ );
+ }
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ template <typename T>
+ typename boost::enable_if<boost::is_rvalue_reference<T&&> >::type convert_construct(
+ T&& operand
+ , int
+ , mpl::false_ = mpl::false_() // is_foreign_variant
+ )
+ {
+ // NOTE TO USER :
+ // Compile error here indicates that the given type is not
+ // unambiguously convertible to one of the variant's types
+ // (or that no conversion exists).
+ //
+ indicate_which(
+ initializer::initialize(
+ storage_.address()
+ , detail::variant::move(operand)
+ )
+ );
+ }
+#endif
+
+ template <typename Variant>
+ void convert_construct(
+ Variant& operand
+ , long
+ , mpl::true_// is_foreign_variant
+ )
+ {
+ convert_copy_into visitor(storage_.address());
+ indicate_which(
+ operand.internal_apply_visitor(visitor)
+ );
+ }
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ template <typename Variant>
+ typename boost::enable_if<boost::is_rvalue_reference<Variant&&> >::type convert_construct(
+ Variant&& operand
+ , long
+ , mpl::true_// is_foreign_variant
+ )
+ {
+ convert_move_into visitor(storage_.address());
+ indicate_which(
+ operand.internal_apply_visitor(visitor)
+ );
+ }
+#endif
+
+ template <typename Variant>
+ void convert_construct_variant(Variant& operand)
+ {
+ // [Determine if the given variant is itself a bounded type, or if its
+ // content needs to be converted (i.e., it is a 'foreign' variant):]
+ //
+
+ typedef typename mpl::find_if<
+ types
+ , is_same<
+ add_const<mpl::_1>
+ , const Variant
+ >
+ >::type found_it;
+
+ typedef typename mpl::end<types>::type not_found;
+ typedef typename is_same<
+ found_it, not_found
+ >::type is_foreign_variant;
+
+ // Convert construct from operand:
+ convert_construct(
+ operand, 1L
+ , is_foreign_variant()
+ );
+ }
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ template <typename Variant>
+ typename boost::enable_if<boost::is_rvalue_reference<Variant&&> >::type convert_construct_variant(Variant&& operand)
+ {
+ // [Determine if the given variant is itself a bounded type, or if its
+ // content needs to be converted (i.e., it is a 'foreign' variant):]
+ //
+
+ typedef typename mpl::find_if<
+ types
+ , is_same<
+ add_const<mpl::_1>
+ , const Variant
+ >
+ >::type found_it;
+
+ typedef typename mpl::end<types>::type not_found;
+ typedef typename is_same<
+ found_it, not_found
+ >::type is_foreign_variant;
+
+ // Convert move construct from operand:
+ convert_construct(
+ detail::variant::move(operand), 1L
+ , is_foreign_variant()
+ );
+ }
+#endif
+
+ template <BOOST_VARIANT_ENUM_PARAMS(typename U)>
+ void convert_construct(
+ boost::variant<BOOST_VARIANT_ENUM_PARAMS(U)>& operand
+ , long
+ )
+ {
+ convert_construct_variant(operand);
+ }
+
+ template <BOOST_VARIANT_ENUM_PARAMS(typename U)>
+ void convert_construct(
+ const boost::variant<BOOST_VARIANT_ENUM_PARAMS(U)>& operand
+ , long
+ )
+ {
+ convert_construct_variant(operand);
+ }
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ template <BOOST_VARIANT_ENUM_PARAMS(typename U)>
+ void convert_construct(
+ boost::variant<BOOST_VARIANT_ENUM_PARAMS(U)>&& operand
+ , long
+ )
+ {
+ convert_construct_variant( detail::variant::move(operand) );
+ }
+#endif
+
+public: // structors, cont.
+
+#if !defined(BOOST_VARIANT_AUX_BROKEN_CONSTRUCTOR_TEMPLATE_ORDERING)
+
+ template <typename T>
+ variant(const T& operand)
+ {
+ convert_construct(operand, 1L);
+ }
+
+ template <typename T>
+ variant(T& operand)
+ {
+ convert_construct(operand, 1L);
+ }
+
+#elif defined(BOOST_VARIANT_AUX_HAS_CONSTRUCTOR_TEMPLATE_ORDERING_SFINAE_WKND)
+
+ // For compilers that cannot distinguish between T& and const T& in
+ // template constructors, but do fully support SFINAE, we can workaround:
+
+ template <typename T>
+ variant(const T& operand)
+ {
+ convert_construct(operand, 1L);
+ }
+
+ template <typename T>
+ variant(
+ T& operand
+ , typename enable_if<
+ mpl::not_< is_const<T> >
+ , void
+ >::type* = 0
+ )
+ {
+ convert_construct(operand, 1L);
+ }
+
+#else // !defined(BOOST_VARIANT_AUX_HAS_CONSTRUCTOR_TEMPLATE_ORDERING_SFINAE_WKND)
+
+ // For compilers that cannot distinguish between T& and const T& in
+ // template constructors, and do NOT support SFINAE, we can't workaround:
+
+ template <typename T>
+ variant(const T& operand)
+ {
+ convert_construct(operand, 1L);
+ }
+#endif // BOOST_VARIANT_AUX_BROKEN_CONSTRUCTOR_TEMPLATE_ORDERING workarounds
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ template <class T>
+ variant(T&& operand, typename boost::enable_if<boost::is_rvalue_reference<T&&> >::type* = 0,
+ typename boost::disable_if<boost::is_const<T> >::type* = 0)
+ {
+ convert_construct( detail::variant::move(operand), 1L);
+ }
+#endif
+
+public: // structors, cont.
+
+ // [MSVC6 requires copy constructor appear after template constructors]
+ variant(const variant& operand)
+ {
+ // Copy the value of operand into *this...
+ detail::variant::copy_into visitor( storage_.address() );
+ operand.internal_apply_visitor(visitor);
+
+ // ...and activate the *this's primary storage on success:
+ indicate_which(operand.which());
+ }
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ variant(variant&& operand) BOOST_NOEXCEPT_IF(variant_move_noexcept_constructible::type::value)
+ {
+ // Move the value of operand into *this...
+ detail::variant::move_into visitor( storage_.address() );
+ operand.internal_apply_visitor(visitor);
+
+ // ...and activate the *this's primary storage on success:
+ indicate_which(operand.which());
+ }
+#endif
+
+private: // helpers, for modifiers (below)
+
+# if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
+ template <typename Variant>
+ friend class detail::variant::backup_assigner;
+# endif
+
+ // class assigner
+ //
+ // Internal visitor that "assigns" the visited value to the given variant
+ // by appropriate destruction and copy-construction.
+ //
+
+ class assigner
+ : public static_visitor<>
+ {
+ protected: // representation
+
+ variant& lhs_;
+ const int rhs_which_;
+
+ public: // structors
+
+ assigner(variant& lhs, int rhs_which) BOOST_NOEXCEPT
+ : lhs_(lhs)
+ , rhs_which_(rhs_which)
+ {
+ }
+
+ protected: // helpers, for internal visitor interface (below)
+
+ template <typename RhsT, typename B1, typename B2>
+ void assign_impl(
+ const RhsT& rhs_content
+ , mpl::true_ // has_nothrow_copy
+ , B1 // is_nothrow_move_constructible
+ , B2 // has_fallback_type
+ ) const BOOST_NOEXCEPT
+ {
+ // Destroy lhs's content...
+ lhs_.destroy_content(); // nothrow
+
+ // ...copy rhs content into lhs's storage...
+ new(lhs_.storage_.address())
+ RhsT( rhs_content ); // nothrow
+
+ // ...and indicate new content type:
+ lhs_.indicate_which(rhs_which_); // nothrow
+ }
+
+ template <typename RhsT, typename B>
+ void assign_impl(
+ const RhsT& rhs_content
+ , mpl::false_ // has_nothrow_copy
+ , mpl::true_ // is_nothrow_move_constructible
+ , B // has_fallback_type
+ ) const
+ {
+ // Attempt to make a temporary copy (so as to move it below)...
+ RhsT temp(rhs_content);
+
+ // ...and upon success destroy lhs's content...
+ lhs_.destroy_content(); // nothrow
+
+ // ...move the temporary copy into lhs's storage...
+ new(lhs_.storage_.address())
+ RhsT( detail::variant::move(temp) ); // nothrow
+
+ // ...and indicate new content type:
+ lhs_.indicate_which(rhs_which_); // nothrow
+ }
+
+ void construct_fallback() const BOOST_NOEXCEPT {
+ // In case of failure, default-construct fallback type in lhs's storage...
+ new (lhs_.storage_.address())
+ fallback_type_; // nothrow
+
+ // ...indicate construction of fallback type...
+ lhs_.indicate_which(
+ BOOST_MPL_AUX_VALUE_WKND(fallback_type_index_)::value
+ ); // nothrow
+ }
+
+ template <typename RhsT>
+ void assign_impl(
+ const RhsT& rhs_content
+ , mpl::false_ // has_nothrow_copy
+ , mpl::false_ // is_nothrow_move_constructible
+ , mpl::true_ // has_fallback_type
+ ) const
+ {
+ // Destroy lhs's content...
+ lhs_.destroy_content(); // nothrow
+
+ BOOST_TRY
+ {
+ // ...and attempt to copy rhs's content into lhs's storage:
+ new(lhs_.storage_.address())
+ RhsT( rhs_content );
+ }
+ BOOST_CATCH (...)
+ {
+ construct_fallback();
+
+ // ...and rethrow:
+ BOOST_RETHROW;
+ }
+ BOOST_CATCH_END
+
+ // In the event of success, indicate new content type:
+ lhs_.indicate_which(rhs_which_); // nothrow
+ }
+
+ template <typename RhsT>
+ void assign_impl(
+ const RhsT& rhs_content
+ , mpl::false_ // has_nothrow_copy
+ , mpl::false_ // is_nothrow_move_constructible
+ , mpl::false_ // has_fallback_type
+ ) const
+ {
+ detail::variant::backup_assigner<wknd_self_t>
+ visitor(lhs_, rhs_which_, rhs_content);
+ lhs_.internal_apply_visitor(visitor);
+ }
+
+ public: // internal visitor interfaces
+
+ template <typename RhsT>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(const RhsT& rhs_content, int) const
+ {
+ typedef typename has_nothrow_copy<RhsT>::type
+ nothrow_copy;
+ typedef typename mpl::or_< // reduces compile-time
+ nothrow_copy
+ , is_nothrow_move_constructible<RhsT>
+ >::type nothrow_move_constructor;
+
+ assign_impl(
+ rhs_content
+ , nothrow_copy()
+ , nothrow_move_constructor()
+ , has_fallback_type_()
+ );
+
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
+ private:
+ // silence MSVC warning C4512: assignment operator could not be generated
+ assigner& operator= (assigner const&);
+#endif
+ };
+
+ friend class assigner;
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ // class move_assigner
+ //
+ // Internal visitor that "move assigns" the visited value to the given variant
+ // by appropriate destruction and move-construction.
+ //
+
+ class move_assigner
+ : public assigner
+ {
+ public: // structors
+
+ move_assigner(variant& lhs, int rhs_which) BOOST_NOEXCEPT
+ : assigner(lhs, rhs_which)
+ {
+ }
+
+ private: // helpers, for internal visitor interface (below)
+
+ template <typename RhsT, typename B2>
+ void assign_impl(
+ RhsT& rhs_content
+ , mpl::true_ // has_nothrow_copy
+ , mpl::false_ // is_nothrow_move_constructible
+ , B2 // has_fallback_type
+ ) const BOOST_NOEXCEPT
+ {
+ assigner::assign_impl(rhs_content, mpl::true_(), mpl::false_(), B2());
+ }
+
+ template <typename RhsT, typename B, typename B2>
+ void assign_impl(
+ RhsT& rhs_content
+ , B // has_nothrow_copy
+ , mpl::true_ // is_nothrow_move_constructible
+ , B2 // has_fallback_type
+ ) const BOOST_NOEXCEPT
+ {
+ // ...destroy lhs's content...
+ assigner::lhs_.destroy_content(); // nothrow
+
+ // ...move the rhs_content into lhs's storage...
+ new(assigner::lhs_.storage_.address())
+ RhsT( detail::variant::move(rhs_content) ); // nothrow
+
+ // ...and indicate new content type:
+ assigner::lhs_.indicate_which(assigner::rhs_which_); // nothrow
+ }
+
+ template <typename RhsT>
+ void assign_impl(
+ RhsT& rhs_content
+ , mpl::false_ // has_nothrow_copy
+ , mpl::false_ // is_nothrow_move_constructible
+ , mpl::true_ // has_fallback_type
+ ) const
+ {
+ // Destroy lhs's content...
+ assigner::lhs_.destroy_content(); // nothrow
+
+ BOOST_TRY
+ {
+ // ...and attempt to copy rhs's content into lhs's storage:
+ new(assigner::lhs_.storage_.address())
+ RhsT( detail::variant::move(rhs_content) );
+ }
+ BOOST_CATCH (...)
+ {
+ assigner::construct_fallback();
+
+ // ...and rethrow:
+ BOOST_RETHROW;
+ }
+ BOOST_CATCH_END
+
+ // In the event of success, indicate new content type:
+ assigner::lhs_.indicate_which(assigner::rhs_which_); // nothrow
+ }
+
+ template <typename RhsT>
+ void assign_impl(
+ RhsT& rhs_content
+ , mpl::false_ // has_nothrow_copy
+ , mpl::false_ // is_nothrow_move_constructible
+ , mpl::false_ // has_fallback_type
+ ) const
+ {
+ assigner::assign_impl(rhs_content, mpl::false_(), mpl::false_(), mpl::false_());
+ }
+
+ public: // internal visitor interfaces
+
+ template <typename RhsT>
+ BOOST_VARIANT_AUX_RETURN_VOID_TYPE
+ internal_visit(RhsT& rhs_content, int) const
+ {
+ typedef typename is_nothrow_move_constructible<RhsT>::type
+ nothrow_move_constructor;
+ typedef typename mpl::or_< // reduces compile-time
+ nothrow_move_constructor
+ , has_nothrow_copy<RhsT>
+ >::type nothrow_copy;
+
+ assign_impl(
+ rhs_content
+ , nothrow_copy()
+ , nothrow_move_constructor()
+ , has_fallback_type_()
+ );
+
+ BOOST_VARIANT_AUX_RETURN_VOID;
+ }
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
+ private:
+ // silence MSVC warning C4512: assignment operator could not be generated
+ move_assigner& operator= (move_assigner const&);
+#endif
+ };
+
+ friend class move_assigner;
+#endif // BOOST_NO_CXX11_RVALUE_REFERENCES
+
+ void variant_assign(const variant& rhs)
+ {
+ // If the contained types are EXACTLY the same...
+ if (which_ == rhs.which_)
+ {
+ // ...then assign rhs's storage to lhs's content:
+ detail::variant::assign_storage visitor(rhs.storage_.address());
+ this->internal_apply_visitor(visitor);
+ }
+ else
+ {
+ // Otherwise, perform general (copy-based) variant assignment:
+ assigner visitor(*this, rhs.which());
+ rhs.internal_apply_visitor(visitor);
+ }
+ }
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ void variant_assign(variant&& rhs)
+ {
+ // If the contained types are EXACTLY the same...
+ if (which_ == rhs.which_)
+ {
+ // ...then move rhs's storage to lhs's content:
+ detail::variant::move_storage visitor(rhs.storage_.address());
+ this->internal_apply_visitor(visitor);
+ }
+ else
+ {
+ // Otherwise, perform general (move-based) variant assignment:
+ move_assigner visitor(*this, rhs.which());
+ rhs.internal_apply_visitor(visitor);
+ }
+ }
+#endif // BOOST_NO_CXX11_RVALUE_REFERENCES
+
+private: // helpers, for modifiers (below)
+
+ template <typename T>
+ void assign(const T& rhs)
+ {
+ // If direct T-to-T assignment is not possible...
+ detail::variant::direct_assigner<T> direct_assign(rhs);
+ if (this->apply_visitor(direct_assign) == false)
+ {
+ // ...then convert rhs to variant and assign:
+ //
+ // While potentially inefficient, the following construction of a
+ // variant allows T as any type convertible to one of the bounded
+ // types without excessive code redundancy.
+ //
+ variant temp(rhs);
+ variant_assign( detail::variant::move(temp) );
+ }
+ }
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ template <typename T>
+ void move_assign(T&& rhs)
+ {
+ // If direct T-to-T move assignment is not possible...
+ detail::variant::direct_mover<T> direct_move(rhs);
+ if (this->apply_visitor(direct_move) == false)
+ {
+ // ...then convert rhs to variant and assign:
+ //
+ // While potentially inefficient, the following construction of a
+ // variant allows T as any type convertible to one of the bounded
+ // types without excessive code redundancy.
+ //
+ variant temp( detail::variant::move(rhs) );
+ variant_assign( detail::variant::move(temp) );
+ }
+ }
+#endif // BOOST_NO_CXX11_RVALUE_REFERENCES
+
+public: // modifiers
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ template <class T>
+ typename boost::enable_if_c<boost::is_rvalue_reference<T&&>::value && !boost::is_const<T>::value, variant& >::type
+ operator=(T&& rhs)
+ {
+ move_assign( detail::variant::move(rhs) );
+ return *this;
+ }
+#endif // BOOST_NO_CXX11_RVALUE_REFERENCES
+
+ template <typename T>
+ variant& operator=(const T& rhs)
+ {
+ assign(rhs);
+ return *this;
+ }
+
+ // [MSVC6 requires copy assign appear after templated operator=]
+ variant& operator=(const variant& rhs)
+ {
+ variant_assign(rhs);
+ return *this;
+ }
+
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ variant& operator=(variant&& rhs)
+#if !defined(__GNUC__) || (__GNUC__ != 4) || (__GNUC_MINOR__ > 6)
+ BOOST_NOEXCEPT_IF(variant_move_noexcept_constructible::type::value && variant_move_noexcept_assignable::type::value)
+#endif
+ {
+ variant_assign( detail::variant::move(rhs) );
+ return *this;
+ }
+#endif // BOOST_NO_CXX11_RVALUE_REFERENCES
+
+ void swap(variant& rhs)
+ {
+ // If the contained types are the same...
+ if (which() == rhs.which())
+ {
+ // ...then swap the values directly:
+ detail::variant::swap_with<variant> visitor(rhs);
+ this->apply_visitor(visitor);
+ }
+ else
+ {
+ // ...otherwise, perform general variant swap:
+ variant tmp( detail::variant::move(rhs) );
+ rhs = detail::variant::move(*this);
+ *this = detail::variant::move(tmp);
+ }
+ }
+
+public: // queries
+
+ //
+ // NOTE: member which() defined above.
+ //
+
+ bool empty() const BOOST_NOEXCEPT
+ {
+ return false;
+ }
+
+ const boost::typeindex::type_info& type() const
+ {
+ detail::variant::reflect visitor;
+ return this->apply_visitor(visitor);
+ }
+
+public: // prevent comparison with foreign types
+
+// Obsolete. Remove.
+# define BOOST_VARIANT_AUX_FAIL_COMPARISON_RETURN_TYPE \
+ void
+
+ template <typename U>
+ void operator==(const U&) const
+ {
+ BOOST_STATIC_ASSERT( false && sizeof(U) );
+ }
+
+ template <typename U>
+ void operator<(const U&) const
+ {
+ BOOST_STATIC_ASSERT( false && sizeof(U) );
+ }
+
+ template <typename U>
+ void operator!=(const U&) const
+ {
+ BOOST_STATIC_ASSERT( false && sizeof(U) );
+ }
+
+ template <typename U>
+ void operator>(const U&) const
+ {
+ BOOST_STATIC_ASSERT( false && sizeof(U) );
+ }
+
+ template <typename U>
+ void operator<=(const U&) const
+ {
+ BOOST_STATIC_ASSERT( false && sizeof(U) );
+ }
+
+ template <typename U>
+ void operator>=(const U&) const
+ {
+ BOOST_STATIC_ASSERT( false && sizeof(U) );
+ }
+
+public: // comparison operators
+
+ // [MSVC6 requires these operators appear after template operators]
+
+ bool operator==(const variant& rhs) const
+ {
+ if (this->which() != rhs.which())
+ return false;
+
+ detail::variant::comparer<
+ variant, detail::variant::equal_comp
+ > visitor(*this);
+ return rhs.apply_visitor(visitor);
+ }
+
+ bool operator<(const variant& rhs) const
+ {
+ //
+ // Dirk Schreib suggested this collating order.
+ //
+
+ if (this->which() != rhs.which())
+ return this->which() < rhs.which();
+
+ detail::variant::comparer<
+ variant, detail::variant::less_comp
+ > visitor(*this);
+ return rhs.apply_visitor(visitor);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // comparison operators != > <= >=
+ inline bool operator!=(const variant& rhs) const
+ {
+ return !(*this == rhs);
+ }
+
+ inline bool operator>(const variant& rhs) const
+ {
+ return rhs < *this;
+ }
+
+ inline bool operator<=(const variant& rhs) const
+ {
+ return !(*this > rhs);
+ }
+
+ inline bool operator>=(const variant& rhs) const
+ {
+ return !(*this < rhs);
+ }
+
+// helpers, for visitation support (below) -- private when possible
+#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
+
+ template < BOOST_VARIANT_ENUM_PARAMS(typename U) >
+ friend class variant;
+
+private:
+
+#else// defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
+
+public:
+
+#endif// !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
+
+ template <typename Visitor, typename VoidPtrCV>
+ static
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(
+ typename Visitor::result_type
+ )
+ internal_apply_visitor_impl(
+ int internal_which
+ , int logical_which
+ , Visitor& visitor
+ , VoidPtrCV storage
+ )
+ {
+ typedef mpl::int_<0> first_which;
+ typedef typename mpl::begin<internal_types>::type first_it;
+ typedef typename mpl::end<internal_types>::type last_it;
+
+ typedef detail::variant::visitation_impl_step<
+ first_it, last_it
+ > first_step;
+
+ return detail::variant::visitation_impl(
+ internal_which, logical_which
+ , visitor, storage, mpl::false_()
+ , never_uses_backup_flag()
+ , static_cast<first_which*>(0), static_cast<first_step*>(0)
+ );
+ }
+
+ template <typename Visitor>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(
+ typename Visitor::result_type
+ )
+ internal_apply_visitor(Visitor& visitor)
+ {
+ return internal_apply_visitor_impl(
+ which_, which(), visitor, storage_.address()
+ );
+ }
+
+ template <typename Visitor>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(
+ typename Visitor::result_type
+ )
+ internal_apply_visitor(Visitor& visitor) const
+ {
+ return internal_apply_visitor_impl(
+ which_, which(), visitor, storage_.address()
+ );
+ }
+
+public: // visitation support
+
+ template <typename Visitor>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(
+ typename Visitor::result_type
+ )
+ apply_visitor(Visitor& visitor)
+ {
+ detail::variant::invoke_visitor<Visitor> invoker(visitor);
+ return this->internal_apply_visitor(invoker);
+ }
+
+ template <typename Visitor>
+ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(
+ typename Visitor::result_type
+ )
+ apply_visitor(Visitor& visitor) const
+ {
+ detail::variant::invoke_visitor<Visitor> invoker(visitor);
+ return this->internal_apply_visitor(invoker);
+ }
+
+}; // class variant
+
+///////////////////////////////////////////////////////////////////////////////
+// metafunction make_variant_over
+//
+// See docs and boost/variant/variant_fwd.hpp for more information.
+//
+template <typename Types>
+struct make_variant_over
+{
+private: // precondition assertions
+
+ BOOST_STATIC_ASSERT(( ::boost::mpl::is_sequence<Types>::value ));
+
+public: // metafunction result
+
+ typedef variant<
+ detail::variant::over_sequence< Types >
+ > type;
+
+};
+
+
+///////////////////////////////////////////////////////////////////////////////
+// function template swap
+//
+// Swaps two variants of the same type (i.e., identical specification).
+//
+template < BOOST_VARIANT_ENUM_PARAMS(typename T) >
+inline void swap(
+ variant< BOOST_VARIANT_ENUM_PARAMS(T) >& lhs
+ , variant< BOOST_VARIANT_ENUM_PARAMS(T) >& rhs
+ )
+{
+ lhs.swap(rhs);
+}
+
+} // namespace boost
+
+// implementation additions
+
+#if !defined(BOOST_NO_IOSTREAM)
+#include "boost/variant/detail/variant_io.hpp"
+#endif // BOOST_NO_IOSTREAM
+
+#endif // BOOST_VARIANT_VARIANT_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost variant/variant_fwd.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003 Eric Friedman, Itay Maman
+// Copyright (c) 2013 Antony Polukhin
+//
+// 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_VARIANT_VARIANT_FWD_HPP
+#define BOOST_VARIANT_VARIANT_FWD_HPP
+
+#include "boost/variant/detail/config.hpp"
+
+#include "boost/blank_fwd.hpp"
+#include "boost/mpl/arg.hpp"
+#include "boost/mpl/limits/arity.hpp"
+#include "boost/mpl/aux_/na.hpp"
+#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/enum.hpp"
+#include "boost/preprocessor/enum_params.hpp"
+#include "boost/preprocessor/enum_shifted_params.hpp"
+#include "boost/preprocessor/repeat.hpp"
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_NO_REFERENCE_SUPPORT
+//
+// Defined if variant does not support references as bounded types.
+//
+#if defined(BOOST_VARIANT_AUX_BROKEN_CONSTRUCTOR_TEMPLATE_ORDERING) \
+ && !defined(BOOST_VARIANT_AUX_HAS_CONSTRUCTOR_TEMPLATE_ORDERING_SFINAE_WKND) \
+ && !defined(BOOST_VARIANT_NO_REFERENCE_SUPPORT)
+# define BOOST_VARIANT_NO_REFERENCE_SUPPORT
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT
+//
+// Defined if variant does not support make_variant_over (see below).
+//
+#if defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
+# define BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT
+//
+// Defined if make_recursive_variant cannot be supported as documented.
+//
+// Note: Currently, MPL lambda facility is used as workaround if defined, and
+// so only types declared w/ MPL lambda workarounds will work.
+//
+
+#include "boost/variant/detail/substitute_fwd.hpp"
+
+#if defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE) \
+ && !defined(BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT)
+# define BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT
+#endif
+
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
+//
+
+/*
+ GCC before 4.0 had no variadic tempaltes;
+ GCC 4.6 has incomplete implementation of variadic templates.
+
+ MSVC2013 has variadic templates, but they have issues.
+
+ NOTE: Clang compiler defines __GNUC__
+*/
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) \
+ || (!defined(__clang__) && defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 7)) \
+ || (defined(_MSC_VER) && (_MSC_VER <= 1900)) \
+ || defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE) \
+ || defined (BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT)
+
+#ifndef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
+# define BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
+#endif
+
+#endif
+
+#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+#include <boost/preprocessor/seq/size.hpp>
+
+#define BOOST_VARIANT_CLASS_OR_TYPENAME_TO_SEQ_class class)(
+#define BOOST_VARIANT_CLASS_OR_TYPENAME_TO_SEQ_typename typename)(
+
+#define BOOST_VARIANT_CLASS_OR_TYPENAME_TO_VARIADIC_class class...
+#define BOOST_VARIANT_CLASS_OR_TYPENAME_TO_VARIADIC_typename typename...
+
+#define ARGS_VARIADER_1(x) x ## N...
+#define ARGS_VARIADER_2(x) BOOST_VARIANT_CLASS_OR_TYPENAME_TO_VARIADIC_ ## x ## N
+
+#define BOOST_VARIANT_MAKE_VARIADIC(sequence, x) BOOST_VARIANT_MAKE_VARIADIC_I(BOOST_PP_SEQ_SIZE(sequence), x)
+#define BOOST_VARIANT_MAKE_VARIADIC_I(argscount, x) BOOST_VARIANT_MAKE_VARIADIC_II(argscount, x)
+#define BOOST_VARIANT_MAKE_VARIADIC_II(argscount, orig) ARGS_VARIADER_ ## argscount(orig)
+
+///////////////////////////////////////////////////////////////////////////////
+// BOOST_VARIANT_ENUM_PARAMS and BOOST_VARIANT_ENUM_SHIFTED_PARAMS
+//
+// Convenience macro for enumeration of variant params.
+// When variadic templates are available expands:
+// BOOST_VARIANT_ENUM_PARAMS(class Something) => class Something0, class... SomethingN
+// BOOST_VARIANT_ENUM_PARAMS(typename Something) => typename Something0, typename... SomethingN
+// BOOST_VARIANT_ENUM_PARAMS(Something) => Something0, SomethingN...
+// BOOST_VARIANT_ENUM_PARAMS(Something) => Something0, SomethingN...
+// BOOST_VARIANT_ENUM_SHIFTED_PARAMS(class Something) => class... SomethingN
+// BOOST_VARIANT_ENUM_SHIFTED_PARAMS(typename Something) => typename... SomethingN
+// BOOST_VARIANT_ENUM_SHIFTED_PARAMS(Something) => SomethingN...
+// BOOST_VARIANT_ENUM_SHIFTED_PARAMS(Something) => SomethingN...
+//
+// Rationale: Cleaner, simpler code for clients of variant library. Minimal
+// code modifications to move from C++03 to C++11.
+//
+// With BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES defined
+// will be used BOOST_VARIANT_ENUM_PARAMS and BOOST_VARIANT_ENUM_SHIFTED_PARAMS from below `#else`
+//
+
+#define BOOST_VARIANT_ENUM_PARAMS(x) \
+ x ## 0, \
+ BOOST_VARIANT_MAKE_VARIADIC( (BOOST_VARIANT_CLASS_OR_TYPENAME_TO_SEQ_ ## x), x) \
+ /**/
+
+#define BOOST_VARIANT_ENUM_SHIFTED_PARAMS(x) \
+ BOOST_VARIANT_MAKE_VARIADIC( (BOOST_VARIANT_CLASS_OR_TYPENAME_TO_SEQ_ ## x), x) \
+ /**/
+
+#else // defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_LIMIT_TYPES
+//
+// Implementation-defined preprocessor symbol describing the actual
+// length of variant's pseudo-variadic template parameter list.
+//
+#include "boost/mpl/limits/list.hpp"
+#define BOOST_VARIANT_LIMIT_TYPES \
+ BOOST_MPL_LIMIT_LIST_SIZE
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_RECURSIVE_VARIANT_MAX_ARITY
+//
+// Exposes maximum allowed arity of class templates with recursive_variant
+// arguments. That is,
+// make_recursive_variant< ..., T<[1], recursive_variant_, ... [N]> >.
+//
+#include "boost/mpl/limits/arity.hpp"
+#define BOOST_VARIANT_RECURSIVE_VARIANT_MAX_ARITY \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_ENUM_PARAMS
+//
+// Convenience macro for enumeration of BOOST_VARIANT_LIMIT_TYPES params.
+//
+// Rationale: Cleaner, simpler code for clients of variant library.
+//
+#define BOOST_VARIANT_ENUM_PARAMS( param ) \
+ BOOST_PP_ENUM_PARAMS(BOOST_VARIANT_LIMIT_TYPES, param)
+
+///////////////////////////////////////////////////////////////////////////////
+// macro BOOST_VARIANT_ENUM_SHIFTED_PARAMS
+//
+// Convenience macro for enumeration of BOOST_VARIANT_LIMIT_TYPES-1 params.
+//
+#define BOOST_VARIANT_ENUM_SHIFTED_PARAMS( param ) \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_VARIANT_LIMIT_TYPES, param)
+
+#endif // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES workaround
+
+
+namespace boost {
+
+namespace detail { namespace variant {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class void_ and class template convert_void
+//
+// Provides the mechanism by which void(NN) types are converted to
+// mpl::void_ (and thus can be passed to mpl::list).
+//
+// Rationale: This is particularly needed for the using-declarations
+// workaround (below), but also to avoid associating mpl namespace with
+// variant in argument dependent lookups (which used to happen because of
+// defaulting of template parameters to mpl::void_).
+//
+
+struct void_;
+
+template <typename T>
+struct convert_void
+{
+ typedef T type;
+};
+
+template <>
+struct convert_void< void_ >
+{
+ typedef mpl::na type;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (workaround) BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
+//
+// Needed to work around compilers that don't support using-declaration
+// overloads. (See the variant::initializer workarounds below.)
+//
+
+#if defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
+// (detail) tags voidNN -- NN defined on [0, BOOST_VARIANT_LIMIT_TYPES)
+//
+// Defines void types that are each unique and specializations of
+// convert_void that yields mpl::na for each voidNN type.
+//
+
+#define BOOST_VARIANT_DETAIL_DEFINE_VOID_N(z,N,_) \
+ struct BOOST_PP_CAT(void,N); \
+ \
+ template <> \
+ struct convert_void< BOOST_PP_CAT(void,N) > \
+ { \
+ typedef mpl::na type; \
+ }; \
+ /**/
+
+BOOST_PP_REPEAT(
+ BOOST_VARIANT_LIMIT_TYPES
+ , BOOST_VARIANT_DETAIL_DEFINE_VOID_N
+ , _
+ )
+
+#undef BOOST_VARIANT_DETAIL_DEFINE_VOID_N
+
+#endif // BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE workaround
+
+}} // namespace detail::variant
+
+#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+# define BOOST_VARIANT_AUX_DECLARE_PARAMS BOOST_VARIANT_ENUM_PARAMS(typename T)
+#else // defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) macro BOOST_VARIANT_AUX_DECLARE_PARAM
+//
+// Template parameter list for variant and recursive_variant declarations.
+//
+
+#if !defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
+
+# define BOOST_VARIANT_AUX_DECLARE_PARAMS_IMPL(z, N, T) \
+ typename BOOST_PP_CAT(T,N) = detail::variant::void_ \
+ /**/
+
+#else // defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
+
+# define BOOST_VARIANT_AUX_DECLARE_PARAMS_IMPL(z, N, T) \
+ typename BOOST_PP_CAT(T,N) = BOOST_PP_CAT(detail::variant::void,N) \
+ /**/
+
+#endif // BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE workaround
+
+#define BOOST_VARIANT_AUX_DECLARE_PARAMS \
+ BOOST_PP_ENUM( \
+ BOOST_VARIANT_LIMIT_TYPES \
+ , BOOST_VARIANT_AUX_DECLARE_PARAMS_IMPL \
+ , T \
+ ) \
+ /**/
+
+#endif // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES workaround
+
+///////////////////////////////////////////////////////////////////////////////
+// class template variant (concept inspired by Andrei Alexandrescu)
+//
+// Efficient, type-safe bounded discriminated union.
+//
+// Preconditions:
+// - Each type must be unique.
+// - No type may be const-qualified.
+//
+// Proper declaration form:
+// variant<types> (where types is a type-sequence)
+// or
+// variant<T0,T1,...,Tn> (where T0 is NOT a type-sequence)
+//
+template < BOOST_VARIANT_AUX_DECLARE_PARAMS > class variant;
+
+///////////////////////////////////////////////////////////////////////////////
+// metafunction make_recursive_variant
+//
+// Exposes a boost::variant with recursive_variant_ tags (below) substituted
+// with the variant itself (wrapped as needed with boost::recursive_wrapper).
+//
+template < BOOST_VARIANT_AUX_DECLARE_PARAMS > struct make_recursive_variant;
+
+#undef BOOST_VARIANT_AUX_DECLARE_PARAMS_IMPL
+#undef BOOST_VARIANT_AUX_DECLARE_PARAMS
+
+///////////////////////////////////////////////////////////////////////////////
+// type recursive_variant_
+//
+// Tag type indicates where recursive variant substitution should occur.
+//
+#if !defined(BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT)
+ struct recursive_variant_ {};
+#else
+ typedef mpl::arg<1> recursive_variant_;
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// metafunction make_variant_over
+//
+// Result is a variant w/ types of the specified type sequence.
+//
+template <typename Types> struct make_variant_over;
+
+///////////////////////////////////////////////////////////////////////////////
+// metafunction make_recursive_variant_over
+//
+// Result is a recursive variant w/ types of the specified type sequence.
+//
+template <typename Types> struct make_recursive_variant_over;
+
+} // namespace boost
+
+#endif // BOOST_VARIANT_VARIANT_FWD_HPP
boost/cstdint.hpp \
boost/lexical_cast.hpp \
boost/regex.hpp \
- boost/signal.hpp \
- boost/signals/connection.hpp \
- boost/signals/trackable.hpp \
+ boost/signals2.hpp \
+ boost/signals2/connection.hpp \
+ boost/signals2/trackable.hpp \
\
needed
-# work around bcp pulling in too much:
-rm -rf needed/boost/typeof
-
# we do not use the provided MSVC project files
find needed -name '*.vcpro*' | xargs rm
rm -rf needed
# found by bcp but not needed by us
+rm -rf boost/typeof
rm -rf libs/config
rm -rf libs/smart_ptr
-rm -rf libs/signals/build
rm -rf libs/regex/build
rm -rf libs/regex/test
add_subdirectory(regex)
endif()
-
-add_subdirectory(signals)
-
+++ /dev/null
-# This file is part of LyX, the document processor.
-# Licence details can be found in the file COPYING.
-#
-# Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
-#
-
-project(boost_signals)
-
-set(boost_signals_sources
- connection.cpp
- named_slot_map.cpp
- signal_base.cpp
- slot.cpp
- trackable.cpp
-)
-
-lyx_add_path(boost_signals_sources ${TOP_SRC_DIR}/3rdparty/boost/libs/signals/src)
-
-if(NOT LYX_MERGE_FILES)
- add_library(boost_signals STATIC ${boost_signals_sources})
-else()
- lyx_const_touched_files(_allinone boost_signals_sources)
- add_library(boost_signals STATIC ${_allinone_files})
-endif()
-
-set_target_properties(boost_signals PROPERTIES FOLDER "3rd_party")
+++ /dev/null
-#
-# Copyright Troy D. Straszheim
-#
-# Distributed under the Boost Software License, Version 1.0.
-# See http://www.boost.org/LICENSE_1_0.txt
-#
-add_definitions(-DBOOST_SIGNALS_NO_LIB=1)
-
-boost_add_library(
- boost_signals
- trackable.cpp connection.cpp named_slot_map.cpp signal_base.cpp slot.cpp
- SHARED_COMPILE_FLAGS "-DBOOST_SIGNALS_DYN_LINK=1"
- )
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_SIGNALS_SOURCE
-
-#include <boost/signals/connection.hpp>
-#include <cassert>
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
-
- connection::connection(const connection& other) :
- con(other.con), controlling_connection(other.controlling_connection)
- {
- }
-
- connection::~connection()
- {
- if (controlling_connection) {
- disconnect();
- }
- }
-
- void
- connection::reset(BOOST_SIGNALS_NAMESPACE::detail::basic_connection* new_con)
- {
- con.reset(new_con);
- }
-
- bool connection::operator==(const connection& other) const
- {
- return con.get() == other.con.get();
- }
-
- bool connection::operator<(const connection& other) const
- {
- return con.get() < other.con.get();
- }
-
- connection& connection::operator=(const connection& other)
- {
- connection(other).swap(*this);
- return *this;
- }
-
- void connection::swap(connection& other)
- {
- this->con.swap(other.con);
- std::swap(this->controlling_connection, other.controlling_connection);
- }
-
- void swap(connection& c1, connection& c2)
- {
- c1.swap(c2);
- }
-
- scoped_connection::scoped_connection(const connection& other) :
- connection(other),
- released(false)
- {
- }
-
- scoped_connection::scoped_connection(const scoped_connection& other) :
- connection(other),
- released(other.released)
- {
- }
-
- scoped_connection::~scoped_connection()
- {
- if (!released) {
- this->disconnect();
- }
- }
-
- connection scoped_connection::release()
- {
- released = true;
- return *this;
- }
-
- void scoped_connection::swap(scoped_connection& other)
- {
- this->connection::swap(other);
- bool other_released = other.released;
- other.released = this->released;
- this->released = other_released;
- }
-
- void swap(scoped_connection& c1, scoped_connection& c2)
- {
- c1.swap(c2);
- }
-
- scoped_connection&
- scoped_connection::operator=(const connection& other)
- {
- scoped_connection(other).swap(*this);
- return *this;
- }
-
- scoped_connection&
- scoped_connection::operator=(const scoped_connection& other)
- {
- scoped_connection(other).swap(*this);
- return *this;
- }
-
- void
- connection::add_bound_object(const BOOST_SIGNALS_NAMESPACE::detail::bound_object& b)
- {
- assert(con.get() != 0);
- con->bound_objects.push_back(b);
- }
-
-
- void connection::disconnect() const
- {
- if (this->connected()) {
- // Make sure we have a reference to the basic_connection object,
- // because 'this' may disappear
- shared_ptr<detail::basic_connection> local_con = con;
-
- void (*signal_disconnect)(void*, void*) = local_con->signal_disconnect;
-
- // Note that this connection no longer exists
- // Order is important here: we could get into an infinite loop if this
- // isn't cleared before we try the disconnect.
- local_con->signal_disconnect = 0;
-
- // Disconnect signal
- signal_disconnect(local_con->signal, local_con->signal_data);
-
- // Disconnect all bound objects
- typedef std::list<BOOST_SIGNALS_NAMESPACE::detail::bound_object>::iterator iterator;
- for (iterator i = local_con->bound_objects.begin();
- i != local_con->bound_objects.end(); ++i) {
- assert(i->disconnect != 0);
- i->disconnect(i->obj, i->data);
- }
- }
- }
- } // end namespace boost
-} // end namespace boost
-
-#ifndef BOOST_MSVC
-// Explicit instantiations to keep everything in the library
-template class std::list<boost::BOOST_SIGNALS_NAMESPACE::detail::bound_object>;
-#endif
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_SIGNALS_SOURCE
-
-#include <boost/signals/detail/named_slot_map.hpp>
-#include <cassert>
-#include <map>
-#include <list>
-#include <typeinfo>
-
-namespace boost { namespace BOOST_SIGNALS_NAMESPACE { namespace detail {
-
-typedef std::list<connection_slot_pair> group_list;
-typedef group_list::iterator slot_pair_iterator;
-typedef std::map<stored_group, group_list, compare_type> slot_container_type;
-typedef slot_container_type::iterator group_iterator;
-typedef slot_container_type::const_iterator const_group_iterator;
-
-
-#if BOOST_WORKAROUND(_MSC_VER, <= 1900)
-void named_slot_map_iterator::decrement() { assert(false); }
-void named_slot_map_iterator::advance(difference_type) { assert(false); }
-#endif
-
-named_slot_map::named_slot_map(const compare_type& compare) : groups(compare)
-{
- clear();
-}
-
-void named_slot_map::clear()
-{
- groups.clear();
- groups[stored_group(stored_group::sk_front)];
- groups[stored_group(stored_group::sk_back)];
- back = groups.end();
- --back;
-}
-
-named_slot_map::iterator named_slot_map::begin()
-{
- return named_slot_map::iterator(groups.begin(), groups.end());
-}
-
-named_slot_map::iterator named_slot_map::end()
-{
- return named_slot_map::iterator(groups.end(), groups.end());
-}
-
-named_slot_map::iterator
-named_slot_map::insert(const stored_group& name, const connection& con,
- const any& slot, connect_position at)
-{
- group_iterator group;
- if (name.empty()) {
- switch (at) {
- case at_front: group = groups.begin(); break;
- case at_back: group = back; break;
- }
- } else {
- group = groups.find(name);
- if (group == groups.end()) {
- slot_container_type::value_type v(name, group_list());
- group = groups.insert(v).first;
- }
- }
- iterator it;
- it.group = group;
- it.last_group = groups.end();
-
- switch (at) {
- case at_back:
- group->second.push_back(connection_slot_pair(con, slot));
- it.slot_ = group->second.end();
- it.slot_assigned = true;
- --(it.slot_);
- break;
-
- case at_front:
- group->second.push_front(connection_slot_pair(con, slot));
- it.slot_ = group->second.begin();
- it.slot_assigned = true;
- break;
- }
- return it;
-}
-
-void named_slot_map::disconnect(const stored_group& name)
-{
- group_iterator group = groups.find(name);
- if (group != groups.end()) {
- slot_pair_iterator i = group->second.begin();
- while (i != group->second.end()) {
- slot_pair_iterator next = i;
- ++next;
- i->first.disconnect();
- i = next;
- }
- groups.erase((const_group_iterator) group);
- }
-}
-
-void named_slot_map::erase(iterator pos)
-{
- // Erase the slot
- pos.slot_->first.disconnect();
- pos.group->second.erase(pos.slot_);
-}
-
-void named_slot_map::remove_disconnected_slots()
-{
- // Remove any disconnected slots
- group_iterator g = groups.begin();
- while (g != groups.end()) {
- slot_pair_iterator s = g->second.begin();
- while (s != g->second.end()) {
- if (s->first.connected()) ++s;
- else g->second.erase(s++);
- }
-
- // Clear out empty groups
- if (empty(g)) groups.erase((const_group_iterator) g++);
- else ++g;
- }
-}
-
-
-} } }
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_SIGNALS_SOURCE
-
-#include <boost/signals/detail/signal_base.hpp>
-#include <cassert>
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
- namespace detail {
- signal_base_impl::signal_base_impl(const compare_type& comp,
- const any& combiner)
- : call_depth(0),
- slots_(comp),
- combiner_(combiner)
- {
- flags.delayed_disconnect = false;
- flags.clearing = false;
- }
-
- signal_base_impl::~signal_base_impl()
- {
- // Set the "clearing" flag to ignore extraneous disconnect requests,
- // because all slots will be disconnected on destruction anyway.
- flags.clearing = true;
- }
-
- void signal_base_impl::disconnect_all_slots()
- {
- // Do nothing if we're already clearing the slot list
- if (flags.clearing)
- return;
-
- if (call_depth == 0) {
- // Clearing the slot list will disconnect all slots automatically
- temporarily_set_clearing set_clearing(this);
- slots_.clear();
- }
- else {
- // We can't actually remove elements from the slot list because there
- // are still iterators into the slot list that must not be
- // invalidated by this operation. So just disconnect each slot
- // without removing it from the slot list. When the call depth does
- // reach zero, the call list will be cleared.
- flags.delayed_disconnect = true;
- temporarily_set_clearing set_clearing(this);
- for (iterator i = slots_.begin(); i != slots_.end(); ++i) {
- i->first.disconnect();
- }
- }
- }
-
- connection
- signal_base_impl::
- connect_slot(const any& slot_,
- const stored_group& name,
- shared_ptr<slot_base::data_t> data,
- connect_position at)
- {
- // Transfer the burden of ownership to a local, scoped
- // connection.
- data->watch_bound_objects.set_controlling(false);
- scoped_connection safe_connection(data->watch_bound_objects);
-
- // Allocate storage for an iterator that will hold the point of
- // insertion of the slot into the list. This is used to later remove
- // the slot when it is disconnected.
- std::auto_ptr<iterator> saved_iter(new iterator);
-
- // Add the slot to the list.
- iterator pos =
- slots_.insert(name, data->watch_bound_objects, slot_, at);
-
- // The assignment operation here absolutely must not throw, which
- // intuitively makes sense (because any container's insert method
- // becomes impossible to use in an exception-safe manner without this
- // assumption), but doesn't appear to be mentioned in the standard.
- *saved_iter = pos;
-
- // Fill out the connection object appropriately. None of these
- // operations can throw
- data->watch_bound_objects.get_connection()->signal = this;
- data->watch_bound_objects.get_connection()->signal_data =
- saved_iter.release();
- data->watch_bound_objects.get_connection()->signal_disconnect =
- &signal_base_impl::slot_disconnected;
-
- // Make the copy of the connection in the list disconnect when it is
- // destroyed. The local, scoped connection is then released
- // because ownership has been transferred.
- pos->first.set_controlling();
- return safe_connection.release();
- }
-
- bool signal_base_impl::empty() const
- {
- // Disconnected slots may still be in the list of slots if
- // a) this is called while slots are being invoked (call_depth > 0)
- // b) an exception was thrown in remove_disconnected_slots
- for (iterator i = slots_.begin(); i != slots_.end(); ++i) {
- if (i->first.connected())
- return false;
- }
-
- return true;
- }
-
- std::size_t signal_base_impl::num_slots() const
- {
- // Disconnected slots may still be in the list of slots if
- // a) this is called while slots are being invoked (call_depth > 0)
- // b) an exception was thrown in remove_disconnected_slots
- std::size_t count = 0;
- for (iterator i = slots_.begin(); i != slots_.end(); ++i) {
- if (i->first.connected())
- ++count;
- }
- return count;
- }
-
- void signal_base_impl::disconnect(const stored_group& group)
- { slots_.disconnect(group); }
-
- void signal_base_impl::slot_disconnected(void* obj, void* data)
- {
- signal_base_impl* self = reinterpret_cast<signal_base_impl*>(obj);
-
- // We won't need the slot iterator after this
- std::auto_ptr<iterator> slot(reinterpret_cast<iterator*>(data));
-
- // If we're flags.clearing, we don't bother updating the list of slots
- if (!self->flags.clearing) {
- // If we're in a call, note the fact that a slot has been deleted so
- // we can come back later to remove the iterator
- if (self->call_depth > 0) {
- self->flags.delayed_disconnect = true;
- }
- else {
- // Just remove the slot now, it's safe
- self->slots_.erase(*slot);
- }
- }
- }
-
- void signal_base_impl::remove_disconnected_slots() const
- { slots_.remove_disconnected_slots(); }
-
- call_notification::
- call_notification(const shared_ptr<signal_base_impl>& b) :
- impl(b)
- {
- // A call will be made, so increment the call depth as a notification
- impl->call_depth++;
- }
-
- call_notification::~call_notification()
- {
- impl->call_depth--;
-
- // If the call depth is zero and we have some slots that have been
- // disconnected during the calls, remove those slots from the list
- if (impl->call_depth == 0 &&
- impl->flags.delayed_disconnect) {
- impl->remove_disconnected_slots();
- impl->flags.delayed_disconnect = false;
- }
- }
-
- signal_base::signal_base(const compare_type& comp, const any& combiner)
- : impl()
- {
- impl.reset(new signal_base_impl(comp, combiner));
- }
-
- signal_base::~signal_base()
- {
- }
-
- } // namespace detail
- } // namespace BOOST_SIGNALS_NAMESPACE
-} // namespace boost
-
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_SIGNALS_SOURCE
-
-#include <boost/signals/slot.hpp>
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
- namespace detail {
- void slot_base::create_connection()
- {
- // Create a new connection object
- basic_connection* con = new basic_connection();
-
- /* nothrow */ {
- // The signal portion isn't really necessary, except that we need a
- // signal for the connection to be connected.
- con->signal = static_cast<void*>(this);
- con->signal_data = 0;
- con->blocked_ = false ;
- con->signal_disconnect = &bound_object_destructed;
- }
-
- // This connection watches for destruction of bound objects. Note
- // that the reset routine will delete con if an allocation throws
- data->watch_bound_objects.reset(con);
-
- // We create a scoped connection, so that exceptions thrown while
- // adding bound objects will cause a cleanup of the bound objects
- // already connected.
- scoped_connection safe_connection(data->watch_bound_objects);
-
- // Now notify each of the bound objects that they are connected to this
- // slot.
- for(std::vector<const trackable*>::iterator i =
- data->bound_objects.begin();
- i != data->bound_objects.end(); ++i) {
- // Notify the object that the slot is connecting to it
- BOOST_SIGNALS_NAMESPACE::detail::bound_object binding;
- (*i)->signal_connected(data->watch_bound_objects, binding);
-
- // This will notify the bound object that the connection just made
- // should be disconnected if an exception is thrown before the
- // end of this iteration
- BOOST_SIGNALS_NAMESPACE::detail::auto_disconnect_bound_object
- disconnector(binding);
-
- // Add the binding to the list of bindings for the connection
- con->bound_objects.push_back(binding);
-
- // The connection object now knows about the bound object, so if an
- // exception is thrown later the connection object will notify the
- // bound object of the disconnection automatically
- disconnector.release();
- }
-
- // No exceptions will be thrown past this point.
- safe_connection.release();
-
- data->watch_bound_objects.set_controlling(true);
- }
- } // end namespace detail
- } // end namespace BOOST_SIGNALS_NAMESPACE
-} // end namespace boost
+++ /dev/null
-// Boost.Signals library
-
-// Copyright Douglas Gregor 2001-2004. Use, modification and
-// distribution is subject to the Boost Software License, Version
-// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// For more information, see http://www.boost.org
-
-#define BOOST_SIGNALS_SOURCE
-
-#include <boost/signals/trackable.hpp>
-#include <algorithm>
-
-namespace boost {
- namespace BOOST_SIGNALS_NAMESPACE {
- void trackable::signal_disconnected(void* obj, void* data)
- {
- trackable* self = reinterpret_cast<trackable*>(obj);
- connection_iterator* signal =
- reinterpret_cast<connection_iterator*>(data);
-
- // If we're dying, don't bother erasing the connection from the list;
- // it'll be gone anyway
- if (!self->dying) {
- self->connected_signals.erase(*signal);
- }
-
- // This iterator pointer won't ever be used again
- delete signal;
- }
-
- void
- trackable::signal_connected(connection c,
- BOOST_SIGNALS_NAMESPACE::detail::bound_object& binding) const
- {
- // Insert the connection
- connection_iterator pos =
- connected_signals.insert(connected_signals.end(), c);
-
- // Make this copy of the object disconnect when destroyed
- pos->set_controlling();
-
- binding.obj = const_cast<void*>(reinterpret_cast<const void*>(this));
- binding.data = reinterpret_cast<void*>(new connection_iterator(pos));
- binding.disconnect = &signal_disconnected;
- }
-
- trackable::~trackable()
- {
- dying = true;
- }
- } // end namespace BOOST_SIGNALS_NAMESPACE
-}
-
-#ifndef BOOST_MSVC
-// Explicit instantiations to keep in the library
-template class std::list<boost::BOOST_SIGNALS_NAMESPACE::connection>;
-#endif
#include "libs/regex/src/wide_posix_api.cpp"
#include "libs/regex/src/regex_debug.cpp"
#include "libs/regex/src/winstances.cpp"
-
-#include "lyxboostsignals.cpp"
+++ /dev/null
-#include "libs/signals/src/connection.cpp"
-#include "libs/signals/src/named_slot_map.cpp"
-#include "libs/signals/src/signal_base.cpp"
-#include "libs/signals/src/slot.cpp"
-#include "libs/signals/src/trackable.cpp"
-
if(LYX_EXTERNAL_BOOST)
message(STATUS "Searching for boost")
- if(LYX_USE_STD_REGEX)
- find_package(Boost COMPONENTS signals)
- else()
- find_package(Boost COMPONENTS signals regex)
+ if(NOT LYX_USE_STD_REGEX)
+ find_package(Boost COMPONENTS regex)
endif()
if(Boost_FOUND)
message(STATUS "Boost found")
message(FATAL_ERROR "Boost not found" ${Boost_ERROR_REASON})
endif()
else()
- if(LYX_USE_STD_REGEX)
- set(Lyx_Boost_Libraries boost_signals)
- else()
- set(Lyx_Boost_Libraries boost_signals boost_regex)
+ if(NOT LYX_USE_STD_REGEX)
+ set(Lyx_Boost_Libraries boost_regex)
endif()
add_definitions(-DBOOST_USER_CONFIG="<config.h>")
- add_definitions(-DBOOST_SIGNALS_NO_DEPRECATION_WARNING=1)
include_directories(${TOP_SRC_DIR}/3rdparty/boost)
add_subdirectory(3rdparty/boost "${TOP_BINARY_DIR}/3rdparty/boost")
endif()
AC_LANG_PUSH(C++)
save_LIBS=$LIBS
+ dnl FIXME: Rewrite test to use regex, we do not use signals anymore.
AC_MSG_CHECKING([for multithreaded boost libraries])
LIBS="$save_LIBS -lboost_signals-mt $LIBTHREAD"
AC_LINK_IFELSE(
AC_LANG_POP(C++)
BOOST_INCLUDES=
if test $lyx_std_regex = yes ; then
- BOOST_LIBS="-lboost_signals${BOOST_MT}"
+ BOOST_LIBS=""
else
- BOOST_LIBS="-lboost_regex${BOOST_MT} -lboost_signals${BOOST_MT}"
+ BOOST_LIBS="-lboost_regex${BOOST_MT}"
fi
dnl In general, system boost libraries are incompatible with
#define BOOST_DISABLE_THREADS 1
#define BOOST_NO_WREGEX 1
#define BOOST_NO_WSTRING 1
-#define BOOST_SIGNALS_NO_DEPRECATION_WARNING 1
#ifdef __CYGWIN__
# define NOMINMAX
#include <boost/regex.hpp>
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
-#include <boost/signal.hpp>
-#include <boost/signals/connection.hpp>
-#include <boost/signals/trackable.hpp>
+#include <boost/signals2.hpp>
+#include <boost/signals2/connection.hpp>
+#include <boost/signals2/trackable.hpp>
#include <boost/tokenizer.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/utility.hpp>
namespace {
class ShowMessage
- : public boost::signals::trackable {
+ : public boost::signals2::trackable {
public:
ShowMessage(Buffer const & b) : buffer_(b) {}
void operator()(docstring const & msg) const { buffer_.message(msg); }
#include "support/docstring.h"
#include "support/FileName.h"
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
#include <vector>
#include <set>
};
/// This signal emits an informative message
- boost::signal<void(docstring)> message;
+ boost::signals2::signal<void(docstring)> message;
/**
#ifndef SERVER_H
#define SERVER_H
-#include <boost/signals/trackable.hpp>
+#include <boost/signals2/trackable.hpp>
#ifdef _WIN32
#include <windows.h>
a clean string interface.
*/
#ifndef _WIN32
-class LyXComm : public boost::signals::trackable {
+class LyXComm : public boost::signals2::trackable {
#else
class LyXComm : public QObject {
Q_OBJECT
namespace graphics {
-class CacheItem::Impl : public boost::signals::trackable {
+class CacheItem::Impl : public boost::signals2::trackable {
public:
///
ImageStatus status_;
/// This signal is emitted when the image loading status changes.
- boost::signal<void()> statusChanged;
+ boost::signals2::signal<void()> statusChanged;
/// The connection of the signal ConvProcess::finishedConversion,
- boost::signals::connection cc_;
+ boost::signals2::connection cc_;
///
unique_ptr<Converter> converter_;
}
-boost::signals::connection CacheItem::connect(slot_type const & slot) const
+boost::signals2::connection CacheItem::connect(slot_type const & slot) const
{
return pimpl_->statusChanged.connect(slot);
}
#include "GraphicsTypes.h"
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
namespace lyx {
/** Connect and you'll be informed when the loading status of the image
* changes.
*/
- typedef boost::signal<void()> sig_type;
+ typedef boost::signals2::signal<void()> sig_type;
typedef sig_type::slot_type slot_type;
///
- boost::signals::connection connect(slot_type const &) const;
+ boost::signals2::connection connect(slot_type const &) const;
private:
/// noncopyable
namespace graphics {
-class Converter::Impl : public boost::signals::trackable {
+class Converter::Impl : public boost::signals2::trackable {
public:
///
Impl(FileName const &, string const &, string const &, string const &);
/** At the end of the conversion process inform the outside world
* by emitting a signal.
*/
- typedef boost::signal<void(bool)> SignalType;
+ typedef boost::signals2::signal<void(bool)> SignalType;
///
SignalType finishedConversion;
}
-boost::signals::connection Converter::connect(slot_type const & slot) const
+boost::signals2::connection Converter::connect(slot_type const & slot) const
{
return pimpl_->finishedConversion.connect(slot);
}
#ifndef GRAPHICSCONVERTER_H
#define GRAPHICSCONVERTER_H
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
namespace lyx {
* finished.
* If the conversion is successful, then the listener is passed \c true.
*/
- typedef boost::signal<void(bool)> sig_type;
+ typedef boost::signals2::signal<void(bool)> sig_type;
typedef sig_type::slot_type slot_type;
///
- boost::signals::connection connect(slot_type const &) const;
+ boost::signals2::connection connect(slot_type const &) const;
/** If the conversion is successful, this returns the name of the
* resulting file.
typedef std::shared_ptr<Image> ImagePtr;
-class Loader::Impl : public boost::signals::trackable {
+class Loader::Impl : public boost::signals2::trackable {
public:
///
Impl();
/// We modify a local copy of the image once it is loaded.
ImagePtr image_;
/// This signal is emitted when the image loading status changes.
- boost::signal<void()> signal_;
+ boost::signals2::signal<void()> signal_;
/// The connection of the signal StatusChanged
- boost::signals::connection sc_;
+ boost::signals2::connection sc_;
double displayPixelRatio() const
{
}
-boost::signals::connection Loader::connect(slot_type const & slot) const
+boost::signals2::connection Loader::connect(slot_type const & slot) const
{
return pimpl_->signal_.connect(slot);
}
#include "GraphicsTypes.h"
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
namespace lyx {
/** Connect and you'll be informed when the loading status of the image
* changes.
*/
- typedef boost::signal<void()> sig_type;
+ typedef boost::signals2::signal<void()> sig_type;
typedef sig_type::slot_type slot_type;
///
- boost::signals::connection connect(slot_type const &) const;
+ boost::signals2::connection connect(slot_type const &) const;
/** The loaded image with Pixmap set.
* If the Pixmap is not yet set (see status() for why...), returns 0.
namespace lyx {
namespace graphics {
-class PreviewImage::Impl : public boost::signals::trackable {
+class PreviewImage::Impl : public boost::signals2::trackable {
public:
///
Impl(PreviewImage & p, PreviewLoader & l,
namespace lyx {
namespace graphics {
-class PreviewLoader::Impl : public boost::signals::trackable {
+class PreviewLoader::Impl : public boost::signals2::trackable {
public:
///
Impl(PreviewLoader & p, Buffer const & b);
void refreshPreviews();
/// Emit this signal when an image is ready for display.
- boost::signal<void(PreviewImage const &)> imageReady;
+ boost::signals2::signal<void(PreviewImage const &)> imageReady;
Buffer const & buffer() const { return buffer_; }
}
-boost::signals::connection PreviewLoader::connect(slot_type const & slot) const
+boost::signals2::connection PreviewLoader::connect(slot_type const & slot) const
{
return pimpl_->imageReady.connect(slot);
}
#ifndef PREVIEWLOADER_H
#define PREVIEWLOADER_H
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
#include <QObject>
#include "ColorCode.h"
* has been created and is ready for loading through
* lyx::graphics::PreviewImage::image().
*/
- typedef boost::signal<void(PreviewImage const &)> sig_type;
+ typedef boost::signals2::signal<void(PreviewImage const &)> sig_type;
typedef sig_type::slot_type slot_type;
///
- boost::signals::connection connect(slot_type const &) const;
+ boost::signals2::connection connect(slot_type const &) const;
/** When PreviewImage has finished loading the image file into memory,
* it tells the PreviewLoader to tell the outside world
// Mouse hover is not copied and remains empty
InsetExternal::InsetExternal(InsetExternal const & other)
: Inset(other),
- boost::signals::trackable(),
+ boost::signals2::trackable(),
params_(other.params_),
renderer_(other.renderer_->clone(this))
{}
#include "support/FileName.h"
#include "support/unique_ptr.h"
-#include <boost/signals/trackable.hpp>
+#include <boost/signals2/trackable.hpp>
namespace lyx {
class RenderBase;
///
-class InsetExternal : public Inset, public boost::signals::trackable
+class InsetExternal : public Inset, public boost::signals2::trackable
{
// Disable assignment operator, since it is not used, and it is too
// complicated to implement it consistently with the copy constructor
RenderPreview::RenderPreview(RenderPreview const & other,
Inset const * inset)
: RenderBase(other),
- boost::signals::trackable(),
+ boost::signals2::trackable(),
snippet_(other.snippet_),
parent_(inset)
{}
}
-boost::signals::connection
+boost::signals2::connection
RenderMonitoredPreview::fileChanged(slot_type const & slot)
{
return monitor_.connect(slot);
#include "support/docstring.h"
#include "support/FileMonitor.h"
-#include <boost/signal.hpp>
-#include <boost/signals/trackable.hpp>
-#include <boost/signals/connection.hpp>
+#include <boost/signals2.hpp>
+#include <boost/signals2/trackable.hpp>
+#include <boost/signals2/connection.hpp>
namespace lyx {
} // namespace graphics
-class RenderPreview : public RenderBase, public boost::signals::trackable {
+class RenderPreview : public RenderBase, public boost::signals2::trackable {
public:
/// Return true if preview is enabled in text (from LyXRC::preview)
static bool previewText();
/** Store the connection to the preview loader so that we connect
* only once.
*/
- boost::signals::connection ploader_connection_;
+ boost::signals2::connection ploader_connection_;
/// Inform the core that the inset has changed.
Inset const * parent_;
/// Connect and you'll be informed when the file changes.
typedef support::FileMonitor::slot_type slot_type;
- boost::signals::connection fileChanged(slot_type const &);
+ boost::signals2::connection fileChanged(slot_type const &);
/// equivalent to dynamic_cast
virtual RenderMonitoredPreview * asMonitoredPreview() { return this; }
#include "support/Timeout.h"
#include "support/bind.h"
-#include <boost/signals/trackable.hpp>
+#include <boost/signals2/trackable.hpp>
using namespace std;
namespace lyx {
namespace support {
-class FileMonitor::Impl : public boost::signals::trackable {
+class FileMonitor::Impl : public boost::signals2::trackable {
public:
///
}
-boost::signals::connection FileMonitor::connect(slot_type const & slot) const
+boost::signals2::connection FileMonitor::connect(slot_type const & slot) const
{
return pimpl_->fileChanged_.connect(slot);
}
#ifndef FILEMONITOR_H
#define FILEMONITOR_H
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
namespace lyx {
namespace support {
unsigned long checksum() const;
/// Connect and you'll be informed when the file has changed.
- typedef boost::signal<void()> FileChangedSig;
+ typedef boost::signals2::signal<void()> FileChangedSig;
typedef FileChangedSig::slot_type slot_type;
///
- boost::signals::connection connect(slot_type const &) const;
+ boost::signals2::connection connect(slot_type const &) const;
private:
/// noncopyable
//
/////////////////////////////////////////////////////////////////////
-class Murder : public boost::signals::trackable {
+class Murder : public boost::signals2::trackable {
public:
//
static void killItDead(int secs, pid_t pid)
#define FORKEDCALLS_H
#include "support/strfwd.h"
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
* we can return easily to C++ methods, rather than just globally
* accessible functions.
*/
- typedef boost::signal<void(pid_t, int)> SignalType;
+ typedef boost::signals2::signal<void(pid_t, int)> SignalType;
/** The signal is connected in the calling routine to the desired
* slot. We pass a shared_ptr rather than a reference to the signal
#ifndef TIMEOUT_H
#define TIMEOUT_H
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
namespace lyx {
/// restart the timer
void restart();
/// signal emitted on timer expiry
- boost::signal<void()> timeout;
+ boost::signals2::signal<void()> timeout;
/// emit the signal
void emit();
/// set the timer type