...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::proto::literal — A simple wrapper for a terminal, provided for ease of use.
// In header: <boost/proto/literal.hpp> template<typename T, typename Domain = proto::default_domain> struct literal : proto::extends<typename proto::terminal<T>::type, proto::literal<T, Domain>, Domain> { // types typedef typename proto::terminal<T>::type X; // For exposition only typedef typename proto::result_of::value<X>::type value_type; typedef typename proto::result_of::value<X &>::type reference; typedef typename proto::result_of::value<X const &>::type const_reference; // construct/copy/destruct literal(); template<typename U> literal(U &); template<typename U> literal(U const &); template<typename U> literal(proto::literal< U, Domain > const &); // public member functions reference get(); const_reference get() const; };
A simple wrapper for a terminal, provided for ease of use. In all cases,
proto::literal<X> l(x);
is equivalent to
proto::terminal<X>::type l = {x};
.
The Domain
template parameter defaults to
proto::default_domain
.
literal
public
construct/copy/destructliteral();
template<typename U> literal(U & u);
template<typename U> literal(U const & u);
template<typename U> literal(proto::literal< U, Domain > const & u);
literal
public member functionsreference get();
Returns: |
proto::value(*this) |
const_reference get() const;
Returns: |
proto::value(*this) |