1

ブーストでは、特定のものをboost::accumulators::tag動的に削除することは可能accumulator_setですか?

typedef boost::accumulators::features <
    boost::accumulators::tag::count,
    boost::accumulators::tag::max,
    boost::accumulators::tag::min,
    boost::accumulators::tag::mean,
    boost::accumulators::tag::variance,
    boost::accumulators::tag::skewness,
    boost::accumulators::tag::kurtosis,
> StatisticalFeatures;
accumulator_set<double, boost::accumulators::stats<StatisticalFeatures>> acc;

または、代わりに、文字列からいくつかを指定できる場所に新しいboost::accumulators::statsコンテナーを割り当てます。たとえば、文字列が の場合、新しい を作成します 。accumulator_setboost::accumulators::tagmin,max,meanaccumulator_set<double,bost::accumulators::stats<boost::accumulators::tag::min,boost::accumulators::tag::max,boost::accumulators::tag::mean>> acc

アドバイスをいただきありがとうございます。

4

1 に答える 1

0

短い答え:いいえ。

より長い答え: 型消去と多くのテンプレート メタプログラミングにより、すべてが可能になります。

これが本当に必要だと思われる場合は、.Boost Function や Boost Erasure などを使用して開始するか、より詳細な目標と行き詰まっている場所を記載した質問を投稿してください。「新しいboost::accumulators::statsコンテナをaccumulator_setに割り当て、文字列からboost::accumulators::tagを指定できる」と解釈できる方法が多すぎます。

組み合わせが限られている場合は、Boost Variant が味方です。それ以外の場合は、Boost Any および ... 多くの特殊なケースで結果を抽出します。これは /lot/ のメタ プログラミングになりますが、

実際には、余裕がある場合は、「最大機能」のアキュムレータ セットを使用して、テキスト構成に従って 1 回だけ公開してみませんか? 実行時に必要以上の作業を行うことになりますが、開発側の労力を大幅に節約できます。

于 2015-01-08T22:09:32.827 に答える