diff --git a/src/communication/bolt/v1/decoder/decoded_value.cpp b/src/communication/bolt/v1/decoder/decoded_value.cpp index 12a0e298e..8bfdcc3dd 100644 --- a/src/communication/bolt/v1/decoder/decoded_value.cpp +++ b/src/communication/bolt/v1/decoder/decoded_value.cpp @@ -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; \ diff --git a/src/communication/bolt/v1/decoder/decoded_value.hpp b/src/communication/bolt/v1/decoder/decoded_value.hpp index 3edef6b19..ff320e955 100644 --- a/src/communication/bolt/v1/decoder/decoded_value.hpp +++ b/src/communication/bolt/v1/decoder/decoded_value.hpp @@ -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)