1

这是我班级中的函数声明:

template <typename PointInT, typename PointNT, typename PointOutT>
class WrinklednessEstimation: public FeatureFromNormals<PointInT, PointNT, PointOutT>
{
    ...
    void normalsToSpherical(const PointCloud<PointNT> &input, PointCloud<Normal> &output);
    ...
}

这是实现的一部分:

template <typename PointInT, typename PointNT, typename PointOutT> void
pcl::WrinklednessEstimation<PointInT, PointNT, PointOutT>::normalsToSpherical(const PointCloud<PointNT> &input, PointCloud<Normal> &output)
{
    ...
}

这是编译器抱怨:

wrinkledness.cpp: In member function ‘void pcl::WrinklednessEstimation<PointInT, PointNT, pointOutT>::computeFeature(typename pcl::Feature<PointInT, PointOutT>::PointCloudOut&) [with PointInT = pcl::PointWithViewpoint, PointNT = pcl::Normal, PointOutT = pcl::InterestPoint]’:
wrinkledness.cpp:76:   instantiated from here
wrinkledness.cpp:40: error: no matching function for call to ‘pcl::WrinklednessEstimation<pcl::PointWithViewpoint, pcl::Normal, pcl::InterestPoint>::normalsToSpherical(boost::shared_ptr<const pcl::PointCloud<pcl::Normal> >&, boost::shared_ptr<pcl::PointCloud<pcl::Normal> >&)’
wrinkledness.cpp:45: note: candidates are: void pcl::WrinklednessEstimation<PointInT, PointNT, PointOutT>::normalsToSpherical(const pcl::PointCloud<PointOutT>&, pcl::PointCloud<pcl::Normal>&) [with PointInT = pcl::PointWithViewpoint, PointNT = pcl::Normal, PointOutT = pcl::InterestPoint]

我不明白的是,为什么候选人有PointOutT而不是PointNT在第一个参数?

谢谢

4

1 回答 1

4

boost::shared_ptr在调用函数时用作参数。尝试使用类似的方法调用该函数*my_shared_ptr

于 2012-05-22T08:16:44.743 回答