A PrimitiveTransform which prevents another PrimitiveTransform from being applied in an ObjectTransform.
More...
#include <make.hpp>


Classes | |
| struct | impl |
Public Types | |
| typedef protect < PrimitiveTransform > | transform_type |
Public Member Functions | |
| BOOST_PROTO_CALLABLE () typedef X proto_is_transform_ | |
| BOOST_FORCEINLINE boost::proto::detail::apply_transform < transform_type(Expr const &)> ::result_type | operator() (Expr &&e) const |
| BOOST_FORCEINLINE boost::proto::detail::apply_transform < transform_type(Expr const &, State const &)> ::result_type | operator() (Expr &&e, State &&s) const |
| BOOST_FORCEINLINE boost::proto::detail::apply_transform < transform_type(Expr const &, State const &, Data const &)> ::result_type | operator() (Expr &&e, State &&s, Data &&d) const |
A PrimitiveTransform which prevents another PrimitiveTransform from being applied in an ObjectTransform.
When building higher order transforms with make<> or lazy<>, you sometimes would like to build types that are parameterized with Proto transforms. In such lambda-style transforms, Proto will unhelpfully find all nested transforms and apply them, even if you don't want them to be applied. Consider the following transform, which will replace the _ in Bar<_>() with proto::terminal<int>::type:
If you actually wanted to default-construct an object of type Bar<_>, you would have to protect the _ to prevent it from being applied. You can use proto::protect<> as follows:
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |