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

Class template quantity

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::quantity — class declaration

Synopsis

// In header: <boost/units/quantity.hpp>
template<typename Unit, typename Y> 
class quantity {
public:
  // types
  typedef quantity< Unit, Y > this_type; 
  typedef Y                   value_type;
  typedef Unit                unit_type; 
  // construct/copy/destruct
  quantity();
  quantity(unspecified_null_pointer_constant_type);
  quantity(const this_type &);
  template<typename YY> 
    quantity(const quantity< Unit, YY > &, unspecified = 0);
  template<typename YY> 
    explicit quantity(const quantity< Unit, YY > &, unspecified = 0);
  template<typename Unit2, typename YY> 
    explicit quantity(const quantity< Unit2, YY > &, unspecified = 0);
  template<typename Unit2, typename YY> 
    quantity(const quantity< Unit2, YY > &, unspecified = 0);
  explicit quantity(const value_type &, int);
  this_type & operator=(const this_type &);
  template<typename YY> this_type & operator=(const quantity< Unit, YY > &);
  template<typename Unit2, typename YY> 
    this_type & operator=(const quantity< Unit2, YY > &);
  // private member functions
   BOOST_MPL_ASSERT_NOT(unspecified);
  // public member functions
  const value_type & value() const;
  template<typename Unit2, typename YY> 
    this_type & operator+=(const quantity< Unit2, YY > &);
  template<typename Unit2, typename YY> 
    this_type & operator-=(const quantity< Unit2, YY > &);
  template<typename Unit2, typename YY> 
    this_type & operator*=(const quantity< Unit2, YY > &);
  template<typename Unit2, typename YY> 
    this_type & operator/=(const quantity< Unit2, YY > &);
  this_type & operator*=(const value_type &);
  this_type & operator/=(const value_type &);
  // public static functions
  static this_type from_value(const value_type &);
};

Description

quantity public construct/copy/destruct

  1. <
    quantity();
    >
  2. <
    quantity(unspecified_null_pointer_constant_type);
    >
  3. <
    quantity(constthis_type&source);
    >
  4. <
    template<typenameYY>
     quantity(constquantity<Unit,YY>&source,unspecified=0);
    >Допускается неявное преобразование между типами ценностей, если допускается само их преобразование.
  5. <
    template<typenameYY>
     explicitquantity(constquantity<Unit,YY>&source,unspecified=0);
    >Неявное преобразование между типами ценностей не допускается, если не допускается для самих типов ценностей.
  6. <
    template<typenameUnit2,typenameYY>
     explicitquantity(constquantity<Unit2,YY>&source,unspecified=0);
    >Допускается явное преобразование между различными единичными системами, если неявное преобразование запрещено.
  7. <
    template<typenameUnit2,typenameYY>
     quantity(constquantity<Unit2,YY>&source,unspecified=0);
    >Неявное преобразование между различными единичными системами допускается, если каждое фундаментальное измерение неявно конвертируемо.
  8. <
    explicitquantity(constvalue_type&val,int);
    >
  9. <
    this_type&operator=(constthis_type&source);
    >
  10. <
    template<typenameYY>
     this_type&operator=(constquantity<Unit,YY>&source);
    >неявное присвоение между типами ценностей допускается, если допускается для самих типов ценностей
  11. <
    template<typenameUnit2,typenameYY>
     this_type&operator=(constquantity<Unit2,YY>&source);
    >неявное назначение между различными единичными системами допускается, если каждое фундаментальное измерение неявно конвертируемо.

quantity private member functions

  1. <
    BOOST_MPL_ASSERT_NOT(unspecified);
    >

quantity public member functions

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

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

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

quantity public static functions

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

PrevUpHomeNext

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




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



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


реклама


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

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 21:49:33/0.0094420909881592/1