research

C++ Metaprogramming Examples

Abstract

Tato práce pojednává o metaprogramování v jazyce C++. Obsahuje přehledovou část zaměřenou na metaprogramování obecně a dále sadu příkladů demonstrujících různé techniky podporující metaprogramování v C++ s důrazem na nové vlastnosti nadcházející verze normy, zatím zvané C++0x. Příklady ukazují použití šablon s proměnným počtem parametrů, jejich výpočetní sílu, staticky polymorfní generování kódu a také obecnou implementaci několika návrhových vzorů.In this thesis we investigate possibilities of metaprogramming in C++. It contains a~general overview of metaprogramming and a~set of examples of various metaprogramming techniques in the C++ programming language with an emphasis on the possibilities proposed by the upcoming standard, called C++0x for now. Examples demonstrate usage of variadic templates, computational power of templates, statically polymorphic generation of a~runtime code and generic implementation of several design patterns.

    Similar works