Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::xpressive::reference< T > Struct Template Reference

reference<> is a lazy wrapper for a reference that can be used in xpressive semantic actions. More...

#include <xpressive_fwd.hpp>

Inheritance diagram for boost::xpressive::reference< T >:
Collaboration diagram for boost::xpressive::reference< T >:

Public Types

typedef proto::extends
< typename proto::terminal
< reference_wrapper< T >
>::type, reference< T > > 
base_type
 INTERNAL ONLY. More...
 

Public Member Functions

 reference (T &t)
 Store a reference to t. More...
 
Tget () const
 Fetch the stored value. More...
 

Detailed Description

template<typename T>
struct boost::xpressive::reference< T >

reference<> is a lazy wrapper for a reference that can be used in xpressive semantic actions.

Template Parameters
TThe type of the referent.

Here is an example of how to use reference<> to create a lazy reference to an existing object so it can be read and written in an xpressive semantic action.

using namespace boost::xpressive;
std::map<std::string, int> result;
// Match a word and an integer, separated by =>,
// and then stuff the result into a std::map<>
sregex pair = ( (s1= +_w) >> "=>" >> (s2= +_d) )
[ result_ref[s1] = as<int>(s2) ];

Member Typedef Documentation

template<typename T >
typedef proto::extends<typename proto::terminal<reference_wrapper<T> >::type, reference<T> > boost::xpressive::reference< T >::base_type

INTERNAL ONLY.

Constructor & Destructor Documentation

template<typename T >
boost::xpressive::reference< T >::reference ( T t)
inlineexplicit

Store a reference to t.

Parameters
tReference to object

Member Function Documentation

template<typename T >
T& boost::xpressive::reference< T >::get ( ) const
inline

Fetch the stored value.

References boost::proto::value().


The documentation for this struct was generated from the following file: