Advertisement
frasl

Untitled

Feb 18th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. template <typename T, int count>
  2. struct counter {
  3.     constexpr T sumup() const
  4.     {
  5.         T sum = 0;
  6.         for (int i = 0; i < count; ++i)
  7.             sum += i;
  8.  
  9.         return sum;
  10.     }
  11. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement