タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

templateに関するkojosanのブックマーク (4)

  • C++ Templates FAQ

    This is not an introduction or a reference manual to templates. It deals with some of the more complex yet still common problems with templates. Other information Templates are an essential part of modern C++, and any good recent introduction to C++ should cover them. If you lack such an introductory text, I recommend you read either Accelerated C++ or The C++ Programming Language, depending on yo

  • C/C++ programming

    激しく今更感がありますが, 自分自身を呼び出すテンプレートのことです. テンプレートメタプログラミング(template metaprogramming)というのが一般的なようです. 再帰呼び出しの終了にはテンプレートの特殊化(template specialization)を利用します. template<int n> struct sum1toN { enum { value = sum1toN<n - 1>::value + n }; }; template<> struct sum1toN<0> { enum { value = 0 }; }; int main() { printf("sum=%d\n", sum1toN<10>::value); return 0; } 実行すると sum=55 と表示されます. この55はコンパイル時

  • http://homepage1.nifty.com/herumi/prog/prog82.html

  • The Boost C++ Metaprogramming Library

    概要 この文書は,アルゴリズム,シーケンス,メタ関数クラスの拡張可能なコンパイル時フレームワークである, Boost C++ テンプレートメタプログラミングライブラリ(MPL) について述べている. ライブラリは実環境での実際の実際の仕様に十分な,強力で使いやすいツールセットを構築するために, ジェネリックプログラミング,及び関数プログラミングの世界から,重要な抽象化を導入している. MPL は,C++標準ライブラリ[STL94], [ISO98]の一部である,標準テンプレートライブラリ (STL) の影響を強く受けている. STLの様に,MPLはこの領域に将来貢献するための土台となるような,公開された概念と実装の枠組みを定義している. ライブラリの基的な概念とイディオムにより,ユーザが与えられたメタプログラミングの問題に対して, アドホックなアプローチの世界に引きづり込まれることなく,

  • 1