Struct _byval
boost::proto::_byval —
A unary callable PolymorphicFunctionObject that strips references and
boost::reference_wrapper<> from its argument.
Synopsis
struct _byval : proto::callable {
template<typename This, typename T>
struct result<This(boost::reference_wrapper< T >)> : result<This(T)> {
};
template<typename This, typename T>
struct result<This(T &)> : result<This(T)> {
};
template<typename This, typename T>
struct result<This(T)> {
typedef T type;
};
template<typename T> T operator()(T const &) const;
template<typename T>
T operator()(boost::reference_wrapper< T > const &) const;
};
Description
Пример:
proto::terminal<int>::type i = {42};
int j = 67;
int k = proto::when<proto::_, proto::_byval(proto::_state)>()(i, boost::ref(j));
assert( 67 == k );
_byval public member functions
- <
template<typenameT>Toperator()(Tconst&t)const;
>Параметры: | |
Возвращение: | <t> |
Броски: | Бросок не будет. |
- <
template<typenameT>
Toperator()(boost::reference_wrapper<T>const&t)const;
>Это перегруженная функция члена, предусмотренная для удобства. Он отличается от вышеуказанной функции только тем, какие аргументы он принимает.