x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
bind.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\bind.hpp
旋转
特效
属性
历史版本
#ifndef BOOST_BIND_HPP_INCLUDED #define BOOST_BIND_HPP_INCLUDED // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif // // bind.hpp - binds function objects to arguments // // Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001 David Abrahams // Copyright (c) 2005 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/bind/bind.html for documentation. // #include
#include
#include
#include
#include
#include
#include
#include
// Borland-specific bug, visit_each() silently fails to produce code #if defined(__BORLANDC__) # define BOOST_BIND_VISIT_EACH boost::visit_each #else # define BOOST_BIND_VISIT_EACH visit_each #endif #include
#ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable: 4512) // assignment operator could not be generated #endif namespace boost { namespace _bi // implementation details { // result_traits template
struct result_traits { typedef R type; }; #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) struct unspecified {}; template
struct result_traits
{ typedef typename F::result_type type; }; template
struct result_traits< unspecified, reference_wrapper
> { typedef typename F::result_type type; }; #endif // ref_compare template
bool ref_compare( T const & a, T const & b, long ) { return a == b; } 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(); } // bind_t forward declaration for listN template
class bind_t; // value template
class value { public: value(T const & t): t_(t) {} T & get() { return t_; } T const & get() const { return t_; } bool operator==(value const & rhs) const { return t_ == rhs.t_; } private: T t_; }; // type template
class type {}; // unwrap template
struct unwrapper { static inline F & unwrap( F & f, long ) { return f; } template
static inline F2 & unwrap( reference_wrapper
rf, int ) { return rf.get(); } template
static inline _mfi::dm
unwrap( R T::* pm, int ) { return _mfi::dm
( pm ); } }; // listN class list0 { public: list0() {} template
T & operator[] (_bi::value
& 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(); } template
typename result_traits
::type operator[] (bind_t
& b) const { return b.eval(*this); } template
typename result_traits
::type operator[] (bind_t
const & b) const { return b.eval(*this); } template
R operator()(type
, F & f, A &, long) { return unwrapper
::unwrap(f, 0)(); } template
R operator()(type
, F const & f, A &, long) const { return unwrapper
::unwrap(f, 0)(); } template
void operator()(type
, F & f, A &, int) { unwrapper
::unwrap(f, 0)(); } template
void operator()(type
, F const & f, A &, int) const { unwrapper
::unwrap(f, 0)(); } template
void accept(V &) const { } bool operator==(list0 const &) const { return true; } }; template< class A1 > class list1: private storage1< A1 > { private: typedef storage1< A1 > base_type; public: explicit list1( A1 a1 ): base_type( a1 ) {} A1 operator[] (boost::arg<1>) const { return base_type::a1_; } A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } template
T & operator[] ( _bi::value
& 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(); } template
typename result_traits
::type operator[] (bind_t
& b) const { return b.eval(*this); } template
typename result_traits
::type operator[] (bind_t
const & b) const { return b.eval(*this); } template
R operator()(type
, F & f, A & a, long) { return unwrapper
::unwrap(f, 0)(a[base_type::a1_]); } template
R operator()(type
, F const & f, A & a, long) const { return unwrapper
::unwrap(f, 0)(a[base_type::a1_]); } template
void operator()(type
, F & f, A & a, int) { unwrapper
::unwrap(f, 0)(a[base_type::a1_]); } template
void operator()(type
, F const & f, A & a, int) const { unwrapper
::unwrap(f, 0)(a[base_type::a1_]); } template
void accept(V & v) const { base_type::accept(v); } bool operator==(list1 const & rhs) const { return ref_compare(base_type::a1_, rhs.a1_, 0); } }; template< class A1, class A2 > class list2: private storage2< A1, A2 > { private: typedef storage2< A1, A2 > base_type; public: list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {} A1 operator[] (boost::arg<1>) const { return base_type::a1_; } A2 operator[] (boost::arg<2>) const { return base_type::a2_; } A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } template
T & operator[] (_bi::value
& 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(); } template
typename result_traits
::type operator[] (bind_t
& b) const { return b.eval(*this); } template
typename result_traits
::type operator[] (bind_t
const & b) const { return b.eval(*this); } template
R operator()(type
, F & f, A & a, long) { 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 unwrapper
::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); } template
void operator()(type
, F & f, A & a, int) { unwrapper
::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); } template
void operator()(type
, F const & f, A & a, int) const { unwrapper
::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); } template
void accept(V & v) const { base_type::accept(v); } bool operator==(list2 const & rhs) const { return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0); } }; template< class A1, class A2, class A3 > class list3: private storage3< A1, A2, A3 > { private: typedef storage3< A1, A2, A3 > base_type; public: list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {} A1 operator[] (boost::arg<1>) const { return base_type::a1_; } A2 operator[] (boost::arg<2>) const { return base_type::a2_; } A3 operator[] (boost::arg<3>) const { return base_type::a3_; } A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } template
T & operator[] (_bi::value
& 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(); } template
typename result_traits
::type operator[] (bind_t
& b) const { return b.eval(*this); } template
typename result_traits
::type operator[] (bind_t
const & b) const { return b.eval(*this); } template
R operator()(type
, F & f, A & a, long) { 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 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) { 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 { unwrapper
::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]); } template
void accept(V & v) const { base_type::accept(v); } bool operator==(list3 const & rhs) const { return ref_compare( base_type::a1_, rhs.a1_, 0 ) && ref_compare( base_type::a2_, rhs.a2_, 0 ) && ref_compare( base_type::a3_, rhs.a3_, 0 ); } }; template< class A1, class A2, class A3, class A4 > class list4: private storage4< A1, A2, A3, A4 > { private: typedef storage4< A1, A2, A3, A4 > base_type; public: list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {} A1 operator[] (boost::arg<1>) const { return base_type::a1_; } A2 operator[] (boost::arg<2>) const { return base_type::a2_; } A3 operator[] (boost::arg<3>) const { return base_type::a3_; } A4 operator[] (boost::arg<4>) const { return base_type::a4_; } A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } template
T & operator[] (_bi::value
& 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(); } template
typename result_traits
::type operator[] (bind_t
& b) const { return b.eval(*this); } template
typename result_traits
::type operator[] (bind_t
const & b) const { return b.eval(*this); } template
R operator()(type
, F & f, A & a, long) { 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 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) { 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 { 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 { base_type::accept(v); } bool operator==(list4 const & rhs) const { return ref_compare( base_type::a1_, rhs.a1_, 0 ) && ref_compare( base_type::a2_, rhs.a2_, 0 ) && ref_compare( base_type::a3_, rhs.a3_, 0 ) && ref_compare( base_type::a4_, rhs.a4_, 0 ); } }; template< class A1, class A2, class A3, class A4, class A5 > class list5: private storage5< A1, A2, A3, A4, A5 > { private: typedef storage5< A1, A2, A3, A4, A5 > base_type; public: list5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): base_type( a1, a2, a3, a4, a5 ) {} A1 operator[] (boost::arg<1>) const { return base_type::a1_; } A2 operator[] (boost::arg<2>) const { return base_type::a2_; } A3 operator[] (boost::arg<3>) const { return base_type::a3_; } A4 operator[] (boost::arg<4>) const { return base_type::a4_; } A5 operator[] (boost::arg<5>) const { return base_type::a5_; } A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; } template
T & operator[] (_bi::value
& 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(); } template
typename result_traits
::type operator[] (bind_t
& b) const { return b.eval(*this); } template
typename result_traits
::type operator[] (bind_t
const & b) const { return b.eval(*this); } template
R operator()(type
, F & f, A & a, long) { 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 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) { 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 { 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 { base_type::accept(v); } bool operator==(list5 const & rhs) const { return ref_compare( base_type::a1_, rhs.a1_, 0 ) && ref_compare( base_type::a2_, rhs.a2_, 0 ) && ref_compare( base_type::a3_, rhs.a3_, 0 ) && ref_compare( base_type::a4_, rhs.a4_, 0 ) && ref_compare( base_type::a5_, rhs.a5_, 0 ); } }; template
class list6: private storage6< A1, A2, A3, A4, A5, A6 > { private: typedef storage6< A1, A2, A3, A4, A5, A6 > base_type; public: list6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): base_type( a1, a2, a3, a4, a5, a6 ) {} A1 operator[] (boost::arg<1>) const { return base_type::a1_; } A2 operator[] (boost::arg<2>) const { return base_type::a2_; } A3 operator[] (boost::arg<3>) const { return base_type::a3_; } A4 operator[] (boost::arg<4>) const { return base_type::a4_; } A5 operator[] (boost::arg<5>) const { return base_type::a5_; } A6 operator[] (boost::arg<6>) const { return base_type::a6_; } A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; } A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; } template
T & operator[] (_bi::value
& 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(); } template
typename result_traits
::type operator[] (bind_t
& b) const { return b.eval(*this); } template
typename result_traits
::type operator[] (bind_t
const & b) const { return b.eval(*this); } template
R operator()(type
, F & f, A & a, long) { 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 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) { 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 { 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 { base_type::accept(v); } bool operator==(list6 const & rhs) const { return ref_compare( base_type::a1_, rhs.a1_, 0 ) && ref_compare( base_type::a2_, rhs.a2_, 0 ) && ref_compare( base_type::a3_, rhs.a3_, 0 ) && ref_compare( base_type::a4_, rhs.a4_, 0 ) && ref_compare( base_type::a5_, rhs.a5_, 0 ) && ref_compare( base_type::a6_, rhs.a6_, 0 ); } }; template
class list7: private storage7< A1, A2, A3, A4, A5, A6, A7 > { private: typedef storage7< A1, A2, A3, A4, A5, A6, A7 > base_type; public: list7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): base_type( a1, a2, a3, a4, a5, a6, a7 ) {} A1 operator[] (boost::arg<1>) const { return base_type::a1_; } A2 operator[] (boost::arg<2>) const { return base_type::a2_; } A3 operator[] (boost::arg<3>) const { return base_type::a3_; } A4 operator[] (boost::arg<4>) const { return base_type::a4_; } A5 operator[] (boost::arg<5>) const { return base_type::a5_; } A6 operator[] (boost::arg<6>) const { return base_type::a6_; } A7 operator[] (boost::arg<7>) const { return base_type::a7_; } A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; } A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; } A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; } template
T & operator[] (_bi::value
& 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(); } template
typename result_traits
::type operator[] (bind_t
& b) const { return b.eval(*this); } template
typename result_traits
::type operator[] (bind_t
const & b) const { return b.eval(*this); } template
R operator()(type
, F & f, A & a, long) { 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 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) { 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 { 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 { base_type::accept(v); } bool operator==(list7 const & rhs) const { return ref_compare( base_type::a1_, rhs.a1_, 0 ) && ref_compare( base_type::a2_, rhs.a2_, 0 ) && ref_compare( base_type::a3_, rhs.a3_, 0 ) && ref_compare( base_type::a4_, rhs.a4_, 0 ) && ref_compare( base_type::a5_, rhs.a5_, 0 ) && ref_compare( base_type::a6_, rhs.a6_, 0 ) && ref_compare( base_type::a7_, rhs.a7_, 0 ); } }; template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class list8: private storage8< A1, A2, A3, A4, A5, A6, A7, A8 > { private: typedef storage8< A1, A2, A3, A4, A5, A6, A7, A8 > base_type; public: list8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8 ) {} A1 operator[] (boost::arg<1>) const { return base_type::a1_; } A2 operator[] (boost::arg<2>) const { return base_type::a2_; } A3 operator[] (boost::arg<3>) const { return base_type::a3_; } A4 operator[] (boost::arg<4>) const { return base_type::a4_; } A5 operator[] (boost::arg<5>) const { return base_type::a5_; } A6 operator[] (boost::arg<6>) const { return base_type::a6_; } A7 operator[] (boost::arg<7>) const { return base_type::a7_; } A8 operator[] (boost::arg<8>) const { return base_type::a8_; } A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; } A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; } A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; } A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; } A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; } A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; } A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; } A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; } template
T & operator[] (_bi::value
& 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(); } template
typename result_traits
::type operator[] (bind_t
& b) const { return b.eval(*this); } template
typename result_traits