Top "Template-specialization" questions

Template specialization refers to programmer-generated explicit specialization of templates for specific types.

Partial specialization of a method in a templated class

Given: struct A { virtual bool what() = 0; }; template<typename T, typename Q> struct B : public A { virtual bool what(); }; …

c++ templates template-specialization sfinae
Template specialization for an empty parameter pack

I have a variadic template function which calls itself to determine the largest number in a list (constituted by the …

c++ templates c++11 template-specialization variadic-templates
enable_if method specialization

template<typename T> struct A { A<T> operator%( const T& x); }; template<typename T&…

c++ boost c++11 template-specialization tr1
How can I use template specialization in c++ classes, and why this doesn't compile?

I am working on a XmlWriter class, and I wanted to be able to output attributes or text in most …

c++ class templates template-specialization
Why aren't template specializations allowed to be in different namespaces?

Please, see what I am trying to do: #include <iostream> namespace first { template <class T> class …

c++ templates namespaces template-specialization
Why is it not possible to overload class templates?

Reading this question made me wonder: is there a technical reason for disallowing class templates overloads? By overloading, I mean …

c++ templates overloading template-specialization language-lawyer
Why does this code give the error, "template specialization requires 'template<>'"?

When I try to compile this with Clang template<class T> struct Field { char const *name; Field(char …

c++ templates clang template-specialization crtp
Syntax for specialization of nested template class

I'm trying to figure out the correct syntax for explicit specialization of a nested template class. The following code will …

c++ templates inner-classes template-specialization
specializing iterator_traits

I'd like to specialize std::iterator_traits<> for iterators of a container class template that does not have …

c++ template-specialization iterator-traits
Partial specialisation of member function with non-type parameter

I have a template class with both a type and a non-type template parameter. I want to specialize a member …

c++ templates template-specialization partial-specialization