File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
hazelcast/include/hazelcast/client/protocol Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,9 @@ struct HAZELCAST_API is_trivial_entry_vector<
195
195
*/
196
196
class HAZELCAST_API ClientMessage
197
197
{
198
+ template <typename T>
199
+ struct default_nullable_decoder ;
200
+
198
201
public:
199
202
static constexpr size_t EXPECTED_DATA_BLOCK_SIZE = 1024 ;
200
203
@@ -1002,10 +1005,8 @@ class HAZELCAST_API ClientMessage
1002
1005
}
1003
1006
1004
1007
template <typename T>
1005
- boost::optional<T> get_nullable (std::function<T(ClientMessage&)> decoder =
1006
- [](ClientMessage& msg) {
1007
- return msg.get <T>();
1008
- })
1008
+ boost::optional<T> get_nullable (
1009
+ std::function<T(ClientMessage&)> decoder = default_nullable_decoder<T>{})
1009
1010
{
1010
1011
if (next_frame_is_null_frame ()) {
1011
1012
// skip next frame with null flag
@@ -1439,6 +1440,12 @@ class HAZELCAST_API ClientMessage
1439
1440
static const frame_header_type BEGIN_FRAME;
1440
1441
static const frame_header_type END_FRAME;
1441
1442
1443
+ template <typename T>
1444
+ struct default_nullable_decoder
1445
+ {
1446
+ T operator ()(ClientMessage& msg) const { return msg.get <T>(); }
1447
+ };
1448
+
1442
1449
template <typename T>
1443
1450
void set_primitive_vector (const std::vector<T>& values,
1444
1451
bool is_final = false )
You can’t perform that action at this time.
0 commit comments