constexpr icon indicating copy to clipboard operation
constexpr copied to clipboard

Counter Not Counting

Open Asher- opened this issue 8 years ago • 1 comments

Counter does not seem to be counting up.

∴ clang -std=c++1z -I../include cx_counter.cpp 
cx_counter.cpp:6:3: error: static_assert failed "counter(1)"
  static_assert(cx::counter() == 1, "counter(1)");
  ^             ~~~~~~~~~~~~~~~~~~
cx_counter.cpp:7:3: error: static_assert failed "counter(2)"
  static_assert(cx::counter() == 2, "counter(2)");
  ^             ~~~~~~~~~~~~~~~~~~
cx_counter.cpp:8:3: error: static_assert failed "counter(3)"
  static_assert(cx::counter() == 3, "counter(3)");
  ^             ~~~~~~~~~~~~~~~~~~
3 errors generated.

Asher- avatar Jan 28 '17 17:01 Asher-

I suppose this counter implementation won't work when compiled with GCC 8 and above. Similar implementation works for me in case of all lower GCC versions.

m-peko avatar Oct 01 '20 09:10 m-peko