Equality<Derived> const& op1
what is the type of op1 in above variable
Equality<Derived> const& op1
what is the type of op1 in above variable
You mean spelled out in English? Because the type is right there in front of you. Reference to const Equality<Derived>.
It's funny, I spent a couple years programming in C and C++ before I learned that you could put the const to the right of the type :P
Also, keep in mind that template classes aren't actually fully realized until your provide the template parameter.
Like,
isn't actually a real type until you do:Code:template <typename T> class my_class { };
Templates are neat because you can think of them as giving the compiler information to someday create a type.Code:my_class<int>
Oh no, it's a type alright. A different one:
(I did not check for syntax errors.)Code:template<typename T> class foo {}; template<typename T> void bar1(T) {} template<template<typename> class T> void bar2(T) {} bar1<foo>(); // Error bar1<foo<int>>(); // OK bar2<foo>(); // OK bar2<foo<int>>(); // Error
Yeah, I'm not really familiar with nested templates....
Trying to make sense of that code is interesting. You can also pass around the templated class definition...