Decoded value - returning non-const primitives by ref
Reviewers: mferencevic, mislav.bradac Reviewed By: mferencevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D820
This commit is contained in:
parent
383175d85f
commit
f2a82f4f58
@ -3,6 +3,10 @@
|
||||
namespace communication::bolt {
|
||||
|
||||
#define DEF_GETTER_BY_VAL(type, value_type, field) \
|
||||
value_type &DecodedValue::Value##type() { \
|
||||
if (type_ != Type::type) throw DecodedValueException(); \
|
||||
return field; \
|
||||
} \
|
||||
value_type DecodedValue::Value##type() const { \
|
||||
if (type_ != Type::type) throw DecodedValueException(); \
|
||||
return field; \
|
||||
|
@ -122,6 +122,7 @@ class DecodedValue {
|
||||
Type type() const { return type_; }
|
||||
|
||||
#define DECL_GETTER_BY_VALUE(type, value_type) \
|
||||
value_type &Value##type(); \
|
||||
value_type Value##type() const;
|
||||
|
||||
DECL_GETTER_BY_VALUE(Bool, bool)
|
||||
|
Loading…
Reference in New Issue
Block a user