This question already has an answer here:
I'm trying to use std::result_of
to determine the return type of a callable object:
template <typename T>
std::result_of<T()>::type CallableWrapper(T callableObj) {
return callableObj();
}
Somewhere else in the code:
auto i = CallableWrapper([](){return 1;});
This code doesn't compile for some reason. I will appreciate if someone would tell me why.
Aucun commentaire:
Enregistrer un commentaire