| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204 |
- /*=============================================================================
- Phoenix V1.2.1
- Copyright (c) 2001-2002 Joel de Guzman
- 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)
- ==============================================================================*/
- #ifndef PHOENIX_OPERATORS_HPP
- #define PHOENIX_OPERATORS_HPP
- ///////////////////////////////////////////////////////////////////////////////
- #if !defined(BOOST_NO_CWCTYPE)
- #include <cwctype>
- #endif
- #if defined(__BORLANDC__) || (defined(__ICL) && __ICL >= 700)
- #define CREF const&
- #else
- #define CREF
- #endif
- #include <climits>
- #include <boost/spirit/home/classic/phoenix/actor.hpp>
- #include <boost/spirit/home/classic/phoenix/composite.hpp>
- #include <boost/config.hpp>
- #include <boost/mpl/if.hpp>
- ///////////////////////////////////////////////////////////////////////////////
- namespace phoenix {
- ///////////////////////////////////////////////////////////////////////////////
- //
- // Operators
- //
- // Lazy operators
- //
- // This class provides a mechanism for lazily evaluating operators.
- // Syntactically, a lazy operator looks like an ordinary C/C++
- // infix, prefix or postfix operator. The operator application
- // looks the same. However, unlike ordinary operators, the actual
- // operator execution is deferred. (see actor.hpp, primitives.hpp
- // and composite.hpp for an overview). Samples:
- //
- // arg1 + arg2
- // 1 + arg1 * arg2
- // 1 / -arg1
- // arg1 < 150
- //
- // T1 set of classes implement all the C++ free operators. Like
- // lazy functions (see functions.hpp), lazy operators are not
- // immediately executed when invoked. Instead, a composite (see
- // composite.hpp) object is created and returned to the caller.
- // Example:
- //
- // (arg1 + arg2) * arg3
- //
- // does nothing more than return a composite. T1 second function
- // call will evaluate the actual operators. Example:
- //
- // int i = 4, j = 5, k = 6;
- // cout << ((arg1 + arg2) * arg3)(i, j, k);
- //
- // will print out "54".
- //
- // Arbitrarily complex expressions can be lazily evaluated
- // following three simple rules:
- //
- // 1) Lazy evaluated binary operators apply when at least one
- // of the operands is an actor object (see actor.hpp and
- // primitives.hpp). Consequently, if an operand is not an actor
- // object, it is implicitly converted to an object of type
- // actor<value<T> > (where T is the original type of the
- // operand).
- //
- // 2) Lazy evaluated unary operators apply only to operands
- // which are actor objects.
- //
- // 3) The result of a lazy operator is a composite actor object
- // that can in turn apply to rule 1.
- //
- // Example:
- //
- // arg1 + 3
- //
- // is a lazy expression involving the operator+. Following rule 1,
- // lazy evaluation is triggered since arg1 is an instance of an
- // actor<argument<N> > class (see primitives.hpp). The right
- // operand <3> is implicitly converted to an actor<value<int> >.
- // The result of this binary + expression is a composite object,
- // following rule 3.
- //
- // Take note that although at least one of the operands must be a
- // valid actor class in order for lazy evaluation to take effect,
- // if this is not the case and we still want to lazily evaluate an
- // expression, we can use var(x), val(x) or cref(x) to transform
- // the operand into a valid action object (see primitives.hpp).
- // Example:
- //
- // val(1) << 3;
- //
- // Supported operators:
- //
- // Unary operators:
- //
- // prefix: ~, !, -, +, ++, --, & (reference), * (dereference)
- // postfix: ++, --
- //
- // Binary operators:
- //
- // =, [], +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=
- // +, -, *, /, %, &, |, ^, <<, >>
- // ==, !=, <, >, <=, >=
- // &&, ||
- //
- // Each operator has a special tag type associated with it. For
- // example the binary + operator has a plus_op tag type associated
- // with it. This is used to specialize either the unary_operator or
- // binary_operator template classes (see unary_operator and
- // binary_operator below). Specializations of these unary_operator
- // and binary_operator are the actual workhorses that implement the
- // operations. The behavior of each lazy operator depends on these
- // unary_operator and binary_operator specializations. 'preset'
- // specializations conform to the canonical operator rules modeled
- // by the behavior of integers and pointers:
- //
- // Prefix -, + and ~ accept constant arguments and return an
- // object by value.
- //
- // The ! accept constant arguments and returns a boolean
- // result.
- //
- // The & (address-of), * (dereference) both return a reference
- // to an object.
- //
- // Prefix ++ returns a reference to its mutable argument after
- // it is incremented.
- //
- // Postfix ++ returns the mutable argument by value before it
- // is incremented.
- //
- // The += and its family accept mutable right hand side (rhs)
- // operand and return a reference to the rhs operand.
- //
- // Infix + and its family accept constant arguments and return
- // an object by value.
- //
- // The == and its family accept constant arguments and return a
- // boolean result.
- //
- // Operators && and || accept constant arguments and return a
- // boolean result and are short circuit evaluated as expected.
- //
- ///////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////
- //
- // Operator tags
- //
- // Each C++ operator has a corresponding tag type. This is
- // used as a means for specializing the unary_operator and
- // binary_operator (see below). The tag also serves as the
- // lazy operator type compatible as a composite operation
- // see (composite.hpp).
- //
- ///////////////////////////////////////////////////////////////////////////////
- // Unary operator tags
- struct negative_op; struct positive_op;
- struct logical_not_op; struct invert_op;
- struct reference_op; struct dereference_op;
- struct pre_incr_op; struct pre_decr_op;
- struct post_incr_op; struct post_decr_op;
- // Binary operator tags
- struct assign_op; struct index_op;
- struct plus_assign_op; struct minus_assign_op;
- struct times_assign_op; struct divide_assign_op; struct mod_assign_op;
- struct and_assign_op; struct or_assign_op; struct xor_assign_op;
- struct shift_l_assign_op; struct shift_r_assign_op;
- struct plus_op; struct minus_op;
- struct times_op; struct divide_op; struct mod_op;
- struct and_op; struct or_op; struct xor_op;
- struct shift_l_op; struct shift_r_op;
- struct eq_op; struct not_eq_op;
- struct lt_op; struct lt_eq_op;
- struct gt_op; struct gt_eq_op;
- struct logical_and_op; struct logical_or_op;
- ///////////////////////////////////////////////////////////////////////////////
- //
- // unary_operator<TagT, T>
- //
- // The unary_operator class implements most of the C++ unary
- // operators. Each specialization is basically a simple static eval
- // function plus a result_type typedef that determines the return
- // type of the eval function.
- //
- // TagT is one of the unary operator tags above and T is the data
- // type (argument) involved in the operation.
- //
- // Only the behavior of C/C++ built-in types are taken into account
- // in the specializations provided below. For user-defined types,
- // these specializations may still be used provided that the
- // operator overloads of such types adhere to the standard behavior
- // of built-in types.
- //
- // T1 separate special_ops.hpp file implements more stl savvy
- // specializations. Other more specialized unary_operator
- // implementations may be defined by the client for specific
- // unary operator tags/data types.
- //
- ///////////////////////////////////////////////////////////////////////////////
- template <typename TagT, typename T>
- struct unary_operator;
- //////////////////////////////////
- template <typename T>
- struct unary_operator<negative_op, T> {
- typedef T const result_type;
- static result_type eval(T const& v)
- { return -v; }
- };
- //////////////////////////////////
- template <typename T>
- struct unary_operator<positive_op, T> {
- typedef T const result_type;
- static result_type eval(T const& v)
- { return +v; }
- };
- //////////////////////////////////
- template <typename T>
- struct unary_operator<logical_not_op, T> {
- typedef T const result_type;
- static result_type eval(T const& v)
- { return !v; }
- };
- //////////////////////////////////
- template <typename T>
- struct unary_operator<invert_op, T> {
- typedef T const result_type;
- static result_type eval(T const& v)
- { return ~v; }
- };
- //////////////////////////////////
- template <typename T>
- struct unary_operator<reference_op, T> {
- typedef T* result_type;
- static result_type eval(T& v)
- { return &v; }
- };
- //////////////////////////////////
- template <typename T>
- struct unary_operator<dereference_op, T*> {
- typedef T& result_type;
- static result_type eval(T* v)
- { return *v; }
- };
- //////////////////////////////////
- template <typename T>
- struct unary_operator<dereference_op, T* const> {
- typedef T& result_type;
- static result_type eval(T* const v)
- { return *v; }
- };
- //////////////////////////////////
- template <>
- struct unary_operator<dereference_op, nil_t> {
- // G++ eager template instantiation
- // somehow requires this.
- typedef nil_t result_type;
- };
- //////////////////////////////////
- #ifndef __BORLANDC__
- template <>
- struct unary_operator<dereference_op, nil_t const> {
- // G++ eager template instantiation
- // somehow requires this.
- typedef nil_t result_type;
- };
- #endif
- //////////////////////////////////
- template <typename T>
- struct unary_operator<pre_incr_op, T> {
- typedef T& result_type;
- static result_type eval(T& v)
- { return ++v; }
- };
- //////////////////////////////////
- template <typename T>
- struct unary_operator<pre_decr_op, T> {
- typedef T& result_type;
- static result_type eval(T& v)
- { return --v; }
- };
- //////////////////////////////////
- template <typename T>
- struct unary_operator<post_incr_op, T> {
- typedef T const result_type;
- static result_type eval(T& v)
- { T t(v); ++v; return t; }
- };
- //////////////////////////////////
- template <typename T>
- struct unary_operator<post_decr_op, T> {
- typedef T const result_type;
- static result_type eval(T& v)
- { T t(v); --v; return t; }
- };
- ///////////////////////////////////////////////////////////////////////////////
- //
- // rank<T>
- //
- // rank<T> class has a static int constant 'value' that defines the
- // absolute rank of a type. rank<T> is used to choose the result
- // type of binary operators such as +. The type with the higher
- // rank wins and is used as the operator's return type. T1 generic
- // user defined type has a very high rank and always wins when
- // compared against a user defined type. If this is not desireable,
- // one can write a rank specialization for the type.
- //
- // Take note that ranks 0..9999 are reserved for the framework.
- //
- ///////////////////////////////////////////////////////////////////////////////
- template <typename T>
- struct rank { static int const value = INT_MAX; };
- template <> struct rank<void> { static int const value = 0; };
- template <> struct rank<bool> { static int const value = 10; };
- template <> struct rank<char> { static int const value = 20; };
- template <> struct rank<signed char> { static int const value = 20; };
- template <> struct rank<unsigned char> { static int const value = 30; };
- #if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
- template <> struct rank<wchar_t> { static int const value = 40; };
- #endif // !defined(BOOST_NO_INTRINSIC_WCHAR_T)
- template <> struct rank<short> { static int const value = 50; };
- template <> struct rank<unsigned short> { static int const value = 60; };
- template <> struct rank<int> { static int const value = 70; };
- template <> struct rank<unsigned int> { static int const value = 80; };
- template <> struct rank<long> { static int const value = 90; };
- template <> struct rank<unsigned long> { static int const value = 100; };
- #ifdef BOOST_HAS_LONG_LONG
- template <> struct rank< ::boost::long_long_type> { static int const value = 110; };
- template <> struct rank< ::boost::ulong_long_type> { static int const value = 120; };
- #endif
- template <> struct rank<float> { static int const value = 130; };
- template <> struct rank<double> { static int const value = 140; };
- template <> struct rank<long double> { static int const value = 150; };
- template <typename T> struct rank<T*>
- { static int const value = 160; };
- template <typename T> struct rank<T* const>
- { static int const value = 160; };
- template <typename T, int N> struct rank<T[N]>
- { static int const value = 160; };
- ///////////////////////////////////////////////////////////////////////////////
- //
- // higher_rank<T0, T1>
- //
- // Chooses the type (T0 or T1) with the higher rank.
- //
- ///////////////////////////////////////////////////////////////////////////////
- template <typename T0, typename T1>
- struct higher_rank {
- typedef typename boost::mpl::if_c<
- rank<T0>::value < rank<T1>::value,
- T1, T0>::type type;
- };
- ///////////////////////////////////////////////////////////////////////////////
- //
- // binary_operator<TagT, T0, T1>
- //
- // The binary_operator class implements most of the C++ binary
- // operators. Each specialization is basically a simple static eval
- // function plus a result_type typedef that determines the return
- // type of the eval function.
- //
- // TagT is one of the binary operator tags above T0 and T1 are the
- // (arguments') data types involved in the operation.
- //
- // Only the behavior of C/C++ built-in types are taken into account
- // in the specializations provided below. For user-defined types,
- // these specializations may still be used provided that the
- // operator overloads of such types adhere to the standard behavior
- // of built-in types.
- //
- // T1 separate special_ops.hpp file implements more stl savvy
- // specializations. Other more specialized unary_operator
- // implementations may be defined by the client for specific
- // unary operator tags/data types.
- //
- // All binary_operator except the logical_and_op and logical_or_op
- // have an eval static function that carries out the actual operation.
- // The logical_and_op and logical_or_op d are special because these
- // two operators are short-circuit evaluated.
- //
- ///////////////////////////////////////////////////////////////////////////////
- template <typename TagT, typename T0, typename T1>
- struct binary_operator;
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs = rhs; }
- };
- //////////////////////////////////
- template <typename T1>
- struct binary_operator<index_op, nil_t, T1> {
- // G++ eager template instantiation
- // somehow requires this.
- typedef nil_t result_type;
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<index_op, T0*, T1> {
- typedef T0& result_type;
- static result_type eval(T0* ptr, T1 const& index)
- { return ptr[index]; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<index_op, T0* const, T1> {
- typedef T0& result_type;
- static result_type eval(T0* const ptr, T1 const& index)
- { return ptr[index]; }
- };
- //////////////////////////////////
- template <typename T0, int N, typename T1>
- struct binary_operator<index_op, T0[N], T1> {
- typedef T0& result_type;
- static result_type eval(T0* ptr, T1 const& index)
- { return ptr[index]; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<plus_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs += rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<minus_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs -= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<times_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs *= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<divide_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs /= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<mod_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs %= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<and_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs &= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<or_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs |= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<xor_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs ^= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<shift_l_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs <<= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<shift_r_assign_op, T0, T1> {
- typedef T0& result_type;
- static result_type eval(T0& lhs, T1 const& rhs)
- { return lhs >>= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<plus_op, T0, T1> {
- typedef typename higher_rank<T0, T1>::type const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs + rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<minus_op, T0, T1> {
- typedef typename higher_rank<T0, T1>::type const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs - rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<times_op, T0, T1> {
- typedef typename higher_rank<T0, T1>::type const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs * rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<divide_op, T0, T1> {
- typedef typename higher_rank<T0, T1>::type const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs / rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<mod_op, T0, T1> {
- typedef typename higher_rank<T0, T1>::type const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs % rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<and_op, T0, T1> {
- typedef typename higher_rank<T0, T1>::type const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs & rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<or_op, T0, T1> {
- typedef typename higher_rank<T0, T1>::type const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs | rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<xor_op, T0, T1> {
- typedef typename higher_rank<T0, T1>::type const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs ^ rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<shift_l_op, T0, T1> {
- typedef T0 const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs << rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<shift_r_op, T0, T1> {
- typedef T0 const result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs >> rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<eq_op, T0, T1> {
- typedef bool result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs == rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<not_eq_op, T0, T1> {
- typedef bool result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs != rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<lt_op, T0, T1> {
- typedef bool result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs < rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<lt_eq_op, T0, T1> {
- typedef bool result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs <= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<gt_op, T0, T1> {
- typedef bool result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs > rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<gt_eq_op, T0, T1> {
- typedef bool result_type;
- static result_type eval(T0 const& lhs, T1 const& rhs)
- { return lhs >= rhs; }
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<logical_and_op, T0, T1> {
- typedef bool result_type;
- // no eval function, see comment above.
- };
- //////////////////////////////////
- template <typename T0, typename T1>
- struct binary_operator<logical_or_op, T0, T1> {
- typedef bool result_type;
- // no eval function, see comment above.
- };
- ///////////////////////////////////////////////////////////////////////////////
- //
- // negative lazy operator (prefix -)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct negative_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<negative_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<negative_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<negative_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<negative_op, BaseT>::type
- operator-(actor<BaseT> const& _0)
- {
- return impl::make_unary<negative_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // positive lazy operator (prefix +)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct positive_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<positive_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<positive_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<positive_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<positive_op, BaseT>::type
- operator+(actor<BaseT> const& _0)
- {
- return impl::make_unary<positive_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // logical not lazy operator (prefix !)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct logical_not_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<logical_not_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<logical_not_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<logical_not_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<logical_not_op, BaseT>::type
- operator!(actor<BaseT> const& _0)
- {
- return impl::make_unary<logical_not_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // invert lazy operator (prefix ~)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct invert_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<invert_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<invert_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<invert_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<invert_op, BaseT>::type
- operator~(actor<BaseT> const& _0)
- {
- return impl::make_unary<invert_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // reference lazy operator (prefix &)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct reference_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<reference_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<reference_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<reference_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<reference_op, BaseT>::type
- operator&(actor<BaseT> const& _0)
- {
- return impl::make_unary<reference_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // dereference lazy operator (prefix *)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct dereference_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<dereference_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<dereference_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<dereference_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<dereference_op, BaseT>::type
- operator*(actor<BaseT> const& _0)
- {
- return impl::make_unary<dereference_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // pre increment lazy operator (prefix ++)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct pre_incr_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<pre_incr_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<pre_incr_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<pre_incr_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<pre_incr_op, BaseT>::type
- operator++(actor<BaseT> const& _0)
- {
- return impl::make_unary<pre_incr_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // pre decrement lazy operator (prefix --)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct pre_decr_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<pre_decr_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<pre_decr_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<pre_decr_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<pre_decr_op, BaseT>::type
- operator--(actor<BaseT> const& _0)
- {
- return impl::make_unary<pre_decr_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // post increment lazy operator (postfix ++)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct post_incr_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<post_incr_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<post_incr_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<post_incr_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<post_incr_op, BaseT>::type
- operator++(actor<BaseT> const& _0, int)
- {
- return impl::make_unary<post_incr_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // post decrement lazy operator (postfix --)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct post_decr_op {
- template <typename T0>
- struct result {
- typedef typename unary_operator<post_decr_op, T0>::result_type type;
- };
- template <typename T0>
- typename unary_operator<post_decr_op, T0>::result_type
- operator()(T0& _0) const
- { return unary_operator<post_decr_op, T0>::eval(_0); }
- };
- //////////////////////////////////
- template <typename BaseT>
- inline typename impl::make_unary<post_decr_op, BaseT>::type
- operator--(actor<BaseT> const& _0, int)
- {
- return impl::make_unary<post_decr_op, BaseT>::construct(_0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // assignment lazy operator (infix =)
- // The acual lazy operator is a member of the actor class.
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT>
- template <typename B>
- inline typename impl::make_binary1<assign_op, BaseT, B>::type
- actor<BaseT>::operator=(B const& _1) const
- {
- return impl::make_binary1<assign_op, BaseT, B>::construct(*this, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // index lazy operator (array index [])
- // The acual lazy operator is a member of the actor class.
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct index_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<index_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<index_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<index_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT>
- template <typename B>
- inline typename impl::make_binary1<index_op, BaseT, B>::type
- actor<BaseT>::operator[](B const& _1) const
- {
- return impl::make_binary1<index_op, BaseT, B>::construct(*this, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // plus assign lazy operator (infix +=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct plus_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<plus_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<plus_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<plus_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<plus_assign_op, BaseT, T1>::type
- operator+=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<plus_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // minus assign lazy operator (infix -=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct minus_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<minus_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<minus_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<minus_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<minus_assign_op, BaseT, T1>::type
- operator-=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<minus_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // times assign lazy operator (infix *=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct times_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<times_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<times_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<times_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<times_assign_op, BaseT, T1>::type
- operator*=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<times_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // divide assign lazy operator (infix /=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct divide_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<divide_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<divide_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<divide_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<divide_assign_op, BaseT, T1>::type
- operator/=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<divide_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // mod assign lazy operator (infix %=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct mod_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<mod_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<mod_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<mod_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<mod_assign_op, BaseT, T1>::type
- operator%=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<mod_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // and assign lazy operator (infix &=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct and_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<and_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<and_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<and_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<and_assign_op, BaseT, T1>::type
- operator&=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<and_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // or assign lazy operator (infix |=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct or_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<or_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<or_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<or_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<or_assign_op, BaseT, T1>::type
- operator|=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<or_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // xor assign lazy operator (infix ^=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct xor_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<xor_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<xor_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<xor_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<xor_assign_op, BaseT, T1>::type
- operator^=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<xor_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // shift left assign lazy operator (infix <<=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct shift_l_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<shift_l_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<shift_l_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<shift_l_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<shift_l_assign_op, BaseT, T1>::type
- operator<<=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<shift_l_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // shift right assign lazy operator (infix >>=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct shift_r_assign_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<shift_r_assign_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<shift_r_assign_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<shift_r_assign_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<shift_r_assign_op, BaseT, T1>::type
- operator>>=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<shift_r_assign_op, BaseT, T1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // plus lazy operator (infix +)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct plus_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<plus_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<plus_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<plus_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<plus_op, BaseT, T1>::type
- operator+(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<plus_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<plus_op, T0, BaseT>::type
- operator+(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<plus_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<plus_op, BaseT0, BaseT1>::type
- operator+(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<plus_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // minus lazy operator (infix -)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct minus_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<minus_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<minus_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<minus_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<minus_op, BaseT, T1>::type
- operator-(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<minus_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<minus_op, T0, BaseT>::type
- operator-(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<minus_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<minus_op, BaseT0, BaseT1>::type
- operator-(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<minus_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // times lazy operator (infix *)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct times_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<times_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<times_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<times_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<times_op, BaseT, T1>::type
- operator*(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<times_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<times_op, T0, BaseT>::type
- operator*(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<times_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<times_op, BaseT0, BaseT1>::type
- operator*(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<times_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // divide lazy operator (infix /)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct divide_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<divide_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<divide_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<divide_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<divide_op, BaseT, T1>::type
- operator/(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<divide_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<divide_op, T0, BaseT>::type
- operator/(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<divide_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<divide_op, BaseT0, BaseT1>::type
- operator/(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<divide_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // mod lazy operator (infix %)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct mod_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<mod_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<mod_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<mod_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<mod_op, BaseT, T1>::type
- operator%(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<mod_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<mod_op, T0, BaseT>::type
- operator%(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<mod_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<mod_op, BaseT0, BaseT1>::type
- operator%(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<mod_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // and lazy operator (infix &)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct and_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<and_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<and_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<and_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<and_op, BaseT, T1>::type
- operator&(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<and_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<and_op, T0, BaseT>::type
- operator&(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<and_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<and_op, BaseT0, BaseT1>::type
- operator&(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<and_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // or lazy operator (infix |)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct or_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<or_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<or_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<or_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<or_op, BaseT, T1>::type
- operator|(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<or_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<or_op, T0, BaseT>::type
- operator|(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<or_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<or_op, BaseT0, BaseT1>::type
- operator|(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<or_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // xor lazy operator (infix ^)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct xor_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<xor_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<xor_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<xor_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<xor_op, BaseT, T1>::type
- operator^(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<xor_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<xor_op, T0, BaseT>::type
- operator^(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<xor_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<xor_op, BaseT0, BaseT1>::type
- operator^(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<xor_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // shift left lazy operator (infix <<)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct shift_l_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<shift_l_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<shift_l_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<shift_l_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<shift_l_op, BaseT, T1>::type
- operator<<(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<shift_l_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<shift_l_op, T0, BaseT>::type
- operator<<(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<shift_l_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<shift_l_op, BaseT0, BaseT1>::type
- operator<<(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<shift_l_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // shift right lazy operator (infix >>)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct shift_r_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<shift_r_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<shift_r_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<shift_r_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<shift_r_op, BaseT, T1>::type
- operator>>(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<shift_r_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<shift_r_op, T0, BaseT>::type
- operator>>(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<shift_r_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<shift_r_op, BaseT0, BaseT1>::type
- operator>>(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<shift_r_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // equal lazy operator (infix ==)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct eq_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<eq_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<eq_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<eq_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<eq_op, BaseT, T1>::type
- operator==(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<eq_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<eq_op, T0, BaseT>::type
- operator==(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<eq_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<eq_op, BaseT0, BaseT1>::type
- operator==(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<eq_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // not equal lazy operator (infix !=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct not_eq_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<not_eq_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<not_eq_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<not_eq_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<not_eq_op, BaseT, T1>::type
- operator!=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<not_eq_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<not_eq_op, T0, BaseT>::type
- operator!=(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<not_eq_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<not_eq_op, BaseT0, BaseT1>::type
- operator!=(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<not_eq_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // less than lazy operator (infix <)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct lt_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<lt_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<lt_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<lt_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<lt_op, BaseT, T1>::type
- operator<(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<lt_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<lt_op, T0, BaseT>::type
- operator<(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<lt_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<lt_op, BaseT0, BaseT1>::type
- operator<(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<lt_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // less than equal lazy operator (infix <=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct lt_eq_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<lt_eq_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<lt_eq_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<lt_eq_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<lt_eq_op, BaseT, T1>::type
- operator<=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<lt_eq_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<lt_eq_op, T0, BaseT>::type
- operator<=(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<lt_eq_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<lt_eq_op, BaseT0, BaseT1>::type
- operator<=(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<lt_eq_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // greater than lazy operator (infix >)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct gt_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<gt_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<gt_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<gt_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<gt_op, BaseT, T1>::type
- operator>(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<gt_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<gt_op, T0, BaseT>::type
- operator>(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<gt_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<gt_op, BaseT0, BaseT1>::type
- operator>(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<gt_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // greater than equal lazy operator (infix >=)
- //
- ///////////////////////////////////////////////////////////////////////////////
- struct gt_eq_op {
- template <typename T0, typename T1>
- struct result {
- typedef typename binary_operator<gt_eq_op, T0, T1>
- ::result_type type;
- };
- template <typename T0, typename T1>
- typename binary_operator<gt_eq_op, T0, T1>::result_type
- operator()(T0& _0, T1& _1) const
- { return binary_operator<gt_eq_op, T0, T1>::eval(_0, _1); }
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline typename impl::make_binary1<gt_eq_op, BaseT, T1>::type
- operator>=(actor<BaseT> const& _0, T1 CREF _1)
- {
- return impl::make_binary1<gt_eq_op, BaseT, T1>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline typename impl::make_binary2<gt_eq_op, T0, BaseT>::type
- operator>=(T0 CREF _0, actor<BaseT> const& _1)
- {
- return impl::make_binary2<gt_eq_op, T0, BaseT>::construct(_0, _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline typename impl::make_binary3<gt_eq_op, BaseT0, BaseT1>::type
- operator>=(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return impl::make_binary3<gt_eq_op, BaseT0, BaseT1>::construct(_0, _1);
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // logical and lazy operator (infix &&)
- //
- // The logical_and_composite class and its corresponding generators are
- // provided to allow short-circuit evaluation of the operator's
- // operands.
- //
- ///////////////////////////////////////////////////////////////////////////////
- template <typename A0, typename A1>
- struct logical_and_composite {
- typedef logical_and_composite<A0, A1> self_t;
- template <typename TupleT>
- struct result {
- typedef typename binary_operator<logical_and_op,
- typename actor_result<A0, TupleT>::plain_type,
- typename actor_result<A1, TupleT>::plain_type
- >::result_type type;
- };
- logical_and_composite(A0 const& _0, A1 const& _1)
- : a0(_0), a1(_1) {}
- template <typename TupleT>
- typename actor_result<self_t, TupleT>::type
- eval(TupleT const& args) const
- {
- return a0.eval(args) && a1.eval(args);
- }
- A0 a0; A1 a1; // actors
- };
- #if !(defined(__ICL) && __ICL <= 500)
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline actor<logical_and_composite
- <actor<BaseT>, typename as_actor<T1>::type> >
- operator&&(actor<BaseT> const& _0, T1 CREF _1)
- {
- return logical_and_composite
- <actor<BaseT>, typename as_actor<T1>::type>
- (_0, as_actor<T1>::convert(_1));
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline actor<logical_and_composite
- <typename as_actor<T0>::type, actor<BaseT> > >
- operator&&(T0 CREF _0, actor<BaseT> const& _1)
- {
- return logical_and_composite
- <typename as_actor<T0>::type, actor<BaseT> >
- (as_actor<T0>::convert(_0), _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline actor<logical_and_composite
- <actor<BaseT0>, actor<BaseT1> > >
- operator&&(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return logical_and_composite
- <actor<BaseT0>, actor<BaseT1> >
- (_0, _1);
- }
- #else
- //////////////////////////////////
- template <typename T0, typename T1>
- inline actor<logical_and_composite
- <typename as_actor<T0>::type, typename as_actor<T1>::type> >
- operator&&(T0 CREF _0, T1 CREF _1)
- {
- return logical_and_composite
- <typename as_actor<T0>::type, typename as_actor<T1>::type>
- (as_actor<T0>::convert(_0), as_actor<T1>::convert(_1));
- }
- #endif // !(__ICL && __ICL <= 500)
- ///////////////////////////////////////////////////////////////////////////////
- //
- // logical or lazy operator (infix ||)
- //
- // The logical_or_composite class and its corresponding generators are
- // provided to allow short-circuit evaluation of the operator's
- // operands.
- //
- ///////////////////////////////////////////////////////////////////////////////
- template <typename A0, typename A1>
- struct logical_or_composite {
- typedef logical_or_composite<A0, A1> self_t;
- template <typename TupleT>
- struct result {
- typedef typename binary_operator<logical_or_op,
- typename actor_result<A0, TupleT>::plain_type,
- typename actor_result<A1, TupleT>::plain_type
- >::result_type type;
- };
- logical_or_composite(A0 const& _0, A1 const& _1)
- : a0(_0), a1(_1) {}
- template <typename TupleT>
- typename actor_result<self_t, TupleT>::type
- eval(TupleT const& args) const
- {
- return a0.eval(args) || a1.eval(args);
- }
- A0 a0; A1 a1; // actors
- };
- //////////////////////////////////
- template <typename BaseT, typename T1>
- inline actor<logical_or_composite
- <actor<BaseT>, typename as_actor<T1>::type> >
- operator||(actor<BaseT> const& _0, T1 CREF _1)
- {
- return logical_or_composite
- <actor<BaseT>, typename as_actor<T1>::type>
- (_0, as_actor<T1>::convert(_1));
- }
- //////////////////////////////////
- template <typename T0, typename BaseT>
- inline actor<logical_or_composite
- <typename as_actor<T0>::type, actor<BaseT> > >
- operator||(T0 CREF _0, actor<BaseT> const& _1)
- {
- return logical_or_composite
- <typename as_actor<T0>::type, actor<BaseT> >
- (as_actor<T0>::convert(_0), _1);
- }
- //////////////////////////////////
- template <typename BaseT0, typename BaseT1>
- inline actor<logical_or_composite
- <actor<BaseT0>, actor<BaseT1> > >
- operator||(actor<BaseT0> const& _0, actor<BaseT1> const& _1)
- {
- return logical_or_composite
- <actor<BaseT0>, actor<BaseT1> >
- (_0, _1);
- }
- } // namespace phoenix
- #undef CREF
- #endif
|