mardi 1 décembre 2015

Understanding function pointers and reference

Consider the following types:

template <class R, class... Args> using type0 = R(Args...);
template <class R, class... Args> using type1 = R(*)(Args...);
template <class R, class... Args> using type2 = R(&)(Args...);
template <class R, class C, class... Args> using type3 = R(C::*)(Args...);
template <class R, class C, class... Args> using type4 = R(C::&)(Args...);
// Any other existing syntax? R(&&)(Args...)? R(const*)(Args...)? R()(Args..)?

What types actually exist? What is the difference between type0, type1, type2, type3, type4? What does the middle parenthesis mean? Are they all function pointers? Where could I find an exhaustive documentation about this syntax, because it is very unclear to me?

Aucun commentaire:

Enregistrer un commentaire