Possible Duplicate:
Where and why do I have to put the “template” and “typename” keywords?
Here is the fragment code:
template <typename alloc_t>
int Protocol_v2<alloc_t>::create(..., alloc_t *alloc, ...) {
Protocol_v2<alloc_t> * pack = alloc->template malloc<Protocol_v2<alloc_t> >();
Protocol_v2 is a template class, as follows:
template <typename alloc_t>
class Protocol_v2 { ...}
alloc_t is a class, as follows:
class reverse_allocator {
...
template<typename T>
inline T * malloc() {}
...
}
What is bothering me is this line:
Protocol_v2<alloc_t> * pack = alloc->template malloc<Protocol_v2<alloc_t> >();
What is that mean? I haven't seen that in c++ primer so far.
Thanks in advance.