Closed ghost closed 1 year ago
Nice, I was going to add this myself. The question is if I should bump the required C++ standard to C++17 which includes [[nodiscard]]
or use macros to support C++11.
I was under the impression that unknown attributes are ignored by major compilers. After some research it turns out this is a c++ 17 feature. Macros are better suited then.
This approach seems to work well https://github.com/rigtorp/SPSCQueue/pull/31
Done. Also, if not too persnickety, I see no reason to #include a pure C header \<stdlib.h> instead of \<cstdlib>, especially as the other two C headers (cassert, cstddef) were included that way.
Done. Also, if not too persnickety, I see no reason to #include a pure C header
instead of , especially as the other two C headers (cassert, cstddef) were included that way.
Yes I agree.
Shouldn't try_pop, try_push etc also have NODISCARD?
Add [[nodiscard]] attributes