Skip to content

Instantly share code, notes, and snippets.

@relrod
Created October 8, 2013 01:27
Show Gist options
  • Save relrod/6877980 to your computer and use it in GitHub Desktop.
Save relrod/6877980 to your computer and use it in GitHub Desktop.
polymorphic id in c++
#include <iostream>
template <class foo>
foo id(foo x) { return x; }
int main() {
std::cout << id(123) << std::endl;
}
// 123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment