Fehler: boost.fusion :: for_each () und von struct Boost.Tuple abgeleiteten
-
26-09-2019 - |
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.
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