Macro BOOST_PROTO_DEFINE_OPERATORSBOOST_PROTO_DEFINE_OPERATORS — Defines a complete set of expression template-building operator overloads for use with non-Proto terminal types. SynopsisBOOST_PROTO_DEFINE_OPERATORS(Trait, Domain) Description
With
Example: namespace My { // A non-Proto terminal type struct S {}; // A unary Boolean metafunction that returns true for type S template<typename T> struct IsS : mpl::false_ {}; template<> struct IsS<S> : mpl::true_ {}; // Make S a Proto terminal non-intrusively by defining the // appropriate operator overloads. This should be in the same // namespace as S so that these overloads can be found by // argument-dependent lookup BOOST_PROTO_DEFINE_OPERATORS(IsS, proto::default_domain) } int main() { My::S s1, s2; // OK, this builds a Proto expression template: s1 + s2; }
|