Class template quantity Boost , The Boost C++ Libraries BoostBook Documentation Subset , Reference
Class template quantity
boost::units::quantity — class declaration
Synopsis
template < typename Unit, typename Y>
class quantity {
public :
typedef quantity < Unit , Y > this_type ;
typedef Y value_type ;
typedef Unit unit_type ;
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 > & ) ;
BOOST_MPL_ASSERT_NOT ( unspecified ) ;
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 & ) ;
static this_type from_value ( const value_type & ) ;
} ;
Description
quantity
public
construct/copy/destruct
<quantity ( ) ; >
<quantity ( unspecified_null_pointer_constant_type ) ; >
<quantity ( const this_type & source) ; >
<template < typename YY>
quantity ( const quantity < Unit , YY > & source, unspecified = 0 ) ; >Допускается неявное преобразование между типами ценностей, если допускается само их преобразование.
<template < typename YY>
explicit quantity ( const quantity < Unit , YY > & source, unspecified = 0 ) ; >Неявное преобразование между типами ценностей не допускается, если не допускается для самих типов ценностей.
<template < typename Unit2, typename YY>
explicit quantity ( const quantity < Unit2 , YY > & source, unspecified = 0 ) ; >Допускается явное преобразование между различными единичными системами, если неявное преобразование запрещено.
<template < typename Unit2, typename YY>
quantity ( const quantity < Unit2 , YY > & source, unspecified = 0 ) ; >Неявное преобразование между различными единичными системами допускается, если каждое фундаментальное измерение неявно конвертируемо.
<explicit quantity ( const value_type & val, int ) ; >
<this_type & operator = ( const this_type & source) ; >
<template < typename YY>
this_type & operator = ( const quantity < Unit , YY > & source) ; >неявное присвоение между типами ценностей допускается, если допускается для самих типов ценностей
<template < typename Unit2, typename YY>
this_type & operator = ( const quantity < Unit2 , YY > & source) ; >неявное назначение между различными единичными системами допускается, если каждое фундаментальное измерение неявно конвертируемо.
quantity
private member functions
<BOOST_MPL_ASSERT_NOT ( unspecified ) ; >
quantity
public member functions
<const value_type & value ( ) const ; >постоянный доступ к значениюможет добавить количество одного и того же типа, если добавить_typeof_helper::type конвертируется в value_type
<template < typename Unit2, typename YY>
this_type & operator += ( const quantity < Unit2 , YY > & source) ; >может вычесть количество одного и того же типа, если вычесть_typeof_helper::type конвертируется в value_type
<template < typename Unit2, typename YY>
this_type & operator -= ( const quantity < Unit2 , YY > & source) ; >
<template < typename Unit2, typename YY>
this_type & operator *= ( const quantity < Unit2 , YY > & source) ; >
<template < typename Unit2, typename YY>
this_type & operator /= ( const quantity < Unit2 , YY > & source) ; >может умножить величину на скалярное значение_тип, если умножить_тип_помощника::type конвертируется в значение_тип
<this_type & operator *= ( const value_type & source) ; >может разделить величину на скалярное значение_тип, если разделить_тип_помощника<значение_тип, значение_тип>::тип конвертируется в значение_тип
<this_type & operator /= ( const value_type & source) ; >
quantity
public static functions
<static this_type from_value ( const value_type & val) ; >Построить количество непосредственно из<value_type
>(потенциально опасно).
Статья Class template quantity раздела The Boost C++ Libraries BoostBook Documentation Subset Reference может быть полезна для разработчиков на c++ и boost.
Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.
:: Главная :: Reference ::