![]() |
Egg provides some workaround utilities.
boost::result_of
has some problems especially
under Boost1.34 or below:
boost::result_of
can't take a const-qualified
function pointer as the target function.
boost::result_of
can't take a POD template as the target function.
![]() |
Note |
---|---|
If you already use Boost1.35 and don't pass a const-qualified function pointer, you don't need this workaround.
|
![]() |
Note |
---|---|
The former bug can probably be worked around by applying a patch to Boost.ResultOf.
|
<pstade/result_of.hpp>
Valid expression |
Semantics |
---|---|
|
|
BOOST_MPL_HAS_XXX_TRAIT_DEF
,
which Boost.ResultOf
and Boost.Lambda depend
on, sometimes fails to work under the msvc compilers. When you see a weird
error message such that "nested sig
template is undefined" or "nested result
template is undefined", use this header.
![]() |
Note |
---|---|
This bug can probably be worked around by applying a patch to Boost.Lambda and Boost.ResultOf.
|
Valid expression |
Semantics |
---|---|
|
A msvc workaround for |
<pstade/detect_result_type.hpp>
must be included before any Boost headers.
Under GCC 3.4.x, when you overload call
in Little Function with
the same arity, the following workaround is needed.
<pstade/egg/deduced_form.hpp>
Valid expression |
Semantics |
---|---|
|
A type |
struct little_foo {typedef deduced_form call_strategy; template<class Myself, class A1> struct apply { typedef A1 &type; };
template<class Result, class A1> Result call(boost::type<Result>, A1 &a1) const { return a1; } template<class Result, class A1> Result call(boost::type<Result>, A1 const &a1) const { return a1; } }; typedef function<little_foo> T_foo;
![]() |
Note |
---|---|
You can also use Boost.EnableIf instead.
|
Under msvc-8.0, boost::mpl::apply<PlaceholderExpression,..>
randomly fails at the instantiation
process in boost::result_of
. So that, deferred
that depends on boost::mpl::apply
needs a workaround.
<pstade/egg/deferred.hpp>
Valid expression |
Semantics |
---|---|
|
|
|
|
typename
to this macro.
When you define a Function Object in namespace scope, GCC might show unused variable warnings without this macro.
![]() |
Note |
---|---|
Strictly speaking, a const-qualified object in namespace scope incurs ODR(One Definition Rule) violation. Though a conforming workaround is found, even GCC can't do the right thing around address constant expression. Anyway, it is unlikely for this violation to cause significant problem.
|
<pstade/egg/const.hpp>
Valid expression |
Semantics |
---|---|
|
|
F
is a POD
type which is not cv-qualified.
PSTADE_EGG_CONST((T_foo), foo) = &foo_impl;
Copyright © 2007 Shunsuke Sogame |