これは動作します:クラスインスタンスをクラスメンバに移動した後、クラスインスタンスを初期化できませんか?
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud2 (new pcl::PointCloud<pcl::PointXYZ>);
しかし、これは動作しません。
Class.h、プライベート変数
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud;
Class.cpp、コンストラクタ
cloud (new pcl::PointCloud<pcl::PointXYZ>);
に
メイクに失敗した:
error: no match for call to ‘(pcl::PointCloud<pcl::PointXYZ>::Ptr {aka boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> >}) (pcl::PointCloud<pcl::PointXYZ>*)’
cloud (new pcl::PointCloud<pcl::PointXYZ>);
どうして同じではないのですか? .cppから見た唯一の違いは、型が左側(宣言中)であり、一方がすでに.hで宣言されていることですが、エラーはどちらも同じ引数を使用するにもかかわらず、引数について文句を言うようです。
私は質問に答えるには十分だとは思っていませんが、初期化子のliで 'cloud'を初期化していないようですst。質問を編集してコンストラクタ全体を表示する必要があります。 – dwcanillas
'bar(foo)'は代入構文ではありません。 [mcve]を表示してください。 –