lundi 18 décembre 2017

Return type of a call only using information on types and not on objects

Consider the following code:

template <class F, class... Args>
void function(F&& f, Args&&... args)
{
    using type1 = decltype(std::forward<F>(f)(std::forwards<Args>(args)...));
    using type2 = decltype(/*equivalent expression but only using types */);
}

Is there a way to make type2 the same as type1 in all cases but only using the types in the decltype expression, or in other words only using F and Args and not f and args?

Aucun commentaire:

Enregistrer un commentaire