Cannot convert parameter from T to T&
<p>I am having trouble with calling calling specialized template function. </p>

<p>My code goes like this:</p>

<pre><code>namespace{
    struct Y {};
}

template&lt;&gt;
bool pcl::visualization::PCLVisualizer::addPointCloud&lt;Y&gt;(const typename pcl::PointCloud&lt; Y &gt;::ConstPtr &amp;cloud, const std::string &amp;id, int viewport);
</code></pre>

<p>and the calling spot is:</p>

<pre><code>pcl::PointCloud&lt;Y&gt;::Ptr cloud(new pcl::PointCloud&lt;Y&gt;);
visualizer-&gt;addPointCloud(cloud, "cloud", 0);
</code></pre>

<p>Error I am getting is </p>

<pre><code>'bool pcl::visualization::PCLVisualizer::addPointCloud(const boost::shared_ptr&lt;T&gt; &amp;,const std::string &amp;,int)' : cannot convert parameter 1 from 'boost::shared_ptr&lt;T&gt;' to 'const boost::shared_ptr&lt;T&gt; &amp;'
</code></pre>

<p>Here are some declarations and typedefs from library:</p>

<pre><code>typedef boost::shared_ptr&lt;PointCloud&lt;PointT&gt; &gt; Ptr;
typedef boost::shared_ptr&lt;const PointCloud&lt;PointT&gt; &gt; ConstPtr;

template &lt;typename PointT&gt; bool pcl::visualization::PCLVisualizer::addPointCloud(
    const typename pcl::PointCloud&lt;PointT&gt;::ConstPtr &amp;cloud,
    const std::string &amp;id, int viewport
)
</code></pre>

<p>I've tried with the <code>boost::shared_ptr&lt;const pcl::PointCloud&lt;Y&gt; &gt; cloud;</code>, but same error rises again.</p>

<p>I am desperately trying to debug one issue in the library which would be very easy to debug if I could access one private map, and iterate through it, but I can't compile the whole library as it would take some time (and I just want to peek into it - I know it is wrong, but I am struggling for the whole day with this)</p>

<p>Compiler is VC++ 10. </p>

<p>Thank you</p>
