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