But when I try to compile it I get an error saying
error: need ‘typename’ before ‘std::list<U>::iterator’ because ‘std::list<U>’ is a dependent scope.
So I can't iterate a list inside my template function or there is another way to do it?
Thank you for your help.
I guess the compliler doesn't still know what could be objected for "ItemClass" since it's only a template in the compiling phase, only can be initiated in run-time.
Try:
"
typedef typename list<ItemClass>::iterator MyIt;
"
before declaring _nhit.