Skip to content

Commit a3d7c2f

Browse files
committed
rpc: rpc_types: replace boost::any with std::any
Technically speaking the type was public, but realistically everyone should have used the provided accessors.
1 parent 39f1d6b commit a3d7c2f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: include/seastar/rpc/rpc_types.hh

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <seastar/net/api.hh>
3232
#include <stdexcept>
3333
#include <string>
34-
#include <boost/any.hpp>
34+
#include <any>
3535
#include <boost/type.hpp>
3636
#include <seastar/util/std-compat.hh>
3737
#include <seastar/util/variant_utils.hh>
@@ -99,16 +99,16 @@ struct client_info {
9999
socket_address addr;
100100
rpc::server& server;
101101
connection_id conn_id;
102-
std::unordered_map<sstring, boost::any> user_data;
102+
std::unordered_map<sstring, std::any> user_data;
103103
template <typename T>
104104
void attach_auxiliary(const sstring& key, T&& object) {
105-
user_data.emplace(key, boost::any(std::forward<T>(object)));
105+
user_data.emplace(key, std::any(std::forward<T>(object)));
106106
}
107107
template <typename T>
108108
T& retrieve_auxiliary(const sstring& key) {
109109
auto it = user_data.find(key);
110110
assert(it != user_data.end());
111-
return boost::any_cast<T&>(it->second);
111+
return std::any_cast<T&>(it->second);
112112
}
113113
template <typename T>
114114
std::add_const_t<T>& retrieve_auxiliary(const sstring& key) const {
@@ -120,15 +120,15 @@ struct client_info {
120120
if (it == user_data.end()) {
121121
return nullptr;
122122
}
123-
return &boost::any_cast<T&>(it->second);
123+
return &std::any_cast<T&>(it->second);
124124
}
125125
template <typename T>
126126
const T* retrieve_auxiliary_opt(const sstring& key) const noexcept {
127127
auto it = user_data.find(key);
128128
if (it == user_data.end()) {
129129
return nullptr;
130130
}
131-
return &boost::any_cast<const T&>(it->second);
131+
return &std::any_cast<const T&>(it->second);
132132
}
133133
};
134134

0 commit comments

Comments
 (0)