LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
util::quantities::concepts::Interval< Q, Cat > Struct Template Reference

An interval (duration, length, distance) between two quantity points. More...

#include "intervals.h"

Inheritance diagram for util::quantities::concepts::Interval< Q, Cat >:
util::quantities::concepts::details::WithCategory< Cat >

Public Types

using category_base_t = details::WithCategory< Cat >
 
using traits_t = typename category_base_t::traits_t
 Traits of the category. More...
 
template<typename OC , typename Type = void>
using enable_if_compatible_t = std::enable_if_t< category_base_t::template category_compatible_with< OC >(), Type >
 
using interval_t = Interval< Q, Cat >
 This type. More...
 
Types from the base quantity
using quantity_t = Q
 Quantity the interval is based on. More...
 
using category_t = typename category_base_t::category_t
 Quantity the interval is based on. More...
 
template<typename R >
using scaled_quantity_t = rescale< quantity_t, R >
 A quantity in the same unit, but possibly a different scale. More...
 
using value_t = typename quantity_t::value_t
 Type of the stored value. More...
 
using unit_t = typename quantity_t::unit_t
 Description of the scaled unit. More...
 
using baseunit_t = typename quantity_t::baseunit_t
 Description of the unscaled unit. More...
 
template<typename OQ , typename OI >
using other_interval_t = Interval< OQ, category_t >
 An interval based on a different quantity but with the same category. More...
 

Public Member Functions

 Interval ()=default
 Constructor: value is left uninitialized. More...
 
constexpr Interval (value_t v)
 Constructor: takes a value in the intended representation. More...
 
template<typename... Args>
constexpr Interval (Quantity< Args... > const &q)
 Constructor: converts from a quantity. More...
 
template<typename IV , typename std::enable_if_t< is_interval_v< IV >> * = nullptr>
constexpr Interval (IV iv)
 Constructor: converts from another interval. More...
 
constexpr quantity_t const & quantity () const
 Returns the value of the interval as a quantity. More...
 
constexpr operator value_t () const
 Conversion to the base quantity. More...
 
template<typename IV >
constexpr IV convertInto () const
 Convert this interval into the specified one. More...
 
Asymmetric operand arithmetic operations

These arithmetic operations take care of preserving the interval unit through them. Not all possible (or reasonable) operations are supported yet. Some operations that may be symmetric (like multiplication by a scalar) are implemented as free functions rather than methods.

Note
These operations are essentially provided by convenience. There are many cases (corner and not) where the implicit conversion to the base type kicks in. This implementation does not aim to prevent that from happening, but requests are welcome to add features to allow that not to happen, with some care of the user.
The addition and subtraction of intervals is conceptually symmetric. This leaves open the question whether the result of a + b should be of the type of a or the one of b, and whether having b + a of a different type than a + b is acceptable. Here we decide it's not, and therefore the operation a + b (and a - b as well) are supported only if a and b have the same type. On the other end, if either a or b are not an interval but rather a simple quantity, it is clear that the result must still be an interval and of the same type as the interval operand. We are in this case allowed to accept quantities of any unit scale.
constexpr interval_t operator+ (interval_t const other) const
 
constexpr interval_t operator- (interval_t const other) const
 
template<typename OQ , typename OC >
constexpr enable_if_compatible_t< Interval< OQ, OC >, value_toperator/ (Interval< OQ, OC > const denom) const
 Division by an interval, returns a pure number. More...
 
template<typename R >
interval_toperator+= (scaled_quantity_t< R > const other)
 Add a quantity (possibly converted) to this one. More...
 
template<typename OQ , typename OC >
enable_if_compatible_t< Interval< OQ, OC >, interval_t & > operator+= (Interval< OQ, OC > const other)
 Add the other interval (possibly converted) to this one. More...
 
template<typename R >
interval_toperator-= (scaled_quantity_t< R > const other)
 Subtract a quantity (possibly converted) from this one. More...
 
template<typename OQ , typename OC >
enable_if_compatible_t< Interval< OQ, OC >, interval_t & > operator-= (Interval< OQ, OC > const other)
 Subtract the other interval (possibly converted) from this one. More...
 
template<typename T >
interval_toperator*= (T factor)
 Scale this interval by a factor. More...
 
template<typename T >
interval_toperator/= (T factor)
 Scale the interval dividing it by a quotient. More...
 
constexpr interval_t operator+ () const
 Returns an interval with same value. More...
 
constexpr interval_t operator- () const
 Returns an interval with same value but the sign flipped. More...
 
constexpr interval_t abs () const
 Returns an interval with the absolute value of this one. More...
 
Comparisons.

Comparisons with plain numbers are managed by implicit conversion. More care is needed for quantities. Comparisons between two quantity instances a and b work this way:

  • if a and b do not have the same unit, they are not comparable
  • if a and b have the same unit, one is converted to the other and the comparison is performed there
  • if a and b have the same scaled unit, their values are compared directly

Value storage types are compared according to C++ rules.

template<typename OQ , typename OC >
constexpr enable_if_compatible_t< Interval< OQ, OC >, bool > operator== (Interval< OQ, OC > const other) const
 
template<typename OQ , typename OC >
constexpr enable_if_compatible_t< Interval< OQ, OC >, bool > operator!= (Interval< OQ, OC > const other) const
 
template<typename OQ , typename OC >
constexpr enable_if_compatible_t< Interval< OQ, OC >, bool > operator>= (Interval< OQ, OC > const other) const
 
template<typename OQ , typename OC >
constexpr enable_if_compatible_t< Interval< OQ, OC >, bool > operator> (Interval< OQ, OC > const other) const
 
template<typename OQ , typename OC >
constexpr enable_if_compatible_t< Interval< OQ, OC >, bool > operator<= (Interval< OQ, OC > const other) const
 
template<typename OQ , typename OC >
constexpr enable_if_compatible_t< Interval< OQ, OC >, bool > operator< (Interval< OQ, OC > const other) const
 

Static Public Member Functions

template<typename U >
static interval_t castFrom (U value)
 Returns a new interval initialized with the specified value. More...
 
static constexpr category_t category ()
 Returns an instance of the category of this object. More...
 
static constexpr bool hasCategoryName ()
 Returns whether this category has a name. More...
 
static std::string categoryName ()
 Returns the name of the category of this object. More...
 
Access to the scaled unit.
template<typename OU >
static constexpr bool sameBaseUnitAs ()
 Returns whether objects of type OU have the same base unit as this. More...
 
template<typename OU >
static constexpr bool sameUnitAs ()
 Returns whether objects of type OU have same unit and scale as this. More...
 
template<typename OC >
static constexpr bool same_category_as ()
 Returns whether the type OC belongs to category_t. More...
 
template<typename OC >
static constexpr bool same_category_as (OC const &)
 Returns whether the type OC belongs to category_t. More...
 
template<typename OC >
static constexpr bool category_compatible_with ()
 Returns whether OC has a category compatible with this one. More...
 
template<typename OC >
static constexpr bool category_compatible_with (OC const &)
 Returns whether OC has a category compatible with this one. More...
 

Detailed Description

template<typename Q, typename Cat = NoCategory>
struct util::quantities::concepts::Interval< Q, Cat >

An interval (duration, length, distance) between two quantity points.


Template Parameters
Qquantity the interval is based on

An interval shares most of the concepts of a Quantity, but it interacts only with other intervals rather than with bare Quantity objects, with the exception of construction. In this sense, the relation between Interval and Quantity is similar to the one between Quantity and its base type (Quantity::value_t).

In addition, an interval can be added to a quantity point (Point) to translate it, and it can be obtained as difference between two quantity points.

Definition at line 106 of file intervals.h.

Member Typedef Documentation

template<typename Q, typename Cat = NoCategory>
using util::quantities::concepts::Interval< Q, Cat >::baseunit_t = typename quantity_t::baseunit_t

Description of the unscaled unit.

Definition at line 140 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
using util::quantities::concepts::Interval< Q, Cat >::category_base_t = details::WithCategory<Cat>

Definition at line 108 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
using util::quantities::concepts::Interval< Q, Cat >::category_t = typename category_base_t::category_t

Quantity the interval is based on.

The category this point belongs to.

Definition at line 127 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
template<typename OC , typename Type = void>
using util::quantities::concepts::Interval< Q, Cat >::enable_if_compatible_t = std::enable_if_t<category_base_t::template category_compatible_with<OC>(), Type>

Definition at line 115 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
using util::quantities::concepts::Interval< Q, Cat >::interval_t = Interval<Q, Cat>

This type.

Definition at line 118 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OI >
using util::quantities::concepts::Interval< Q, Cat >::other_interval_t = Interval<OQ, category_t>

An interval based on a different quantity but with the same category.

Definition at line 144 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
using util::quantities::concepts::Interval< Q, Cat >::quantity_t = Q

Quantity the interval is based on.

The category this point belongs to.

Definition at line 124 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
template<typename R >
using util::quantities::concepts::Interval< Q, Cat >::scaled_quantity_t = rescale<quantity_t, R>

A quantity in the same unit, but possibly a different scale.

Definition at line 131 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
using util::quantities::concepts::Interval< Q, Cat >::traits_t = typename category_base_t::traits_t

Traits of the category.

Definition at line 111 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
using util::quantities::concepts::Interval< Q, Cat >::unit_t = typename quantity_t::unit_t

Description of the scaled unit.

Definition at line 137 of file intervals.h.

template<typename Q, typename Cat = NoCategory>
using util::quantities::concepts::Interval< Q, Cat >::value_t = typename quantity_t::value_t

Type of the stored value.

Definition at line 134 of file intervals.h.

Constructor & Destructor Documentation

template<typename Q, typename Cat = NoCategory>
util::quantities::concepts::Interval< Q, Cat >::Interval ( )
explicitdefault

Constructor: value is left uninitialized.

template<typename Q, typename Cat = NoCategory>
constexpr util::quantities::concepts::Interval< Q, Cat >::Interval ( value_t  v)
inlineexplicit

Constructor: takes a value in the intended representation.

Definition at line 155 of file intervals.h.

155 : Interval(quantity_t{v}) {}
Interval()=default
Constructor: value is left uninitialized.
Q quantity_t
Quantity the interval is based on.
Definition: intervals.h:124
template<typename Q, typename Cat = NoCategory>
template<typename... Args>
constexpr util::quantities::concepts::Interval< Q, Cat >::Interval ( Quantity< Args... > const &  q)
inline

Constructor: converts from a quantity.

Template Parameters
OQtype of the quantity
Parameters
qquantity to be converted from

The quantity is required to be in the same unit as this interval (unit scale may differ). The value in q is converted from its native scale into the one of this interval.

Definition at line 168 of file intervals.h.

168  : quantity_t(quantity_t{q})
169  {}
Q quantity_t
Quantity the interval is based on.
Definition: intervals.h:124
template<typename Q, typename Cat = NoCategory>
template<typename IV , typename std::enable_if_t< is_interval_v< IV >> * = nullptr>
constexpr util::quantities::concepts::Interval< Q, Cat >::Interval ( IV  iv)
inline

Constructor: converts from another interval.

Template Parameters
Itype of the other interval
Parameters
ivinterval to be converted from

Intervals are required to be in the same unit (unit scale may differ). The value in iv is converted from its native scale into the one of this interval.

Definition at line 181 of file intervals.h.

181  : Interval(quantity_t{iv.quantity()})
182  {}
Interval()=default
Constructor: value is left uninitialized.
Q quantity_t
Quantity the interval is based on.
Definition: intervals.h:124

Member Function Documentation

template<typename Q, typename Cat = NoCategory>
constexpr interval_t util::quantities::concepts::Interval< Q, Cat >::abs ( ) const
inline

Returns an interval with the absolute value of this one.

Definition at line 336 of file intervals.h.

References util::quantities::concepts::Interval< Q, Cat >::abs().

Referenced by util::quantities::concepts::Interval< Q, Cat >::abs().

336 { return interval_t(quantity().abs()); }
Interval< Q, Cat > interval_t
This type.
Definition: intervals.h:118
constexpr quantity_t const & quantity() const
Returns the value of the interval as a quantity.
Definition: intervals.h:185
constexpr interval_t abs() const
Returns an interval with the absolute value of this one.
Definition: intervals.h:336
template<typename Q, typename Cat = NoCategory>
template<typename U >
static interval_t util::quantities::concepts::Interval< Q, Cat >::castFrom ( value)
inlinestatic

Returns a new interval initialized with the specified value.

Template Parameters
Utype to initialize the quantity with
Parameters
valuethe value to initialize the interval with
Returns
a new Interval object initialized with value

The value is cast into value_t via static_cast().

Definition at line 420 of file intervals.h.

References value.

421  {
422  return interval_t{static_cast<value_t>(value)};
423  }
Interval< Q, Cat > interval_t
This type.
Definition: intervals.h:118
double value
Definition: spectrum.C:18
typename quantity_t::value_t value_t
Type of the stored value.
Definition: intervals.h:134
template<typename Cat >
constexpr auto util::quantities::concepts::details::WithCategory< Cat >::category ( )
staticinherited

Returns an instance of the category of this object.

Definition at line 1190 of file intervals.h.

1191  {
1192  return {};
1193  }
template<typename Cat >
template<typename OC >
constexpr bool util::quantities::concepts::details::WithCategory< Cat >::category_compatible_with ( )
staticinherited

Returns whether OC has a category compatible with this one.

Definition at line 1213 of file intervals.h.

1214  {
1215  return traits_t::template compatible_with<category_of<OC>>();
1216  }
template<typename Cat >
template<typename OC >
constexpr bool util::quantities::concepts::details::WithCategory< Cat >::category_compatible_with ( OC const &  )
staticinherited

Returns whether OC has a category compatible with this one.

Definition at line 1220 of file intervals.h.

1221  {
1222  return category_compatible_with<OC>();
1223  }
template<typename Cat >
std::string util::quantities::concepts::details::WithCategory< Cat >::categoryName ( )
staticinherited

Returns the name of the category of this object.

Definition at line 1234 of file intervals.h.

1235  {
1236  return Cat::name();
1237  }
template<typename Q, typename Cat = NoCategory>
template<typename IV >
constexpr IV util::quantities::concepts::Interval< Q, Cat >::convertInto ( ) const
inline

Convert this interval into the specified one.

Definition at line 406 of file intervals.h.

407  {
408  return IV(*this);
409  }
template<typename Cat >
constexpr bool util::quantities::concepts::details::WithCategory< Cat >::hasCategoryName ( )
staticinherited

Returns whether this category has a name.

Definition at line 1227 of file intervals.h.

1228  {
1230  }
static constexpr bool has_name
Whether the category supports name() call.
Definition: intervals.h:1126
template<typename Q, typename Cat = NoCategory>
constexpr util::quantities::concepts::Interval< Q, Cat >::operator value_t ( ) const
inlineexplicit

Conversion to the base quantity.

Definition at line 191 of file intervals.h.

References value.

191 { return value(); }
double value
Definition: spectrum.C:18
template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OC >
constexpr enable_if_compatible_t<Interval<OQ, OC>, bool> util::quantities::concepts::Interval< Q, Cat >::operator!= ( Interval< OQ, OC > const  other) const
inline

Definition at line 367 of file intervals.h.

References util::quantities::concepts::operator!=(), and util::quantities::concepts::Interval< Q, Cat >::quantity().

369  {
370  return quantity_t::operator!=(other.quantity());
371  }
constexpr bool operator!=(Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
Definition: intervals.h:932
template<typename Q, typename Cat = NoCategory>
template<typename T >
interval_t& util::quantities::concepts::Interval< Q, Cat >::operator*= ( factor)
inline

Scale this interval by a factor.

Definition at line 315 of file intervals.h.

316  {
317  quantity_t::operator*=(factor);
318  return *this;
319  }
template<typename Q, typename Cat = NoCategory>
constexpr interval_t util::quantities::concepts::Interval< Q, Cat >::operator+ ( interval_t const  other) const
inline

Returns an interval sum of this and other (must have exactly the same unit and scale).

Definition at line 263 of file intervals.h.

References util::quantities::concepts::Interval< Q, Cat >::quantity().

264  {
265  return interval_t{quantity() + other.quantity()};
266  }
Interval< Q, Cat > interval_t
This type.
Definition: intervals.h:118
constexpr quantity_t const & quantity() const
Returns the value of the interval as a quantity.
Definition: intervals.h:185
template<typename Q, typename Cat = NoCategory>
constexpr interval_t util::quantities::concepts::Interval< Q, Cat >::operator+ ( ) const
inline

Returns an interval with same value.

Definition at line 330 of file intervals.h.

330 { return interval_t(quantity()); }
Interval< Q, Cat > interval_t
This type.
Definition: intervals.h:118
constexpr quantity_t const & quantity() const
Returns the value of the interval as a quantity.
Definition: intervals.h:185
template<typename Q, typename Cat = NoCategory>
template<typename R >
interval_t& util::quantities::concepts::Interval< Q, Cat >::operator+= ( scaled_quantity_t< R > const  other)
inline

Add a quantity (possibly converted) to this one.

Definition at line 285 of file intervals.h.

References lar::dump::operator+=().

286  {
288  return *this;
289  }
String & operator+=(String &s, VectorDumper< Vector > const &manip)
Appends a string rendering of a vector to the specified string.
Definition: DumpUtils.h:463
template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OC >
enable_if_compatible_t<Interval<OQ, OC>, interval_t&> util::quantities::concepts::Interval< Q, Cat >::operator+= ( Interval< OQ, OC > const  other)
inline

Add the other interval (possibly converted) to this one.

Definition at line 293 of file intervals.h.

References lar::dump::operator+=(), and util::quantities::concepts::Interval< Q, Cat >::quantity().

294  {
295  return operator+=(other.quantity());
296  }
interval_t & operator+=(scaled_quantity_t< R > const other)
Add a quantity (possibly converted) to this one.
Definition: intervals.h:285
template<typename Q, typename Cat = NoCategory>
constexpr interval_t util::quantities::concepts::Interval< Q, Cat >::operator- ( interval_t const  other) const
inline

Returns an interval difference of this and other (must have exactly the same unit and scale).

Definition at line 270 of file intervals.h.

References util::quantities::concepts::Interval< Q, Cat >::quantity().

271  {
272  return interval_t{quantity() - other.quantity()};
273  }
Interval< Q, Cat > interval_t
This type.
Definition: intervals.h:118
constexpr quantity_t const & quantity() const
Returns the value of the interval as a quantity.
Definition: intervals.h:185
template<typename Q, typename Cat = NoCategory>
constexpr interval_t util::quantities::concepts::Interval< Q, Cat >::operator- ( ) const
inline

Returns an interval with same value but the sign flipped.

Definition at line 333 of file intervals.h.

333 { return interval_t(-quantity()); }
Interval< Q, Cat > interval_t
This type.
Definition: intervals.h:118
constexpr quantity_t const & quantity() const
Returns the value of the interval as a quantity.
Definition: intervals.h:185
template<typename Q, typename Cat = NoCategory>
template<typename R >
interval_t& util::quantities::concepts::Interval< Q, Cat >::operator-= ( scaled_quantity_t< R > const  other)
inline

Subtract a quantity (possibly converted) from this one.

Definition at line 300 of file intervals.h.

301  {
302  quantity_t::operator-=(other);
303  return *this;
304  }
template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OC >
enable_if_compatible_t<Interval<OQ, OC>, interval_t&> util::quantities::concepts::Interval< Q, Cat >::operator-= ( Interval< OQ, OC > const  other)
inline

Subtract the other interval (possibly converted) from this one.

Definition at line 308 of file intervals.h.

References util::quantities::concepts::Interval< Q, Cat >::quantity().

309  {
310  return operator-=(other.quantity());
311  }
interval_t & operator-=(scaled_quantity_t< R > const other)
Subtract a quantity (possibly converted) from this one.
Definition: intervals.h:300
template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OC >
constexpr enable_if_compatible_t<Interval<OQ, OC>, value_t> util::quantities::concepts::Interval< Q, Cat >::operator/ ( Interval< OQ, OC > const  denom) const
inline

Division by an interval, returns a pure number.

Definition at line 277 of file intervals.h.

References util::quantities::concepts::Interval< Q, Cat >::quantity().

279  {
280  return quantity() / denom.quantity();
281  }
constexpr quantity_t const & quantity() const
Returns the value of the interval as a quantity.
Definition: intervals.h:185
template<typename Q, typename Cat = NoCategory>
template<typename T >
interval_t& util::quantities::concepts::Interval< Q, Cat >::operator/= ( factor)
inline

Scale the interval dividing it by a quotient.

Definition at line 323 of file intervals.h.

324  {
325  quantity_t::operator/=(factor);
326  return *this;
327  }
template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OC >
constexpr enable_if_compatible_t<Interval<OQ, OC>, bool> util::quantities::concepts::Interval< Q, Cat >::operator< ( Interval< OQ, OC > const  other) const
inline

Definition at line 395 of file intervals.h.

References util::quantities::concepts::operator<(), and util::quantities::concepts::Interval< Q, Cat >::quantity().

397  {
398  return quantity_t::operator<(other.quantity());
399  }
constexpr bool operator<(Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
Definition: intervals.h:956
template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OC >
constexpr enable_if_compatible_t<Interval<OQ, OC>, bool> util::quantities::concepts::Interval< Q, Cat >::operator<= ( Interval< OQ, OC > const  other) const
inline

Definition at line 388 of file intervals.h.

References util::quantities::concepts::operator<=(), and util::quantities::concepts::Interval< Q, Cat >::quantity().

390  {
391  return quantity_t::operator<=(other.quantity());
392  }
constexpr bool operator<=(Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
Definition: intervals.h:944
template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OC >
constexpr enable_if_compatible_t<Interval<OQ, OC>, bool> util::quantities::concepts::Interval< Q, Cat >::operator== ( Interval< OQ, OC > const  other) const
inline

Definition at line 360 of file intervals.h.

References util::quantities::concepts::operator==(), and util::quantities::concepts::Interval< Q, Cat >::quantity().

362  {
363  return quantity_t::operator==(other.quantity());
364  }
constexpr bool operator==(Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
Definition: intervals.h:920
template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OC >
constexpr enable_if_compatible_t<Interval<OQ, OC>, bool> util::quantities::concepts::Interval< Q, Cat >::operator> ( Interval< OQ, OC > const  other) const
inline

Definition at line 381 of file intervals.h.

References util::quantities::concepts::operator>(), and util::quantities::concepts::Interval< Q, Cat >::quantity().

383  {
384  return quantity_t::operator>(other.quantity());
385  }
constexpr bool operator>(Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
Definition: intervals.h:980
template<typename Q, typename Cat = NoCategory>
template<typename OQ , typename OC >
constexpr enable_if_compatible_t<Interval<OQ, OC>, bool> util::quantities::concepts::Interval< Q, Cat >::operator>= ( Interval< OQ, OC > const  other) const
inline

Definition at line 374 of file intervals.h.

References util::quantities::concepts::operator>=(), and util::quantities::concepts::Interval< Q, Cat >::quantity().

376  {
377  return quantity_t::operator>=(other.quantity());
378  }
constexpr bool operator>=(Quantity< Args... > const a, Point< Q, Cat, IV > const b) noexcept
Definition: intervals.h:968
template<typename Cat >
template<typename OC >
constexpr bool util::quantities::concepts::details::WithCategory< Cat >::same_category_as ( )
staticinherited

Returns whether the type OC belongs to category_t.

Definition at line 1198 of file intervals.h.

1199  {
1200  return details::has_category_v<OC> && std::is_same_v<typename OC::category_t, category_t>;
1201  } // WithCategory<>::same_category_as()
template<typename Cat >
template<typename OC >
constexpr bool util::quantities::concepts::details::WithCategory< Cat >::same_category_as ( OC const &  )
staticinherited

Returns whether the type OC belongs to category_t.

Definition at line 1205 of file intervals.h.

1206  {
1207  return same_category_as<OC>();
1208  }
template<typename Q, typename Cat = NoCategory>
template<typename OU >
static constexpr bool util::quantities::concepts::Interval< Q, Cat >::sameBaseUnitAs ( )
inlinestatic

Returns whether objects of type OU have the same base unit as this.

Definition at line 214 of file intervals.h.

215  {
216  return quantity_t::template sameBaseUnitAs<OU>();
217  }
template<typename Q, typename Cat = NoCategory>
template<typename OU >
static constexpr bool util::quantities::concepts::Interval< Q, Cat >::sameUnitAs ( )
inlinestatic

Returns whether objects of type OU have same unit and scale as this.

Definition at line 221 of file intervals.h.

222  {
223  return quantity_t::template sameUnitAs<OU>();
224  }

The documentation for this struct was generated from the following file: