title: C++ template arguments in constructor
body: <p>Why doesn't this code compile?</p>
  
  <pre><code>template &lt;class T&gt;
  class A
  {
      public:
              A(T t) : t_(t) {}
  
      private:
              T t_;
  };
  
  
  int main()
  {
      A a(5.5);
      // A&lt;double&gt; a(5.5); // that's what i don't want to do
  }
  </code></pre>
  
  <p>I want template arguments to be implicit.</p>
  
  <p>Like in this example:</p>
  
  <pre><code>template&lt;class T&gt;
  T Foo(T t) { return t; }
  
  // usage:
  Foo(5.5);
  </code></pre>
  
  <p><strong>UPDATE</strong>: named-constructor idiom isn't acceptable for me. I want to use this class for RAII.
  The only way to do so is <code>const A&amp; a = A::MakeA(t)</code>, but it's ugly!</p>