using typedef in template instantiation and extern template declaration
问题 There are two cases where typedef confuses me when it comes to extern template declaration and explicit template instantiation . To illustrate the two see below 2 example code snippets. Consider following example (Case 1) : // suppose following code in some cpp file template <typename T> struct example { T value; }; // valid typedefs typedef example<int> int_example; typedef example<std::string> string_example; // explicit instantiation using above typedefs template class int_example; // ->