is there a difference, from prospective of meta-programming for example, between the two
declarations?
template<typename T>
struct matrix {
typedef matrix self_type; // or
typedef matrix<T> self_type;
};
thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In this particular situation (inside a class template),
matrixis a shorthand formatrix<T>. When you write lots of hairy templates all day long while trying to fit everything in 80 columns, the shorthand is welcome.Note that you can also abbreviate method arguments: