From 157247f98fcfe73dbb126b740206e8603eb6e002 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 3 Jun 2022 17:20:03 +0200 Subject: [PATCH] asio: fix example for compatibility with C++20 Fix deprecated-enum-enum-conversion warning when compiling the example with C++20 --- examples/protocols/asio/asio_chat/main/chat_message.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/protocols/asio/asio_chat/main/chat_message.hpp b/examples/protocols/asio/asio_chat/main/chat_message.hpp index 629105b05b..a6ffc83b8c 100644 --- a/examples/protocols/asio/asio_chat/main/chat_message.hpp +++ b/examples/protocols/asio/asio_chat/main/chat_message.hpp @@ -18,8 +18,8 @@ class chat_message { public: - enum { header_length = 4 }; - enum { max_body_length = 512 }; + static constexpr std::size_t header_length = 4; + static constexpr std::size_t max_body_length = 512; chat_message() : body_length_(0)