Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
decltype(z) u = 4; //int
decltype(w) t = u; //int&
std::cout << u << " " << t << "\n"; //4 4
t = 16;
std::cout << u << " " << t << "\n"; //16 16
decltype(e + e) a1 = e + e; //decltype with expression
std::cout << a1 << "\n"; //5.43656
decltype(make_square_pair(10)) a2 = make_square_pair(10);
std::cout << get_y(a2) << " -> "<< typeid(a2).name() << "\n"; //100 -> struct f_pair<int>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment