1

on compilation this 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? I want it to inherit from boost.tuple.

Luc Touraille
  • 79,925
  • 15
  • 92
  • 137
niXman
  • 1,698
  • 3
  • 16
  • 40

1 Answers1

1

Inherit from boost::fusion::tuple instead of boost::tuple.
Note: Consider making void operator()(const std::string& v) const

Anthony Pegram
  • 123,721
  • 27
  • 225
  • 246
Eugen Constantin Dinca
  • 8,994
  • 2
  • 34
  • 51