initialization list question, with emphasis on std vector
<p>newbie here, in order to help sort out problems in my C++ project, I am compiling with the -Weffc++ option in g++.</p>

<p>It's giving me hundreds of warnings about "warning ... should be initialized in the member initialization list"</p>

<p>Is this really necessary seeing as it will a) take a bit of time to write them all in, and b) make make things messier when I was happy initialising variables when they are need only.</p>

<p>But more specifically, how do I initialise a std::vector?</p>

<p>Is this the way, ie just putting a 0 in brackets?
My header:</p>

<pre><code>class Blade;
class Postpro {
   public:
     Postpro(string fName) : theFileName(fName),
                             blade(NULL),
                             sizes(10),
                             t(std::vector&lt;double&gt;(0){};
     ~Postpro(){};
     void test();

   private:
     string theFileName;
     Blade* blade;
     int sizes;
     std::vector&lt;double&gt; t;
}
</code></pre>

<p>And then in the cpp I just resize the vector if I want to use it?</p>

<pre><code>void Postpro::test() {
    blade = new Blade;
    t.resize(37);
}
</code></pre>

<p>Thanks</p>
