1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203 |
- /*=============================================================================
- 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 BOOST_SPIRIT_CLASSIC_PHOENIX_OPERATORS_HPP
- #define BOOST_SPIRIT_CLASSIC_PHOENIX_OPERATORS_HPP
- ///////////////////////////////////////////////////////////////////////////////
- #if !defined(BOOST_NO_CWCTYPE)
- #include <cwctype>
- #endif
- #if (defined(__BORLANDC__) && !defined(__clang__)) || (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 BOOST_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 desirable,
- // 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
|