errore: boost.fusion :: for_each () e struct derivati da boost.tuple
-
26-09-2019 - |
Domanda
sulla compilazione di questo codice:
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());
}
ottenere errore: nessun tipo di nome 'categoria' a 'struct quals._tipo' perché? Voglio che ereditare da boost.tuple.
Soluzione
Eredita dal boost::fusion::tuple
invece di boost::tuple
.
Nota: Considerare la void operator()(const std::string& v)
const
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow