one Class Reference

A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to be one at compile-time. It is also used for tagged dispatch. More...

Inheritance diagram for one:

Public Types

typedef one value_type
 The value type. More...
 

Public Member Functions

constexpr one () noexcept
 Default construct. More...
 
constexpr one (Istream &) noexcept
 Construct from Istream consumes no content. More...
 
constexpr operator label () const noexcept
 Return 1 for label. More...
 
constexpr operator float () const noexcept
 Return 1 for float. More...
 
constexpr operator double () const noexcept
 Return 1 for double. More...
 
one operator[] (const label) const noexcept
 Component-wise or element-wise access returns one. More...
 

Detailed Description

A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to be one at compile-time. It is also used for tagged dispatch.

Source files
See also
Foam::zero

Definition at line 56 of file one.H.

Member Typedef Documentation

◆ value_type

typedef one value_type

The value type.

Definition at line 63 of file one.H.

Constructor & Destructor Documentation

◆ one() [1/2]

constexpr one ( )
inlinenoexcept

Default construct.

Definition at line 68 of file one.H.

◆ one() [2/2]

constexpr one ( Istream )
inlineexplicitnoexcept

Construct from Istream consumes no content.

Definition at line 73 of file one.H.

Member Function Documentation

◆ operator label()

constexpr operator label ( ) const
inlinenoexcept

Return 1 for label.

Definition at line 79 of file one.H.

◆ operator float()

constexpr operator float ( ) const
inlinenoexcept

Return 1 for float.

Definition at line 84 of file one.H.

◆ operator double()

constexpr operator double ( ) const
inlinenoexcept

Return 1 for double.

Definition at line 89 of file one.H.

◆ operator[]()

one operator[] ( const label  ) const
inlinenoexcept

Component-wise or element-wise access returns one.

Definition at line 94 of file one.H.


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