for文ではなく、std::copyで参照配列を作成したいです。
下記for文は動きますが、
C++
1 std::vector<const DataIn*> ref; 2 for (const DataIn& f : data) //dataはstd::vector<DataIn> 3 { 4 ref.push_back(&f); 5 }
下記std::copyはalgorithmエラーが発生します。
C++
1 std::vector<const DataIn*> ref; 2 std::copy(data.begin(), data.end(), std::back_inserter(ref) );
どのように修正すれば良いでしょうか?
宜しくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/02/03 06:47 編集