views:

56

answers:

1

Hi all! 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.

+1  A: 

Inherit from boost::fusion::tuple instead of boost::tuple.
Note1: Consider making void operator()(const std::string& v) const
Note2: a 0% accept rate usually does NOT help you get answers..

Eugen Constantin Dinca
Thanks.it works:)
niXman
Cool. Don't forget Note2 :)
Eugen Constantin Dinca