title: Template function argument deduction with enable_if - reference to pointer
body: <p>Maybe there is good solution that work on g++ 4.6.{3,4} ? 
  You can check in on <a href="https://godbolt.org/" rel="nofollow noreferrer">https://godbolt.org/</a> </p>
  
  <pre><code>#include &lt;type_traits&gt;
  class A{};
  class B{};
  class C{
      public:
      A* a;
      B* b;
  };
  
  template&lt;typename T, typename std::enable_if&lt;std::is_same&lt;typename std::remove_reference&lt;T&gt;::type,A*&gt;::value&gt;::type* = nullptr &gt;
  void f(T&amp;&amp; t) { 
      return;
  }
  
  int main() { 
      C c;
      auto&amp; cRef = c;
      f(cRef.a);
      f(c.a);
  }
  </code></pre>
  
  <p>g++ /tmp/enable_if.cpp -std=c++0x</p>
  
  <pre><code>/tmp/enable_if.cpp: In function ‘int main()’:
  /tmp/enable_if.cpp:20:13: error: no matching function for call to ‘f(A*&amp;)’
  /tmp/enable_if.cpp:20:13: note: candidate is:
  /tmp/enable_if.cpp:13:6: note: template&lt;class T, typename std::enable_if&lt;std::is_same&lt;typename std::remove_reference&lt;_MemPtr&gt;::type, A*&gt;::value, void&gt;::type* &lt;anonymous&gt; &gt; void f(T&amp;&amp;)
  /tmp/enable_if.cpp:21:10: error: no matching function for call to ‘f(A*&amp;)’
  /tmp/enable_if.cpp:21:10: note: candidate is:
  /tmp/enable_if.cpp:13:6: note: template&lt;class T, typename std::enable_if&lt;std::is_same&lt;typename std::remove_reference&lt;_MemPtr&gt;::type, A*&gt;::value, void&gt;::type* &lt;anonymous&gt; &gt; void f(T&amp;&amp;)
  </code></pre>