Casting std::tr1::shared_ptr<T> and std::shared_ptr<T> with same function but different overloads
<p>In my current project we are building for Linux and Windows at the same time. 
Unfortunately because some platform issues our MSVC is very old. We are using MSVC 2010. And gcc we are using relatively new and smarter which has the version 4.8 . </p>

<p>The code below compile in gcc but MSCV nags about it : </p>

<pre><code>template&lt;class T, class U&gt;
std::shared_ptr&lt;T&gt; Cast( const std::shared_ptr&lt;U&gt;&amp; spObject )   // rename from CastTerrainObject
{
    return std::dynamic_pointer_cast&lt;T&gt;(spObject);
}

template&lt;class T, class U&gt;
std::tr1::shared_ptr&lt;T&gt; Cast( const std::tr1::shared_ptr&lt;U&gt;&amp; spObject ) // rename from CastTerrainObject
{
    return std::tr1::dynamic_pointer_cast&lt;T&gt;(spObject);
}
</code></pre>

<p>MSVC began nagging after I add the second overload for std::tr1::shared_ptr.
The compile errors I am getting repeatedly : </p>

<pre><code>error C2995: 'std::tr1::shared_ptr&lt;_Ty&gt; Cast(const std::tr1::shared_ptr&lt;_Ty2&gt; &amp;)' : function template has already been defined

And 

 error C2440: 'initializing' : cannot convert from 'std::tr1::shared_ptr&lt;_Ty&gt; (__cdecl *)(const std::tr1::shared_ptr&lt;_Ty2&gt; &amp;)' to 'std::tr1::shared_ptr&lt;_Ty&gt;'
</code></pre>

<p>Do you guys have a solution for my case? </p>