Loading...
Searching...
No Matches
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...

#include <one.H>

Inheritance diagram for one:

Public Types

typedef one value_type
 The value type.

Public Member Functions

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

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]

one ( )
inlineconstexprnoexcept

Default construct.

Definition at line 68 of file one.H.

References Foam::noexcept.

Referenced by geometricOneField::operator[](), operator[](), and oneFieldField::operator[]().

Here is the caller graph for this function:

◆ one() [2/2]

one ( Istream & )
inlineexplicitconstexprnoexcept

Construct from Istream consumes no content.

Definition at line 73 of file one.H.

Member Function Documentation

◆ operator label()

operator label ( ) const
inlineconstexprnoexcept

Return 1 for label.

Definition at line 79 of file one.H.

References Foam::noexcept.

◆ operator float()

operator float ( ) const
inlineconstexprnoexcept

Return 1 for float.

Definition at line 84 of file one.H.

References Foam::noexcept.

◆ operator double()

operator double ( ) const
inlineconstexprnoexcept

Return 1 for double.

Definition at line 89 of file one.H.

References Foam::noexcept.

◆ operator[]()

one operator[] ( const label ) const
inlinenoexcept

Component-wise or element-wise access returns one.

Definition at line 94 of file one.H.

References one().

Here is the call graph for this function:

The documentation for this class was generated from the following file:
  • src/OpenFOAM/primitives/traits/one.H