Skip to content

Instantly share code, notes, and snippets.

@qbit86
Last active December 15, 2016 20:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save qbit86/aaa7b953649dd01e595bd8d2ca43247d to your computer and use it in GitHub Desktop.
Save qbit86/aaa7b953649dd01e595bd8d2ca43247d to your computer and use it in GitHub Desktop.
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