title: How to correctly initialize member variable of template type?
body: <p>suggest i have a template function like following:</p>
  
  <pre><code>template&lt;class T&gt;
  void doSomething()
  {
      T a; // a is correctly initialized if T is a class with a default constructor
      ...
  };
  </code></pre>
  
  <p>But variable a leaves uninitialized, if T is a primitive type. I can write T a(0), but this doesn't work if T is a class. Is there a way to initialize the variable in both cases (T == class, T == int, char, bool, ...)?</p>