cppzmq icon indicating copy to clipboard operation
cppzmq copied to clipboard

Fix deprecated literal operator

Open cielavenir opened this issue 10 months ago • 2 comments

On clang 20, this happens:

$ clang++-20 zmq.hpp
zmq.hpp:1367:35: warning: identifier '_zbuf' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
 1367 | constexpr const_buffer operator"" _zbuf(const char *str, size_t len) noexcept
      |                        ~~~~~~~~~~~^~~~~
      |                        operator""_zbuf
zmq.hpp:1371:35: warning: identifier '_zbuf' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
 1371 | constexpr const_buffer operator"" _zbuf(const wchar_t *str, size_t len) noexcept
      |                        ~~~~~~~~~~~^~~~~
      |                        operator""_zbuf
zmq.hpp:1375:35: warning: identifier '_zbuf' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
 1375 | constexpr const_buffer operator"" _zbuf(const char16_t *str, size_t len) noexcept
      |                        ~~~~~~~~~~~^~~~~
      |                        operator""_zbuf
zmq.hpp:1379:35: warning: identifier '_zbuf' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
 1379 | constexpr const_buffer operator"" _zbuf(const char32_t *str, size_t len) noexcept
      |                        ~~~~~~~~~~~^~~~~
      |                        operator""_zbuf
4 warnings generated.

cielavenir avatar Feb 25 '25 03:02 cielavenir

It looks like this was already merged: https://github.com/zeromq/cppzmq/pull/652

mschubert avatar Apr 15 '25 17:04 mschubert

@mschubert may I ask which is better, operator ""_zbuf or operator""_zbuf?

cielavenir avatar Apr 17 '25 07:04 cielavenir