Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created May 3, 2017 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/7c9df369489da9406ba318b9332f1481 to your computer and use it in GitHub Desktop.
Save deque-blog/7c9df369489da9406ba318b9332f1481 to your computer and use it in GitHub Desktop.
// Meta-function
template <int a, int b>
struct add_struct
{
enum { value = a + b };
};
// Compute the value at compile time
add_struct<1, 2>::value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment