It is difficult or even impossible to get a Function Object from a function template. Egg no longer considers function templates to be useful, so that it provides "objectified" functions which replace some famous function templates.
apply
calls a function with
trailing arguments.
<pstade/egg/apply.hpp>
Valid expression |
Semantics |
---|---|
|
A Major Function Object type |
|
|
|
|
_arg_list(b, _Stg)
is a valid expression, where b
is _pfo, a1,...,aN
.
BOOST_CHECK(apply(negate, apply(negate, apply(negate, 10))) == -10);
bll_bind
is a Static
Function Object which represents boost::lambda::bind
.
<pstade/egg/bll/bind.hpp>
Valid expression |
Semantics |
---|---|
|
Polymorphic
|
0 <=
N &&
N <=
9
.
// \x -> (\y -> plus(x, y)) BOOST_CHECK( lazy(bll_bind)(plus, _1, bll::protect(_1)) (a)(b) == plus(a, b) );
This is currying in Boost.Lambda. |
bll_N
is a Static
Function Object which represents boost::lambda::_N
.
<pstade/egg/bll/placeholders.hpp>
Valid expression |
Semantics |
---|---|
|
Polymorphic
|
1 <=
N &&
N <=
3
.
...
This header lets a Boost.Lambda functor be a Polymorphic Function Object.
<pstade/egg/bll/result_of.hpp>
Valid expression |
Semantics |
---|---|
|
A Boost.Lambda functor becomes a Polymorphic Function Object. |
...
Egg provides FC++ infix operator syntax.
<pstade/egg/infix.hpp>
Valid expression |
Semantics |
---|---|
|
|
using namespace
infix;
is placed before the valid expression.
^_pfo^
behaves as if it had left to right associativity.
using namespace infix; BOOST_CHECK( (10 ^plus^ 12 ^plus^ 3) == 25 );
tuple_get
is akin to boost::get
.
<pstade/egg/tuple/get.hpp>
Valid expression |
Semantics |
---|---|
|
A Major Function Object type |
|
|
|
|
|
|
|
|
...
tuple_pack
is a Static
Function Object which represents boost::tie
but
const-qualifier sensitive.
<pstade/egg/tuple/pack.hpp>
refs(c1,...,cK)
is
c1&,...,cK&
.
Valid expression |
Semantics |
---|---|
|
A Major Function Object type |
|
|
|
|
_Stg
is not by_value
.
...
Copyright © 2007 Shunsuke Sogame |