Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template value

boost::xpressive::value — value<> is a lazy wrapper for a value that can be used in xpressive semantic actions.

Synopsis

// In header: <boost/xpressive/regex_actions.hpp>

template<typename T> 
struct value : public  {
  // construct/copy/destruct
  ();
  ();

  // public member functions
   ();
   () ;
};

Description

Below is an example that shows where value<> is useful.

sregex 

In the above code, xpressive::val() is a function that returns a value<> object. Had val() not been used here, the operation ++*pi would have been evaluated eagerly once, instead of lazily when the regex match happens.

Template Parameters

  1. typename T

    The type of the value to store.

value public construct/copy/destruct

  1. ();
    Store a default-constructed T.
  2. ( t);
    Store a copy of t.

    Parameters:

    t

    The initial value.

value public member functions

  1.  ();
    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
  2.  () ;
    Fetch the stored value.

PrevUpHomeNext