c++ - error: boost.fusion::for_each() and struct derived from boost.tuple -


on compilation code:

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: no type named 'category' in 'struct any_type' why? want inherit boost.tuple.

inherit boost::fusion::tuple instead of boost::tuple.
note: consider making void operator()(const std::string& v) const


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -