Rokiのチラ裏

学生による学習のログ

2016-09-11から1日間の記事一覧

テンプレートプレディケートをCompareに渡す

C++

一応まとめておく。 当然だが、インスタンス生成されていないテンプレート関数を推測するのは不可能である。そういった場合は、明示的にキャストをする。 #include<array> #include<boost/range/algorithm_ext/iota.hpp> #include<boost/range/algorithm/copy.hpp> #include<boost/range/algorithm/sort.hpp> #include<iostream> #include<functional> #include<experimental/iterator> template</experimental/iterator></functional></iostream></boost/range/algorithm/sort.hpp></boost/range/algorithm/copy.hpp></boost/range/algorithm_ext/iota.hpp></array>

STL Tutorial and Reference Guide,Second Edition C++ Programming with the Standard Template Library #4

前回から続く。このエントリーは以下の書籍を参照している。 STL―標準テンプレートライブラリによるC++プログラミング 第2版作者: ディビッド・R.マッサー,アトゥルサイニ,ギルマー・J.ダージ,David R. Musser,Atul Saini,Gillmer J. Derge,滝沢徹,牧野祐子…