jeudi 28 décembre 2017

What does "using X = int(&)()" do?

I have been seen following type of code when i browsing Quora.

#include <iostream>
int f() { return 1; }
int main()
{
    int (&var1)() = f;
    using X = int(&)();
    int i = reinterpret_cast<X>(var1)();
    std::cout << " i = " << i << '\n';
}

So, What does using X = int(&)() do?

Aucun commentaire:

Enregistrer un commentaire