title: Call template function for the value of a pointer out of a template function, in C++
body: <p>I am trying to call a template function for the pointer that was given as template parameter in my calling function. My code is:</p>
  
  <pre><code>template &lt;&gt;
  struct serialize_helper&lt;std::string&gt; {
       // not important code...
      }
  
  };
  
  template &lt;class T&gt;
  inline void serializer(const T&amp; obj, StreamType::iterator&amp; res) {
  
      if(std::is_pointer&lt;T&gt;::value)
      {
          //THIS doesn' work
          serialize_helper&lt;*T&gt;::apply(*obj,res);
      }
      else
          serialize_helper&lt;T&gt;::apply(obj,res);
  
  }
  </code></pre>
  
  <p>If I call:</p>
  
  <pre><code>std::string test("test");
  serializer(test, res);
  </code></pre>
  
  <p>everything works fine.
  But I want also to be able to call the serializer with a pointer as obj:</p>
  
  <pre><code>std::string test* = new std::string("test");
  serializer(test, res);
  </code></pre>
  
  <p>Dereferencing the pointer before calling the serializer function is not a possible option, please do not propose that. Inside the serializer function it is possible.</p>
  
  <p>Shorter description: I want to call <code>serializer</code> with a <code>std::string*</code> and have that do the same thing has if I'd called it with the <code>std::string</code> it points to.</p>