12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366 |
- #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
|