エラー:boost.fusion :: for_each()とboost.tuple由来の構造体
-
26-09-2019 - |
質問
のコンパイルでこのコード:
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::tuple
のboost::tuple
から。
注: void operator()(const std::string& v)
のconst
所属していません StackOverflow