Questions tagged [template-meta-programming]

Template meta-programming is a meta-programming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled.

Wikipedia entry.

Template meta-programming is a meta-programming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled.

The template outputs include compile time constants, data structures and functions; this technique can be described as a "compile time" execution. It can be used to control the generation of optimized code based on the compile time type being used, and "static polymorphism" (also known by the pattern name CRTP).

2288 questions
1
vote
1 answer

initializing std::tuple which element constructors require object from another std::tuple

consider the following code template struct B; template struct C; template struct A { typedef std::tuple< B ...> Bs; typedef std::tuple< C< B >...> Cs; Bs m_Bs; Cs m_Cs; A() : …
1
vote
1 answer

Determine uniqueness of parameters at compile time

The problem I have the following array like container: template < class _Tp, size_t _Size > class Alphabet { public: template constexpr Alphabet(_Ts&& ... ts) : m_data(std::forward<_Ts>(ts)...}) …
1
vote
1 answer

Can't apply int to result of partial_apply

// partial_apply.hpp template