std::divides
提供: cppreference.com
< cpp | utility | functional
ヘッダ <functional> で定義 | ||
template<class T > struct divides; | (C++14未満) | |
template<class T =void> struct divides; | (C++14以上) | |
除算を行うための関数オブジェクト。 実質的に T
型の2つのインスタンスに対して operator/ を呼びます。
目次 |
[編集]特殊化
標準ライブラリは
| (C++14以上) |
メンバ型
| (C++20未満) |
[編集]メンバ関数
operator() | 第1引数を第2引数で割った結果を返します (パブリックメンバ関数) |
std::divides::operator()
T operator()(const T& lhs, const T& rhs )const; | (C++14未満) | |
constexpr T operator()(const T& lhs, const T& rhs )const; | (C++14以上) | |
lhs
を rhs
で割った結果を返します。
引数
lhs, rhs | - | 除算する値 |
戻り値
lhs / rhs の結果。
例外
(なし)
実装例
constexpr T operator()(const T &lhs, const T &rhs)const{return lhs / rhs;} |