Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Macro BOOST_PROTO_AUTO

BOOST_PROTO_AUTO — For defining a local variable that stores a Proto expression template, deep-copying the expression so there are no dangling references.

Synopsis

// In header: <boost/proto/proto_typeof.hpp>

BOOST_PROTO_AUTO(Var, Expr)

Description

To define a local variable ex that stores the expression proto::lit(1) + 2, do the following:

BOOST_PROTO_AUTO( ex, proto::lit(1) + 2 );

. The above is equivalent to the following:

BOOST_AUTO( ex, proto::deep_copy( proto::lit(1) + 2 ) );


PrevUpHomeNext