title: Failed loading from file in class constructor issue
body: <p>I'm trying to add the option in class A constructor to load objects from file. But I'm not sure what to do when loading fails (file loading fails, bad file format ..). Code uses A whether loadObjects is true or not which leads to segmentation fault. Maybe loading in constructor isn't the best approach ...</p>
  
  <pre><code>template &lt;typename T&gt;
  class A
  {
      public:
          A(const std::vector&lt;Obj&lt;T&gt;*&gt;&amp; o) : objs(o) {}
  
          A(const std::string&amp; file)
          {
              // loadObject adds new objects in objs
              // objs.push_back(new Obj&lt;T&gt;);
              if ( loadObjects(file, objs) ) 
              {
                  // good, can use object A
              }
              else
              {
                  // Segmentation fault when using undefined A, 
                  // What can I do to stop execution here.
              }
  
          }
  
          virtual ~A()
          {
              for (size_t i=0; i&lt;objs.size(); ++i)
                  delete objs[i];
              objs.clear();
          }
  
      private:
          std::vector&lt;Obj&lt;T&gt;*&gt; objs;
  
  };
  </code></pre>