Last active
August 29, 2015 13:56
-
-
Save bolero-MURAKAMI/9283758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C++1y標準ライブラリ関数のconstexpr指定の検討 | |
Auther: Bolero MURAKAMI | |
URL: https://gist.github.com/bolero-MURAKAMI/9283758 | |
* モチベーション | |
C++14 では、constexpr関数の制限緩和をはじめとして、constexprについて多くの機能が強化・改善された。 | |
参考: C++14 constexpr関数の制限緩和(Faith and Brave - C++で遊ぼう) http://faithandbrave.hateblo.jp/entry/20131119/1384837618 | |
しかしながら、標準ライブラリ関数は、constexpr指定できるにもかかわらず、指定されていないものが未だ多く残されている。 | |
本テキストでは、次期C++1yに向けて、新たにconstexpr指定すべき標準ライブラリ関数を洗い出すものである。 | |
なお、現時点での最新の Working Draft は N3936(2014-03-02)( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3936.pdf ) である。 | |
よって、N3936 で未だconstexpr指定されていない関数を対象として検討する。 | |
ところで、標準ライブラリのnoexcept指定については、明確な指針が存在する。 | |
N3279 Conservative use of noexcept in the Library( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3279.pdf ) | |
しかし、constexpr指定については、そのような全般的な指針を設けることはできないと思われる。 | |
なぜならば、noexcept指定は、関数本体の実装詳細に制限をもたらさないが、constexpr指定は、実装に制限をもたらす。 | |
そのため、constexpr指定によって実装上の問題が生じないか、constexpr指定の妥当性については、個別に検討する必要がある。 | |
* 妥当性 | |
constexpr指定することが妥当であるかを、妥当性1~5 で評価する。 | |
妥当性1 が一番高く、妥当性5 が一番低い。 | |
1: 想定されるほとんどの実装でconstexpr指定できる。 | |
(例えば、std::swap) | |
規格でconstexpr指定すべき。 | |
2: 典型的な実装でconstexpr指定できる。 | |
(例えば、std::pair::pair(piecewise_construct_t, tuple<Args1...>, tuple<Args2...>)) | |
とくに反例がなければ規格でconstexpr指定すべき。 | |
3: 容易な実装でconstexpr指定できるが、実装のシンプルさを損ねるおそれがある。 | |
(例えば、std::char_traits::findは、単純なforループで実装できるが、constexpr指定すると、標準ライブラリの非constexprアルゴリズムで実装することができない) | |
規格でconstexpr指定するには検討が必要。 | |
4: 限定的な実装ではconstexpr指定できるが、実装の自由度を制限する。 | |
(例えば、std::findは、単純なforループで実装できるが、constexpr指定すると、イテレータについて独自の実行時アサーションを入れるといった実装を阻害する) | |
規格でconstexpr指定するのは適切とは言い難い。 | |
5: いくつかの実装ではconstexpr指定できるが、一般に困難もしくはパフォーマンスの問題がある、または自由度を著しく制限する。 | |
(例えば、std::sortは、constexprの要件を満たすように実装できるが、困難であり、placement newによる最適化といった実装も阻害する) | |
規格でconstexpr指定すべきでない。 | |
X: constexprであるべき妥当性はあるが、コンパイラーマジックを必要とする。 | |
(例えば、std::cosは、constexprな組み込み関数がなければ非常に低速である) | |
* 具体的基準 | |
コピー/ムーブコンストラクタがconstexprであるようなクラス(またはクラステンプレート)について、 | |
コピー/ムーブ代入演算子、および自身と同じクラステンプレートのインスタンスを引数に取る変換代入演算子は、constexpr指定すべきである。 | |
例: | |
X<T>::operator=(const X<T>&) (妥当性1) | |
X<T>::operator=(X<T>&&) (妥当性1) | |
X<T>::operator=(const X<U>&) (妥当性1) | |
X<T>::operator=(X<U>&&) (妥当性1) | |
std::tuple, std::pair, std::complexなど。 | |
理由: | |
スカラー型のような組込のリテラル型や、リテラル型の単純なホルダーにおいて、コピー/ムーブ代入演算子はconstexprの要件を満たす。 | |
それらと同水準に単純なクラスも、対称性のため、constexpr指定すべきである。 | |
また、コピー/ムーブコンストラクタがconstexprの要件を満たす以上、コピー/ムーブ代入演算子が要件を満たさない実装はまず考えられない。 | |
参考: | |
N3936( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3936.pdf )より | |
§12.8-13 | |
If the implicitly-defined constructor would satisfy the requirements of a constexpr constructor (7.1.5), the implicitly-defined constructor is constexpr. | |
暗黙に定義されたコンストラクタが、constexprコンストラクタ(7.1.5)の要件を満たすのであれば、暗黙に定義されたコンストラクタは、constexprである。 | |
§12.8-26 | |
The implicitly-defined copy/move assignment operator is constexpr if | |
― X is a literal type, and | |
― the assignment operator selected to copy/move each direct base class subobject is a constexpr function, and | |
― for each non-static data member of X that is of class type (or array thereof), the assignment operator selected to copy/move that member is a constexpr function. | |
暗黙に定義されたコピー/ムーブ代入演算子が、もし次の条件を満たすならば、constexprである。 | |
― Xがリテラル型であり、 | |
― 直接基底クラスのサブオブジェクトの対応するコピー/ムーブ代入演算子がconstexpr関数であり、 | |
― クラス型(またはその配列)であるようなXの非staticデータメンバのそれぞれに対して、そのメンバの対応するコピー/ムーブ代入演算子がconstexpr関数である。 | |
仕様上、constexprの要件を満たすと考えられる小さなユーティリティ関数は、constexpr指定すべきである。 | |
例: | |
std::rel_ops (妥当性1) | |
std::swap (妥当性1) | |
理由: | |
std::forwardやstd::make_tupleのような、C++11のconstexprの要件を満たす小さなユーティリティ関数は、C++14で既にconstexpr指定されている。・ | |
C++14のconstexprの要件を満たすものも、同様にconstexpr指定すべきである。 | |
単純なgetterとして作用するメンバ関数で、const版のオーバーロードがconstexpr指定されている場合、非const版のオーバーロードも同様に、constexpr指定すべきである。 | |
例: | |
std::array::front() (妥当性1) | |
std::array::back() (妥当性1) | |
std::array::at(size_type) (妥当性1) | |
std::array::operator[](size_type) (妥当性1) | |
理由: | |
N3598 constexpr member functions and implicit const( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3598.html ) | |
より、非const版のオーバーロードをconstexpr指定できない理由はない。 | |
対称性のため、constexpr指定すべきである。 | |
* 提案 | |
ここで妥当性1 と評価したものについては、C++1yにおいてconstexpr指定されるよう提案すべきである。 | |
* ライブラリ | |
<utility> | |
std::rel_ops (妥当性1) | |
実質的に他の演算に転送するのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/utility/rel_ops.hpp#L14 | |
std::swap (妥当性1) | |
ムーブコンストラクトとムーブ代入、および配列版の場合は各要素へのループのみ。 | |
ただし、配列版は Effects が swap_ranges で表現されていることが問題になるかもしれない。 | |
参考実装: (swap_impl) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/utility/swap.hpp#L23 | |
std::exchange (妥当性1) | |
ムーブコンストラクトと代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/utility/exchange.hpp#L21 | |
std::pair::pair(piecewise_construct_t, tuple<Args1...>, tuple<Args2...>) (妥当性2) | |
index sequence と転送コンストラクタで実装すれば各要素のコンストラクタ呼出のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/utility/pair/pair.hpp#L39 | |
std::pair::operator=(const pair&) (妥当性1) | |
std::pair::operator=(const pair<U, V>&) (妥当性1) | |
各要素の代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/utility/pair/pair_decl.hpp#L105 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/utility/pair/pair_decl.hpp#L123 | |
std::pair::operator=(pair&&) (妥当性1) | |
std::pair::operator=(pair<U, V>&&) (妥当性1) | |
各要素のムーブ代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/utility/pair/pair_decl.hpp#L110 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/utility/pair/pair_decl.hpp#L134 | |
std::pair::swap(pair&) (妥当性1) | |
各要素の swap のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/utility/pair/pair_decl.hpp#L154 | |
<tuple> | |
std::swap(tuple<Types...>&, tuple<Types...>&) (妥当性1) | |
各要素の swap のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/tuple/tuple/tuple_decl.hpp#L490 | |
std::tuple::operator=(const tuple&) (妥当性1) | |
std::tuple::operator=(const tuple<UTypes...>&) (妥当性1) | |
std::tuple::operator=(const pair<U1, U2>&) (妥当性1) | |
各要素の代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/tuple/tuple/tuple_decl.hpp#L445 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/tuple/tuple/tuple_decl.hpp#L461 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/tuple/tuple/tuple.hpp#L63 | |
std::tuple::operator=(tuple&&) (妥当性1) | |
std::tuple::operator=(tuple<UTypes...>&&) (妥当性1) | |
std::tuple::operator=(pair<U1, U2>&&) (妥当性1) | |
各要素のムーブ代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/tuple/tuple/tuple_decl.hpp#L449 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/tuple/tuple/tuple_decl.hpp#L471 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/tuple/tuple/tuple.hpp#L74 | |
std::tuple::swap(tuple&) (妥当性1) | |
各要素の swap のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/tuple/tuple/tuple_decl.hpp#L490 | |
<bitset> | |
std::operator&(const bitset<N>&, const bitset<N>&) (妥当性1) | |
std::operator|(const bitset<N>&, const bitset<N>&) (妥当性1) | |
std::operator^(const bitset<N>&, const bitset<N>&) (妥当性1) | |
各ビットをビット演算するループのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitwise.hpp#L20 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitwise.hpp#L25 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitwise.hpp#L30 | |
std::bitset::reference::operator=(bool) (妥当性1) | |
std::bitset::reference::operator=(const reference&) (妥当性1) | |
ビットマスク作成とビット演算代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L950 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L959 | |
std::bitset::reference::operator~() const (妥当性1) | |
std::bitset::reference::operator bool() const (妥当性1) | |
ビットマスク作成とビット演算のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L969 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L973 | |
std::bitset::reference::flip() (妥当性1) | |
ビットマスク作成とビット演算代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L977 | |
std::bitset::operator&=(const bitset<N>&) (妥当性1) | |
std::bitset::operator|=(const bitset<N>&) (妥当性1) | |
std::bitset::operator^=(const bitset<N>&) (妥当性1) | |
各ビットをビット演算代入するループのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1165 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1170 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1175 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1165 | |
std::bitset::operator<<=(const bitset<N>&) (妥当性1) | |
std::bitset::operator>>=(const bitset<N>&) (妥当性1) | |
単純なアルゴリズムで実装可能。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1180 | |
→ ( https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L317 ) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1190 | |
→ ( https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L345 ) | |
std::bitset::set() (妥当性1) | |
std::bitset::set(size_t, bool = true) (妥当性1) | |
単純なアルゴリズムで実装可能。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1200 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1210 | |
std::bitset::reset() (妥当性1) | |
std::bitset::reset(size_t) (妥当性1) | |
単純なアルゴリズムで実装可能。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1223 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1232 | |
std::bitset::operator~() const (妥当性1) | |
std::bitset::flip() (妥当性1) | |
各ビットをビット演算と代入するループのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L969 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1245 | |
std::bitset::flip(size_t) (妥当性1) | |
指定ビット取得と、ビットマスク作成とビット演算代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1255 | |
std::bitset::operator[](size_t) (妥当性1) | |
referenceオブジェクトを構築するのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1274 | |
std::bitset::to_ulong() const (妥当性1) | |
std::bitset::to_ullong() const (妥当性1) | |
単純なアルゴリズムで実装可能。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1282 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1286 | |
std::bitset::count() const (妥当性1) | |
単純なアルゴリズムで実装可能。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1333 | |
std::bitset::operator==(const bitset<N>&) const (妥当性1) | |
std::bitset::operator!=(const bitset<N>&) const (妥当性1) | |
各ビットを比較演算するループのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1341 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1345 | |
std::bitset::test(size_t) const (妥当性1) | |
指定ビット取得と、ビットマスク作成のみ。constexpr関数である operator[](size_t) const と同等。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1349 | |
std::bitset::all() const (妥当性1) | |
std::bitset::any() const (妥当性1) | |
std::bitset::none() const (妥当性1) | |
各ビットをチェックするループのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1355 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1359 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1363 | |
std::bitset::operator<<(size_t) const (妥当性1) | |
std::bitset::operator>>(size_t) const (妥当性1) | |
単純なアルゴリズムで実装可能。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1367 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/bitset/bitset.hpp#L1374 | |
<functional> | |
std::ref(T&) | |
std::cref(const T&) | |
std::ref(reference_wrapper<T>) | |
std::cref(reference_wrapper<T>) | |
std::bind(F&&, BoundArgs&&...) (妥当性3) | |
constexprな実装が可能であるが、いくつかの課題がある。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/functional/bind/bind.hpp#L998 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/functional/bind/bind.hpp#L1006 | |
std::bind1st(const Fn&, const T&) | |
std::bind2nd(const Fn&, const T&) | |
(deprecated) | |
std::ptr_fun(Result (*)(Arg)) | |
std::ptr_fun(Result (*)(Arg1,Arg2)) | |
(deprecated) | |
std::mem_fun(S (T::*f)()) | |
std::mem_fun(S (T::*f)(A)) | |
std::mem_fun_ref(S (T::*f)()) | |
std::mem_fun_ref(S (T::*f)(A)) | |
std::mem_fun(S (T::*f)() const) | |
std::mem_fun(S (T::*f)(A) const) | |
std::mem_fun_ref(S (T::*f)() const) | |
std::mem_fun_ref(S (T::*f)(A) const) | |
(deprecated) | |
std::mem_fn(R T::*) | |
<string> | |
std::char_traits::assign(char_type&, const char_type&) (妥当性1) | |
代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/string/char_traits.hpp#L76 | |
std::char_traits::compare (妥当性3) | |
std::char_traits::length (妥当性3) | |
std::char_traits::find (妥当性3) | |
std::char_traits::move (妥当性3) | |
std::char_traits::copy (妥当性3) | |
std::char_traits::assign(char_type*, size_t, char_type) (妥当性3) | |
いずれもconstexprな実装が可能。 | |
参考実装: (compare) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/string/char_traits.hpp#L94 | |
参考実装: (length) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/string/char_traits.hpp#L101 | |
参考実装: (find) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/string/char_traits.hpp#L104 | |
参考実装: (move) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/string/char_traits.hpp#L115 | |
参考実装: (copy) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/string/char_traits.hpp#L119 | |
参考実装: (assign) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/string/char_traits.hpp#L123 | |
<cctype> | |
<cwctype> | |
<cstring> | |
<cwchar> | |
<cstdlib> | |
<array> | |
std::operator==(const array<T,N>&, const array<T,N>&) (妥当性1) | |
std::operator!=(const array<T,N>&, const array<T,N>&) (妥当性1) | |
std::operator>(const array<T,N>&, const array<T,N>&) (妥当性1) | |
std::operator<(const array<T,N>&, const array<T,N>&) (妥当性1) | |
std::operator>=(const array<T,N>&, const array<T,N>&) (妥当性1) | |
std::operator<>(const array<T,N>&, const array<T,N>&) (妥当性1) | |
各要素を比較演算するループのみ。 | |
参考実装: (operator==) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/comparison.hpp#L28 | |
参考実装: (operator!=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/comparison.hpp#L33 | |
参考実装: (operator>) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/comparison.hpp#L38 | |
参考実装: (operator<) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/comparison.hpp#L43 | |
参考実装: (operator>=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/comparison.hpp#L48 | |
参考実装: (operator<=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/comparison.hpp#L53 | |
swap(array<T,N>& x, array<T,N>& y) (妥当性1) | |
各要素の swap のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/array.hpp#L227 | |
std::array::begin() (妥当性1) | |
std::array::begin() const (妥当性1) | |
std::array::end() (妥当性1) | |
std::array::end() const (妥当性1) | |
std::array::rbegin() (妥当性1) | |
std::array::rbegin() const (妥当性1) | |
std::array::rend() (妥当性1) | |
std::array::rend() const (妥当性1) | |
std::array::cbegin() (妥当性1) | |
std::array::cbegin() const (妥当性1) | |
std::array::cend() (妥当性1) | |
std::array::cend() const (妥当性1) | |
std::array::crbegin() (妥当性1) | |
std::array::crbegin() const (妥当性1) | |
std::array::crend() (妥当性1) | |
std::array::crend() const (妥当性1) | |
イテレータを構築するのみ。 | |
ただし、イテレータが非リテラル型の場合コンパイル時に呼び出せない。とはいえ、非リテラル型であってもconstexpr指定は可能。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/array.hpp#L97 | |
std::array::operator[](size_type) (妥当性1) | |
std::array::at(size_type) (妥当性1) | |
std::array::front() (妥当性1) | |
std::array::back() (妥当性1) | |
const版がconstexprである以上、同様にconstexpr指定できる。 | |
参考実装: (operator[]) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/array.hpp#L169 | |
参考実装: (at) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/array.hpp#L175 | |
参考実装: (front) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/array.hpp#L187 | |
参考実装: (back) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/array.hpp#L193 | |
std::array:data() (妥当性1) | |
std::array:data() const (妥当性1) | |
自明。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/array.hpp#L200 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/array/array.hpp#L203 | |
<iterator> | |
std::advance(InputIterator&, Distance) (妥当性1) | |
イテレータを進めるループのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/advance.hpp#L50 | |
std::distance(InputIterator, InputIterator) (妥当性1) | |
イテレータを進めるループ、もしくは減算のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/distance.hpp#L41 | |
std::next(ForwardIterator, typename std::iterator_traits<ForwardIterator>::difference_type = 1) (妥当性1) | |
std::prev(BidirectionalIterator, typename std::iterator_traits<BidirectionalIterator>::difference_type = 1) (妥当性1) | |
advance のみ。 | |
参考実装: (next) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/next.hpp#L29 | |
参考実装: (prev) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/prev.hpp#L27 | |
std::begin(C&) (妥当性1) | |
std::begin(const C&) (妥当性1) | |
std::end(C&) (妥当性1) | |
std::end(const C&) (妥当性1) | |
std::cbegin(const C&) (妥当性1) | |
std::cend(const C&) (妥当性1) | |
std::rbegin(C&) (妥当性1) | |
std::rbegin(const C&) (妥当性1) | |
std::rend(C&) (妥当性1) | |
std::rend(const C&) (妥当性1) | |
std::rbegin(T (&)[N]) (妥当性1) | |
std::rend(T (&)[N]) (妥当性1) | |
std::rbegin(initializer_list<E>) (妥当性1) | |
std::end(initializer_list<E>) (妥当性1) | |
std::crbegin(const C&) (妥当性1) | |
std::crend(const C&) (妥当性1) | |
対応するメンバ関数を呼び出すのみ。 | |
参考実装: https://gist.github.com/bolero-MURAKAMI/9680516 | |
std::reverse_iterator::reverse_iterator() (妥当性1) | |
std::reverse_iterator::reverse_iterator(Iterator) (妥当性1) | |
std::reverse_iterator::reverse_iterator(const reverse_iterator<U>&) (妥当性1) | |
メンバの初期化のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L45 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L49 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L53 | |
std::reverse_iterator::operator=(const reverse_iterator<U>&) (妥当性1) | |
代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L57 | |
std::reverse_iterator::base() const (妥当性1) | |
メンバを返すのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L62 | |
std::reverse_iterator::operator*() const (妥当性1) | |
std::reverse_iterator::operator->() const (妥当性1) | |
デクリメントとデリファレンスのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L65 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L68 | |
std::reverse_iterator::operator++() (妥当性1) | |
std::reverse_iterator::operator++(int) (妥当性1) | |
std::reverse_iterator::operator--() (妥当性1) | |
std::reverse_iterator::operator--(int) (妥当性1) | |
イテレータのデクリメント/インクリメント(およびコピー構築)のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L71 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L75 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L80 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L84 | |
std::reverse_iterator::operator+(difference_type) const (妥当性1) | |
std::reverse_iterator::operator+=(difference_type) (妥当性1) | |
std::reverse_iterator::operator-(difference_type) const (妥当性1) | |
std::reverse_iterator::operator-=(difference_type) (妥当性1) | |
イテレータの減算/加算(代入)のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L89 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L95 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L92 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L100 | |
std::reverse_iterator::operator[](difference_type) const (妥当性1) | |
operator[] 呼び出しのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L105 | |
std::reverse_iterator::operator==(const reverse_iterator<Iterator1>&, const reverse_iterator<Iterator2>&) (妥当性1) | |
std::reverse_iterator::operator!=(const reverse_iterator<Iterator1>&, const reverse_iterator<Iterator2>&) (妥当性1) | |
std::reverse_iterator::operator<(const reverse_iterator<Iterator1>&, const reverse_iterator<Iterator2>&) (妥当性1) | |
std::reverse_iterator::operator>(const reverse_iterator<Iterator1>&, const reverse_iterator<Iterator2>&) (妥当性1) | |
std::reverse_iterator::operator<=(const reverse_iterator<Iterator1>&, const reverse_iterator<Iterator2>&) (妥当性1) | |
std::reverse_iterator::operator>=(const reverse_iterator<Iterator1>&, const reverse_iterator<Iterator2>&) (妥当性1) | |
イテレータの比較のみ。 | |
参考実装: (operator==) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L125 | |
参考実装: (operator!=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L130 | |
参考実装: (operator<) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L135 | |
参考実装: (operator>) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L140 | |
参考実装: (operator<=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L145 | |
参考実装: (operator>=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L150 | |
std::reverse_iterator::operator-(const reverse_iterator<Iterator1>&, const reverse_iterator<Iterator2>&) (妥当性1) | |
std::reverse_iterator::operator+(typename reverse_iterator<Iterator>::difference_type, const reverse_iterator<Iterator>&) (妥当性1) | |
イテレータの減算/加算のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L155 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/reverse_iterator.hpp#L160 | |
std::move_iterator::move_iterator() (妥当性1) | |
std::move_iterator::move_iterator(Iterator) (妥当性1) | |
std::move_iterator::move_iterator(const move_iterator<U>&) (妥当性1) | |
メンバの初期化のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L46 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L50 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L54 | |
std::move_iterator::operator=(const move_iterator<U>&) (妥当性1) | |
代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L58 | |
std::move_iterator::base() const (妥当性1) | |
メンバを返すのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L63 | |
std::move_iterator::operator*() const (妥当性1) | |
std::move_iterator::operator->() const (妥当性1) | |
デクリメントとデリファレンスのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L66 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L69 | |
std::move_iterator::operator++() (妥当性1) | |
std::move_iterator::operator++(int) (妥当性1) | |
std::move_iterator::operator--() (妥当性1) | |
std::move_iterator::operator--(int) (妥当性1) | |
イテレータのデクリメント/インクリメント(およびコピー構築)のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L72 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L76 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L81 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L85 | |
std::move_iterator::operator+(difference_type) const (妥当性1) | |
std::move_iterator::operator+=(difference_type) (妥当性1) | |
std::move_iterator::operator-(difference_type) const (妥当性1) | |
std::move_iterator::operator-=(difference_type) (妥当性1) | |
イテレータの減算/加算(代入)のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L90 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L96 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L93 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L101 | |
std::move_iterator::operator[](difference_type) const (妥当性1) | |
operator[] 呼び出しのみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L106 | |
std::move_iterator::operator==(const move_iterator<Iterator1>&, const move_iterator<Iterator2>&) (妥当性1) | |
std::move_iterator::operator!=(const move_iterator<Iterator1>&, const move_iterator<Iterator2>&) (妥当性1) | |
std::move_iterator::operator<(const move_iterator<Iterator1>&, const move_iterator<Iterator2>&) (妥当性1) | |
std::move_iterator::operator>(const move_iterator<Iterator1>&, const move_iterator<Iterator2>&) (妥当性1) | |
std::move_iterator::operator<=(const move_iterator<Iterator1>&, const move_iterator<Iterator2>&) (妥当性1) | |
std::move_iterator::operator>=(const move_iterator<Iterator1>&, const move_iterator<Iterator2>&) (妥当性1) | |
イテレータの比較のみ。 | |
参考実装: (operator==) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L126 | |
参考実装: (operator!=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L131 | |
参考実装: (operator<) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L136 | |
参考実装: (operator>) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L141 | |
参考実装: (operator<=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L146 | |
参考実装: (operator>=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L151 | |
std::move_iterator::operator-(const move_iterator<Iterator1>&, const move_iterator<Iterator2>&) (妥当性1) | |
std::move_iterator::operator+(typename move_iterator<Iterator>::difference_type, const move_iterator<Iterator>&) (妥当性1) | |
イテレータの減算/加算のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L156 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/iterator/move_iterator.hpp#L161 | |
<algorithm> | |
25.2 Non-modifying sequence operations および副作用を伴わないアルゴリズム (妥当性4) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/algorithm/non_modifying.hpp | |
25.3 Mutating sequence operations, 25.4 Sorting and related operations のうち引数への副作用を伴うアルゴリズム (妥当性5) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/algorithm/cxx14.hpp | |
<complex> | |
std::complex::real(T) (妥当性1) | |
std::complex::imag(T) (妥当性1) | |
代入のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L50 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L59 | |
std::complex::operator=(const T&) (妥当性1) | |
std::complex::operator+=(const T&) (妥当性1) | |
std::complex::operator-=(const T&) (妥当性1) | |
std::complex::operator*=(const T&) (妥当性1) | |
std::complex::operator/=(const T&) (妥当性1) | |
代入または複合代入のみ。 | |
参考実装: (operator=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L62 | |
参考実装: (operator+=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L67 | |
参考実装: (operator-=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L71 | |
参考実装: (operator*=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L75 | |
参考実装: (operator/=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L80 | |
std::complex::operator=(const complex<X>&) (妥当性1) | |
std::complex::operator+=(const complex<X>&) (妥当性1) | |
std::complex::operator-=(const complex<X>&) (妥当性1) | |
代入または複合代入のみ。 | |
参考実装: (operator=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L85 | |
参考実装: (operator+=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L91 | |
参考実装: (operator-=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L97 | |
std::complex::operator*=(const complex<X>&) (妥当性1) | |
std::complex::operator/=(const complex<X>&) (妥当性1) | |
算術演算と代入のみ。 | |
参考実装: (operator*=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L109 | |
参考実装: (operator/=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/complex.hpp#L116 | |
std::operator+(const complex<T>&, const complex<T>&) (妥当性1) | |
std::operator+(const complex<T>&, const T&) (妥当性1) | |
std::operator+(const T&, const complex<T>&) (妥当性1) | |
std::operator-(const complex<T>&, const complex<T>&) (妥当性1) | |
std::operator-(const complex<T>&, const T&) (妥当性1) | |
std::operator-(const T&, const complex<T>&) (妥当性1) | |
std::operator*(const complex<T>&, const complex<T>&) (妥当性1) | |
std::operator*(const complex<T>&, const T&) (妥当性1) | |
std::operator*(const T&, const complex<T>&) (妥当性1) | |
std::operator/(const complex<T>&, const complex<T>&) (妥当性1) | |
std::operator/(const complex<T>&, const T&) (妥当性1) | |
std::operator/(const T&, const complex<T>&) (妥当性1) | |
算術演算のみ。 | |
参考実装: (operator+) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/operators.hpp#L20 | |
参考実装: (operator-) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/operators.hpp#L35 | |
参考実装: (operator*) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/operators.hpp#L50 | |
参考実装: (operator/) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/operators.hpp#L83 | |
std::operator+(const complex<T>&) (妥当性1) | |
std::operator-(const complex<T>&) (妥当性1) | |
算術演算のみ。 | |
参考実装: (operator+) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/operators.hpp#L98 | |
参考実装: (operator-) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/operators.hpp#L103 | |
std::operator==(const complex<T>&, const complex<T>&) (妥当性1) | |
std::operator==(const complex<T>&, const T&) (妥当性1) | |
std::operator==(const T&, const complex<T>&) (妥当性1) | |
std::operator!=(const complex<T>&, const complex<T>&) (妥当性1) | |
std::operator!=(const complex<T>&, const T&) (妥当性1) | |
std::operator!=(const T&, const complex<T>&) (妥当性1) | |
比較演算と論理演算のみ。 | |
参考実装: (operator==) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/operators.hpp#L108 | |
参考実装: (operator!=) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/operators.hpp#L123 | |
std::abs(const complex<T>&) (妥当性X) | |
std::arg(const complex<T>&) (妥当性X) | |
sqrt, atan2を必要とする。 | |
参考実装: (abs) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/values.hpp#L47 | |
参考実装: (arg) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/values.hpp#L52 | |
std::norm(const complex<T>&) (妥当性1) | |
算術演算のみ。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/values.hpp#L57 | |
std::conj(const complex<T>&) (妥当性1) | |
std::proj(const complex<T>&) (妥当性1) | |
算術演算のみ。 | |
参考実装: (conj) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/values.hpp#L62 | |
参考実装: (proj) https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/values.hpp#L77 | |
26.4.8, transcendentals の数学関数 (妥当性X) | |
数学関数を必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/complex/transcendentals.hpp | |
<random> | |
26.5.1.4 Random number engine requirements を満たす疑似乱数エンジンのメンバ関数 | |
(代表としてlinear_congruential_engineを取り上げる) | |
std::linear_congruential_engine::linear_congruential_engine(result_type) (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/linear_congruential.hpp#L92 | |
std::linear_congruential_engine::linear_congruential_engine(Sseq&) (妥当性2) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/linear_congruential.hpp#L96 | |
std::linear_congruential_engine::seed(result_type) (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/linear_congruential.hpp#L107 | |
std::linear_congruential_engine::seed(Sseq&) (妥当性2) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/linear_congruential.hpp#L111 | |
std::linear_congruential_engine::operator()() (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/linear_congruential.hpp#L128 | |
std::linear_congruential_engine::discard(unsigned long long) (妥当性1) | |
26.5.1.6 Random number distribution requirements を満たす確立分布クラスのメンバ関数 | |
(代表としてuniform_int_distributionを取り上げる) | |
std::uniform_int_distribution::uniform_int_distribution(IntTyp, IntType) (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L867 | |
std::uniform_int_distribution::uniform_int_distribution(const param_type&) (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L871 | |
std::uniform_int_distribution::reset() (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L887 | |
std::uniform_int_distribution::operator()(URNG&) (妥当性1) | |
std::uniform_int_distribution::operator()(URNG&, const param_type&) (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L896 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L904 | |
std::uniform_int_distribution::a() (妥当性1) | |
std::uniform_int_distribution::b() (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L875 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L878 | |
std::uniform_int_distribution::param() (妥当性1) | |
std::uniform_int_distribution::param(const param_type&) (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L888 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L891 | |
std::uniform_int_distribution::min() (妥当性1) | |
std::uniform_int_distribution::max() (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L881 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/uniform_int_distribution.hpp#L884 | |
std::generate_canonical(URNG&) (妥当性2, X) | |
数学関数を必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/random/generate_canonical.hpp#L71 | |
<numeric> | |
副作用を伴わないアルゴリズム(accumulate, inner_product) (妥当性4) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/numeric/non_modifying.hpp | |
引数への副作用を伴うアルゴリズム(partial_sum, adjacent_difference, iota) (妥当性5) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/numeric/cxx14.hpp | |
<cmath> | |
数学関数の計算自体はconstexpr関数として実装可能だが、組み込み関数がなければ非常に低速。 | |
また、符号の取り扱いを厳密に実装するには、copysignまたはsignbitがconstexprである必要があり、これにはコンパイラーマジックが必須である。 | |
7.12.3 Classification macros のうちsignbitを除く (妥当性1) | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/classifications.hpp | |
std::signbit (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/signbit.hpp#L43 | |
7.12.4 Trigonometric functions (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/trigonometric.hpp | |
7.12.5 Hyperbolic functions (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/hyperbolic.hpp | |
7.12.6 Exponential and logarithmic functions (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/exponential.hpp | |
7.12.7 Power and absolute-value functions (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/power.hpp | |
7.12.8 Error and gamma functions (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/error.hpp | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/gamma.hpp | |
7.12.9 Nearest integer functions (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/nearest.hpp | |
7.12.10 Remainder functions (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/remainders.hpp | |
7.12.11 Manipulation functions (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/manipulations.hpp | |
7.12.12 Maximum, minimum, and positive difference functions (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/minmax.hpp | |
7.12.13 Floating multiply-add (妥当性X) | |
コンパイラーマジックを必要とする。 | |
参考実装: https://github.com/bolero-MURAKAMI/Sprout/blob/master/sprout/math/muladd.hpp | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment