Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// 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