File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 10
10
11
11
#include < boost/redis/resp3/node.hpp>
12
12
#include < boost/redis/adapter/adapt.hpp>
13
- #include < boost/system/detail/ error_code.hpp>
13
+ #include < boost/system/error_code.hpp>
14
14
#include < cstddef>
15
15
#include < functional>
16
16
#include < string_view>
17
17
#include < type_traits>
18
18
19
19
namespace boost ::redis {
20
20
21
+ namespace detail {
22
+
23
+ // Forward decl
24
+ template <class Executor >
25
+ class connection_base ;
26
+
27
+ }
28
+
21
29
class any_adapter
22
30
{
23
31
using fn_type = std::function<void (std::size_t , resp3::basic_node<std::string_view> const &, system::error_code&)>;
@@ -36,12 +44,12 @@ class any_adapter
36
44
return { std::move (adapter), size };
37
45
}
38
46
47
+ template <class Executor >
48
+ friend class detail ::connection_base;
49
+
39
50
public:
40
51
template <class T , class = std::enable_if_t <!std::is_same_v<T, any_adapter>>>
41
52
explicit any_adapter (T& response) : impl_(create_impl(response)) {}
42
-
43
- // TODO: make this private
44
- auto get_impl () && { return std::move (impl_); }
45
53
};
46
54
47
55
}
Original file line number Diff line number Diff line change @@ -445,9 +445,9 @@ class connection_base {
445
445
}
446
446
447
447
template <class CompletionToken >
448
- auto async_exec (request const & req, any_adapter adapter, CompletionToken&& token)
448
+ auto async_exec (request const & req, any_adapter&& adapter, CompletionToken&& token)
449
449
{
450
- auto adapter_impl = std::move ( adapter). get_impl () ;
450
+ auto & adapter_impl = adapter. impl_ ;
451
451
BOOST_ASSERT_MSG (req.get_expected_responses () <= adapter_impl.supported_response_size , " Request and response have incompatible sizes." );
452
452
453
453
auto info = std::make_shared<req_info>(req, std::move (adapter_impl.adapt_fn ), get_executor ());
You can’t perform that action at this time.
0 commit comments