manasij7479

TMP add with enum hack

Jul 25th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.13 KB | None | 0 0
  1. #include<iostream>
  2. template <int X,int Y>
  3. struct add
  4. {
  5.     enum {Value = X+Y };
  6. };
  7. int main()
  8. {
  9.     std::cout<<add<2,3>::Value;
  10. }
Add Comment
Please, Sign In to add comment