Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Type Inference in C++11
int original = 42;
decltype(original) copy = original;
decltype((original)) reference = original;
original = 1729;
std::cout << copy << std::endl; // 42
std::cout << reference << std::endl; // 1729
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.