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

Function object for performing multiplication. More...

Public Types

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

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 multiplied by 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 multiplied by second value.
 

Detailed Description

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

Function object for performing multiplication.

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::multiplies< T >::first_argument_type = T

Type of the first value to multiply.

◆ result_type

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

Result type of invoking this object.

◆ second_argument_type

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

Type of the second value to multiply.

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::multiplies< T >::operator() ( T const & lhs,
T const & rhs ) const -> T
inlineconstexprnoexcept

Returns the first value multiplied by second value.

Template Parameters
UTemplate parameter to enable constraints.
Parameters
lhsThe first value to multiply
rhsThe second value to multiply
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::multiplies< T >::operator() ( T const & lhs,
T const & rhs ) const -> T
inlineconstexprnoexcept

Returns the first value multiplied by second value.

Template Parameters
UTemplate parameter to enable constraints.
Parameters
lhsThe first value to multiply
rhsThe second value to multiply
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: