2

I was looking through the boost::python source code and found this snippet:

template <class T>
struct pointee
    : pointee_impl<is_pointer<T>::value>::template apply<T>
{
};

I have never seen anything like this before. I am surprised this compiles for a few reasons:

  1. There is no member named ::template on pointee_impl.
  2. template is a reserved keyword
  3. pointee seems to inherit from two values separated by a space

Is there another use of the template keyword that I am not aware of? What's going on here?

Michael Koval
  • 8,207
  • 5
  • 42
  • 53

0 Answers0