I have this code:
class USerializer {
public:
template<typename T>
static std::string serialize(std::list<T*> listOfObjectToSerialize)
{
// stringstream containing serialized Objects
std::stringstream serializedObjectList;
typename std::list<T*>::iterator iter;
// serialize Objects
for (iter = listOfObjectToSerialize.begin(); iter != listOfObjectToSerialize.end(); ++iter)
{
// Class delimiter
serializedObjectList << '+'<< endl;
// Need to serialise the class itself, and not the pointer to it!
serializedObjectList << **iter;
}
return serializedObjectList.str();
}
}
and then I use this methods like this:
std::string serializedAlarmInfo = USerializer::serialize<CcAlarm::AlarmInfo>(getActiveAlarms());
I am getting a SIGILL fault:
Program received signal SIGILL, Illegal instruction.
Using gdb I traced the execution and everything seems fine until I exit the serialize function.
Any ideas?
Try: