2
0
mirror of https://github.com/boostorg/redis.git synced 2026-01-19 04:42:09 +00:00

Marks the next_layer() functions as deprecated (#256)

CI builds now use BOOST_ALLOW_DEPRECATED to prevent warnings
This commit is contained in:
Anarthal (Rubén Pérez)
2025-05-25 11:05:07 +02:00
committed by GitHub
parent e8b13bd7a0
commit b58e4f94de
3 changed files with 15 additions and 0 deletions

View File

@@ -42,6 +42,7 @@
#include <boost/asio/steady_timer.hpp>
#include <boost/asio/write.hpp>
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/core/ignore_unused.hpp>
#include <array>
@@ -745,9 +746,15 @@ public:
}
/// Returns a reference to the next layer.
BOOST_DEPRECATED(
"Accessing the underlying stream is deprecated and will be removed in the next release. Use "
"the other member functions to interact with the connection.")
auto& next_layer() noexcept { return *stream_; }
/// Returns a const reference to the next layer.
BOOST_DEPRECATED(
"Accessing the underlying stream is deprecated and will be removed in the next release. Use "
"the other member functions to interact with the connection.")
auto const& next_layer() const noexcept { return *stream_; }
/// Sets the response object of `async_receive` operations.
@@ -915,9 +922,15 @@ public:
bool will_reconnect() const noexcept { return impl_.will_reconnect(); }
/// Calls `boost::redis::basic_connection::next_layer`.
BOOST_DEPRECATED(
"Accessing the underlying stream is deprecated and will be removed in the next release. Use "
"the other member functions to interact with the connection.")
auto& next_layer() noexcept { return impl_.next_layer(); }
/// Calls `boost::redis::basic_connection::next_layer`.
BOOST_DEPRECATED(
"Accessing the underlying stream is deprecated and will be removed in the next release. Use "
"the other member functions to interact with the connection.")
auto const& next_layer() const noexcept { return impl_.next_layer(); }
/// Calls `boost::redis::basic_connection::reset_stream`.

View File

@@ -9,6 +9,7 @@ if (MSVC)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(boost_redis_project_options INTERFACE -Wall -Wextra -Werror)
endif()
target_compile_definitions(boost_redis_project_options INTERFACE BOOST_ALLOW_DEPRECATED=1) # we need to still test deprecated fns
add_library(boost_redis_src STATIC boost_redis.cpp)
target_compile_features(boost_redis_src PRIVATE cxx_std_17)

View File

@@ -14,6 +14,7 @@ local requirements =
<define>BOOST_ASIO_DISABLE_BOOST_BIND=1
<define>BOOST_ASIO_DISABLE_BOOST_DATE_TIME=1
<define>BOOST_ASIO_DISABLE_BOOST_REGEX=1
<define>BOOST_ALLOW_DEPRECATED=1 # we need to test deprecated fns
<toolset>msvc:<cxxflags>"/bigobj"
<target-os>windows:<define>_WIN32_WINNT=0x0601
[ requires