Hello!
I tried searching for this error, but it seems a little uncommon, so I decided to register here.
My problem is, that i would like to declare an iterator of type std::list<std::vector<T> >::iterator
within a for statement. I tried it like this:
template <class T>
class CSplit
{
private:
std::list<std::vector<T> > m_Events;
public:
bool Event (int Channel, int Message);
};
template <class T>
bool CSplit<T>::Event (int Channel, int Message)
{
...
for (std::list<std::vector<T> >::iterator i = m_Events.begin (); i != m_Events.end (); i++)
{ ... }
...
return true;
}
The error message returned is:
D:\Programming\C++\Synthie\alpha 0.04\src\Objects\Splitters\CSplitMidi.cpp|14|error: expected `;' before "i"|
It feels as if i had missed out one of these <{([::])}>.
Also, it seems to work fine, if I declare the iterator before the for loop, which is, what I would like to avoid.
I hope, someone has a solution or a clever idea.
Greetings,
JaR
PS: I just realized, that I did not try to declare an iterator but a list, when I tried to get it to work outside the for loop. It does not work, no matter, where I write it. It works, if i change the T to a known type. Any Ideas?