Pregunta

en la compilación de este código:

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());
}

obtener error: ningún tipo llamado 'categoría' en 'struct any_type' ¿por qué? Yo quiero que heredan de boost.tuple.

¿Fue útil?

Solución

Heredar del boost::fusion::tuple en lugar de boost::tuple.
Nota: Considere hacer void operator()(const std::string& v) const

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top