Answer the question
In order to leave comments, you need to log in
Help with an error in the template function code
There is this code:
#define GDMLExtReader_H 1
#ifndef _WIN32
#include <map>
#endif
class GDMLExtReader : public G4GDMLReadStructure
{
template Type* GetPtr(const G4String& name, const std::map<G4String, Type*>& l)
{
Type* ret = 0;
std::map<G4String, Type*>::const_iterator pos = l.find(name);
if (pos != l.end())
ret = pos->second;
else
{
G4String err_mess = "Attribute: " + name + " NOT found !";
G4Exception("GDMLExtReader", "ReadError", FatalException, err_mess);
}
return ret;
}
};
#endif
In member function Type* GDMLExtReader::GetPtr(const G4String&, const std::map<G4String, Type*, std::less, std::allocator<std::pair<const G4String, Type*> > >&)':
include/GDMLExtReader.hh: error: expected ;' before pos'
include/GDMLExtReader.hh: error: pos' was not declared in this scope
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question