G
Guest
In the code bellow, I have this compiler error in line 2:
error C2947: expecting '>' to terminate template-argument-list, found '>>'
Why?
------------------------------------------------------
template<typename C> // C can be: char, wchar_t, unsigned long
vector<basic_string<C>> explode(const basic_string<C> &delimiter, const basic_string<C> &s, unsigned int part = -1)
{
vector<basic_string<C>> e;
int a, b = 0;
for(;
{
a = s.find(delimiter, b);
if (a == basic_string<C>::npos) { e.push_back(s.substr(b)); return e; }
e.push_back(s.substr(b, a - b));
b = a + 1;
if(!(--part)) return e;
}
}
------------------------------------------------------
error C2947: expecting '>' to terminate template-argument-list, found '>>'
Why?
------------------------------------------------------
template<typename C> // C can be: char, wchar_t, unsigned long
vector<basic_string<C>> explode(const basic_string<C> &delimiter, const basic_string<C> &s, unsigned int part = -1)
{
vector<basic_string<C>> e;
int a, b = 0;
for(;
{
a = s.find(delimiter, b);
if (a == basic_string<C>::npos) { e.push_back(s.substr(b)); return e; }
e.push_back(s.substr(b, a - b));
b = a + 1;
if(!(--part)) return e;
}
}
------------------------------------------------------