Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

>

>>

>

Struct template reference

Boost , The Boost C++ Libraries BoostBook Documentation Subset , Reference

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

Struct template reference

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

Synopsis

// In header: <boost/xpressive/xpressive_fwd.hpp>
template<typename T> 
struct reference : public proto::extends< proto::terminal< reference_wrapper< T > >::type, reference< T > >
{
  // construct/copy/destruct
  explicit reference(T &);
  // public member functions
  T & get() const;
};

Description

Вот пример того, как использовать reference<>, чтобы создать ленивую ссылку на существующий объект, чтобы его можно было прочитать и написать в хпрессивном семантическом действии.

using namespace boost::xpressive;
std::map<std::string, int> result;
reference<std::map<std::string, int> > result_ref(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) ];

Template Parameters

  1. имя  T

    Тип референта.

reference public construct/copy/destruct

>20>>Парам>>>

reference public member functions

  1. T & get() const;
    Получить сохраненное значение.

PrevUpHomeNext

Статья Struct template reference раздела The Boost C++ Libraries BoostBook Documentation Subset Reference может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Reference ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-20 07:02:29/0.0075638294219971/1