变量,我想请教一下在C++中的typedef变量的typedef在C++
好了,我现在正在使用PCL,我想代码分离到的.h和.cpp
,这里是我的.h文件
template <typename PointType>
class OpenNIViewer
{
public:
typedef pcl::PointCloud<PointType> Cloud;
typedef typename Cloud::ConstPtr CloudConstPtr;
...
...
CloudConstPtr getLatestCloud();
...
...
};
然后getLatestCloud()对其他.cpp文件
template <typename PointType>
CloudConstPtr OpenNIViewer<PointType>::getLatestCloud()
{
...
}
然后我得到了C4430的定义错误,因为它不承认返回类型CloudConstPtr
抱歉愚蠢的问题:d
啊,谢谢你的回答,反正我发现模板类不应该分开来的.h和.cpp 我应该把他们都在一个单一的.h代替:d – 2012-03-24 07:50:43
@RezaAdhityaSaputra:是的。把它们放在单个'.h'文件中 – Nawaz 2012-03-24 07:54:36