A Bite of Template in C++ (3)

In the post A Bite of Template in C++ (1), I mentioned a constraint for template member functions in class that explicit specialization is not allowed. However, I realized there are more constraints on function templates later when I wanted to make two template varients with slightly difference on only one member function. I tried specializing member function template, as well as inheriting a template member function from base class. Both of them failed due to some constraints. Briefly, the constraints are

  1. partial specialization is not allowed for function template,
  2. using declaration plus template disambiguator is not the right way to inherit a template member function from a template class.
Read More

A Bite of Template in C++ (2)

I encountered two issues when using C++ template. One is about why sometimes typename has to be prefixed to declarations, and another is how to access the types in the parameter list from outside of the template. This post has some ideas for those two questions, as well as some discussions about nested templates.

Read More