epoc32/include/stdapis/boost/bind.hpp
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/boost/bind.hpp	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/boost/bind.hpp	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,547 +1,1651 @@
     1.4 +#ifndef BOOST_BIND_HPP_INCLUDED
     1.5 +#define BOOST_BIND_HPP_INCLUDED
     1.6  
     1.7 -#if !defined(BOOST_PP_IS_ITERATING)
     1.8 +// MS compatible compilers support #pragma once
     1.9  
    1.10 -///// header body
    1.11 +#if defined(_MSC_VER) && (_MSC_VER >= 1020)
    1.12 +# pragma once
    1.13 +#endif
    1.14  
    1.15 -#ifndef BOOST_MPL_BIND_HPP_INCLUDED
    1.16 -#define BOOST_MPL_BIND_HPP_INCLUDED
    1.17 -
    1.18 -// Copyright Peter Dimov 2001
    1.19 -// Copyright Aleksey Gurtovoy 2001-2004
    1.20  //
    1.21 -// Distributed under the Boost Software License, Version 1.0. 
    1.22 -// (See accompanying file LICENSE_1_0.txt or copy at 
    1.23 +//  bind.hpp - binds function objects to arguments
    1.24 +//
    1.25 +//  Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
    1.26 +//  Copyright (c) 2001 David Abrahams
    1.27 +//  Copyright (c) 2005 Peter Dimov
    1.28 +//
    1.29 +// Distributed under the Boost Software License, Version 1.0. (See
    1.30 +// accompanying file LICENSE_1_0.txt or copy at
    1.31  // http://www.boost.org/LICENSE_1_0.txt)
    1.32  //
    1.33 -// See http://www.boost.org/libs/mpl for documentation.
    1.34 +//  See http://www.boost.org/libs/bind/bind.html for documentation.
    1.35 +//
    1.36  
    1.37 -// $Source: /cvsroot/boost/boost/boost/mpl/bind.hpp,v $
    1.38 -// $Date: 2004/10/26 14:51:04 $
    1.39 -// $Revision: 1.13 $
    1.40 +#include <boost/config.hpp>
    1.41 +#include <boost/ref.hpp>
    1.42 +#include <boost/mem_fn.hpp>
    1.43 +#include <boost/type.hpp>
    1.44 +#include <boost/bind/arg.hpp>
    1.45 +#include <boost/detail/workaround.hpp>
    1.46 +#include <boost/visit_each.hpp>
    1.47  
    1.48 -#if !defined(BOOST_MPL_PREPROCESSING_MODE)
    1.49 -#   include <boost/mpl/bind_fwd.hpp>
    1.50 -#   include <boost/mpl/placeholders.hpp>
    1.51 -#   include <boost/mpl/next.hpp>
    1.52 -#   include <boost/mpl/protect.hpp>
    1.53 -#   include <boost/mpl/apply_wrap.hpp>
    1.54 -#   include <boost/mpl/limits/arity.hpp>
    1.55 -#   include <boost/mpl/aux_/na.hpp>
    1.56 -#   include <boost/mpl/aux_/arity_spec.hpp>
    1.57 -#   include <boost/mpl/aux_/type_wrapper.hpp>
    1.58 -#   include <boost/mpl/aux_/yes_no.hpp>
    1.59 -#   if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
    1.60 -#       include <boost/type_traits/is_reference.hpp>
    1.61 -#   endif 
    1.62 +// Borland-specific bug, visit_each() silently fails to produce code
    1.63 +
    1.64 +#if defined(__BORLANDC__)
    1.65 +#  define BOOST_BIND_VISIT_EACH boost::visit_each
    1.66 +#else
    1.67 +#  define BOOST_BIND_VISIT_EACH visit_each
    1.68  #endif
    1.69  
    1.70 -#include <boost/mpl/aux_/config/bind.hpp>
    1.71 -#include <boost/mpl/aux_/config/static_constant.hpp>
    1.72 -#include <boost/mpl/aux_/config/use_preprocessed.hpp>
    1.73 +#include <boost/bind/storage.hpp>
    1.74  
    1.75 -#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
    1.76 -    && !defined(BOOST_MPL_PREPROCESSING_MODE)
    1.77 +#ifdef BOOST_MSVC
    1.78 +# pragma warning(push)
    1.79 +# pragma warning(disable: 4512) // assignment operator could not be generated
    1.80 +#endif
    1.81  
    1.82 -#   if defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
    1.83 -#       define BOOST_MPL_PREPROCESSED_HEADER basic_bind.hpp
    1.84 -#   else
    1.85 -#       define BOOST_MPL_PREPROCESSED_HEADER bind.hpp
    1.86 -#   endif
    1.87 -#   include <boost/mpl/aux_/include_preprocessed.hpp>
    1.88 +namespace boost
    1.89 +{
    1.90 +
    1.91 +namespace _bi // implementation details
    1.92 +{
    1.93 +
    1.94 +// result_traits
    1.95 +
    1.96 +template<class R, class F> struct result_traits
    1.97 +{
    1.98 +    typedef R type;
    1.99 +};
   1.100 +
   1.101 +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
   1.102 +
   1.103 +struct unspecified {};
   1.104 +
   1.105 +template<class F> struct result_traits<unspecified, F>
   1.106 +{
   1.107 +    typedef typename F::result_type type;
   1.108 +};
   1.109 +
   1.110 +template<class F> struct result_traits< unspecified, reference_wrapper<F> >
   1.111 +{
   1.112 +    typedef typename F::result_type type;
   1.113 +};
   1.114 +
   1.115 +#endif
   1.116 +
   1.117 +// ref_compare
   1.118 +
   1.119 +template<class T> bool ref_compare( T const & a, T const & b, long )
   1.120 +{
   1.121 +    return a == b;
   1.122 +}
   1.123 +
   1.124 +template<int I> bool ref_compare( arg<I> const &, arg<I> const &, int )
   1.125 +{
   1.126 +    return true;
   1.127 +}
   1.128 +
   1.129 +template<int I> bool ref_compare( arg<I> (*) (), arg<I> (*) (), int )
   1.130 +{
   1.131 +    return true;
   1.132 +}
   1.133 +
   1.134 +template<class T> bool ref_compare( reference_wrapper<T> const & a, reference_wrapper<T> const & b, int )
   1.135 +{
   1.136 +    return a.get_pointer() == b.get_pointer();
   1.137 +}
   1.138 +
   1.139 +// bind_t forward declaration for listN
   1.140 +
   1.141 +template<class R, class F, class L> class bind_t;
   1.142 +
   1.143 +// value
   1.144 +
   1.145 +template<class T> class value
   1.146 +{
   1.147 +public:
   1.148 +
   1.149 +    value(T const & t): t_(t) {}
   1.150 +
   1.151 +    T & get() { return t_; }
   1.152 +    T const & get() const { return t_; }
   1.153 +
   1.154 +    bool operator==(value const & rhs) const
   1.155 +    {
   1.156 +        return t_ == rhs.t_;
   1.157 +    }
   1.158 +
   1.159 +private:
   1.160 +
   1.161 +    T t_;
   1.162 +};
   1.163 +
   1.164 +// type
   1.165 +
   1.166 +template<class T> class type {};
   1.167 +
   1.168 +// unwrap
   1.169 +
   1.170 +template<class F> struct unwrapper
   1.171 +{
   1.172 +    static inline F & unwrap( F & f, long )
   1.173 +    {
   1.174 +        return f;
   1.175 +    }
   1.176 +
   1.177 +    template<class F2> static inline F2 & unwrap( reference_wrapper<F2> rf, int )
   1.178 +    {
   1.179 +        return rf.get();
   1.180 +    }
   1.181 +
   1.182 +    template<class R, class T> static inline _mfi::dm<R, T> unwrap( R T::* pm, int )
   1.183 +    {
   1.184 +        return _mfi::dm<R, T>( pm );
   1.185 +    }
   1.186 +};
   1.187 +
   1.188 +// listN
   1.189 +
   1.190 +class list0
   1.191 +{
   1.192 +public:
   1.193 +
   1.194 +    list0() {}
   1.195 +
   1.196 +    template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
   1.197 +
   1.198 +    template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
   1.199 +
   1.200 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.201 +
   1.202 +    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); }
   1.203 +
   1.204 +    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); }
   1.205 +
   1.206 +    template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
   1.207 +    {
   1.208 +        return unwrapper<F>::unwrap(f, 0)();
   1.209 +    }
   1.210 +
   1.211 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
   1.212 +    {
   1.213 +        return unwrapper<F const>::unwrap(f, 0)();
   1.214 +    }
   1.215 +
   1.216 +    template<class F, class A> void operator()(type<void>, F & f, A &, int)
   1.217 +    {
   1.218 +        unwrapper<F>::unwrap(f, 0)();
   1.219 +    }
   1.220 +
   1.221 +    template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
   1.222 +    {
   1.223 +        unwrapper<F const>::unwrap(f, 0)();
   1.224 +    }
   1.225 +
   1.226 +    template<class V> void accept(V &) const
   1.227 +    {
   1.228 +    }
   1.229 +
   1.230 +    bool operator==(list0 const &) const
   1.231 +    {
   1.232 +        return true;
   1.233 +    }
   1.234 +};
   1.235 +
   1.236 +template< class A1 > class list1: private storage1< A1 >
   1.237 +{
   1.238 +private:
   1.239 +
   1.240 +    typedef storage1< A1 > base_type;
   1.241 +
   1.242 +public:
   1.243 +
   1.244 +    explicit list1( A1 a1 ): base_type( a1 ) {}
   1.245 +
   1.246 +    A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
   1.247 +
   1.248 +    A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
   1.249 +
   1.250 +    template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
   1.251 +
   1.252 +    template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
   1.253 +
   1.254 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.255 +
   1.256 +    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); }
   1.257 +
   1.258 +    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); }
   1.259 +
   1.260 +    template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
   1.261 +    {
   1.262 +        return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
   1.263 +    }
   1.264 +
   1.265 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
   1.266 +    {
   1.267 +        return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
   1.268 +    }
   1.269 +
   1.270 +    template<class F, class A> void operator()(type<void>, F & f, A & a, int)
   1.271 +    {
   1.272 +        unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
   1.273 +    }
   1.274 +
   1.275 +    template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
   1.276 +    {
   1.277 +        unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
   1.278 +    }
   1.279 +
   1.280 +    template<class V> void accept(V & v) const
   1.281 +    {
   1.282 +        base_type::accept(v);
   1.283 +    }
   1.284 +
   1.285 +    bool operator==(list1 const & rhs) const
   1.286 +    {
   1.287 +        return ref_compare(base_type::a1_, rhs.a1_, 0);
   1.288 +    }
   1.289 +};
   1.290 +
   1.291 +template< class A1, class A2 > class list2: private storage2< A1, A2 >
   1.292 +{
   1.293 +private:
   1.294 +
   1.295 +    typedef storage2< A1, A2 > base_type;
   1.296 +
   1.297 +public:
   1.298 +
   1.299 +    list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {}
   1.300 +
   1.301 +    A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
   1.302 +    A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
   1.303 +
   1.304 +    A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
   1.305 +    A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
   1.306 +
   1.307 +    template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
   1.308 +
   1.309 +    template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
   1.310 +
   1.311 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.312 +
   1.313 +    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); }
   1.314 +
   1.315 +    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); }
   1.316 +
   1.317 +    template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
   1.318 +    {
   1.319 +        return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
   1.320 +    }
   1.321 +
   1.322 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
   1.323 +    {
   1.324 +        return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
   1.325 +    }
   1.326 +
   1.327 +    template<class F, class A> void operator()(type<void>, F & f, A & a, int)
   1.328 +    {
   1.329 +        unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
   1.330 +    }
   1.331 +
   1.332 +    template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
   1.333 +    {
   1.334 +        unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
   1.335 +    }
   1.336 +
   1.337 +    template<class V> void accept(V & v) const
   1.338 +    {
   1.339 +        base_type::accept(v);
   1.340 +    }
   1.341 +
   1.342 +    bool operator==(list2 const & rhs) const
   1.343 +    {
   1.344 +        return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0);
   1.345 +    }
   1.346 +};
   1.347 +
   1.348 +template< class A1, class A2, class A3 > class list3: private storage3< A1, A2, A3 >
   1.349 +{
   1.350 +private:
   1.351 +
   1.352 +    typedef storage3< A1, A2, A3 > base_type;
   1.353 +
   1.354 +public:
   1.355 +
   1.356 +    list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {}
   1.357 +
   1.358 +    A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
   1.359 +    A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
   1.360 +    A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
   1.361 +
   1.362 +    A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
   1.363 +    A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
   1.364 +    A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
   1.365 +
   1.366 +    template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
   1.367 +
   1.368 +    template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
   1.369 +
   1.370 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.371 +
   1.372 +    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); }
   1.373 +
   1.374 +    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); }
   1.375 +
   1.376 +    template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
   1.377 +    {
   1.378 +        return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
   1.379 +    }
   1.380 +
   1.381 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
   1.382 +    {
   1.383 +        return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
   1.384 +    }
   1.385 +
   1.386 +    template<class F, class A> void operator()(type<void>, F & f, A & a, int)
   1.387 +    {
   1.388 +        unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
   1.389 +    }
   1.390 +
   1.391 +    template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
   1.392 +    {
   1.393 +        unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
   1.394 +    }
   1.395 +
   1.396 +    template<class V> void accept(V & v) const
   1.397 +    {
   1.398 +        base_type::accept(v);
   1.399 +    }
   1.400 +
   1.401 +    bool operator==(list3 const & rhs) const
   1.402 +    {
   1.403 +        return
   1.404 +            
   1.405 +            ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
   1.406 +            ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
   1.407 +            ref_compare( base_type::a3_, rhs.a3_, 0 );
   1.408 +    }
   1.409 +};
   1.410 +
   1.411 +template< class A1, class A2, class A3, class A4 > class list4: private storage4< A1, A2, A3, A4 >
   1.412 +{
   1.413 +private:
   1.414 +
   1.415 +    typedef storage4< A1, A2, A3, A4 > base_type;
   1.416 +
   1.417 +public:
   1.418 +
   1.419 +    list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {}
   1.420 +
   1.421 +    A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
   1.422 +    A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
   1.423 +    A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
   1.424 +    A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
   1.425 +
   1.426 +    A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
   1.427 +    A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
   1.428 +    A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
   1.429 +    A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
   1.430 +
   1.431 +    template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
   1.432 +
   1.433 +    template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
   1.434 +
   1.435 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.436 +
   1.437 +    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); }
   1.438 +
   1.439 +    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); }
   1.440 +
   1.441 +    template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
   1.442 +    {
   1.443 +        return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
   1.444 +    }
   1.445 +
   1.446 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
   1.447 +    {
   1.448 +        return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
   1.449 +    }
   1.450 +
   1.451 +    template<class F, class A> void operator()(type<void>, F & f, A & a, int)
   1.452 +    {
   1.453 +        unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
   1.454 +    }
   1.455 +
   1.456 +    template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
   1.457 +    {
   1.458 +        unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
   1.459 +    }
   1.460 +
   1.461 +    template<class V> void accept(V & v) const
   1.462 +    {
   1.463 +        base_type::accept(v);
   1.464 +    }
   1.465 +
   1.466 +    bool operator==(list4 const & rhs) const
   1.467 +    {
   1.468 +        return
   1.469 +
   1.470 +            ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
   1.471 +            ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
   1.472 +            ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
   1.473 +            ref_compare( base_type::a4_, rhs.a4_, 0 );
   1.474 +    }
   1.475 +};
   1.476 +
   1.477 +template< class A1, class A2, class A3, class A4, class A5 > class list5: private storage5< A1, A2, A3, A4, A5 >
   1.478 +{
   1.479 +private:
   1.480 +
   1.481 +    typedef storage5< A1, A2, A3, A4, A5 > base_type;
   1.482 +
   1.483 +public:
   1.484 +
   1.485 +    list5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): base_type( a1, a2, a3, a4, a5 ) {}
   1.486 +
   1.487 +    A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
   1.488 +    A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
   1.489 +    A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
   1.490 +    A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
   1.491 +    A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
   1.492 +
   1.493 +    A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
   1.494 +    A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
   1.495 +    A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
   1.496 +    A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
   1.497 +    A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
   1.498 +
   1.499 +    template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
   1.500 +
   1.501 +    template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
   1.502 +
   1.503 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.504 +
   1.505 +    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); }
   1.506 +
   1.507 +    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); }
   1.508 +
   1.509 +    template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
   1.510 +    {
   1.511 +        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_]);
   1.512 +    }
   1.513 +
   1.514 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
   1.515 +    {
   1.516 +        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_]);
   1.517 +    }
   1.518 +
   1.519 +    template<class F, class A> void operator()(type<void>, F & f, A & a, int)
   1.520 +    {
   1.521 +        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_]);
   1.522 +    }
   1.523 +
   1.524 +    template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
   1.525 +    {
   1.526 +        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_]);
   1.527 +    }
   1.528 +
   1.529 +    template<class V> void accept(V & v) const
   1.530 +    {
   1.531 +        base_type::accept(v);
   1.532 +    }
   1.533 +
   1.534 +    bool operator==(list5 const & rhs) const
   1.535 +    {
   1.536 +        return
   1.537 +
   1.538 +            ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
   1.539 +            ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
   1.540 +            ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
   1.541 +            ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
   1.542 +            ref_compare( base_type::a5_, rhs.a5_, 0 );
   1.543 +    }
   1.544 +};
   1.545 +
   1.546 +template<class A1, class A2, class A3, class A4, class A5, class A6> class list6: private storage6< A1, A2, A3, A4, A5, A6 >
   1.547 +{
   1.548 +private:
   1.549 +
   1.550 +    typedef storage6< A1, A2, A3, A4, A5, A6 > base_type;
   1.551 +
   1.552 +public:
   1.553 +
   1.554 +    list6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): base_type( a1, a2, a3, a4, a5, a6 ) {}
   1.555 +
   1.556 +    A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
   1.557 +    A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
   1.558 +    A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
   1.559 +    A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
   1.560 +    A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
   1.561 +    A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
   1.562 +
   1.563 +    A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
   1.564 +    A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
   1.565 +    A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
   1.566 +    A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
   1.567 +    A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
   1.568 +    A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
   1.569 +
   1.570 +    template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
   1.571 +
   1.572 +    template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
   1.573 +
   1.574 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.575 +
   1.576 +    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); }
   1.577 +
   1.578 +    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); }
   1.579 +
   1.580 +    template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
   1.581 +    {
   1.582 +        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_]);
   1.583 +    }
   1.584 +
   1.585 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
   1.586 +    {
   1.587 +        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_]);
   1.588 +    }
   1.589 +
   1.590 +    template<class F, class A> void operator()(type<void>, F & f, A & a, int)
   1.591 +    {
   1.592 +        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_]);
   1.593 +    }
   1.594 +
   1.595 +    template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
   1.596 +    {
   1.597 +        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_]);
   1.598 +    }
   1.599 +
   1.600 +    template<class V> void accept(V & v) const
   1.601 +    {
   1.602 +        base_type::accept(v);
   1.603 +    }
   1.604 +
   1.605 +    bool operator==(list6 const & rhs) const
   1.606 +    {
   1.607 +        return
   1.608 +
   1.609 +            ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
   1.610 +            ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
   1.611 +            ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
   1.612 +            ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
   1.613 +            ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
   1.614 +            ref_compare( base_type::a6_, rhs.a6_, 0 );
   1.615 +    }
   1.616 +};
   1.617 +
   1.618 +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 >
   1.619 +{
   1.620 +private:
   1.621 +
   1.622 +    typedef storage7< A1, A2, A3, A4, A5, A6, A7 > base_type;
   1.623 +
   1.624 +public:
   1.625 +
   1.626 +    list7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): base_type( a1, a2, a3, a4, a5, a6, a7 ) {}
   1.627 +
   1.628 +    A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
   1.629 +    A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
   1.630 +    A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
   1.631 +    A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
   1.632 +    A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
   1.633 +    A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
   1.634 +    A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
   1.635 +
   1.636 +    A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
   1.637 +    A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
   1.638 +    A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
   1.639 +    A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
   1.640 +    A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
   1.641 +    A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
   1.642 +    A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
   1.643 +
   1.644 +    template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
   1.645 +
   1.646 +    template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
   1.647 +
   1.648 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.649 +
   1.650 +    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); }
   1.651 +
   1.652 +    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); }
   1.653 +
   1.654 +    template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
   1.655 +    {
   1.656 +        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_]);
   1.657 +    }
   1.658 +
   1.659 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
   1.660 +    {
   1.661 +        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_]);
   1.662 +    }
   1.663 +
   1.664 +    template<class F, class A> void operator()(type<void>, F & f, A & a, int)
   1.665 +    {
   1.666 +        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_]);
   1.667 +    }
   1.668 +
   1.669 +    template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
   1.670 +    {
   1.671 +        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_]);
   1.672 +    }
   1.673 +
   1.674 +    template<class V> void accept(V & v) const
   1.675 +    {
   1.676 +        base_type::accept(v);
   1.677 +    }
   1.678 +
   1.679 +    bool operator==(list7 const & rhs) const
   1.680 +    {
   1.681 +        return
   1.682 +
   1.683 +            ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
   1.684 +            ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
   1.685 +            ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
   1.686 +            ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
   1.687 +            ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
   1.688 +            ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
   1.689 +            ref_compare( base_type::a7_, rhs.a7_, 0 );
   1.690 +    }
   1.691 +};
   1.692 +
   1.693 +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 >
   1.694 +{
   1.695 +private:
   1.696 +
   1.697 +    typedef storage8< A1, A2, A3, A4, A5, A6, A7, A8 > base_type;
   1.698 +
   1.699 +public:
   1.700 +
   1.701 +    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 ) {}
   1.702 +
   1.703 +    A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
   1.704 +    A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
   1.705 +    A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
   1.706 +    A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
   1.707 +    A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
   1.708 +    A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
   1.709 +    A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
   1.710 +    A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
   1.711 +
   1.712 +    A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
   1.713 +    A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
   1.714 +    A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
   1.715 +    A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
   1.716 +    A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
   1.717 +    A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
   1.718 +    A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
   1.719 +    A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
   1.720 +
   1.721 +    template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
   1.722 +
   1.723 +    template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
   1.724 +
   1.725 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.726 +
   1.727 +    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); }
   1.728 +
   1.729 +    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); }
   1.730 +
   1.731 +    template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
   1.732 +    {
   1.733 +        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_]);
   1.734 +    }
   1.735 +
   1.736 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
   1.737 +    {
   1.738 +        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_]);
   1.739 +    }
   1.740 +
   1.741 +    template<class F, class A> void operator()(type<void>, F & f, A & a, int)
   1.742 +    {
   1.743 +        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_]);
   1.744 +    }
   1.745 +
   1.746 +    template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
   1.747 +    {
   1.748 +        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_]);
   1.749 +    }
   1.750 +
   1.751 +    template<class V> void accept(V & v) const
   1.752 +    {
   1.753 +        base_type::accept(v);
   1.754 +    }
   1.755 +
   1.756 +    bool operator==(list8 const & rhs) const
   1.757 +    {
   1.758 +        return
   1.759 +            
   1.760 +            ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
   1.761 +            ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
   1.762 +            ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
   1.763 +            ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
   1.764 +            ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
   1.765 +            ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
   1.766 +            ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
   1.767 +            ref_compare( base_type::a8_, rhs.a8_, 0 );
   1.768 +    }
   1.769 +};
   1.770 +
   1.771 +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 >
   1.772 +{
   1.773 +private:
   1.774 +
   1.775 +    typedef storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > base_type;
   1.776 +
   1.777 +public:
   1.778 +
   1.779 +    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 ) {}
   1.780 +
   1.781 +    A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
   1.782 +    A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
   1.783 +    A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
   1.784 +    A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
   1.785 +    A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
   1.786 +    A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
   1.787 +    A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
   1.788 +    A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
   1.789 +    A9 operator[] (boost::arg<9>) const { return base_type::a9_; }
   1.790 +
   1.791 +    A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
   1.792 +    A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
   1.793 +    A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
   1.794 +    A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
   1.795 +    A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
   1.796 +    A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
   1.797 +    A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
   1.798 +    A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
   1.799 +    A9 operator[] (boost::arg<9> (*) ()) const { return base_type::a9_; }
   1.800 +
   1.801 +    template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
   1.802 +
   1.803 +    template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
   1.804 +
   1.805 +    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
   1.806 +
   1.807 +    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); }
   1.808 +
   1.809 +    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); }
   1.810 +
   1.811 +    template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
   1.812 +    {
   1.813 +        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_]);
   1.814 +    }
   1.815 +
   1.816 +    template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
   1.817 +    {
   1.818 +        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_]);
   1.819 +    }
   1.820 +
   1.821 +    template<class F, class A> void operator()(type<void>, F & f, A & a, int)
   1.822 +    {
   1.823 +        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_]);
   1.824 +    }
   1.825 +
   1.826 +    template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
   1.827 +    {
   1.828 +        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_]);
   1.829 +    }
   1.830 +
   1.831 +    template<class V> void accept(V & v) const
   1.832 +    {
   1.833 +        base_type::accept(v);
   1.834 +    }
   1.835 +
   1.836 +    bool operator==(list9 const & rhs) const
   1.837 +    {
   1.838 +        return
   1.839 +
   1.840 +            ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
   1.841 +            ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
   1.842 +            ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
   1.843 +            ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
   1.844 +            ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
   1.845 +            ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
   1.846 +            ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
   1.847 +            ref_compare( base_type::a8_, rhs.a8_, 0 ) &&
   1.848 +            ref_compare( base_type::a9_, rhs.a9_, 0 );
   1.849 +    }
   1.850 +};
   1.851 +
   1.852 +// bind_t
   1.853 +
   1.854 +#ifndef BOOST_NO_VOID_RETURNS
   1.855 +
   1.856 +template<class R, class F, class L> class bind_t
   1.857 +{
   1.858 +public:
   1.859 +
   1.860 +    typedef bind_t this_type;
   1.861 +
   1.862 +    bind_t(F f, L const & l): f_(f), l_(l) {}
   1.863 +
   1.864 +#define BOOST_BIND_RETURN return
   1.865 +#include <boost/bind/bind_template.hpp>
   1.866 +#undef BOOST_BIND_RETURN
   1.867 +
   1.868 +};
   1.869  
   1.870  #else
   1.871  
   1.872 -#   include <boost/mpl/aux_/preprocessor/params.hpp>
   1.873 -#   include <boost/mpl/aux_/preprocessor/default_params.hpp>
   1.874 -#   include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
   1.875 -#   include <boost/mpl/aux_/preprocessor/partial_spec_params.hpp>
   1.876 -#   include <boost/mpl/aux_/preprocessor/ext_params.hpp>
   1.877 -#   include <boost/mpl/aux_/preprocessor/repeat.hpp>
   1.878 -#   include <boost/mpl/aux_/preprocessor/enum.hpp>
   1.879 -#   include <boost/mpl/aux_/preprocessor/add.hpp>
   1.880 -#   include <boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp>
   1.881 -#   include <boost/mpl/aux_/config/ctps.hpp>
   1.882 -#   include <boost/mpl/aux_/config/ttp.hpp>
   1.883 -#   include <boost/mpl/aux_/config/dtp.hpp>
   1.884 -#   include <boost/mpl/aux_/nttp_decl.hpp>
   1.885 +template<class R> struct bind_t_generator
   1.886 +{
   1.887  
   1.888 -#   include <boost/preprocessor/iterate.hpp>
   1.889 -#   include <boost/preprocessor/comma_if.hpp>
   1.890 -#   include <boost/preprocessor/cat.hpp>
   1.891 -#   include <boost/preprocessor/inc.hpp>
   1.892 +template<class F, class L> class implementation
   1.893 +{
   1.894 +public:
   1.895  
   1.896 -namespace boost { namespace mpl {
   1.897 +    typedef implementation this_type;
   1.898  
   1.899 -// local macros, #undef-ined at the end of the header
   1.900 -#   define AUX778076_APPLY \
   1.901 -    BOOST_PP_CAT(apply_wrap,BOOST_MPL_LIMIT_METAFUNCTION_ARITY) \
   1.902 -    /**/
   1.903 +    implementation(F f, L const & l): f_(f), l_(l) {}
   1.904  
   1.905 -#   if defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
   1.906 -#       define AUX778076_DMC_PARAM() , int dummy_
   1.907 -#   else
   1.908 -#       define AUX778076_DMC_PARAM()
   1.909 -#   endif
   1.910 +#define BOOST_BIND_RETURN return
   1.911 +#include <boost/bind/bind_template.hpp>
   1.912 +#undef BOOST_BIND_RETURN
   1.913  
   1.914 -#   define AUX778076_BIND_PARAMS(param) \
   1.915 -    BOOST_MPL_PP_PARAMS( \
   1.916 -          BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
   1.917 -        , param \
   1.918 -        ) \
   1.919 -    /**/
   1.920 +};
   1.921  
   1.922 -#   define AUX778076_BIND_DEFAULT_PARAMS(param, value) \
   1.923 -    BOOST_MPL_PP_DEFAULT_PARAMS( \
   1.924 -          BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
   1.925 -        , param \
   1.926 -        , value \
   1.927 -        ) \
   1.928 -    /**/
   1.929 +};
   1.930  
   1.931 -#   define AUX778076_BIND_N_PARAMS(n, param) \
   1.932 -    BOOST_PP_COMMA_IF(n) BOOST_MPL_PP_PARAMS(n, param) \
   1.933 -    /**/
   1.934 +template<> struct bind_t_generator<void>
   1.935 +{
   1.936  
   1.937 -#   define AUX778076_BIND_N_SPEC_PARAMS(n, param, def) \
   1.938 -    BOOST_PP_COMMA_IF(n) \
   1.939 -    BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(n, param, def) \
   1.940 -    /**/
   1.941 +template<class F, class L> class implementation
   1.942 +{
   1.943 +private:
   1.944  
   1.945 -#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
   1.946 -#   define AUX778076_BIND_NESTED_DEFAULT_PARAMS(param, value) \
   1.947 -    AUX778076_BIND_DEFAULT_PARAMS(param, value) \
   1.948 -    /**/
   1.949 -#else
   1.950 -#   define AUX778076_BIND_NESTED_DEFAULT_PARAMS(param, value) \
   1.951 -    AUX778076_BIND_PARAMS(param) \
   1.952 -    /**/
   1.953 +    typedef void R;
   1.954 +
   1.955 +public:
   1.956 +
   1.957 +    typedef implementation this_type;
   1.958 +
   1.959 +    implementation(F f, L const & l): f_(f), l_(l) {}
   1.960 +
   1.961 +#define BOOST_BIND_RETURN
   1.962 +#include <boost/bind/bind_template.hpp>
   1.963 +#undef BOOST_BIND_RETURN
   1.964 +
   1.965 +};
   1.966 +
   1.967 +};
   1.968 +
   1.969 +template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
   1.970 +{
   1.971 +public:
   1.972 +
   1.973 +    bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
   1.974 +
   1.975 +};
   1.976 +
   1.977  #endif
   1.978  
   1.979 -namespace aux {
   1.980 +// function_equal
   1.981  
   1.982 -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
   1.983 +#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
   1.984  
   1.985 -template<
   1.986 -      typename T, AUX778076_BIND_PARAMS(typename U)
   1.987 -    >
   1.988 -struct resolve_bind_arg
   1.989 +// put overloads in _bi, rely on ADL
   1.990 +
   1.991 +# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
   1.992 +
   1.993 +template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
   1.994  {
   1.995 -    typedef T type;
   1.996 +    return a.compare(b);
   1.997 +}
   1.998 +
   1.999 +# else
  1.1000 +
  1.1001 +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 )
  1.1002 +{
  1.1003 +    return a.compare(b);
  1.1004 +}
  1.1005 +
  1.1006 +# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
  1.1007 +
  1.1008 +#else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
  1.1009 +
  1.1010 +// put overloads in boost
  1.1011 +
  1.1012 +} // namespace _bi
  1.1013 +
  1.1014 +# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
  1.1015 +
  1.1016 +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 )
  1.1017 +{
  1.1018 +    return a.compare(b);
  1.1019 +}
  1.1020 +
  1.1021 +# else
  1.1022 +
  1.1023 +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 )
  1.1024 +{
  1.1025 +    return a.compare(b);
  1.1026 +}
  1.1027 +
  1.1028 +# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
  1.1029 +
  1.1030 +namespace _bi
  1.1031 +{
  1.1032 +
  1.1033 +#endif // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
  1.1034 +
  1.1035 +// add_value
  1.1036 +
  1.1037 +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
  1.1038 +
  1.1039 +template<class T> struct add_value
  1.1040 +{
  1.1041 +    typedef _bi::value<T> type;
  1.1042  };
  1.1043  
  1.1044 -#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
  1.1045 -
  1.1046 -template<
  1.1047 -      typename T
  1.1048 -    , typename Arg
  1.1049 -    >
  1.1050 -struct replace_unnamed_arg
  1.1051 +template<class T> struct add_value< value<T> >
  1.1052  {
  1.1053 -    typedef Arg next;
  1.1054 -    typedef T type;
  1.1055 +    typedef _bi::value<T> type;
  1.1056  };
  1.1057  
  1.1058 -template<
  1.1059 -      typename Arg
  1.1060 -    >
  1.1061 -struct replace_unnamed_arg< arg<-1>,Arg >
  1.1062 +template<class T> struct add_value< reference_wrapper<T> >
  1.1063  {
  1.1064 -    typedef typename Arg::next next;
  1.1065 -    typedef Arg type;
  1.1066 +    typedef reference_wrapper<T> type;
  1.1067  };
  1.1068  
  1.1069 -#   endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
  1.1070 -
  1.1071 -template<
  1.1072 -      BOOST_MPL_AUX_NTTP_DECL(int, N), AUX778076_BIND_PARAMS(typename U)
  1.1073 -    >
  1.1074 -struct resolve_bind_arg< arg<N>,AUX778076_BIND_PARAMS(U) >
  1.1075 +template<int I> struct add_value< arg<I> >
  1.1076  {
  1.1077 -    typedef typename AUX778076_APPLY<mpl::arg<N>, AUX778076_BIND_PARAMS(U)>::type type;
  1.1078 +    typedef boost::arg<I> type;
  1.1079  };
  1.1080  
  1.1081 -#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
  1.1082 -template<
  1.1083 -      typename F, AUX778076_BIND_PARAMS(typename T), AUX778076_BIND_PARAMS(typename U)
  1.1084 -    >
  1.1085 -struct resolve_bind_arg< bind<F,AUX778076_BIND_PARAMS(T)>,AUX778076_BIND_PARAMS(U) >
  1.1086 +template<int I> struct add_value< arg<I> (*) () >
  1.1087  {
  1.1088 -    typedef bind<F,AUX778076_BIND_PARAMS(T)> f_;
  1.1089 -    typedef typename AUX778076_APPLY<f_, AUX778076_BIND_PARAMS(U)>::type type;
  1.1090 +    typedef boost::arg<I> (*type) ();
  1.1091  };
  1.1092 -#endif
  1.1093  
  1.1094 -#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  1.1095 +template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
  1.1096 +{
  1.1097 +    typedef bind_t<R, F, L> type;
  1.1098 +};
  1.1099  
  1.1100 -// agurt, 15/jan/02: it's not a intended to be used as a function class, and 
  1.1101 -// MSVC6.5 has problems with 'apply' name here (the code compiles, but doesn't
  1.1102 -// work), so I went with the 'result_' here, and in all other similar cases
  1.1103 -template< bool >
  1.1104 -struct resolve_arg_impl
  1.1105 +#else
  1.1106 +
  1.1107 +template<int I> struct _avt_0;
  1.1108 +
  1.1109 +template<> struct _avt_0<1>
  1.1110  {
  1.1111 -    template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_
  1.1112 +    template<class T> struct inner
  1.1113      {
  1.1114          typedef T type;
  1.1115      };
  1.1116  };
  1.1117  
  1.1118 -template<> 
  1.1119 -struct resolve_arg_impl<true>
  1.1120 +template<> struct _avt_0<2>
  1.1121  {
  1.1122 -    template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_
  1.1123 +    template<class T> struct inner
  1.1124      {
  1.1125 -        typedef typename AUX778076_APPLY<
  1.1126 -              T
  1.1127 -            , AUX778076_BIND_PARAMS(U)
  1.1128 -            >::type type;
  1.1129 +        typedef value<T> type;
  1.1130      };
  1.1131  };
  1.1132  
  1.1133 -// for 'resolve_bind_arg'
  1.1134 -template< typename T > struct is_bind_template;
  1.1135 +typedef char (&_avt_r1) [1];
  1.1136 +typedef char (&_avt_r2) [2];
  1.1137  
  1.1138 -template< 
  1.1139 -      typename T, AUX778076_BIND_PARAMS(typename U)
  1.1140 -    >
  1.1141 -struct resolve_bind_arg
  1.1142 -    : resolve_arg_impl< is_bind_template<T>::value >
  1.1143 -            ::template result_< T,AUX778076_BIND_PARAMS(U) >
  1.1144 +template<class T> _avt_r1 _avt_f(value<T>);
  1.1145 +template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
  1.1146 +template<int I> _avt_r1 _avt_f(arg<I>);
  1.1147 +template<int I> _avt_r1 _avt_f(arg<I> (*) ());
  1.1148 +template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
  1.1149 +
  1.1150 +_avt_r2 _avt_f(...);
  1.1151 +
  1.1152 +template<class T> struct add_value
  1.1153  {
  1.1154 +    static T t();
  1.1155 +    typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
  1.1156  };
  1.1157  
  1.1158 -#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
  1.1159 +#endif
  1.1160  
  1.1161 -template< typename T > 
  1.1162 -struct replace_unnamed_arg_impl
  1.1163 +// list_av_N
  1.1164 +
  1.1165 +template<class A1> struct list_av_1
  1.1166  {
  1.1167 -    template< typename Arg > struct result_
  1.1168 -    {
  1.1169 -        typedef Arg next;
  1.1170 -        typedef T type;
  1.1171 -    };
  1.1172 +    typedef typename add_value<A1>::type B1;
  1.1173 +    typedef list1<B1> type;
  1.1174  };
  1.1175  
  1.1176 -template<> 
  1.1177 -struct replace_unnamed_arg_impl< arg<-1> >
  1.1178 +template<class A1, class A2> struct list_av_2
  1.1179  {
  1.1180 -    template< typename Arg > struct result_
  1.1181 -    {
  1.1182 -        typedef typename next<Arg>::type next;
  1.1183 -        typedef Arg type;
  1.1184 -    };
  1.1185 +    typedef typename add_value<A1>::type B1;
  1.1186 +    typedef typename add_value<A2>::type B2;
  1.1187 +    typedef list2<B1, B2> type;
  1.1188  };
  1.1189  
  1.1190 -template< typename T, typename Arg > 
  1.1191 -struct replace_unnamed_arg
  1.1192 -    : replace_unnamed_arg_impl<T>::template result_<Arg>
  1.1193 +template<class A1, class A2, class A3> struct list_av_3
  1.1194  {
  1.1195 +    typedef typename add_value<A1>::type B1;
  1.1196 +    typedef typename add_value<A2>::type B2;
  1.1197 +    typedef typename add_value<A3>::type B3;
  1.1198 +    typedef list3<B1, B2, B3> type;
  1.1199  };
  1.1200  
  1.1201 -#   endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
  1.1202 +template<class A1, class A2, class A3, class A4> struct list_av_4
  1.1203 +{
  1.1204 +    typedef typename add_value<A1>::type B1;
  1.1205 +    typedef typename add_value<A2>::type B2;
  1.1206 +    typedef typename add_value<A3>::type B3;
  1.1207 +    typedef typename add_value<A4>::type B4;
  1.1208 +    typedef list4<B1, B2, B3, B4> type;
  1.1209 +};
  1.1210  
  1.1211 -// agurt, 10/mar/02: the forward declaration has to appear before any of
  1.1212 -// 'is_bind_helper' overloads, otherwise MSVC6.5 issues an ICE on it
  1.1213 -template< BOOST_MPL_AUX_NTTP_DECL(int, arity_) > struct bind_chooser;
  1.1214 +template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
  1.1215 +{
  1.1216 +    typedef typename add_value<A1>::type B1;
  1.1217 +    typedef typename add_value<A2>::type B2;
  1.1218 +    typedef typename add_value<A3>::type B3;
  1.1219 +    typedef typename add_value<A4>::type B4;
  1.1220 +    typedef typename add_value<A5>::type B5;
  1.1221 +    typedef list5<B1, B2, B3, B4, B5> type;
  1.1222 +};
  1.1223  
  1.1224 -aux::no_tag is_bind_helper(...);
  1.1225 -template< typename T > aux::no_tag is_bind_helper(protect<T>*);
  1.1226 +template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
  1.1227 +{
  1.1228 +    typedef typename add_value<A1>::type B1;
  1.1229 +    typedef typename add_value<A2>::type B2;
  1.1230 +    typedef typename add_value<A3>::type B3;
  1.1231 +    typedef typename add_value<A4>::type B4;
  1.1232 +    typedef typename add_value<A5>::type B5;
  1.1233 +    typedef typename add_value<A6>::type B6;
  1.1234 +    typedef list6<B1, B2, B3, B4, B5, B6> type;
  1.1235 +};
  1.1236  
  1.1237 -// overload for "main" form
  1.1238 -// agurt, 15/mar/02: MSVC 6.5 fails to properly resolve the overload 
  1.1239 -// in case if we use 'aux::type_wrapper< bind<...> >' here, and all 
  1.1240 -// 'bind' instantiations form a complete type anyway
  1.1241 -#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
  1.1242 -template<
  1.1243 -      typename F, AUX778076_BIND_PARAMS(typename T)
  1.1244 -    >
  1.1245 -aux::yes_tag is_bind_helper(bind<F,AUX778076_BIND_PARAMS(T)>*);
  1.1246 +template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
  1.1247 +{
  1.1248 +    typedef typename add_value<A1>::type B1;
  1.1249 +    typedef typename add_value<A2>::type B2;
  1.1250 +    typedef typename add_value<A3>::type B3;
  1.1251 +    typedef typename add_value<A4>::type B4;
  1.1252 +    typedef typename add_value<A5>::type B5;
  1.1253 +    typedef typename add_value<A6>::type B6;
  1.1254 +    typedef typename add_value<A7>::type B7;
  1.1255 +    typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
  1.1256 +};
  1.1257 +
  1.1258 +template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
  1.1259 +{
  1.1260 +    typedef typename add_value<A1>::type B1;
  1.1261 +    typedef typename add_value<A2>::type B2;
  1.1262 +    typedef typename add_value<A3>::type B3;
  1.1263 +    typedef typename add_value<A4>::type B4;
  1.1264 +    typedef typename add_value<A5>::type B5;
  1.1265 +    typedef typename add_value<A6>::type B6;
  1.1266 +    typedef typename add_value<A7>::type B7;
  1.1267 +    typedef typename add_value<A8>::type B8;
  1.1268 +    typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
  1.1269 +};
  1.1270 +
  1.1271 +template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
  1.1272 +{
  1.1273 +    typedef typename add_value<A1>::type B1;
  1.1274 +    typedef typename add_value<A2>::type B2;
  1.1275 +    typedef typename add_value<A3>::type B3;
  1.1276 +    typedef typename add_value<A4>::type B4;
  1.1277 +    typedef typename add_value<A5>::type B5;
  1.1278 +    typedef typename add_value<A6>::type B6;
  1.1279 +    typedef typename add_value<A7>::type B7;
  1.1280 +    typedef typename add_value<A8>::type B8;
  1.1281 +    typedef typename add_value<A9>::type B9;
  1.1282 +    typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
  1.1283 +};
  1.1284 +
  1.1285 +// operator!
  1.1286 +
  1.1287 +struct logical_not
  1.1288 +{
  1.1289 +    template<class V> bool operator()(V const & v) const { return !v; }
  1.1290 +};
  1.1291 +
  1.1292 +template<class R, class F, class L>
  1.1293 +    bind_t< bool, logical_not, list1< bind_t<R, F, L> > >
  1.1294 +    operator! (bind_t<R, F, L> const & f)
  1.1295 +{
  1.1296 +    typedef list1< bind_t<R, F, L> > list_type;
  1.1297 +    return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
  1.1298 +}
  1.1299 +
  1.1300 +// relational operators
  1.1301 +
  1.1302 +#define BOOST_BIND_OPERATOR( op, name ) \
  1.1303 +\
  1.1304 +struct name \
  1.1305 +{ \
  1.1306 +    template<class V, class W> bool operator()(V const & v, W const & w) const { return v op w; } \
  1.1307 +}; \
  1.1308 + \
  1.1309 +template<class R, class F, class L, class A2> \
  1.1310 +    bind_t< bool, name, list2< bind_t<R, F, L>, typename add_value<A2>::type > > \
  1.1311 +    operator op (bind_t<R, F, L> const & f, A2 a2) \
  1.1312 +{ \
  1.1313 +    typedef typename add_value<A2>::type B2; \
  1.1314 +    typedef list2< bind_t<R, F, L>, B2> list_type; \
  1.1315 +    return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
  1.1316 +}
  1.1317 +
  1.1318 +BOOST_BIND_OPERATOR( ==, equal )
  1.1319 +BOOST_BIND_OPERATOR( !=, not_equal )
  1.1320 +
  1.1321 +BOOST_BIND_OPERATOR( <, less )
  1.1322 +BOOST_BIND_OPERATOR( <=, less_equal )
  1.1323 +
  1.1324 +BOOST_BIND_OPERATOR( >, greater )
  1.1325 +BOOST_BIND_OPERATOR( >=, greater_equal )
  1.1326 +
  1.1327 +#undef BOOST_BIND_OPERATOR
  1.1328 +
  1.1329 +#if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3)
  1.1330 +
  1.1331 +// resolve ambiguity with rel_ops
  1.1332 +
  1.1333 +#define BOOST_BIND_OPERATOR( op, name ) \
  1.1334 +\
  1.1335 +template<class R, class F, class L> \
  1.1336 +    bind_t< bool, name, list2< bind_t<R, F, L>, bind_t<R, F, L> > > \
  1.1337 +    operator op (bind_t<R, F, L> const & f, bind_t<R, F, L> const & g) \
  1.1338 +{ \
  1.1339 +    typedef list2< bind_t<R, F, L>, bind_t<R, F, L> > list_type; \
  1.1340 +    return bind_t<bool, name, list_type> ( name(), list_type(f, g) ); \
  1.1341 +}
  1.1342 +
  1.1343 +BOOST_BIND_OPERATOR( !=, not_equal )
  1.1344 +BOOST_BIND_OPERATOR( <=, less_equal )
  1.1345 +BOOST_BIND_OPERATOR( >, greater )
  1.1346 +BOOST_BIND_OPERATOR( >=, greater_equal )
  1.1347 +
  1.1348  #endif
  1.1349  
  1.1350 -template< BOOST_MPL_AUX_NTTP_DECL(int, N) >
  1.1351 -aux::yes_tag is_bind_helper(arg<N>*);
  1.1352 +// visit_each, ADL
  1.1353  
  1.1354 -template< bool is_ref_ = true >
  1.1355 -struct is_bind_template_impl
  1.1356 +#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ ) \
  1.1357 +   && !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
  1.1358 +
  1.1359 +template<class V, class T> void visit_each( V & v, value<T> const & t, int )
  1.1360  {
  1.1361 -    template< typename T > struct result_
  1.1362 -    {
  1.1363 -        BOOST_STATIC_CONSTANT(bool, value = false);
  1.1364 -    };
  1.1365 -};
  1.1366 +    using boost::visit_each;
  1.1367 +    BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
  1.1368 +}
  1.1369  
  1.1370 -template<>
  1.1371 -struct is_bind_template_impl<false>
  1.1372 +template<class V, class R, class F, class L> void visit_each( V & v, bind_t<R, F, L> const & t, int )
  1.1373  {
  1.1374 -    template< typename T > struct result_
  1.1375 -    {
  1.1376 -        BOOST_STATIC_CONSTANT(bool, value = 
  1.1377 -              sizeof(aux::is_bind_helper(static_cast<T*>(0))) 
  1.1378 -                == sizeof(aux::yes_tag)
  1.1379 -            );
  1.1380 -    };
  1.1381 -};
  1.1382 +    t.accept( v );
  1.1383 +}
  1.1384  
  1.1385 -template< typename T > struct is_bind_template
  1.1386 -    : is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
  1.1387 -        ::template result_<T>
  1.1388 -{
  1.1389 -};
  1.1390 -
  1.1391 -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  1.1392 -
  1.1393 -} // namespace aux
  1.1394 -
  1.1395 -
  1.1396 -#define BOOST_PP_ITERATION_PARAMS_1 \
  1.1397 -    (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/bind.hpp>))
  1.1398 -#include BOOST_PP_ITERATE()
  1.1399 -
  1.1400 -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
  1.1401 -    && !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS)
  1.1402 -/// if_/eval_if specializations
  1.1403 -#   define AUX778076_SPEC_NAME if_
  1.1404 -#   define BOOST_PP_ITERATION_PARAMS_1 (3,(3, 3, <boost/mpl/bind.hpp>))
  1.1405 -#   include BOOST_PP_ITERATE()
  1.1406 -
  1.1407 -#if !defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
  1.1408 -#   define AUX778076_SPEC_NAME eval_if
  1.1409 -#   define BOOST_PP_ITERATION_PARAMS_1 (3,(3, 3, <boost/mpl/bind.hpp>))
  1.1410 -#   include BOOST_PP_ITERATE()
  1.1411 -#endif
  1.1412  #endif
  1.1413  
  1.1414 -// real C++ version is already taken care of
  1.1415 -#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
  1.1416 -    && !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
  1.1417 +} // namespace _bi
  1.1418  
  1.1419 -namespace aux {
  1.1420 -// apply_count_args
  1.1421 -#define AUX778076_COUNT_ARGS_PREFIX bind
  1.1422 -#define AUX778076_COUNT_ARGS_DEFAULT na
  1.1423 -#define AUX778076_COUNT_ARGS_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
  1.1424 -#include <boost/mpl/aux_/count_args.hpp>
  1.1425 +// visit_each, no ADL
  1.1426 +
  1.1427 +#if defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) || defined( __BORLANDC__ ) \
  1.1428 +  || (defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
  1.1429 +
  1.1430 +template<class V, class T> void visit_each( V & v, _bi::value<T> const & t, int )
  1.1431 +{
  1.1432 +    BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
  1.1433  }
  1.1434  
  1.1435 +template<class V, class R, class F, class L> void visit_each( V & v, _bi::bind_t<R, F, L> const & t, int )
  1.1436 +{
  1.1437 +    t.accept( v );
  1.1438 +}
  1.1439 +
  1.1440 +#endif
  1.1441 +
  1.1442  // bind
  1.1443 -template<
  1.1444 -      typename F, AUX778076_BIND_PARAMS(typename T) AUX778076_DMC_PARAM()
  1.1445 -    >
  1.1446 -struct bind
  1.1447 -    : aux::bind_chooser<
  1.1448 -          aux::bind_count_args<AUX778076_BIND_PARAMS(T)>::value
  1.1449 -        >::template result_< F,AUX778076_BIND_PARAMS(T) >::type
  1.1450 +
  1.1451 +#ifndef BOOST_BIND
  1.1452 +#define BOOST_BIND bind
  1.1453 +#endif
  1.1454 +
  1.1455 +// generic function objects
  1.1456 +
  1.1457 +template<class R, class F>
  1.1458 +    _bi::bind_t<R, F, _bi::list0>
  1.1459 +    BOOST_BIND(F f)
  1.1460  {
  1.1461 -};
  1.1462 +    typedef _bi::list0 list_type;
  1.1463 +    return _bi::bind_t<R, F, list_type> (f, list_type());
  1.1464 +}
  1.1465  
  1.1466 -BOOST_MPL_AUX_ARITY_SPEC(
  1.1467 -      BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
  1.1468 -    , bind
  1.1469 -    )
  1.1470 +template<class R, class F, class A1>
  1.1471 +    _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
  1.1472 +    BOOST_BIND(F f, A1 a1)
  1.1473 +{
  1.1474 +    typedef typename _bi::list_av_1<A1>::type list_type;
  1.1475 +    return _bi::bind_t<R, F, list_type> (f, list_type(a1));
  1.1476 +}
  1.1477  
  1.1478 -BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(
  1.1479 -      BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
  1.1480 -    , bind
  1.1481 -    )
  1.1482 +template<class R, class F, class A1, class A2>
  1.1483 +    _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
  1.1484 +    BOOST_BIND(F f, A1 a1, A2 a2)
  1.1485 +{
  1.1486 +    typedef typename _bi::list_av_2<A1, A2>::type list_type;
  1.1487 +    return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
  1.1488 +}
  1.1489  
  1.1490 +template<class R, class F, class A1, class A2, class A3>
  1.1491 +    _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
  1.1492 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
  1.1493 +{
  1.1494 +    typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
  1.1495 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
  1.1496 +}
  1.1497  
  1.1498 -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  1.1499 +template<class R, class F, class A1, class A2, class A3, class A4>
  1.1500 +    _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
  1.1501 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
  1.1502 +{
  1.1503 +    typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
  1.1504 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
  1.1505 +}
  1.1506  
  1.1507 -#   undef AUX778076_BIND_NESTED_DEFAULT_PARAMS
  1.1508 -#   undef AUX778076_BIND_N_SPEC_PARAMS
  1.1509 -#   undef AUX778076_BIND_N_PARAMS
  1.1510 -#   undef AUX778076_BIND_DEFAULT_PARAMS
  1.1511 -#   undef AUX778076_BIND_PARAMS
  1.1512 -#   undef AUX778076_DMC_PARAM
  1.1513 -#   undef AUX778076_APPLY
  1.1514 +template<class R, class F, class A1, class A2, class A3, class A4, class A5>
  1.1515 +    _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
  1.1516 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
  1.1517 +{
  1.1518 +    typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
  1.1519 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
  1.1520 +}
  1.1521  
  1.1522 -}}
  1.1523 +template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
  1.1524 +    _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
  1.1525 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
  1.1526 +{
  1.1527 +    typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
  1.1528 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
  1.1529 +}
  1.1530  
  1.1531 -#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  1.1532 -#endif // BOOST_MPL_BIND_HPP_INCLUDED
  1.1533 +template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
  1.1534 +    _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
  1.1535 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
  1.1536 +{
  1.1537 +    typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
  1.1538 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
  1.1539 +}
  1.1540  
  1.1541 -///// iteration, depth == 1
  1.1542 +template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
  1.1543 +    _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
  1.1544 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
  1.1545 +{
  1.1546 +    typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
  1.1547 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
  1.1548 +}
  1.1549  
  1.1550 -#elif BOOST_PP_ITERATION_DEPTH() == 1
  1.1551 +template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
  1.1552 +    _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
  1.1553 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
  1.1554 +{
  1.1555 +    typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
  1.1556 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
  1.1557 +}
  1.1558  
  1.1559 -#   define i_ BOOST_PP_FRAME_ITERATION(1)
  1.1560 +// generic function objects, alternative syntax
  1.1561  
  1.1562 -#if defined(AUX778076_SPEC_NAME)
  1.1563 +template<class R, class F>
  1.1564 +    _bi::bind_t<R, F, _bi::list0>
  1.1565 +    BOOST_BIND(boost::type<R>, F f)
  1.1566 +{
  1.1567 +    typedef _bi::list0 list_type;
  1.1568 +    return _bi::bind_t<R, F, list_type> (f, list_type());
  1.1569 +}
  1.1570  
  1.1571 -// lazy metafunction specialization
  1.1572 -template< template< BOOST_MPL_PP_PARAMS(i_, typename T) > class F, typename Tag >
  1.1573 -struct BOOST_PP_CAT(quote,i_);
  1.1574 +template<class R, class F, class A1>
  1.1575 +    _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
  1.1576 +    BOOST_BIND(boost::type<R>, F f, A1 a1)
  1.1577 +{
  1.1578 +    typedef typename _bi::list_av_1<A1>::type list_type;
  1.1579 +    return _bi::bind_t<R, F, list_type> (f, list_type(a1));
  1.1580 +}
  1.1581  
  1.1582 -template< BOOST_MPL_PP_PARAMS(i_, typename T) > struct AUX778076_SPEC_NAME;
  1.1583 +template<class R, class F, class A1, class A2>
  1.1584 +    _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
  1.1585 +    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
  1.1586 +{
  1.1587 +    typedef typename _bi::list_av_2<A1, A2>::type list_type;
  1.1588 +    return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
  1.1589 +}
  1.1590  
  1.1591 -template<
  1.1592 -      typename Tag AUX778076_BIND_N_PARAMS(i_, typename T)
  1.1593 -    >
  1.1594 -struct BOOST_PP_CAT(bind,i_)< 
  1.1595 -      BOOST_PP_CAT(quote,i_)<AUX778076_SPEC_NAME,Tag>
  1.1596 -    AUX778076_BIND_N_PARAMS(i_,T)
  1.1597 -    >
  1.1598 +template<class R, class F, class A1, class A2, class A3>
  1.1599 +    _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
  1.1600 +    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
  1.1601  {
  1.1602 -    template<
  1.1603 -          AUX778076_BIND_NESTED_DEFAULT_PARAMS(typename U, na)
  1.1604 -        >
  1.1605 -    struct apply
  1.1606 -    {
  1.1607 -     private:
  1.1608 -        typedef mpl::arg<1> n1;
  1.1609 -#       define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i_, <boost/mpl/bind.hpp>))
  1.1610 -#       include BOOST_PP_ITERATE()
  1.1611 +    typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
  1.1612 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
  1.1613 +}
  1.1614  
  1.1615 -        typedef typename AUX778076_SPEC_NAME<
  1.1616 -              typename t1::type
  1.1617 -            , BOOST_MPL_PP_EXT_PARAMS(2, BOOST_PP_INC(i_), t)
  1.1618 -            >::type f_;
  1.1619 +template<class R, class F, class A1, class A2, class A3, class A4>
  1.1620 +    _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
  1.1621 +    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
  1.1622 +{
  1.1623 +    typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
  1.1624 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
  1.1625 +}
  1.1626  
  1.1627 -     public:
  1.1628 -        typedef typename f_::type type;
  1.1629 -    };
  1.1630 -};
  1.1631 +template<class R, class F, class A1, class A2, class A3, class A4, class A5>
  1.1632 +    _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
  1.1633 +    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
  1.1634 +{
  1.1635 +    typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
  1.1636 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
  1.1637 +}
  1.1638  
  1.1639 -#undef AUX778076_SPEC_NAME
  1.1640 +template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
  1.1641 +    _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
  1.1642 +    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
  1.1643 +{
  1.1644 +    typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
  1.1645 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
  1.1646 +}
  1.1647  
  1.1648 -#else // AUX778076_SPEC_NAME
  1.1649 +template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
  1.1650 +    _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
  1.1651 +    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
  1.1652 +{
  1.1653 +    typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
  1.1654 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
  1.1655 +}
  1.1656  
  1.1657 -template<
  1.1658 -      typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
  1.1659 -    >
  1.1660 -struct BOOST_PP_CAT(bind,i_)
  1.1661 +template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
  1.1662 +    _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
  1.1663 +    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
  1.1664  {
  1.1665 -    template<
  1.1666 -          AUX778076_BIND_NESTED_DEFAULT_PARAMS(typename U, na)
  1.1667 -        >
  1.1668 -    struct apply
  1.1669 -    {
  1.1670 -     private:
  1.1671 -#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
  1.1672 +    typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
  1.1673 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
  1.1674 +}
  1.1675  
  1.1676 -        typedef aux::replace_unnamed_arg< F,mpl::arg<1> > r0;
  1.1677 -        typedef typename r0::type a0;
  1.1678 -        typedef typename r0::next n1;
  1.1679 -        typedef typename aux::resolve_bind_arg<a0,AUX778076_BIND_PARAMS(U)>::type f_;
  1.1680 -        ///
  1.1681 -#   else
  1.1682 -        typedef typename aux::resolve_bind_arg<F,AUX778076_BIND_PARAMS(U)>::type f_;
  1.1683 +template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
  1.1684 +    _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
  1.1685 +    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)
  1.1686 +{
  1.1687 +    typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
  1.1688 +    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
  1.1689 +}
  1.1690  
  1.1691 -#   endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
  1.1692 +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
  1.1693  
  1.1694 -#   if i_ > 0
  1.1695 -#       define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i_, <boost/mpl/bind.hpp>))
  1.1696 -#       include BOOST_PP_ITERATE()
  1.1697 -#   endif
  1.1698 +// adaptable function objects
  1.1699  
  1.1700 -     public:
  1.1701 +template<class F>
  1.1702 +    _bi::bind_t<_bi::unspecified, F, _bi::list0>
  1.1703 +    BOOST_BIND(F f)
  1.1704 +{
  1.1705 +    typedef _bi::list0 list_type;
  1.1706 +    return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
  1.1707 +}
  1.1708  
  1.1709 -#   define AUX778076_ARG(unused, i_, t) \
  1.1710 -    BOOST_PP_COMMA_IF(i_) \
  1.1711 -    typename BOOST_PP_CAT(t,BOOST_PP_INC(i_))::type \
  1.1712 -/**/
  1.1713 +template<class F, class A1>
  1.1714 +    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
  1.1715 +    BOOST_BIND(F f, A1 a1)
  1.1716 +{
  1.1717 +    typedef typename _bi::list_av_1<A1>::type list_type;
  1.1718 +    return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
  1.1719 +}
  1.1720  
  1.1721 -        typedef typename BOOST_PP_CAT(apply_wrap,i_)<
  1.1722 -              f_ 
  1.1723 -            BOOST_PP_COMMA_IF(i_) BOOST_MPL_PP_REPEAT(i_, AUX778076_ARG, t)
  1.1724 -            >::type type;
  1.1725 +template<class F, class A1, class A2>
  1.1726 +    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
  1.1727 +    BOOST_BIND(F f, A1 a1, A2 a2)
  1.1728 +{
  1.1729 +    typedef typename _bi::list_av_2<A1, A2>::type list_type;
  1.1730 +    return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
  1.1731 +}
  1.1732  
  1.1733 -#   undef AUX778076_ARG
  1.1734 -    };
  1.1735 -};
  1.1736 +template<class F, class A1, class A2, class A3>
  1.1737 +    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
  1.1738 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
  1.1739 +{
  1.1740 +    typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
  1.1741 +    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
  1.1742 +}
  1.1743  
  1.1744 -namespace aux {
  1.1745 +template<class F, class A1, class A2, class A3, class A4>
  1.1746 +    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
  1.1747 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
  1.1748 +{
  1.1749 +    typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
  1.1750 +    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
  1.1751 +}
  1.1752  
  1.1753 -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
  1.1754 +template<class F, class A1, class A2, class A3, class A4, class A5>
  1.1755 +    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
  1.1756 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
  1.1757 +{
  1.1758 +    typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
  1.1759 +    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
  1.1760 +}
  1.1761  
  1.1762 -template<
  1.1763 -      typename F AUX778076_BIND_N_PARAMS(i_, typename T), AUX778076_BIND_PARAMS(typename U)
  1.1764 -    >
  1.1765 -struct resolve_bind_arg<
  1.1766 -      BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)>,AUX778076_BIND_PARAMS(U)
  1.1767 -    >
  1.1768 +template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
  1.1769 +    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
  1.1770 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
  1.1771  {
  1.1772 -    typedef BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)> f_;
  1.1773 -    typedef typename AUX778076_APPLY<f_, AUX778076_BIND_PARAMS(U)>::type type;
  1.1774 -};
  1.1775 +    typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
  1.1776 +    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
  1.1777 +}
  1.1778 +
  1.1779 +template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
  1.1780 +    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
  1.1781 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
  1.1782 +{
  1.1783 +    typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
  1.1784 +    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
  1.1785 +}
  1.1786 +
  1.1787 +template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
  1.1788 +    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
  1.1789 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
  1.1790 +{
  1.1791 +    typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
  1.1792 +    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
  1.1793 +}
  1.1794 +
  1.1795 +template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
  1.1796 +    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
  1.1797 +    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
  1.1798 +{
  1.1799 +    typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
  1.1800 +    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
  1.1801 +}
  1.1802 +
  1.1803 +#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
  1.1804 +
  1.1805 +// function pointers
  1.1806 +
  1.1807 +#define BOOST_BIND_CC
  1.1808 +#define BOOST_BIND_ST
  1.1809 +
  1.1810 +#include <boost/bind/bind_cc.hpp>
  1.1811 +
  1.1812 +#undef BOOST_BIND_CC
  1.1813 +#undef BOOST_BIND_ST
  1.1814 +
  1.1815 +#ifdef BOOST_BIND_ENABLE_STDCALL
  1.1816 +
  1.1817 +#define BOOST_BIND_CC __stdcall
  1.1818 +#define BOOST_BIND_ST
  1.1819 +
  1.1820 +#include <boost/bind/bind_cc.hpp>
  1.1821 +
  1.1822 +#undef BOOST_BIND_CC
  1.1823 +#undef BOOST_BIND_ST
  1.1824 +
  1.1825 +#endif
  1.1826 +
  1.1827 +#ifdef BOOST_BIND_ENABLE_FASTCALL
  1.1828 +
  1.1829 +#define BOOST_BIND_CC __fastcall
  1.1830 +#define BOOST_BIND_ST
  1.1831 +
  1.1832 +#include <boost/bind/bind_cc.hpp>
  1.1833 +
  1.1834 +#undef BOOST_BIND_CC
  1.1835 +#undef BOOST_BIND_ST
  1.1836 +
  1.1837 +#endif
  1.1838 +
  1.1839 +#ifdef BOOST_BIND_ENABLE_PASCAL
  1.1840 +
  1.1841 +#define BOOST_BIND_ST pascal
  1.1842 +#define BOOST_BIND_CC
  1.1843 +
  1.1844 +#include <boost/bind/bind_cc.hpp>
  1.1845 +
  1.1846 +#undef BOOST_BIND_ST
  1.1847 +#undef BOOST_BIND_CC
  1.1848 +
  1.1849 +#endif
  1.1850 +
  1.1851 +// member function pointers
  1.1852 +
  1.1853 +#define BOOST_BIND_MF_NAME(X) X
  1.1854 +#define BOOST_BIND_MF_CC
  1.1855 +
  1.1856 +#include <boost/bind/bind_mf_cc.hpp>
  1.1857 +
  1.1858 +#undef BOOST_BIND_MF_NAME
  1.1859 +#undef BOOST_BIND_MF_CC
  1.1860 +
  1.1861 +#ifdef BOOST_MEM_FN_ENABLE_CDECL
  1.1862 +
  1.1863 +#define BOOST_BIND_MF_NAME(X) X##_cdecl
  1.1864 +#define BOOST_BIND_MF_CC __cdecl
  1.1865 +
  1.1866 +#include <boost/bind/bind_mf_cc.hpp>
  1.1867 +
  1.1868 +#undef BOOST_BIND_MF_NAME
  1.1869 +#undef BOOST_BIND_MF_CC
  1.1870 +
  1.1871 +#endif
  1.1872 +
  1.1873 +#ifdef BOOST_MEM_FN_ENABLE_STDCALL
  1.1874 +
  1.1875 +#define BOOST_BIND_MF_NAME(X) X##_stdcall
  1.1876 +#define BOOST_BIND_MF_CC __stdcall
  1.1877 +
  1.1878 +#include <boost/bind/bind_mf_cc.hpp>
  1.1879 +
  1.1880 +#undef BOOST_BIND_MF_NAME
  1.1881 +#undef BOOST_BIND_MF_CC
  1.1882 +
  1.1883 +#endif
  1.1884 +
  1.1885 +#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
  1.1886 +
  1.1887 +#define BOOST_BIND_MF_NAME(X) X##_fastcall
  1.1888 +#define BOOST_BIND_MF_CC __fastcall
  1.1889 +
  1.1890 +#include <boost/bind/bind_mf_cc.hpp>
  1.1891 +
  1.1892 +#undef BOOST_BIND_MF_NAME
  1.1893 +#undef BOOST_BIND_MF_CC
  1.1894 +
  1.1895 +#endif
  1.1896 +
  1.1897 +// data member pointers
  1.1898 +
  1.1899 +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
  1.1900 +    || ( defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, < 0x600 ) )
  1.1901 +
  1.1902 +template<class R, class T, class A1>
  1.1903 +_bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
  1.1904 +    BOOST_BIND(R T::*f, A1 a1)
  1.1905 +{
  1.1906 +    typedef _mfi::dm<R, T> F;
  1.1907 +    typedef typename _bi::list_av_1<A1>::type list_type;
  1.1908 +    return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
  1.1909 +}
  1.1910  
  1.1911  #else
  1.1912  
  1.1913 -template<
  1.1914 -      typename F AUX778076_BIND_N_PARAMS(i_, typename T)
  1.1915 -    >
  1.1916 -aux::yes_tag
  1.1917 -is_bind_helper(BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)>*);
  1.1918 +namespace _bi
  1.1919 +{
  1.1920  
  1.1921 -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  1.1922 +template< class Pm, int I > struct add_cref;
  1.1923  
  1.1924 -} // namespace aux
  1.1925 +template< class M, class T > struct add_cref< M T::*, 0 >
  1.1926 +{
  1.1927 +    typedef M type;
  1.1928 +};
  1.1929  
  1.1930 -BOOST_MPL_AUX_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_))
  1.1931 -BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_))
  1.1932 +template< class M, class T > struct add_cref< M T::*, 1 >
  1.1933 +{
  1.1934 +    typedef M const & type;
  1.1935 +};
  1.1936  
  1.1937 -#   if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
  1.1938 -#   if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
  1.1939 -    
  1.1940 -#if i_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY
  1.1941 -/// primary template (not a specialization!)
  1.1942 -template<
  1.1943 -      typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
  1.1944 -    >
  1.1945 -struct bind
  1.1946 -    : BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T) >
  1.1947 +template< class R, class T > struct add_cref< R (T::*) (), 1 >
  1.1948  {
  1.1949 +    typedef void type;
  1.1950  };
  1.1951 -#else
  1.1952 -template<
  1.1953 -      typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
  1.1954 -    >
  1.1955 -struct bind< F AUX778076_BIND_N_SPEC_PARAMS(i_, T, na) >
  1.1956 -    : BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T) >
  1.1957 +
  1.1958 +#if !( defined(__IBMCPP__) && BOOST_WORKAROUND( __IBMCPP__, BOOST_TESTED_AT(600) ) )
  1.1959 +
  1.1960 +template< class R, class T > struct add_cref< R (T::*) () const, 1 >
  1.1961  {
  1.1962 +    typedef void type;
  1.1963  };
  1.1964 +
  1.1965 +#endif // __IBMCPP__
  1.1966 +
  1.1967 +template<class R> struct isref
  1.1968 +{
  1.1969 +    enum value_type { value = 0 };
  1.1970 +};
  1.1971 +
  1.1972 +template<class R> struct isref< R& >
  1.1973 +{
  1.1974 +    enum value_type { value = 1 };
  1.1975 +};
  1.1976 +
  1.1977 +template<class R> struct isref< R* >
  1.1978 +{
  1.1979 +    enum value_type { value = 1 };
  1.1980 +};
  1.1981 +
  1.1982 +template<class Pm, class A1> struct dm_result
  1.1983 +{
  1.1984 +    typedef typename add_cref< Pm, 1 >::type type;
  1.1985 +};
  1.1986 +
  1.1987 +template<class Pm, class R, class F, class L> struct dm_result< Pm, bind_t<R, F, L> >
  1.1988 +{
  1.1989 +    typedef typename bind_t<R, F, L>::result_type result_type;
  1.1990 +    typedef typename add_cref< Pm, isref< result_type >::value >::type type;
  1.1991 +};
  1.1992 +
  1.1993 +} // namespace _bi
  1.1994 +
  1.1995 +template< class A1, class M, class T >
  1.1996 +
  1.1997 +_bi::bind_t<
  1.1998 +    typename _bi::dm_result< M T::*, A1 >::type,
  1.1999 +    _mfi::dm<M, T>,
  1.2000 +    typename _bi::list_av_1<A1>::type
  1.2001 +>
  1.2002 +
  1.2003 +BOOST_BIND( M T::*f, A1 a1 )
  1.2004 +{
  1.2005 +    typedef typename _bi::dm_result< M T::*, A1 >::type result_type;
  1.2006 +    typedef _mfi::dm<M, T> F;
  1.2007 +    typedef typename _bi::list_av_1<A1>::type list_type;
  1.2008 +    return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) );
  1.2009 +}
  1.2010 +
  1.2011  #endif
  1.2012  
  1.2013 -#   else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  1.2014 +} // namespace boost
  1.2015  
  1.2016 -namespace aux {
  1.2017 +#ifndef BOOST_BIND_NO_PLACEHOLDERS
  1.2018  
  1.2019 -template<>
  1.2020 -struct bind_chooser<i_>
  1.2021 -{
  1.2022 -    template<
  1.2023 -          typename F, AUX778076_BIND_PARAMS(typename T)
  1.2024 -        >
  1.2025 -    struct result_
  1.2026 -    {
  1.2027 -        typedef BOOST_PP_CAT(bind,i_)< F AUX778076_BIND_N_PARAMS(i_,T) > type;
  1.2028 -    };
  1.2029 -};
  1.2030 +# include <boost/bind/placeholders.hpp>
  1.2031  
  1.2032 -} // namespace aux
  1.2033 +#endif
  1.2034  
  1.2035 -#   endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  1.2036 -#   endif // BOOST_MPL_CFG_NO_BIND_TEMPLATE
  1.2037 +#ifdef BOOST_MSVC
  1.2038 +# pragma warning(default: 4512) // assignment operator could not be generated
  1.2039 +# pragma warning(pop)
  1.2040 +#endif
  1.2041  
  1.2042 -#endif // AUX778076_SPEC_NAME
  1.2043 -
  1.2044 -#   undef i_
  1.2045 -
  1.2046 -///// iteration, depth == 2
  1.2047 -
  1.2048 -#elif BOOST_PP_ITERATION_DEPTH() == 2
  1.2049 -
  1.2050 -#   define j_ BOOST_PP_FRAME_ITERATION(2)
  1.2051 -#   if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
  1.2052 -
  1.2053 -        typedef aux::replace_unnamed_arg< BOOST_PP_CAT(T,j_),BOOST_PP_CAT(n,j_) > BOOST_PP_CAT(r,j_);
  1.2054 -        typedef typename BOOST_PP_CAT(r,j_)::type BOOST_PP_CAT(a,j_);
  1.2055 -        typedef typename BOOST_PP_CAT(r,j_)::next BOOST_PP_CAT(n,BOOST_PP_INC(j_));
  1.2056 -        typedef aux::resolve_bind_arg<BOOST_PP_CAT(a,j_), AUX778076_BIND_PARAMS(U)> BOOST_PP_CAT(t,j_);
  1.2057 -        ///
  1.2058 -#   else
  1.2059 -        typedef aux::resolve_bind_arg< BOOST_PP_CAT(T,j_),AUX778076_BIND_PARAMS(U)> BOOST_PP_CAT(t,j_);
  1.2060 -
  1.2061 -#   endif
  1.2062 -#   undef j_
  1.2063 -
  1.2064 -#endif // BOOST_PP_IS_ITERATING
  1.2065 +#endif // #ifndef BOOST_BIND_HPP_INCLUDED