C++:template
Template implementation
아래와 같은 코드가 존재한다고 가정할 경우
template <typename T1, typename T2>
class SomeClass
{
template <typename E>
void extraTypedMethod(E & e);
};
아래와 같이 구현을 분리할 수 있다.
template <typename T1, typename T2>
template <typename E>
void SomeClass<T1, T2>::extraTypedMethod(E & e)
{
// ...
}
Template template parameter
Variadic template
Template 에서 타입의 인자를 가변으로 처리 할 수 있는, 새로운 ...
표현식.
Variadic CRTP
The Curiously-Recurring Template Pattern (CRTP) is a pleasant and common C++ coding idiom. This installment of Once, Weakly combines CRTP with variadic template template parameter packs to implement restricted numeric types suitable for implementing memory-mapped devices.
Template Trees for Modern C++ Interfaces
Modern C++ increasingly uses “Do What I Mean” (DWIM) interfaces that depend on interface selection based on secondary properties of types. Often, these interfaces make use of SFINAE techniques and/or static assertions that require the ability to compose complex compile time queries about types. This installment of Once, Weakly describes the implementation and use of a simple facility for compile time composition and evaluation of abstract syntax trees (ASTs) of template predicates.