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

Struct _byval

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 _byval

boost::proto::_byval — A unary callable PolymorphicFunctionObject that strips references and boost::reference_wrapper<> from its argument.

Synopsis

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

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

Description

Пример:

proto::terminal<int>::type i = {42};
int j = 67;
int k = proto::when<proto::_, proto::_byval(proto::_state)>()(i, boost::ref(j));
assert( 67 == k );

_byval public member functions

  1. <
    template<typenameT>Toperator()(Tconst&t)const;
    >

    Параметры:

    Параметры:

    <t>

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

    <t>

    Броски:

    Бросок не будет.
  2. <
    template<typenameT>
     Toperator()(boost::reference_wrapper<T>const&t)const;
    >

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


PrevUpHomeNext

Статья Struct _byval раздела 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 05:43:42/0.00472092628479/1