1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365 |
- #ifndef BOOST_BIND_BIND_HPP_INCLUDED
- #define BOOST_BIND_BIND_HPP_INCLUDED
- // MS compatible compilers support #pragma once
- #if defined(_MSC_VER) && (_MSC_VER >= 1020)
- # pragma once
- #endif
- //
- // bind.hpp - binds function objects to arguments
- //
- // Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
- // Copyright (c) 2001 David Abrahams
- // Copyright (c) 2005 Peter Dimov
- //
- // Distributed under the Boost Software License, Version 1.0. (See
- // accompanying file LICENSE_1_0.txt or copy at
- // http://www.boost.org/LICENSE_1_0.txt)
- //
- // See http://www.boost.org/libs/bind/bind.html for documentation.
- //
- #include <boost/config.hpp>
- #include <boost/ref.hpp>
- #include <boost/mem_fn.hpp>
- #include <boost/type.hpp>
- #include <boost/is_placeholder.hpp>
- #include <boost/bind/arg.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/visit_each.hpp>
- #include <boost/core/enable_if.hpp>
- #include <boost/core/is_same.hpp>
- #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
- #include <utility> // std::forward
- #endif
- // Borland-specific bug, visit_each() silently fails to produce code
- #if defined(__BORLANDC__)
- # define BOOST_BIND_VISIT_EACH boost::visit_each
- #else
- # define BOOST_BIND_VISIT_EACH visit_each
- #endif
- #include <boost/bind/storage.hpp>
- #ifdef BOOST_MSVC
- # pragma warning(push)
- # pragma warning(disable: 4512) // assignment operator could not be generated
- #endif
- namespace boost
- {
- template<class T> class weak_ptr;
- namespace _bi // implementation details
- {
- // result_traits
- template<class R, class F> struct result_traits
- {
- typedef R type;
- };
- #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- struct unspecified {};
- template<class F> struct result_traits<unspecified, F>
- {
- typedef typename F::result_type type;
- };
- template<class F> struct result_traits< unspecified, reference_wrapper<F> >
- {
- typedef typename F::result_type type;
- };
- #endif
- // ref_compare
- template<class T> bool ref_compare( T const & a, T const & b, long )
- {
- return a == b;
- }
- template<int I> bool ref_compare( arg<I> const &, arg<I> const &, int )
- {
- return true;
- }
- template<int I> bool ref_compare( arg<I> (*) (), arg<I> (*) (), int )
- {
- return true;
- }
- template<class T> bool ref_compare( reference_wrapper<T> const & a, reference_wrapper<T> const & b, int )
- {
- return a.get_pointer() == b.get_pointer();
- }
- // bind_t forward declaration for listN
- template<class R, class F, class L> class bind_t;
- template<class R, class F, class L> bool ref_compare( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
- {
- return a.compare( b );
- }
- // value
- template<class T> class value
- {
- public:
- value(T const & t): t_(t) {}
- T & get() { return t_; }
- T const & get() const { return t_; }
- bool operator==(value const & rhs) const
- {
- return t_ == rhs.t_;
- }
- private:
- T t_;
- };
- // ref_compare for weak_ptr
- template<class T> bool ref_compare( value< weak_ptr<T> > const & a, value< weak_ptr<T> > const & b, int )
- {
- return !(a.get() < b.get()) && !(b.get() < a.get());
- }
- // type
- template<class T> class type {};
- // unwrap
- template<class F> struct unwrapper
- {
- static inline F & unwrap( F & f, long )
- {
- return f;
- }
- template<class F2> static inline F2 & unwrap( reference_wrapper<F2> rf, int )
- {
- return rf.get();
- }
- template<class R, class T> static inline _mfi::dm<R, T> unwrap( R T::* pm, int )
- {
- return _mfi::dm<R, T>( pm );
- }
- };
- // listN
- class list0
- {
- public:
- list0() {}
- template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
- template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
- {
- return unwrapper<F>::unwrap(f, 0)();
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)();
- }
- template<class F, class A> void operator()(type<void>, F & f, A &, int)
- {
- unwrapper<F>::unwrap(f, 0)();
- }
- template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
- {
- unwrapper<F const>::unwrap(f, 0)();
- }
- template<class V> void accept(V &) const
- {
- }
- bool operator==(list0 const &) const
- {
- return true;
- }
- };
- #ifdef BOOST_MSVC
- // MSVC is bright enough to realise that the parameter rhs
- // in operator==may be unused for some template argument types:
- #pragma warning(push)
- #pragma warning(disable:4100)
- #endif
- template< class A1 > class list1: private storage1< A1 >
- {
- private:
- typedef storage1< A1 > base_type;
- public:
- explicit list1( A1 a1 ): base_type( a1 ) {}
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
- {
- return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
- }
- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
- {
- unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
- }
- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
- {
- unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
- }
- template<class V> void accept(V & v) const
- {
- base_type::accept(v);
- }
- bool operator==(list1 const & rhs) const
- {
- return ref_compare(base_type::a1_, rhs.a1_, 0);
- }
- };
- struct logical_and;
- struct logical_or;
- template< class A1, class A2 > class list2: private storage2< A1, A2 >
- {
- private:
- typedef storage2< A1, A2 > base_type;
- public:
- list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {}
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
- template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
- template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
- {
- return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
- }
- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
- {
- unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
- }
- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
- {
- unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
- }
- template<class A> bool operator()( type<bool>, logical_and & /*f*/, A & a, int )
- {
- return a[ base_type::a1_ ] && a[ base_type::a2_ ];
- }
- template<class A> bool operator()( type<bool>, logical_and const & /*f*/, A & a, int ) const
- {
- return a[ base_type::a1_ ] && a[ base_type::a2_ ];
- }
- template<class A> bool operator()( type<bool>, logical_or & /*f*/, A & a, int )
- {
- return a[ base_type::a1_ ] || a[ base_type::a2_ ];
- }
- template<class A> bool operator()( type<bool>, logical_or const & /*f*/, A & a, int ) const
- {
- return a[ base_type::a1_ ] || a[ base_type::a2_ ];
- }
- template<class V> void accept(V & v) const
- {
- base_type::accept(v);
- }
- bool operator==(list2 const & rhs) const
- {
- return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0);
- }
- };
- template< class A1, class A2, class A3 > class list3: private storage3< A1, A2, A3 >
- {
- private:
- typedef storage3< A1, A2, A3 > base_type;
- public:
- list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {}
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
- template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
- template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
- {
- return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
- }
- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
- {
- unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
- }
- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
- {
- unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
- }
- template<class V> void accept(V & v) const
- {
- base_type::accept(v);
- }
- bool operator==(list3 const & rhs) const
- {
- return
-
- ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
- ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
- ref_compare( base_type::a3_, rhs.a3_, 0 );
- }
- };
- template< class A1, class A2, class A3, class A4 > class list4: private storage4< A1, A2, A3, A4 >
- {
- private:
- typedef storage4< A1, A2, A3, A4 > base_type;
- public:
- list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {}
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
- template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
- template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
- {
- return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
- }
- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
- {
- unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
- }
- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
- {
- unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
- }
- template<class V> void accept(V & v) const
- {
- base_type::accept(v);
- }
- bool operator==(list4 const & rhs) const
- {
- return
- ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
- ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
- ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
- ref_compare( base_type::a4_, rhs.a4_, 0 );
- }
- };
- template< class A1, class A2, class A3, class A4, class A5 > class list5: private storage5< A1, A2, A3, A4, A5 >
- {
- private:
- typedef storage5< A1, A2, A3, A4, A5 > base_type;
- public:
- list5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): base_type( a1, a2, a3, a4, a5 ) {}
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
- template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
- template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
- {
- return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
- }
- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
- {
- unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
- }
- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
- {
- unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
- }
- template<class V> void accept(V & v) const
- {
- base_type::accept(v);
- }
- bool operator==(list5 const & rhs) const
- {
- return
- ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
- ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
- ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
- ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
- ref_compare( base_type::a5_, rhs.a5_, 0 );
- }
- };
- template<class A1, class A2, class A3, class A4, class A5, class A6> class list6: private storage6< A1, A2, A3, A4, A5, A6 >
- {
- private:
- typedef storage6< A1, A2, A3, A4, A5, A6 > base_type;
- public:
- list6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): base_type( a1, a2, a3, a4, a5, a6 ) {}
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
- A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
- A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
- template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
- template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
- {
- return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
- }
- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
- {
- unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
- }
- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
- {
- unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
- }
- template<class V> void accept(V & v) const
- {
- base_type::accept(v);
- }
- bool operator==(list6 const & rhs) const
- {
- return
- ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
- ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
- ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
- ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
- ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
- ref_compare( base_type::a6_, rhs.a6_, 0 );
- }
- };
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7: private storage7< A1, A2, A3, A4, A5, A6, A7 >
- {
- private:
- typedef storage7< A1, A2, A3, A4, A5, A6, A7 > base_type;
- public:
- list7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): base_type( a1, a2, a3, a4, a5, a6, a7 ) {}
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
- A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
- A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
- A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
- A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
- template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
- template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
- {
- return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
- }
- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
- {
- unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
- }
- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
- {
- unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
- }
- template<class V> void accept(V & v) const
- {
- base_type::accept(v);
- }
- bool operator==(list7 const & rhs) const
- {
- return
- ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
- ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
- ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
- ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
- ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
- ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
- ref_compare( base_type::a7_, rhs.a7_, 0 );
- }
- };
- template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class list8: private storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
- {
- private:
- typedef storage8< A1, A2, A3, A4, A5, A6, A7, A8 > base_type;
- public:
- list8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
- A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
- A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
- A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
- A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
- A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
- A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
- template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
- template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
- {
- return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
- }
- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
- {
- unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
- }
- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
- {
- unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
- }
- template<class V> void accept(V & v) const
- {
- base_type::accept(v);
- }
- bool operator==(list8 const & rhs) const
- {
- return
-
- ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
- ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
- ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
- ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
- ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
- ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
- ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
- ref_compare( base_type::a8_, rhs.a8_, 0 );
- }
- };
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9: private storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 >
- {
- private:
- typedef storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > base_type;
- public:
- list9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8, a9 ) {}
- A1 operator[] (boost::arg<1>) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2>) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3>) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4>) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5>) const { return base_type::a5_; }
- A6 operator[] (boost::arg<6>) const { return base_type::a6_; }
- A7 operator[] (boost::arg<7>) const { return base_type::a7_; }
- A8 operator[] (boost::arg<8>) const { return base_type::a8_; }
- A9 operator[] (boost::arg<9>) const { return base_type::a9_; }
- A1 operator[] (boost::arg<1> (*) ()) const { return base_type::a1_; }
- A2 operator[] (boost::arg<2> (*) ()) const { return base_type::a2_; }
- A3 operator[] (boost::arg<3> (*) ()) const { return base_type::a3_; }
- A4 operator[] (boost::arg<4> (*) ()) const { return base_type::a4_; }
- A5 operator[] (boost::arg<5> (*) ()) const { return base_type::a5_; }
- A6 operator[] (boost::arg<6> (*) ()) const { return base_type::a6_; }
- A7 operator[] (boost::arg<7> (*) ()) const { return base_type::a7_; }
- A8 operator[] (boost::arg<8> (*) ()) const { return base_type::a8_; }
- A9 operator[] (boost::arg<9> (*) ()) const { return base_type::a9_; }
- template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
- template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
- template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
- {
- return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
- }
- template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
- {
- return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
- }
- template<class F, class A> void operator()(type<void>, F & f, A & a, int)
- {
- unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
- }
- template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
- {
- unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
- }
- template<class V> void accept(V & v) const
- {
- base_type::accept(v);
- }
- bool operator==(list9 const & rhs) const
- {
- return
- ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
- ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
- ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
- ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
- ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
- ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
- ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
- ref_compare( base_type::a8_, rhs.a8_, 0 ) &&
- ref_compare( base_type::a9_, rhs.a9_, 0 );
- }
- };
- #ifdef BOOST_MSVC
- #pragma warning(pop)
- #endif
- // bind_t
- #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
- template< class A1 > class rrlist1
- {
- private:
- A1 & a1_; // not A1&& because of msvc-10.0
- public:
- explicit rrlist1( A1 & a1 ): a1_( a1 ) {}
- A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); } // not static_cast because of g++ 4.9
- A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
- {
- rrlist1<A1&> a( a1_ );
- return b.eval( a );
- }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
- {
- rrlist1<A1&> a( a1_ );
- return b.eval( a );
- }
- };
- template< class A1, class A2 > class rrlist2
- {
- private:
- A1 & a1_;
- A2 & a2_;
- public:
- rrlist2( A1 & a1, A2 & a2 ): a1_( a1 ), a2_( a2 ) {}
- A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
- A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
- {
- rrlist2<A1&, A2&> a( a1_, a2_ );
- return b.eval( a );
- }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
- {
- rrlist2<A1&, A2&> a( a1_, a2_ );
- return b.eval( a );
- }
- };
- template< class A1, class A2, class A3 > class rrlist3
- {
- private:
- A1 & a1_;
- A2 & a2_;
- A3 & a3_;
- public:
- rrlist3( A1 & a1, A2 & a2, A3 & a3 ): a1_( a1 ), a2_( a2 ), a3_( a3 ) {}
- A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
- A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
- {
- rrlist3<A1&, A2&, A3&> a( a1_, a2_, a3_ );
- return b.eval( a );
- }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
- {
- rrlist3<A1&, A2&, A3&> a( a1_, a2_, a3_ );
- return b.eval( a );
- }
- };
- template< class A1, class A2, class A3, class A4 > class rrlist4
- {
- private:
- A1 & a1_;
- A2 & a2_;
- A3 & a3_;
- A4 & a4_;
- public:
- rrlist4( A1 & a1, A2 & a2, A3 & a3, A4 & a4 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ) {}
- A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
- A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
- {
- rrlist4<A1&, A2&, A3&, A4&> a( a1_, a2_, a3_, a4_ );
- return b.eval( a );
- }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
- {
- rrlist4<A1&, A2&, A3&, A4&> a( a1_, a2_, a3_, a4_ );
- return b.eval( a );
- }
- };
- template< class A1, class A2, class A3, class A4, class A5 > class rrlist5
- {
- private:
- A1 & a1_;
- A2 & a2_;
- A3 & a3_;
- A4 & a4_;
- A5 & a5_;
- public:
- rrlist5( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ) {}
- A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
- A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
- {
- rrlist5<A1&, A2&, A3&, A4&, A5&> a( a1_, a2_, a3_, a4_, a5_ );
- return b.eval( a );
- }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
- {
- rrlist5<A1&, A2&, A3&, A4&, A5&> a( a1_, a2_, a3_, a4_, a5_ );
- return b.eval( a );
- }
- };
- template< class A1, class A2, class A3, class A4, class A5, class A6 > class rrlist6
- {
- private:
- A1 & a1_;
- A2 & a2_;
- A3 & a3_;
- A4 & a4_;
- A5 & a5_;
- A6 & a6_;
- public:
- rrlist6( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ) {}
- A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
- A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
- A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
- A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
- {
- rrlist6<A1&, A2&, A3&, A4&, A5&, A6&> a( a1_, a2_, a3_, a4_, a5_, a6_ );
- return b.eval( a );
- }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
- {
- rrlist6<A1&, A2&, A3&, A4&, A5&, A6&> a( a1_, a2_, a3_, a4_, a5_, a6_ );
- return b.eval( a );
- }
- };
- template< class A1, class A2, class A3, class A4, class A5, class A6, class A7 > class rrlist7
- {
- private:
- A1 & a1_;
- A2 & a2_;
- A3 & a3_;
- A4 & a4_;
- A5 & a5_;
- A6 & a6_;
- A7 & a7_;
- public:
- rrlist7( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ) {}
- A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
- A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
- A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
- A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
- A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
- A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
- {
- rrlist7<A1&, A2&, A3&, A4&, A5&, A6&, A7&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ );
- return b.eval( a );
- }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
- {
- rrlist7<A1&, A2&, A3&, A4&, A5&, A6&, A7&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ );
- return b.eval( a );
- }
- };
- template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class rrlist8
- {
- private:
- A1 & a1_;
- A2 & a2_;
- A3 & a3_;
- A4 & a4_;
- A5 & a5_;
- A6 & a6_;
- A7 & a7_;
- A8 & a8_;
- public:
- rrlist8( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ), a8_( a8 ) {}
- A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
- A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
- A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
- A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
- A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
- A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
- A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
- A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
- {
- rrlist8<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ );
- return b.eval( a );
- }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
- {
- rrlist8<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ );
- return b.eval( a );
- }
- };
- template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > class rrlist9
- {
- private:
- A1 & a1_;
- A2 & a2_;
- A3 & a3_;
- A4 & a4_;
- A5 & a5_;
- A6 & a6_;
- A7 & a7_;
- A8 & a8_;
- A9 & a9_;
- public:
- rrlist9( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ), a8_( a8 ), a9_( a9 ) {}
- A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
- A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
- A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
- A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
- A9 && operator[] (boost::arg<9>) const { return std::forward<A9>( a9_ ); }
- A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
- A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
- A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
- A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
- A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
- A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
- A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
- A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
- A9 && operator[] (boost::arg<9> (*) ()) const { return std::forward<A9>( a9_ ); }
- template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
- template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
- template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
- {
- rrlist9<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&, A9&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ );
- return b.eval( a );
- }
- template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
- {
- rrlist9<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&, A9&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ );
- return b.eval( a );
- }
- };
- template<class R, class F, class L> class bind_t
- {
- private:
- F f_;
- L l_;
- public:
- typedef typename result_traits<R, F>::type result_type;
- typedef bind_t this_type;
- bind_t( F f, L const & l ): f_( f ), l_( l ) {}
- //
- result_type operator()()
- {
- list0 a;
- return l_( type<result_type>(), f_, a, 0 );
- }
- result_type operator()() const
- {
- list0 a;
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1> result_type operator()( A1 && a1 )
- {
- rrlist1< A1 > a( a1 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1> result_type operator()( A1 && a1 ) const
- {
- rrlist1< A1 > a( a1 );
- return l_(type<result_type>(), f_, a, 0);
- }
- template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 )
- {
- rrlist2< A1, A2 > a( a1, a2 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 ) const
- {
- rrlist2< A1, A2 > a( a1, a2 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 )
- {
- rrlist3< A1, A2, A3 > a( a1, a2, a3 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 ) const
- {
- rrlist3< A1, A2, A3 > a( a1, a2, a3 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
- {
- rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 ) const
- {
- rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
- {
- rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 ) const
- {
- rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
- {
- rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 ) const
- {
- rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
- {
- rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 ) const
- {
- rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
- {
- rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 ) const
- {
- rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
- {
- rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 ) const
- {
- rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
- return l_( type<result_type>(), f_, a, 0 );
- }
- //
- template<class A> result_type eval( A & a )
- {
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class A> result_type eval( A & a ) const
- {
- return l_( type<result_type>(), f_, a, 0 );
- }
- template<class V> void accept( V & v ) const
- {
- #if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ )
- using boost::visit_each;
- #endif
- BOOST_BIND_VISIT_EACH( v, f_, 0 );
- l_.accept( v );
- }
- bool compare( this_type const & rhs ) const
- {
- return ref_compare( f_, rhs.f_, 0 ) && l_ == rhs.l_;
- }
- };
- #elif !defined( BOOST_NO_VOID_RETURNS )
- template<class R, class F, class L> class bind_t
- {
- public:
- typedef bind_t this_type;
- bind_t(F f, L const & l): f_(f), l_(l) {}
- #define BOOST_BIND_RETURN return
- #include <boost/bind/bind_template.hpp>
- #undef BOOST_BIND_RETURN
- };
- #else // no void returns
- template<class R> struct bind_t_generator
- {
- template<class F, class L> class implementation
- {
- public:
- typedef implementation this_type;
- implementation(F f, L const & l): f_(f), l_(l) {}
- #define BOOST_BIND_RETURN return
- #include <boost/bind/bind_template.hpp>
- #undef BOOST_BIND_RETURN
- };
- };
- template<> struct bind_t_generator<void>
- {
- template<class F, class L> class implementation
- {
- private:
- typedef void R;
- public:
- typedef implementation this_type;
- implementation(F f, L const & l): f_(f), l_(l) {}
- #define BOOST_BIND_RETURN
- #include <boost/bind/bind_template.hpp>
- #undef BOOST_BIND_RETURN
- };
- };
- template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
- {
- public:
- bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
- };
- #endif
- // function_equal
- #ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
- // put overloads in _bi, rely on ADL
- # ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
- {
- return a.compare(b);
- }
- # else
- template<class R, class F, class L> bool function_equal_impl( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
- {
- return a.compare(b);
- }
- # endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- #else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
- // put overloads in boost
- } // namespace _bi
- # ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- template<class R, class F, class L> bool function_equal( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b )
- {
- return a.compare(b);
- }
- # else
- template<class R, class F, class L> bool function_equal_impl( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b, int )
- {
- return a.compare(b);
- }
- # endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- namespace _bi
- {
- #endif // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
- // add_value
- #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
- #if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x582) )
- template<class T> struct add_value
- {
- typedef _bi::value<T> type;
- };
- #else
- template< class T, int I > struct add_value_2
- {
- typedef boost::arg<I> type;
- };
- template< class T > struct add_value_2< T, 0 >
- {
- typedef _bi::value< T > type;
- };
- template<class T> struct add_value
- {
- typedef typename add_value_2< T, boost::is_placeholder< T >::value >::type type;
- };
- #endif
- template<class T> struct add_value< value<T> >
- {
- typedef _bi::value<T> type;
- };
- template<class T> struct add_value< reference_wrapper<T> >
- {
- typedef reference_wrapper<T> type;
- };
- template<int I> struct add_value< arg<I> >
- {
- typedef boost::arg<I> type;
- };
- template<int I> struct add_value< arg<I> (*) () >
- {
- typedef boost::arg<I> (*type) ();
- };
- template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
- {
- typedef bind_t<R, F, L> type;
- };
- #else
- template<int I> struct _avt_0;
- template<> struct _avt_0<1>
- {
- template<class T> struct inner
- {
- typedef T type;
- };
- };
- template<> struct _avt_0<2>
- {
- template<class T> struct inner
- {
- typedef value<T> type;
- };
- };
- typedef char (&_avt_r1) [1];
- typedef char (&_avt_r2) [2];
- template<class T> _avt_r1 _avt_f(value<T>);
- template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
- template<int I> _avt_r1 _avt_f(arg<I>);
- template<int I> _avt_r1 _avt_f(arg<I> (*) ());
- template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
- _avt_r2 _avt_f(...);
- template<class T> struct add_value
- {
- static T t();
- typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
- };
- #endif
- // list_av_N
- template<class A1> struct list_av_1
- {
- typedef typename add_value<A1>::type B1;
- typedef list1<B1> type;
- };
- template<class A1, class A2> struct list_av_2
- {
- typedef typename add_value<A1>::type B1;
- typedef typename add_value<A2>::type B2;
- typedef list2<B1, B2> type;
- };
- template<class A1, class A2, class A3> struct list_av_3
- {
- typedef typename add_value<A1>::type B1;
- typedef typename add_value<A2>::type B2;
- typedef typename add_value<A3>::type B3;
- typedef list3<B1, B2, B3> type;
- };
- template<class A1, class A2, class A3, class A4> struct list_av_4
- {
- typedef typename add_value<A1>::type B1;
- typedef typename add_value<A2>::type B2;
- typedef typename add_value<A3>::type B3;
- typedef typename add_value<A4>::type B4;
- typedef list4<B1, B2, B3, B4> type;
- };
- template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
- {
- typedef typename add_value<A1>::type B1;
- typedef typename add_value<A2>::type B2;
- typedef typename add_value<A3>::type B3;
- typedef typename add_value<A4>::type B4;
- typedef typename add_value<A5>::type B5;
- typedef list5<B1, B2, B3, B4, B5> type;
- };
- template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
- {
- typedef typename add_value<A1>::type B1;
- typedef typename add_value<A2>::type B2;
- typedef typename add_value<A3>::type B3;
- typedef typename add_value<A4>::type B4;
- typedef typename add_value<A5>::type B5;
- typedef typename add_value<A6>::type B6;
- typedef list6<B1, B2, B3, B4, B5, B6> type;
- };
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
- {
- typedef typename add_value<A1>::type B1;
- typedef typename add_value<A2>::type B2;
- typedef typename add_value<A3>::type B3;
- typedef typename add_value<A4>::type B4;
- typedef typename add_value<A5>::type B5;
- typedef typename add_value<A6>::type B6;
- typedef typename add_value<A7>::type B7;
- typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
- };
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
- {
- typedef typename add_value<A1>::type B1;
- typedef typename add_value<A2>::type B2;
- typedef typename add_value<A3>::type B3;
- typedef typename add_value<A4>::type B4;
- typedef typename add_value<A5>::type B5;
- typedef typename add_value<A6>::type B6;
- typedef typename add_value<A7>::type B7;
- typedef typename add_value<A8>::type B8;
- typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
- };
- template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
- {
- typedef typename add_value<A1>::type B1;
- typedef typename add_value<A2>::type B2;
- typedef typename add_value<A3>::type B3;
- typedef typename add_value<A4>::type B4;
- typedef typename add_value<A5>::type B5;
- typedef typename add_value<A6>::type B6;
- typedef typename add_value<A7>::type B7;
- typedef typename add_value<A8>::type B8;
- typedef typename add_value<A9>::type B9;
- typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
- };
- // operator!
- struct logical_not
- {
- template<class V> bool operator()(V const & v) const { return !v; }
- };
- template<class R, class F, class L>
- bind_t< bool, logical_not, list1< bind_t<R, F, L> > >
- operator! (bind_t<R, F, L> const & f)
- {
- typedef list1< bind_t<R, F, L> > list_type;
- return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
- }
- // relational operators
- #define BOOST_BIND_OPERATOR( op, name ) \
- \
- struct name \
- { \
- template<class V, class W> bool operator()(V const & v, W const & w) const { return v op w; } \
- }; \
- \
- template<class R, class F, class L, class A2> \
- bind_t< bool, name, list2< bind_t<R, F, L>, typename add_value<A2>::type > > \
- operator op (bind_t<R, F, L> const & f, A2 a2) \
- { \
- typedef typename add_value<A2>::type B2; \
- typedef list2< bind_t<R, F, L>, B2> list_type; \
- return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
- }
- BOOST_BIND_OPERATOR( ==, equal )
- BOOST_BIND_OPERATOR( !=, not_equal )
- BOOST_BIND_OPERATOR( <, less )
- BOOST_BIND_OPERATOR( <=, less_equal )
- BOOST_BIND_OPERATOR( >, greater )
- BOOST_BIND_OPERATOR( >=, greater_equal )
- BOOST_BIND_OPERATOR( &&, logical_and )
- BOOST_BIND_OPERATOR( ||, logical_or )
- #undef BOOST_BIND_OPERATOR
- #if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3)
- // resolve ambiguity with rel_ops
- #define BOOST_BIND_OPERATOR( op, name ) \
- \
- template<class R, class F, class L> \
- bind_t< bool, name, list2< bind_t<R, F, L>, bind_t<R, F, L> > > \
- operator op (bind_t<R, F, L> const & f, bind_t<R, F, L> const & g) \
- { \
- typedef list2< bind_t<R, F, L>, bind_t<R, F, L> > list_type; \
- return bind_t<bool, name, list_type> ( name(), list_type(f, g) ); \
- }
- BOOST_BIND_OPERATOR( !=, not_equal )
- BOOST_BIND_OPERATOR( <=, less_equal )
- BOOST_BIND_OPERATOR( >, greater )
- BOOST_BIND_OPERATOR( >=, greater_equal )
- #endif
- // visit_each, ADL
- #if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ ) \
- && !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
- template<class V, class T> void visit_each( V & v, value<T> const & t, int )
- {
- using boost::visit_each;
- BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
- }
- template<class V, class R, class F, class L> void visit_each( V & v, bind_t<R, F, L> const & t, int )
- {
- t.accept( v );
- }
- #endif
- } // namespace _bi
- // visit_each, no ADL
- #if defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) || defined( __BORLANDC__ ) \
- || (defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
- template<class V, class T> void visit_each( V & v, _bi::value<T> const & t, int )
- {
- BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
- }
- template<class V, class R, class F, class L> void visit_each( V & v, _bi::bind_t<R, F, L> const & t, int )
- {
- t.accept( v );
- }
- #endif
- // is_bind_expression
- template< class T > struct is_bind_expression
- {
- enum _vt { value = 0 };
- };
- #if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
- template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, F, L > >
- {
- enum _vt { value = 1 };
- };
- #endif
- // bind
- #ifndef BOOST_BIND
- #define BOOST_BIND bind
- #endif
- // generic function objects
- template<class R, class F>
- _bi::bind_t<R, F, _bi::list0>
- BOOST_BIND(F f)
- {
- typedef _bi::list0 list_type;
- return _bi::bind_t<R, F, list_type> (f, list_type());
- }
- template<class R, class F, class A1>
- _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
- BOOST_BIND(F f, A1 a1)
- {
- typedef typename _bi::list_av_1<A1>::type list_type;
- return _bi::bind_t<R, F, list_type> (f, list_type(a1));
- }
- template<class R, class F, class A1, class A2>
- _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
- BOOST_BIND(F f, A1 a1, A2 a2)
- {
- typedef typename _bi::list_av_2<A1, A2>::type list_type;
- return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
- }
- template<class R, class F, class A1, class A2, class A3>
- _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
- {
- typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
- }
- template<class R, class F, class A1, class A2, class A3, class A4>
- _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
- {
- typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5>
- _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
- {
- typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
- _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
- {
- typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
- _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
- {
- typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
- _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
- {
- typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
- _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
- {
- typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
- }
- // generic function objects, alternative syntax
- template<class R, class F>
- _bi::bind_t<R, F, _bi::list0>
- BOOST_BIND(boost::type<R>, F f)
- {
- typedef _bi::list0 list_type;
- return _bi::bind_t<R, F, list_type> (f, list_type());
- }
- template<class R, class F, class A1>
- _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
- BOOST_BIND(boost::type<R>, F f, A1 a1)
- {
- typedef typename _bi::list_av_1<A1>::type list_type;
- return _bi::bind_t<R, F, list_type> (f, list_type(a1));
- }
- template<class R, class F, class A1, class A2>
- _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
- BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
- {
- typedef typename _bi::list_av_2<A1, A2>::type list_type;
- return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
- }
- template<class R, class F, class A1, class A2, class A3>
- _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
- BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
- {
- typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
- }
- template<class R, class F, class A1, class A2, class A3, class A4>
- _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
- BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
- {
- typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5>
- _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
- BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
- {
- typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
- _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
- BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
- {
- typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
- _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
- BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
- {
- typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
- _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
- BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
- {
- typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
- }
- template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
- _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
- BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
- {
- typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
- return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
- }
- #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- // adaptable function objects
- template<class F>
- _bi::bind_t<_bi::unspecified, F, _bi::list0>
- BOOST_BIND(F f)
- {
- typedef _bi::list0 list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
- }
- template<class F, class A1>
- _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
- BOOST_BIND(F f, A1 a1)
- {
- typedef typename _bi::list_av_1<A1>::type list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
- }
- template<class F, class A1, class A2>
- _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
- BOOST_BIND(F f, A1 a1, A2 a2)
- {
- typedef typename _bi::list_av_2<A1, A2>::type list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
- }
- template<class F, class A1, class A2, class A3>
- _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
- {
- typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
- }
- template<class F, class A1, class A2, class A3, class A4>
- _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
- {
- typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
- }
- template<class F, class A1, class A2, class A3, class A4, class A5>
- _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
- {
- typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
- }
- template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
- _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
- {
- typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
- }
- template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
- _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
- {
- typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
- }
- template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
- _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
- {
- typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
- }
- template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
- _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
- BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
- {
- typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
- return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
- }
- #endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- // function pointers
- #define BOOST_BIND_CC
- #define BOOST_BIND_ST
- #define BOOST_BIND_NOEXCEPT
- #include <boost/bind/bind_cc.hpp>
- # if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
- # undef BOOST_BIND_NOEXCEPT
- # define BOOST_BIND_NOEXCEPT noexcept
- # include <boost/bind/bind_cc.hpp>
- # endif
- #undef BOOST_BIND_CC
- #undef BOOST_BIND_ST
- #undef BOOST_BIND_NOEXCEPT
- #if defined(BOOST_BIND_ENABLE_STDCALL) && !defined(_M_X64)
- #define BOOST_BIND_CC __stdcall
- #define BOOST_BIND_ST
- #define BOOST_BIND_NOEXCEPT
- #include <boost/bind/bind_cc.hpp>
- #undef BOOST_BIND_CC
- #undef BOOST_BIND_ST
- #undef BOOST_BIND_NOEXCEPT
- #endif
- #if defined(BOOST_BIND_ENABLE_FASTCALL) && !defined(_M_X64)
- #define BOOST_BIND_CC __fastcall
- #define BOOST_BIND_ST
- #define BOOST_BIND_NOEXCEPT
- #include <boost/bind/bind_cc.hpp>
- #undef BOOST_BIND_CC
- #undef BOOST_BIND_ST
- #undef BOOST_BIND_NOEXCEPT
- #endif
- #ifdef BOOST_BIND_ENABLE_PASCAL
- #define BOOST_BIND_ST pascal
- #define BOOST_BIND_CC
- #define BOOST_BIND_NOEXCEPT
- #include <boost/bind/bind_cc.hpp>
- #undef BOOST_BIND_ST
- #undef BOOST_BIND_CC
- #undef BOOST_BIND_NOEXCEPT
- #endif
- // member function pointers
- #define BOOST_BIND_MF_NAME(X) X
- #define BOOST_BIND_MF_CC
- #define BOOST_BIND_MF_NOEXCEPT
- #include <boost/bind/bind_mf_cc.hpp>
- #include <boost/bind/bind_mf2_cc.hpp>
- # if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
- # undef BOOST_BIND_MF_NOEXCEPT
- # define BOOST_BIND_MF_NOEXCEPT noexcept
- # include <boost/bind/bind_mf_cc.hpp>
- # endif
- #undef BOOST_BIND_MF_NAME
- #undef BOOST_BIND_MF_CC
- #undef BOOST_BIND_MF_NOEXCEPT
- #if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
- #define BOOST_BIND_MF_NAME(X) X##_cdecl
- #define BOOST_BIND_MF_CC __cdecl
- #define BOOST_BIND_MF_NOEXCEPT
- #include <boost/bind/bind_mf_cc.hpp>
- #include <boost/bind/bind_mf2_cc.hpp>
- #undef BOOST_BIND_MF_NAME
- #undef BOOST_BIND_MF_CC
- #undef BOOST_BIND_MF_NOEXCEPT
- #endif
- #if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
- #define BOOST_BIND_MF_NAME(X) X##_stdcall
- #define BOOST_BIND_MF_CC __stdcall
- #define BOOST_BIND_MF_NOEXCEPT
- #include <boost/bind/bind_mf_cc.hpp>
- #include <boost/bind/bind_mf2_cc.hpp>
- #undef BOOST_BIND_MF_NAME
- #undef BOOST_BIND_MF_CC
- #undef BOOST_BIND_MF_NOEXCEPT
- #endif
- #if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
- #define BOOST_BIND_MF_NAME(X) X##_fastcall
- #define BOOST_BIND_MF_CC __fastcall
- #define BOOST_BIND_MF_NOEXCEPT
- #include <boost/bind/bind_mf_cc.hpp>
- #include <boost/bind/bind_mf2_cc.hpp>
- #undef BOOST_BIND_MF_NAME
- #undef BOOST_BIND_MF_CC
- #undef BOOST_BIND_MF_NOEXCEPT
- #endif
- // data member pointers
- #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
- || ( defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x620 ) ) )
- template<class R, class T, class A1>
- _bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
- BOOST_BIND(R T::*f, A1 a1)
- {
- typedef _mfi::dm<R, T> F;
- typedef typename _bi::list_av_1<A1>::type list_type;
- return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
- }
- #else
- namespace _bi
- {
- template< class Pm, int I > struct add_cref;
- template< class M, class T > struct add_cref< M T::*, 0 >
- {
- typedef M type;
- };
- template< class M, class T > struct add_cref< M T::*, 1 >
- {
- #ifdef BOOST_MSVC
- #pragma warning(push)
- #pragma warning(disable:4180)
- #endif
- typedef M const & type;
- #ifdef BOOST_MSVC
- #pragma warning(pop)
- #endif
- };
- template< class R, class T > struct add_cref< R (T::*) (), 1 >
- {
- typedef void type;
- };
- #if !defined(__IBMCPP__) || __IBMCPP_FUNC_CV_TMPL_ARG_DEDUCTION
- template< class R, class T > struct add_cref< R (T::*) () const, 1 >
- {
- typedef void type;
- };
- #if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
- template< class R, class T > struct add_cref< R (T::*) () const noexcept, 1 >
- {
- typedef void type;
- };
- #endif // __cpp_noexcept_function_type
- #endif // __IBMCPP__
- template<class R> struct isref
- {
- enum value_type { value = 0 };
- };
- template<class R> struct isref< R& >
- {
- enum value_type { value = 1 };
- };
- template<class R> struct isref< R* >
- {
- enum value_type { value = 1 };
- };
- template<class Pm, class A1> struct dm_result
- {
- typedef typename add_cref< Pm, 1 >::type type;
- };
- template<class Pm, class R, class F, class L> struct dm_result< Pm, bind_t<R, F, L> >
- {
- typedef typename bind_t<R, F, L>::result_type result_type;
- typedef typename add_cref< Pm, isref< result_type >::value >::type type;
- };
- } // namespace _bi
- template< class A1, class M, class T >
- _bi::bind_t<
- typename _bi::dm_result< M T::*, A1 >::type,
- _mfi::dm<M, T>,
- typename _bi::list_av_1<A1>::type
- >
- BOOST_BIND( M T::*f, A1 a1 )
- {
- typedef typename _bi::dm_result< M T::*, A1 >::type result_type;
- typedef _mfi::dm<M, T> F;
- typedef typename _bi::list_av_1<A1>::type list_type;
- return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) );
- }
- #endif
- } // namespace boost
- #ifndef BOOST_BIND_NO_PLACEHOLDERS
- # include <boost/bind/placeholders.hpp>
- #endif
- #ifdef BOOST_MSVC
- # pragma warning(default: 4512) // assignment operator could not be generated
- # pragma warning(pop)
- #endif
- #endif // #ifndef BOOST_BIND_BIND_HPP_INCLUDED
|