I\'m attempting to figure out why some code that I have won\'t compile and I done a fair bit of reduction an anonymizing to end up with this example:
#define NUL
Need to add the template
keyword:
return ap->template amem<b>();
Please read Where and why do I have to put the “template” and “typename” keywords? for an in-depth explanation.
In the context where you call
return ap->amem<b>();
the name amem
is a dependent name: If such a beast indeed refers to a member function template, you need to say so by adding the keyword template
:
return ap->template amem<b>();
BTW, note that you shall not define NULL
! If you need a definition of the abomination you should include, e.g., cstddef
. Best you use just 0
or nullptr
when using C++ 2011.