Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
std::plus< T > Class Template Reference

Function object for performing addition. More...

Public Types

using first_argument_type = T
 Type of the first value to add.
 
using result_type = T
 Result type of invoking this object.
 
using second_argument_type = T
 Type of the second value to add.
 

Public Member Functions

template<class U = T, arene::base::constraints< std::enable_if_t<!is_integral_v< U > > > = nullptr>
constexpr auto operator() (T const &lhs, T const &rhs) const noexcept(noexcept(std::declval< T & >()+std::declval< T & >())) -> T
 Returns the first value plus the second value.
 
template<class U = T, arene::base::constraints< std::enable_if_t< is_integral_v< U > > > = nullptr>
constexpr auto operator() (T const &lhs, T const &rhs) const noexcept(noexcept(std::declval< T >()+std::declval< T & >())) -> T
 Returns the first value plus the second value.
 

Detailed Description

template<class T = void>
class std::plus< T >

Function object for performing addition.

Template Parameters
TThe type of the values
Note
This class contains the member types result_type, first_argument type, and second_argument type. These aliases have been deprecated in C++17 and removed in C++20.

Member Typedef Documentation

◆ first_argument_type

template<class T = void>
using std::plus< T >::first_argument_type = T

Type of the first value to add.

◆ result_type

template<class T = void>
using std::plus< T >::result_type = T

Result type of invoking this object.

◆ second_argument_type

template<class T = void>
using std::plus< T >::second_argument_type = T

Type of the second value to add.

Member Function Documentation

◆ operator()() [1/2]

template<class T = void>
template<class U = T, arene::base::constraints< std::enable_if_t<!is_integral_v< U > > > = nullptr>
auto std::plus< T >::operator() ( T const & lhs,
T const & rhs ) const -> T
inlineconstexprnoexcept

Returns the first value plus the second value.

Template Parameters
UTemplate parameter to enable constraints.
Parameters
lhsThe first value to add
rhsThe second value to add
Returns
Returns the result of invoking operator+ on lhs and rhs

◆ operator()() [2/2]

template<class T = void>
template<class U = T, arene::base::constraints< std::enable_if_t< is_integral_v< U > > > = nullptr>
auto std::plus< T >::operator() ( T const & lhs,
T const & rhs ) const -> T
inlineconstexprnoexcept

Returns the first value plus the second value.

Template Parameters
UTemplate parameter to enable constraints.
Parameters
lhsThe first value to add
rhsThe second value to add
Returns
Returns the result of invoking operator+ on lhs and rhs
Note
This overload explicitly casts the result of the computation to the type T. This avoids any warning for implicit conversion (present on gcc8).

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