My code was very fine until I added a function to a template:
/// Format a string with all names of the factory
template <class T> std::string getAllNamesInFactory(const std::string & separator, const std::string & surround)
{
const std::vector<T*> & v = T::getAllInstances() ; // exists.
line 126: std::vector<T*>::const_iterator it ; //=v.begin();
std::ostringstream os ;
/* some stuff done to the stream ... */
return os.str() ;
}
I have the following message from the compiler:
g++ -c -O2 -I.. -fPIC -o build/Release/GNU-Linux-x86/src/strategy/indicator/indicator.o src/strategy/indicator/indicator.cpp
../tinsim/src/patterns/factory.h: In function ‘std::string tinsim::getAllNamesInFactory(const std::string&, const std::string&)’:
../tinsim/src/patterns/factory.h:126: error: expected `;' before ‘it’