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

Struct _byref

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 _byref

boost::proto::_byref — A unary callable PolymorphicFunctionObject that wraps its argument in a boost::reference_wrapper<>.

Synopsis

// In header: <boost/proto/transform/arg.hpp>

struct _byref :  proto::callable {
  // member classes/structs/unions
  template<typename This, typename T> 
  struct result<This(T &)> {
    // types
    typedef boost::reference_wrapper< T > const type;
  };
  template<typename This, typename T> 
  struct result<This(T)> {
    // types
    typedef boost::reference_wrapper< T const  > const type;
  };
  // public member functions
  template<typename T> 
    boost::reference_wrapper< T > const operator()(T &) const;
  template<typename T> 
    boost::reference_wrapper< T const > const operator()(T const &) const;
};

Description

Пример:

proto::terminal<int>::type i = {42};
boost::reference_wrapper<proto::terminal<int>::type> j
  = proto::when<proto::_, proto::_byref(_)>()(i);
assert( boost::addressof(i) == boost::addressof(j.get()) );

_byref public member functions

  1. <
    template<typenameT>
     boost::reference_wrapper<T>constoperator()(T&t)const;
    >

    Оберните параметр<t>в<boost::reference_wrapper<>>

    Параметры:

    <t>

    Возражение

    Возвращение:

    <boost::ref(t)>

    Броски:

    Не бросят.
  2. <
    template<typenameT>
     boost::reference_wrapper<Tconst>constoperator()(Tconst&t)const;
    >

    Это перегруженная функция члена, предусмотренная для удобства. Он отличается от вышеуказанной функции только тем, какие аргументы он принимает.


PrevUpHomeNext

Статья Struct _byref раздела 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 06:01:24/0.0059909820556641/0