私は、Calum Grant http://calumgrant.net/units/のC++ Unitsライブラリを使用して、長さまたは速度を表す値を管理しています。C++ユニットを使用した場合の "incomplete type" :: compose
このライブラリで指定されていないユニットが必要です。これは1分あたりのフィートです。
typedef units::compose< units::units::m, units::pow<units::units::s, -1> > meters_per_second;
をが、この例では動作しません:http://calumgrant.net/units/units.htmlによると、あなたは、このように新しいユニットを作ることができます。私は
typedef units::compose< units::units::foot, units::pow<units::units::minute, -1> >
feet_per_minute;
feet_per_minute vertical_speed(12);
を指定した場合、私は(Mac上でGCC 4.2.1を使用して)以下のコンパイルエラーを取得
error: variable 'feet_per_minute vertical_speed' has initializer but incomplete type
と、このエラー欠けている何を打ち鳴らす3
error: implicit instantiation of undefined template 'units::compose<units::scale<units::scale<units::scale<units::units::m, 100, 1>, 100, 254>, 1, 12>, units::pow<units::scale<units::units::s, 1, 60>, -1, 1> >'
でコンパイルするとき?
フィート?真剣に? –