I\'m having trouble with templates and dependent types:
namespace Utils
{
void PrintLine(const string& line, int tabLevel = 0);
string getTabs(in
You need an additional typename keyword on this line:
set<result_t> findAll_if(typename set<result_t>::iterator begin,
typenameset<result_t>::iterator end, Predicate pred) // warning C4346
Well, the warning says:
dependent name is not a type. prefix with 'typename' to indicate a type
The dependent name (that is, the iterator
in std::set<result_t>::iterator
) is not a type. You need to prefix it with typename
to indicate a type:
typename std::set<result_t>::iterator
So, your declaration should be:
template<class result_t, class Predicate>
set<result_t> findAll_if(typename set<result_t>::iterator begin, typename set<result_t>::iterator end, Predicate pred)
note added typename ^
(and the definition should match the declaration)