Frage

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

Fehler: kein Typ mit dem Namen ‚Kategorie‘ in ‚struct bel._Typ‘ Warum? Ich will es von Boost.Tuple erben.

War es hilfreich?

Lösung

vererben boost::fusion::tuple statt boost::tuple.
Hinweis: Überlegen Sie void operator()(const std::string& v) const

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top