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

Class template quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y>

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

Class template quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y>

boost::units::quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y>

Synopsis

// In header: <boost/units/quantity.hpp>
template<typename System, typename Y> 
class quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> {
public:
  // types
  typedef quantity< unit< dimensionless_type, System >, Y > this_type;     
  typedef Y                                                 value_type;    
  typedef System                                            system_type;   
  typedef dimensionless_type                                dimension_type;
  typedef unit< dimension_type, system_type >               unit_type;     
  // construct/copy/destruct
  quantity();
  quantity(value_type);
  quantity(const this_type &);
  template<typename YY> 
    quantity(const quantity< unit< dimension_type, system_type >, YY > &, 
             unspecified = 0);
  template<typename YY> 
    explicit quantity(const quantity< unit< dimension_type, system_type >, YY > &, 
                      unspecified = 0);
  template<typename System2, typename Y2> 
    quantity(const quantity< unit< dimensionless_type, System2 >, Y2 > &, 
             unspecified = 0, unspecified = 0, unspecified = 0);
  template<typename System2, typename Y2> 
    explicit quantity(const quantity< unit< dimensionless_type, System2 >, Y2 > &, 
                      unspecified = 0, unspecified = 0, unspecified = 0);
  template<typename System2, typename Y2> 
    explicit quantity(const quantity< unit< dimensionless_type, System2 >, Y2 > &, 
                      unspecified = 0);
  this_type & operator=(const this_type &);
  template<typename YY> 
    this_type & operator=(const quantity< unit< dimension_type, system_type >, YY > &);
  template<typename System2> 
    this_type & operator=(const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System2), Y > &);
  // public member functions
  operator value_type() const;
  const value_type & value() const;
  this_type & operator+=(const this_type &);
  this_type & operator-=(const this_type &);
  this_type & operator*=(const value_type &);
  this_type & operator/=(const value_type &);
  // public static functions
  static this_type from_value(const value_type &);
};

Description

Специализация для безразмерных величин. Допускаются неявные преобразования между единичными системами, поскольку все безразмерные величины эквивалентны. Также допускается неявное строительство и назначение из<value_type>и преобразование в<value_type>.

quantity public construct/copy/destruct

  1. <
    quantity();
    >
  2. <
    quantity(value_typeval);
    >Допускается строительство из сырья<value_type>
  3. <
    quantity(constthis_type&source);
    >
  4. <
    template<typenameYY>
     quantity(constquantity<unit<dimension_type,system_type>,YY>&source,
              unspecified=0);
    >Допускается неявное преобразование между типами ценностей, если допускается само преобразование типов ценностей.
  5. <
    template<typenameYY>
     explicitquantity(constquantity<unit<dimension_type,system_type>,YY>&source,
                       unspecified=0);
    >неявное преобразование между типами ценностей не допускается, если не допускается само по себе
  6. <
    template<typenameSystem2,typenameY2>
     quantity(constquantity<unit<dimensionless_type,System2>,Y2>&source,
              unspecified=0,unspecified=0,unspecified=0);
    >Допускается неявная конверсия между различными единичными системами.
  7. <
    template<typenameSystem2,typenameY2>
     explicitquantity(constquantity<unit<dimensionless_type,System2>,Y2>&source,
                       unspecified=0,unspecified=0,unspecified=0);
    >Допускается неявное преобразование между различными единичными системами.
  8. <
    template<typenameSystem2,typenameY2>
     explicitquantity(constquantity<unit<dimensionless_type,System2>,Y2>&source,
                       unspecified=0);
    >

    Преобразование между различными единичными системами является явным, когда единицы не эквивалентны.

  9. <
    this_type&operator=(constthis_type&source);
    >
  10. <
    template<typenameYY>
     this_type&operator=(constquantity<unit<dimension_type,system_type>,YY>&source);
    >Неявное присвоение между типами ценностей допускается, если допускается для самих типов ценностей.
  11. <
    template<typenameSystem2>
     this_type&operator=(constquantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System2),Y>&source);
    >допускается неявное назначение между различными единичными системами

quantity public member functions

  1. <
    operatorvalue_type()const;
    >Неявное преобразование в<value_type>допускается
  2. <
    constvalue_type&value()const;
    >постоянный доступ к значению

    может добавить количество одного и того же типа, если добавить_typeof_helper::type конвертируется в value_type

  3. <
    this_type&operator+=(constthis_type&source);
    >может вычесть количество одного и того же типа, если вычесть_typeof_helper::type конвертируется в value_type
  4. <
    this_type&operator-=(constthis_type&source);
    >может умножить величину на скалярное значение_тип, если умножить_тип_helper::type конвертируется в значение_тип
  5. <
    this_type&operator*=(constvalue_type&val);
    >может разделить величину на скалярное значение_тип, если разделить_тип_помощника<значение_тип, значение_тип>::тип конвертируется в значение_тип
  6. <
    this_type&operator/=(constvalue_type&val);
    >

quantity public static functions

  1. <
    staticthis_typefrom_value(constvalue_type&val);
    >Построить количество непосредственно из<value_type>.

PrevUpHomeNext

Статья Class template quantity<BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y> раздела The Boost C++ Libraries BoostBook Documentation Subset Reference может быть полезна для разработчиков на c++ и boost.




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



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


реклама


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

Время компиляции файла: 2024-08-30 11:47:00
2025-07-04 14:32:09/0.0045490264892578/0