Boost C++ Libraries

PrevUpHomeNext

Utilities

expr
infix
bll/result_of.hpp
Description

expr, cooperating with Boost.Typeof, enables you to extract a type of expression without resulf_of.

Header
  • <boost/egg/expr.hpp>
Valid expressions

Valid expression

Semantics

egg::expr<Sig>(__pfo)

X_mono<Sig>()(__pfo) which can be used with Boost.Typeof.

Preconditions
  • Except for boost::use_default, types in Sig are registered to Boost.Typeof.
[Note] Note

expr performs type-erasure when native typeof isn't available so that type registrations into Boost.Typeof can be minimized.

Example

void egg_example()
{
    BOOST_AUTO(f,
        egg::expr<int(int, int)>(unfuse(fuse(bll::_1 + bll::_2))) );

    BOOST_CHECK( f(1,2) == 1+2 );
}

See also
Description

Egg provides FC++ infix operator syntax.

Header
  • <boost/egg/infix.hpp>
Valid expressions

Valid expression

Semantics

a1 ^__pfo^ a2

__pfo(__fwd_arg_list([a1], by_perfect)++__fwd_arg_list([a2], by_perfect))

Preconditions
  • using namespace infix; is placed before the valid expression.
  • operator^ is not overloaded with __typeof(a1).
Invariants
  • ^__pfo^ behaves as if it had left to right associativity.
Example

void egg_example()
{
    using namespace infix;

    std::plus<int> plus;
    BOOST_CHECK( (1 ^plus^ 2) == 3 );
}

See also
Description

This header lets a Boost.Lambda Function Object be a Polymorphic Function Object.

Header
  • <boost/egg/bll/result_of.hpp>
Valid expressions

Valid expression

Semantics

#include <boost/egg/bll/result_of.hpp>

A Boost.Lambda Function Object becomes a Polymorphic Function Object.

See also

PrevUpHomeNext