I have ran into yet another problem I do not understand.
The following does not instantiate (argument instantiation fails), why?
template<class E>
void operator[](typename boost::mpl::identity<E>::type e) const;
thank you for your help
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.
identitycan be used to force you to specify the template argument explicitly. It effectively prevents that function parameter from partaking in template argument deduction.A qualified type name is one of the non deduced contexts; that is,
identity<E>::typewill not be used to deduce the template parameter forE.For example, if you have: