From c30511f6a06fb220d2640039e519eae792e1da3d Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Fri, 25 Aug 2006 14:59:20 +0000 Subject: [PATCH] Fix bug 2677 * boost/boost/bind.hpp: * boost/boost/ref.hpp: * boost/boost/mem_fn.hpp: * boost/boost/bind/mem_fn_template.hpp: * boost/boost/bind/storage.hpp: * boost/boost/bind/placeholders.hpp: * boost/boost/bind/bind_template.hpp: Update to boost 1.34cvs git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@14839 a592a061-630c-0410-9148-cb99ea01b6c8 --- boost/boost/bind.hpp | 913 +++++++++++++++------------ boost/boost/bind/bind_template.hpp | 65 ++ boost/boost/bind/mem_fn_template.hpp | 86 +++ boost/boost/bind/placeholders.hpp | 2 +- boost/boost/bind/storage.hpp | 475 ++++++++++++++ boost/boost/mem_fn.hpp | 76 ++- boost/boost/ref.hpp | 5 +- status.14x | 3 + 8 files changed, 1220 insertions(+), 405 deletions(-) create mode 100644 boost/boost/bind/storage.hpp diff --git a/boost/boost/bind.hpp b/boost/boost/bind.hpp index 0525e60666..bece8a7af3 100644 --- a/boost/boost/bind.hpp +++ b/boost/boost/bind.hpp @@ -12,6 +12,7 @@ // // 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 @@ -25,8 +26,8 @@ #include #include #include -#include #include +#include // Borland-specific bug, visit_each() silently fails to produce code @@ -36,6 +37,8 @@ # define BOOST_BIND_VISIT_EACH visit_each #endif +#include + #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable: 4512) // assignment operator could not be generated @@ -72,12 +75,22 @@ template struct result_traits< unspecified, reference_wrapper > // ref_compare -template bool ref_compare(T const & a, T const & b, long) +template bool ref_compare( T const & a, T const & b, long ) { return a == b; } -template bool ref_compare(reference_wrapper const & a, reference_wrapper const & b, int) +template bool ref_compare( arg const &, arg const &, int ) +{ + return true; +} + +template bool ref_compare( arg (*) (), arg (*) (), int ) +{ + return true; +} + +template bool ref_compare( reference_wrapper const & a, reference_wrapper const & b, int ) { return a.get_pointer() == b.get_pointer(); } @@ -113,38 +126,23 @@ template class type {}; // unwrap -template inline F & unwrap(F * f, long) +template struct unwrapper { - return *f; -} + static inline F & unwrap( F & f, long ) + { + return f; + } -template inline F & unwrap(reference_wrapper * f, int) -{ - return f->get(); -} + template static inline F2 & unwrap( reference_wrapper rf, int ) + { + return rf.get(); + } -template inline F & unwrap(reference_wrapper const * f, int) -{ - return f->get(); -} - -#if !( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, <= 0x3003) ) - -template inline _mfi::dm unwrap(R T::* * pm, int) -{ - return _mfi::dm(*pm); -} - -#if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) -// IBM/VisualAge 6.0 is not able to handle this overload. -template inline _mfi::dm unwrap(R T::* const * pm, int) -{ - return _mfi::dm(*pm); -} -#endif - - -#endif + template static inline _mfi::dm unwrap( R T::* pm, int ) + { + return _mfi::dm( pm ); + } +}; // listN @@ -154,9 +152,9 @@ public: list0() {} - template T & operator[] (value & v) const { return v.get(); } + template T & operator[] (_bi::value & v) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] (_bi::value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -166,22 +164,22 @@ public: template R operator()(type, F & f, A &, long) { - return unwrap(&f, 0)(); + return unwrapper::unwrap(f, 0)(); } template R operator()(type, F const & f, A &, long) const { - return unwrap(&f, 0)(); + return unwrapper::unwrap(f, 0)(); } template void operator()(type, F & f, A &, int) { - unwrap(&f, 0)(); + unwrapper::unwrap(f, 0)(); } template void operator()(type, F const & f, A &, int) const { - unwrap(&f, 0)(); + unwrapper::unwrap(f, 0)(); } template void accept(V &) const @@ -194,19 +192,23 @@ public: } }; -template class list1 +template< class A1 > class list1: private storage1< A1 > { +private: + + typedef storage1< A1 > base_type; + public: - explicit list1(A1 a1): a1_(a1) {} + explicit list1( A1 a1 ): base_type( a1 ) {} - A1 operator[] (boost::arg<1>) const { return a1_; } + A1 operator[] (boost::arg<1>) const { return base_type::a1_; } - A1 operator[] (boost::arg<1> (*) ()) const { return a1_; } + A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } - template T & operator[] (value & v) const { return v.get(); } + template T & operator[] ( _bi::value & v ) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] ( _bi::value const & v ) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -216,54 +218,54 @@ public: template R operator()(type, F & f, A & a, long) { - return unwrap(&f, 0)(a[a1_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_]); } template R operator()(type, F const & f, A & a, long) const { - return unwrap(&f, 0)(a[a1_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_]); } template void operator()(type, F & f, A & a, int) { - unwrap(&f, 0)(a[a1_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_]); } template void operator()(type, F const & f, A & a, int) const { - unwrap(&f, 0)(a[a1_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_]); } template void accept(V & v) const { - BOOST_BIND_VISIT_EACH(v, a1_, 0); + base_type::accept(v); } bool operator==(list1 const & rhs) const { - return ref_compare(a1_, rhs.a1_, 0); + return ref_compare(base_type::a1_, rhs.a1_, 0); } - -private: - - A1 a1_; }; -template class list2 +template< class A1, class A2 > class list2: private storage2< A1, A2 > { +private: + + typedef storage2< A1, A2 > base_type; + public: - list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {} + list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {} - A1 operator[] (boost::arg<1>) const { return a1_; } - A2 operator[] (boost::arg<2>) const { return 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 a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return a2_; } + A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } + A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } - template T & operator[] (value & v) const { return v.get(); } + template T & operator[] (_bi::value & v) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] (_bi::value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -273,58 +275,56 @@ public: template R operator()(type, F & f, A & a, long) { - return unwrap(&f, 0)(a[a1_], a[a2_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); } template R operator()(type, F const & f, A & a, long) const { - return unwrap(&f, 0)(a[a1_], a[a2_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); } template void operator()(type, F & f, A & a, int) { - unwrap(&f, 0)(a[a1_], a[a2_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); } template void operator()(type, F const & f, A & a, int) const { - unwrap(&f, 0)(a[a1_], a[a2_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); } template void accept(V & v) const { - BOOST_BIND_VISIT_EACH(v, a1_, 0); - BOOST_BIND_VISIT_EACH(v, a2_, 0); + base_type::accept(v); } bool operator==(list2 const & rhs) const { - return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0); + return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0); } - -private: - - A1 a1_; - A2 a2_; }; -template class list3 +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): a1_(a1), a2_(a2), a3_(a3) {} + list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {} - A1 operator[] (boost::arg<1>) const { return a1_; } - A2 operator[] (boost::arg<2>) const { return a2_; } - A3 operator[] (boost::arg<3>) const { return 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 a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return 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 T & operator[] (value & v) const { return v.get(); } + template T & operator[] (_bi::value & v) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] (_bi::value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -334,62 +334,62 @@ public: template R operator()(type, F & f, A & a, long) { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]); } template R operator()(type, F const & f, A & a, long) const { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]); } template void operator()(type, F & f, A & a, int) { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]); } template void operator()(type, F const & f, A & a, int) const { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]); } template void accept(V & v) const { - BOOST_BIND_VISIT_EACH(v, a1_, 0); - BOOST_BIND_VISIT_EACH(v, a2_, 0); - BOOST_BIND_VISIT_EACH(v, a3_, 0); + base_type::accept(v); } bool operator==(list3 const & rhs) const { - return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0); + 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 ); } - -private: - - A1 a1_; - A2 a2_; - A3 a3_; }; -template class list4 +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): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {} + list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {} - A1 operator[] (boost::arg<1>) const { return a1_; } - A2 operator[] (boost::arg<2>) const { return a2_; } - A3 operator[] (boost::arg<3>) const { return a3_; } - A4 operator[] (boost::arg<4>) const { return 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 a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return 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 T & operator[] (value & v) const { return v.get(); } + template T & operator[] (_bi::value & v) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] (_bi::value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -399,68 +399,65 @@ public: template R operator()(type, F & f, A & a, long) { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]); } template R operator()(type, F const & f, A & a, long) const { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]); } template void operator()(type, F & f, A & a, int) { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]); } template void operator()(type, F const & f, A & a, int) const { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]); } template void accept(V & v) const { - BOOST_BIND_VISIT_EACH(v, a1_, 0); - BOOST_BIND_VISIT_EACH(v, a2_, 0); - BOOST_BIND_VISIT_EACH(v, a3_, 0); - BOOST_BIND_VISIT_EACH(v, a4_, 0); + base_type::accept(v); } bool operator==(list4 const & rhs) const { return - ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) && - ref_compare(a4_, rhs.a4_, 0); + + 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 ); } - -private: - - A1 a1_; - A2 a2_; - A3 a3_; - A4 a4_; }; -template class list5 +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): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {} + 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 a1_; } - A2 operator[] (boost::arg<2>) const { return a2_; } - A3 operator[] (boost::arg<3>) const { return a3_; } - A4 operator[] (boost::arg<4>) const { return a4_; } - A5 operator[] (boost::arg<5>) const { return 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 a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return 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 T & operator[] (value & v) const { return v.get(); } + template T & operator[] (_bi::value & v) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] (_bi::value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -470,72 +467,68 @@ public: template R operator()(type, F & f, A & a, long) { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]); } template R operator()(type, F const & f, A & a, long) const { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]); + return unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]); } template void operator()(type, F & f, A & a, int) { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]); } template void operator()(type, F const & f, A & a, int) const { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]); + unwrapper::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]); } template void accept(V & v) const { - BOOST_BIND_VISIT_EACH(v, a1_, 0); - BOOST_BIND_VISIT_EACH(v, a2_, 0); - BOOST_BIND_VISIT_EACH(v, a3_, 0); - BOOST_BIND_VISIT_EACH(v, a4_, 0); - BOOST_BIND_VISIT_EACH(v, a5_, 0); + base_type::accept(v); } bool operator==(list5 const & rhs) const { return - ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) && - ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0); + + 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 ); } - -private: - - A1 a1_; - A2 a2_; - A3 a3_; - A4 a4_; - A5 a5_; }; -template class list6 +template 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): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6) {} + 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 a1_; } - A2 operator[] (boost::arg<2>) const { return a2_; } - A3 operator[] (boost::arg<3>) const { return a3_; } - A4 operator[] (boost::arg<4>) const { return a4_; } - A5 operator[] (boost::arg<5>) const { return a5_; } - A6 operator[] (boost::arg<6>) const { return 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 a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return a5_; } - A6 operator[] (boost::arg<6> (*) ()) const { return 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 T & operator[] (value & v) const { return v.get(); } + template T & operator[] (_bi::value & v) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] (_bi::value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -545,76 +538,71 @@ public: template R operator()(type, F & f, A & a, long) { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]); + return unwrapper::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 R operator()(type, F const & f, A & a, long) const { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]); + return unwrapper::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 void operator()(type, F & f, A & a, int) { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]); + unwrapper::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 void operator()(type, F const & f, A & a, int) const { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]); + unwrapper::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 void accept(V & v) const { - BOOST_BIND_VISIT_EACH(v, a1_, 0); - BOOST_BIND_VISIT_EACH(v, a2_, 0); - BOOST_BIND_VISIT_EACH(v, a3_, 0); - BOOST_BIND_VISIT_EACH(v, a4_, 0); - BOOST_BIND_VISIT_EACH(v, a5_, 0); - BOOST_BIND_VISIT_EACH(v, a6_, 0); + base_type::accept(v); } bool operator==(list6 const & rhs) const { return - ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) && - ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0); + + 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 ); } - -private: - - A1 a1_; - A2 a2_; - A3 a3_; - A4 a4_; - A5 a5_; - A6 a6_; }; -template class list7 +template 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): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7) {} + 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 a1_; } - A2 operator[] (boost::arg<2>) const { return a2_; } - A3 operator[] (boost::arg<3>) const { return a3_; } - A4 operator[] (boost::arg<4>) const { return a4_; } - A5 operator[] (boost::arg<5>) const { return a5_; } - A6 operator[] (boost::arg<6>) const { return a6_; } - A7 operator[] (boost::arg<7>) const { return 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 a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return a5_; } - A6 operator[] (boost::arg<6> (*) ()) const { return a6_; } - A7 operator[] (boost::arg<7> (*) ()) const { return 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 T & operator[] (value & v) const { return v.get(); } + template T & operator[] (_bi::value & v) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] (_bi::value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -624,81 +612,74 @@ public: template R operator()(type, F & f, A & a, long) { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); + return unwrapper::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 R operator()(type, F const & f, A & a, long) const { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); + return unwrapper::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 void operator()(type, F & f, A & a, int) { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); + unwrapper::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 void operator()(type, F const & f, A & a, int) const { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); + unwrapper::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 void accept(V & v) const { - BOOST_BIND_VISIT_EACH(v, a1_, 0); - BOOST_BIND_VISIT_EACH(v, a2_, 0); - BOOST_BIND_VISIT_EACH(v, a3_, 0); - BOOST_BIND_VISIT_EACH(v, a4_, 0); - BOOST_BIND_VISIT_EACH(v, a5_, 0); - BOOST_BIND_VISIT_EACH(v, a6_, 0); - BOOST_BIND_VISIT_EACH(v, a7_, 0); + base_type::accept(v); } bool operator==(list7 const & rhs) const { return - ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) && - ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) && - ref_compare(a7_, rhs.a7_, 0); + + 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 ); } - -private: - - A1 a1_; - A2 a2_; - A3 a3_; - A4 a4_; - A5 a5_; - A6 a6_; - A7 a7_; }; -template class list8 +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): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7), a8_(a8) {} + 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 a1_; } - A2 operator[] (boost::arg<2>) const { return a2_; } - A3 operator[] (boost::arg<3>) const { return a3_; } - A4 operator[] (boost::arg<4>) const { return a4_; } - A5 operator[] (boost::arg<5>) const { return a5_; } - A6 operator[] (boost::arg<6>) const { return a6_; } - A7 operator[] (boost::arg<7>) const { return a7_; } - A8 operator[] (boost::arg<8>) const { return 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 a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return a5_; } - A6 operator[] (boost::arg<6> (*) ()) const { return a6_; } - A7 operator[] (boost::arg<7> (*) ()) const { return a7_; } - A8 operator[] (boost::arg<8> (*) ()) const { return 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 T & operator[] (value & v) const { return v.get(); } + template T & operator[] (_bi::value & v) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] (_bi::value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -708,85 +689,77 @@ public: template R operator()(type, F & f, A & a, long) { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]); + return unwrapper::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 R operator()(type, F const & f, A & a, long) const { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]); + return unwrapper::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 void operator()(type, F & f, A & a, int) { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]); + unwrapper::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 void operator()(type, F const & f, A & a, int) const { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]); + unwrapper::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 void accept(V & v) const { - BOOST_BIND_VISIT_EACH(v, a1_, 0); - BOOST_BIND_VISIT_EACH(v, a2_, 0); - BOOST_BIND_VISIT_EACH(v, a3_, 0); - BOOST_BIND_VISIT_EACH(v, a4_, 0); - BOOST_BIND_VISIT_EACH(v, a5_, 0); - BOOST_BIND_VISIT_EACH(v, a6_, 0); - BOOST_BIND_VISIT_EACH(v, a7_, 0); - BOOST_BIND_VISIT_EACH(v, a8_, 0); + base_type::accept(v); } bool operator==(list8 const & rhs) const { return - ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) && - ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) && - ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0); + + 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 ); } - -private: - - A1 a1_; - A2 a2_; - A3 a3_; - A4 a4_; - A5 a5_; - A6 a6_; - A7 a7_; - A8 a8_; }; -template class list9 +template 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): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7), a8_(a8), a9_(a9) {} + 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 a1_; } - A2 operator[] (boost::arg<2>) const { return a2_; } - A3 operator[] (boost::arg<3>) const { return a3_; } - A4 operator[] (boost::arg<4>) const { return a4_; } - A5 operator[] (boost::arg<5>) const { return a5_; } - A6 operator[] (boost::arg<6>) const { return a6_; } - A7 operator[] (boost::arg<7>) const { return a7_; } - A8 operator[] (boost::arg<8>) const { return a8_; } - A9 operator[] (boost::arg<9>) const { return 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 a1_; } - A2 operator[] (boost::arg<2> (*) ()) const { return a2_; } - A3 operator[] (boost::arg<3> (*) ()) const { return a3_; } - A4 operator[] (boost::arg<4> (*) ()) const { return a4_; } - A5 operator[] (boost::arg<5> (*) ()) const { return a5_; } - A6 operator[] (boost::arg<6> (*) ()) const { return a6_; } - A7 operator[] (boost::arg<7> (*) ()) const { return a7_; } - A8 operator[] (boost::arg<8> (*) ()) const { return a8_; } - A9 operator[] (boost::arg<9> (*) ()) const { return 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 T & operator[] (value & v) const { return v.get(); } + template T & operator[] (_bi::value & v) const { return v.get(); } - template T const & operator[] (value const & v) const { return v.get(); } + template T const & operator[] (_bi::value const & v) const { return v.get(); } template T & operator[] (reference_wrapper const & v) const { return v.get(); } @@ -796,56 +769,43 @@ public: template R operator()(type, F & f, A & a, long) { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]); + return unwrapper::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 R operator()(type, F const & f, A & a, long) const { - return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]); + return unwrapper::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 void operator()(type, F & f, A & a, int) { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]); + unwrapper::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 void operator()(type, F const & f, A & a, int) const { - unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]); + unwrapper::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 void accept(V & v) const { - BOOST_BIND_VISIT_EACH(v, a1_, 0); - BOOST_BIND_VISIT_EACH(v, a2_, 0); - BOOST_BIND_VISIT_EACH(v, a3_, 0); - BOOST_BIND_VISIT_EACH(v, a4_, 0); - BOOST_BIND_VISIT_EACH(v, a5_, 0); - BOOST_BIND_VISIT_EACH(v, a6_, 0); - BOOST_BIND_VISIT_EACH(v, a7_, 0); - BOOST_BIND_VISIT_EACH(v, a8_, 0); - BOOST_BIND_VISIT_EACH(v, a9_, 0); + base_type::accept(v); } bool operator==(list9 const & rhs) const { return - ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) && - ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) && - ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0) && ref_compare(a9_, rhs.a9_, 0); + + 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 ); } - -private: - - A1 a1_; - A2 a2_; - A3 a3_; - A4 a4_; - A5 a5_; - A6 a6_; - A7 a7_; - A8 a8_; - A9 a9_; }; // bind_t @@ -920,30 +880,67 @@ public: #endif -// bind_t::operator== +// function_equal -template bool operator==(bind_t const & a, bind_t const & b) +#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP + +// put overloads in _bi, rely on ADL + +# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + +template bool function_equal( bind_t const & a, bind_t const & b ) { return a.compare(b); } -template bool operator!=(bind_t const & a, bind_t const & b) +# else + +template bool function_equal_impl( bind_t const & a, bind_t const & b, int ) { - return !a.compare(b); + 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 bool function_equal( _bi::bind_t const & a, _bi::bind_t const & b ) +{ + return a.compare(b); +} + +# else + +template bool function_equal_impl( _bi::bind_t const & a, _bi::bind_t 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) template struct add_value { - typedef value type; + typedef _bi::value type; }; template struct add_value< value > { - typedef value type; + typedef _bi::value type; }; template struct add_value< reference_wrapper > @@ -1097,20 +1094,106 @@ template type; }; +// operator! + +struct logical_not +{ + template bool operator()(V const & v) const { return !v; } +}; + +template + bind_t< bool, logical_not, list1< bind_t > > + operator! (bind_t const & f) +{ + typedef list1< bind_t > list_type; + return bind_t ( logical_not(), list_type(f) ); +} + +// relational operators + +#define BOOST_BIND_OPERATOR( op, name ) \ +\ +struct name \ +{ \ + template bool operator()(V const & v, W const & w) const { return v op w; } \ +}; \ + \ +template \ + bind_t< bool, name, list2< bind_t, typename add_value::type > > \ + operator op (bind_t const & f, A2 a2) \ +{ \ + typedef typename add_value::type B2; \ + typedef list2< bind_t, B2> list_type; \ + return bind_t ( 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 ) + +#undef BOOST_BIND_OPERATOR + +#if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3) + +// resolve ambiguity with rel_ops + +#define BOOST_BIND_OPERATOR( op, name ) \ +\ +template \ + bind_t< bool, name, list2< bind_t, bind_t > > \ + operator op (bind_t const & f, bind_t const & g) \ +{ \ + typedef list2< bind_t, bind_t > list_type; \ + return bind_t ( 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__ ) + +template void visit_each( V & v, value const & t, int ) +{ + using boost::visit_each; + BOOST_BIND_VISIT_EACH( v, t.get(), 0 ); +} + +template void visit_each( V & v, bind_t const & t, int ) +{ + t.accept( v ); +} + +#endif + } // namespace _bi -// visit_each +// visit_each, no ADL -template void visit_each(V & v, _bi::value const & t, int) +#if defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) || defined( __BORLANDC__ ) + +template void visit_each( V & v, _bi::value const & t, int ) { - BOOST_BIND_VISIT_EACH(v, t.get(), 0); + BOOST_BIND_VISIT_EACH( v, t.get(), 0 ); } -template void visit_each(V & v, _bi::bind_t const & t, int) +template void visit_each( V & v, _bi::bind_t const & t, int ) { - t.accept(v); + t.accept( v ); } +#endif + // bind #ifndef BOOST_BIND @@ -1423,6 +1506,18 @@ template + +#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 @@ -1449,53 +1544,8 @@ template struct add_cref -{ - typedef T const & type; -}; - -template struct add_cref< T & > -{ - typedef T const & type; -}; - -template<> struct add_cref -{ - typedef void type; -}; - -} // namespace _bi - -template -_bi::bind_t< typename _bi::add_cref::type, _mfi::dm, typename _bi::list_av_1::type > - BOOST_BIND(R T::*f, A1 a1) -{ - typedef _mfi::dm F; - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t::type, F, list_type>(F(f), list_type(a1)); -} - -#else - -template -_bi::bind_t< R const &, _mfi::dm, typename _bi::list_av_1::type > - BOOST_BIND(R T::*f, A1 a1) -{ - typedef _mfi::dm F; - typedef typename _bi::list_av_1::type list_type; - return _bi::bind_t(F(f), list_type(a1)); -} - -#endif - -*/ +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ + || ( defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, < 0x600 ) ) template _bi::bind_t< R, _mfi::dm, typename _bi::list_av_1::type > @@ -1506,6 +1556,83 @@ _bi::bind_t< R, _mfi::dm, typename _bi::list_av_1::type > return _bi::bind_t( 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 > +{ + typedef M const & type; +}; + +template< class R, class T > struct add_cref< R (T::*) (), 1 > +{ + typedef void type; +}; + +#if !( defined(__IBMCPP__) && BOOST_WORKAROUND( __IBMCPP__, BOOST_TESTED_AT(600) ) ) + +template< class R, class T > struct add_cref< R (T::*) () const, 1 > +{ + typedef void type; +}; + +#endif // __IBMCPP__ + +template struct isref +{ + enum value_type { value = 0 }; +}; + +template struct isref< R& > +{ + enum value_type { value = 1 }; +}; + +template struct isref< R* > +{ + enum value_type { value = 1 }; +}; + +template struct dm_result +{ + typedef typename add_cref< Pm, 1 >::type type; +}; + +template struct dm_result< Pm, bind_t > +{ + typedef typename bind_t::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, + typename _bi::list_av_1::type +> + +BOOST_BIND( M T::*f, A1 a1 ) +{ + typedef typename _bi::dm_result< M T::*, A1 >::type result_type; + typedef _mfi::dm F; + typedef typename _bi::list_av_1::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 diff --git a/boost/boost/bind/bind_template.hpp b/boost/boost/bind/bind_template.hpp index 60d78b31bb..b2c295d245 100644 --- a/boost/boost/bind/bind_template.hpp +++ b/boost/boost/bind/bind_template.hpp @@ -38,6 +38,23 @@ BOOST_BIND_RETURN l_(type(), f_, a, 0); } +#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ + && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) + + template result_type operator()(A1 const & a1) + { + list1 a(a1); + BOOST_BIND_RETURN l_(type(), f_, a, 0); + } + + template result_type operator()(A1 const & a1) const + { + list1 a(a1); + BOOST_BIND_RETURN l_(type(), f_, a, 0); + } + +#endif + template result_type operator()(A1 & a1, A2 & a2) { list2 a(a1, a2); @@ -50,6 +67,49 @@ BOOST_BIND_RETURN l_(type(), f_, a, 0); } +#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ + && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) + + template result_type operator()(A1 const & a1, A2 & a2) + { + list2 a(a1, a2); + BOOST_BIND_RETURN l_(type(), f_, a, 0); + } + + template result_type operator()(A1 const & a1, A2 & a2) const + { + list2 a(a1, a2); + BOOST_BIND_RETURN l_(type(), f_, a, 0); + } + + + template result_type operator()(A1 & a1, A2 const & a2) + { + list2 a(a1, a2); + BOOST_BIND_RETURN l_(type(), f_, a, 0); + } + + template result_type operator()(A1 & a1, A2 const & a2) const + { + list2 a(a1, a2); + BOOST_BIND_RETURN l_(type(), f_, a, 0); + } + + + template result_type operator()(A1 const & a1, A2 const & a2) + { + list2 a(a1, a2); + BOOST_BIND_RETURN l_(type(), f_, a, 0); + } + + template result_type operator()(A1 const & a1, A2 const & a2) const + { + list2 a(a1, a2); + BOOST_BIND_RETURN l_(type(), f_, a, 0); + } + +#endif + template result_type operator()(A1 & a1, A2 & a2, A3 & a3) { list3 a(a1, a2, a3); @@ -146,6 +206,11 @@ template 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); } diff --git a/boost/boost/bind/mem_fn_template.hpp b/boost/boost/bind/mem_fn_template.hpp index 6368bf25c2..1db0713b77 100644 --- a/boost/boost/bind/mem_fn_template.hpp +++ b/boost/boost/bind/mem_fn_template.hpp @@ -12,6 +12,10 @@ // See http://www.boost.org/libs/bind/mem_fn.html for documentation. // +#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) +# define BOOST_MEM_FN_ENABLE_CONST_OVERLOADS +#endif + // mf0 template class BOOST_MEM_FN_NAME(mf0) @@ -50,6 +54,15 @@ public: BOOST_MEM_FN_RETURN call(u, &u); } +#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS + + template R operator()(U const & u) const + { + BOOST_MEM_FN_RETURN call(u, &u); + } + +#endif + R operator()(T & t) const { BOOST_MEM_FN_RETURN (t.*f_)(); @@ -154,6 +167,15 @@ public: BOOST_MEM_FN_RETURN call(u, &u, a1); } +#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS + + template R operator()(U const & u, A1 a1) const + { + BOOST_MEM_FN_RETURN call(u, &u, a1); + } + +#endif + R operator()(T & t, A1 a1) const { BOOST_MEM_FN_RETURN (t.*f_)(a1); @@ -257,6 +279,15 @@ public: BOOST_MEM_FN_RETURN call(u, &u, a1, a2); } +#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS + + template R operator()(U const & u, A1 a1, A2 a2) const + { + BOOST_MEM_FN_RETURN call(u, &u, a1, a2); + } + +#endif + R operator()(T & t, A1 a1, A2 a2) const { BOOST_MEM_FN_RETURN (t.*f_)(a1, a2); @@ -358,6 +389,15 @@ public: BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3); } +#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS + + template R operator()(U const & u, A1 a1, A2 a2, A3 a3) const + { + BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3); + } + +#endif + R operator()(T & t, A1 a1, A2 a2, A3 a3) const { BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3); @@ -459,6 +499,15 @@ public: BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4); } +#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS + + template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const + { + BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4); + } + +#endif + R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4) const { BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4); @@ -560,6 +609,15 @@ public: BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5); } +#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS + + template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const + { + BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5); + } + +#endif + R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5); @@ -661,6 +719,15 @@ public: BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6); } +#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS + + template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const + { + BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6); + } + +#endif + R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6); @@ -762,6 +829,15 @@ public: BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7); } +#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS + + template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const + { + BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7); + } + +#endif + R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7); @@ -863,6 +939,15 @@ public: BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8); } +#ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS + + template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const + { + BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8); + } + +#endif + R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8); @@ -932,3 +1017,4 @@ public: } }; +#undef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS diff --git a/boost/boost/bind/placeholders.hpp b/boost/boost/bind/placeholders.hpp index 8feed58905..a8098a7b10 100644 --- a/boost/boost/bind/placeholders.hpp +++ b/boost/boost/bind/placeholders.hpp @@ -25,7 +25,7 @@ namespace { -#if defined(__BORLANDC__) +#if defined(__BORLANDC__) || defined(__GNUC__) static inline boost::arg<1> _1() { return boost::arg<1>(); } static inline boost::arg<2> _2() { return boost::arg<2>(); } diff --git a/boost/boost/bind/storage.hpp b/boost/boost/bind/storage.hpp new file mode 100644 index 0000000000..be490b0f59 --- /dev/null +++ b/boost/boost/bind/storage.hpp @@ -0,0 +1,475 @@ +#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 +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4512) // assignment operator could not be generated +#endif + +namespace boost +{ + +namespace _bi +{ + +// 1 + +template struct storage1 +{ + explicit storage1( A1 a1 ): a1_( a1 ) {} + + template void accept(V & v) const + { + BOOST_BIND_VISIT_EACH(v, a1_, 0); + } + + A1 a1_; +}; + +#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( __BORLANDC__ ) + +template struct storage1< boost::arg > +{ + explicit storage1( boost::arg ) {} + + template void accept(V &) const { } + + static boost::arg a1_() { return boost::arg(); } +}; + +template struct storage1< boost::arg (*) () > +{ + explicit storage1( boost::arg (*) () ) {} + + template void accept(V &) const { } + + static boost::arg a1_() { return boost::arg(); } +}; + +#endif + +// 2 + +template struct storage2: public storage1 +{ + typedef storage1 inherited; + + storage2( A1 a1, A2 a2 ): storage1( a1 ), a2_( a2 ) {} + + template 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 struct storage2< A1, boost::arg >: public storage1 +{ + typedef storage1 inherited; + + storage2( A1 a1, boost::arg ): storage1( a1 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a2_() { return boost::arg(); } +}; + +template struct storage2< A1, boost::arg (*) () >: public storage1 +{ + typedef storage1 inherited; + + storage2( A1 a1, boost::arg (*) () ): storage1( a1 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a2_() { return boost::arg(); } +}; + +#endif + +// 3 + +template struct storage3: public storage2< A1, A2 > +{ + typedef storage2 inherited; + + storage3( A1 a1, A2 a2, A3 a3 ): storage2( a1, a2 ), a3_( a3 ) {} + + template 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 struct storage3< A1, A2, boost::arg >: public storage2< A1, A2 > +{ + typedef storage2 inherited; + + storage3( A1 a1, A2 a2, boost::arg ): storage2( a1, a2 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a3_() { return boost::arg(); } +}; + +template struct storage3< A1, A2, boost::arg (*) () >: public storage2< A1, A2 > +{ + typedef storage2 inherited; + + storage3( A1 a1, A2 a2, boost::arg (*) () ): storage2( a1, a2 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a3_() { return boost::arg(); } +}; + +#endif + +// 4 + +template struct storage4: public storage3< A1, A2, A3 > +{ + typedef storage3 inherited; + + storage4( A1 a1, A2 a2, A3 a3, A4 a4 ): storage3( a1, a2, a3 ), a4_( a4 ) {} + + template 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 struct storage4< A1, A2, A3, boost::arg >: public storage3< A1, A2, A3 > +{ + typedef storage3 inherited; + + storage4( A1 a1, A2 a2, A3 a3, boost::arg ): storage3( a1, a2, a3 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a4_() { return boost::arg(); } +}; + +template struct storage4< A1, A2, A3, boost::arg (*) () >: public storage3< A1, A2, A3 > +{ + typedef storage3 inherited; + + storage4( A1 a1, A2 a2, A3 a3, boost::arg (*) () ): storage3( a1, a2, a3 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a4_() { return boost::arg(); } +}; + +#endif + +// 5 + +template struct storage5: public storage4< A1, A2, A3, A4 > +{ + typedef storage4 inherited; + + storage5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): storage4( a1, a2, a3, a4 ), a5_( a5 ) {} + + template 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 struct storage5< A1, A2, A3, A4, boost::arg >: public storage4< A1, A2, A3, A4 > +{ + typedef storage4 inherited; + + storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg ): storage4( a1, a2, a3, a4 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a5_() { return boost::arg(); } +}; + +template struct storage5< A1, A2, A3, A4, boost::arg (*) () >: public storage4< A1, A2, A3, A4 > +{ + typedef storage4 inherited; + + storage5( A1 a1, A2 a2, A3 a3, A4 a4, boost::arg (*) () ): storage4( a1, a2, a3, a4 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a5_() { return boost::arg(); } +}; + +#endif + +// 6 + +template struct storage6: public storage5< A1, A2, A3, A4, A5 > +{ + typedef storage5 inherited; + + storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): storage5( a1, a2, a3, a4, a5 ), a6_( a6 ) {} + + template 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 struct storage6< A1, A2, A3, A4, A5, boost::arg >: public storage5< A1, A2, A3, A4, A5 > +{ + typedef storage5 inherited; + + storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg ): storage5( a1, a2, a3, a4, a5 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a6_() { return boost::arg(); } +}; + +template struct storage6< A1, A2, A3, A4, A5, boost::arg (*) () >: public storage5< A1, A2, A3, A4, A5 > +{ + typedef storage5 inherited; + + storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, boost::arg (*) () ): storage5( a1, a2, a3, a4, a5 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a6_() { return boost::arg(); } +}; + +#endif + +// 7 + +template struct storage7: public storage6< A1, A2, A3, A4, A5, A6 > +{ + typedef storage6 inherited; + + storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): storage6( a1, a2, a3, a4, a5, a6 ), a7_( a7 ) {} + + template 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 struct storage7< A1, A2, A3, A4, A5, A6, boost::arg >: public storage6< A1, A2, A3, A4, A5, A6 > +{ + typedef storage6 inherited; + + storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg ): storage6( a1, a2, a3, a4, a5, a6 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a7_() { return boost::arg(); } +}; + +template struct storage7< A1, A2, A3, A4, A5, A6, boost::arg (*) () >: public storage6< A1, A2, A3, A4, A5, A6 > +{ + typedef storage6 inherited; + + storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, boost::arg (*) () ): storage6( a1, a2, a3, a4, a5, a6 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a7_() { return boost::arg(); } +}; + +#endif + +// 8 + +template struct storage8: public storage7< A1, A2, A3, A4, A5, A6, A7 > +{ + typedef storage7 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 ), a8_( a8 ) {} + + template 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 struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg >: public storage7< A1, A2, A3, A4, A5, A6, A7 > +{ + typedef storage7 inherited; + + storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg ): storage7( a1, a2, a3, a4, a5, a6, a7 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a8_() { return boost::arg(); } +}; + +template struct storage8< A1, A2, A3, A4, A5, A6, A7, boost::arg (*) () >: public storage7< A1, A2, A3, A4, A5, A6, A7 > +{ + typedef storage7 inherited; + + storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, boost::arg (*) () ): storage7( a1, a2, a3, a4, a5, a6, a7 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a8_() { return boost::arg(); } +}; + +#endif + +// 9 + +template struct storage9: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 > +{ + typedef storage8 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 ), a9_( a9 ) {} + + template 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 struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 > +{ + typedef storage8 inherited; + + storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg ): storage8( a1, a2, a3, a4, a5, a6, a7, a8 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a9_() { return boost::arg(); } +}; + +template struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, boost::arg (*) () >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 > +{ + typedef storage8 inherited; + + storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, boost::arg (*) () ): storage8( a1, a2, a3, a4, a5, a6, a7, a8 ) {} + + template void accept(V & v) const + { + inherited::accept(v); + } + + static boost::arg a9_() { return boost::arg(); } +}; + +#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 diff --git a/boost/boost/mem_fn.hpp b/boost/boost/mem_fn.hpp index dd46ef3f3e..9695f57e80 100644 --- a/boost/boost/mem_fn.hpp +++ b/boost/boost/mem_fn.hpp @@ -12,6 +12,7 @@ // // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001 David Abrahams +// Copyright (c) 2003-2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -48,6 +49,18 @@ template struct mf #undef BOOST_MEM_FN_CC #undef BOOST_MEM_FN_NAME +#ifdef BOOST_MEM_FN_ENABLE_CDECL + +#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl +#define BOOST_MEM_FN_CC __cdecl + +#include + +#undef BOOST_MEM_FN_CC +#undef BOOST_MEM_FN_NAME + +#endif + #ifdef BOOST_MEM_FN_ENABLE_STDCALL #define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall @@ -89,6 +102,18 @@ template<> struct mf #undef BOOST_MEM_FN_CC #undef BOOST_MEM_FN_NAME +#ifdef BOOST_MEM_FN_ENABLE_CDECL + +#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl +#define BOOST_MEM_FN_CC __cdecl + +#include + +#undef BOOST_MEM_FN_CC +#undef BOOST_MEM_FN_NAME + +#endif + #ifdef BOOST_MEM_FN_ENABLE_STDCALL #define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall @@ -130,6 +155,20 @@ template<> struct mf #undef BOOST_MEM_FN_NAME2 #undef BOOST_MEM_FN_CC +#ifdef BOOST_MEM_FN_ENABLE_CDECL + +#define BOOST_MEM_FN_NAME(X) X##_cdecl +#define BOOST_MEM_FN_NAME2(X) inner_##X##_cdecl +#define BOOST_MEM_FN_CC __cdecl + +#include + +#undef BOOST_MEM_FN_NAME +#undef BOOST_MEM_FN_NAME2 +#undef BOOST_MEM_FN_CC + +#endif + #ifdef BOOST_MEM_FN_ENABLE_STDCALL #define BOOST_MEM_FN_NAME(X) X##_stdcall @@ -178,6 +217,18 @@ namespace _mfi #undef BOOST_MEM_FN_CC #undef BOOST_MEM_FN_NAME +#ifdef BOOST_MEM_FN_ENABLE_CDECL + +#define BOOST_MEM_FN_NAME(X) X##_cdecl +#define BOOST_MEM_FN_CC __cdecl + +#include + +#undef BOOST_MEM_FN_CC +#undef BOOST_MEM_FN_NAME + +#endif + #ifdef BOOST_MEM_FN_ENABLE_STDCALL #define BOOST_MEM_FN_NAME(X) X##_stdcall @@ -219,6 +270,18 @@ namespace _mfi #undef BOOST_MEM_FN_NAME #undef BOOST_MEM_FN_CC +#ifdef BOOST_MEM_FN_ENABLE_CDECL + +#define BOOST_MEM_FN_NAME(X) X##_cdecl +#define BOOST_MEM_FN_CC __cdecl + +#include + +#undef BOOST_MEM_FN_NAME +#undef BOOST_MEM_FN_CC + +#endif + #ifdef BOOST_MEM_FN_ENABLE_STDCALL #define BOOST_MEM_FN_NAME(X) X##_stdcall @@ -265,11 +328,6 @@ private: return (u.*f_); } - template R & call(U & u, T *) const - { - return (u.*f_); - } - template R const & call(U & u, void const *) const { return (get_pointer(u)->*f_); @@ -289,25 +347,25 @@ public: return (p->*f_); } - template R const & operator()(U & u) const + template R const & operator()(U const & u) const { return call(u, &u); } -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, < 0x3200) R & operator()(T & t) const { return (t.*f_); } -#endif - R const & operator()(T const & t) const { return (t.*f_); } +#endif + bool operator==(dm const & rhs) const { return f_ == rhs.f_; diff --git a/boost/boost/ref.hpp b/boost/boost/ref.hpp index 3745e7ca0f..ab09ae7412 100644 --- a/boost/boost/ref.hpp +++ b/boost/boost/ref.hpp @@ -10,6 +10,7 @@ #include #include #include +#include // // ref.hpp - ref/cref, useful helper functions @@ -33,7 +34,7 @@ template class reference_wrapper public: typedef T type; -#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) +#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1300 ) explicit reference_wrapper(T& t): t_(&t) {} @@ -54,7 +55,7 @@ private: T* t_; }; -# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x570) +# if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) ) # define BOOST_REF_CONST # else # define BOOST_REF_CONST const diff --git a/status.14x b/status.14x index ab88167257..4fe2e3c5a8 100644 --- a/status.14x +++ b/status.14x @@ -107,6 +107,9 @@ What's new - Fix a crash when a non-template file is selected in the "New from Template" dialog (bug 2404) +- Fix random crashes resulting of an incompatibility of the included + boost::bind library with gcc 4.1 (bug 2677, probably also 2662 and 2684) + * Build/installation: - Fix 'check' make target for systems which do not have /bin/bash (bug 2524).