質問

のコンパイルでこのコード:

struct any_type: boost::tuple<std::string, std::string, std::string> {
   ...
};

struct functor {
   void operator()(const std::string& v) {
      std::cout << v << std::endl;
   }
};

int main() {
   any_type type;
   boost::fusion::for_each(type, functor());
}

GET ERROR: '構造体ANY_TYPE' で 'カテゴリ' という名前の無いタイプ どうして? 私はそれがboost.tupleを継承したい。

役に立ちましたか?

解決

継承の代わりにboost::fusion::tupleboost::tupleから。
注: void operator()(const std::string& v)のconst

ことを検討
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top