From 77f82e19340dbeeb9199d2ced16ae4c2ed415db3 Mon Sep 17 00:00:00 2001 From: Filippo Brizzi Date: Tue, 2 Apr 2024 11:39:31 +0200 Subject: [PATCH] Fix: improve protobuf concept (#39) # Description Cleanup `ProtobufSerializable` concept. --- .../serdes/include/hephaestus/serdes/protobuf/concepts.h | 4 +--- modules/serdes/include/hephaestus/serdes/serdes.h | 6 +----- modules/utils/src/version_impl.h | 6 +++--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/serdes/include/hephaestus/serdes/protobuf/concepts.h b/modules/serdes/include/hephaestus/serdes/protobuf/concepts.h index 12e17b69..0b7b9e20 100644 --- a/modules/serdes/include/hephaestus/serdes/protobuf/concepts.h +++ b/modules/serdes/include/hephaestus/serdes/protobuf/concepts.h @@ -9,9 +9,7 @@ namespace heph::serdes::protobuf { template -struct ProtoAssociation { - using Type = void; -}; +struct ProtoAssociation {}; template concept ProtobufMessage = requires(T proto, void* out_data, const void* in_data, int size) { diff --git a/modules/serdes/include/hephaestus/serdes/serdes.h b/modules/serdes/include/hephaestus/serdes/serdes.h index 6e49c8de..04e72975 100644 --- a/modules/serdes/include/hephaestus/serdes/serdes.h +++ b/modules/serdes/include/hephaestus/serdes/serdes.h @@ -11,11 +11,7 @@ namespace heph::serdes { template -concept ProtobufSerializable = requires(T data) { - { !std::is_same_v::Type, void> }; -}; - -// ProtoAssociation::Type +concept ProtobufSerializable = protobuf::ProtobufMessage::Type>; template [[nodiscard]] auto serialize(const T& data) -> std::vector; diff --git a/modules/utils/src/version_impl.h b/modules/utils/src/version_impl.h index 6c2304ab..1b280f2e 100644 --- a/modules/utils/src/version_impl.h +++ b/modules/utils/src/version_impl.h @@ -17,8 +17,8 @@ static constexpr std::uint8_t VERSION_MAJOR = 0; static constexpr std::uint8_t VERSION_MINOR = 0; static constexpr std::uint16_t VERSION_PATCH = 1; -static constexpr std::string_view REPO_BRANCH = "feature/spinner"; -static constexpr std::string_view BUILD_PROFILE = "RelWithDebInfo"; -static constexpr std::string_view REPO_HASH = "6b4f737"; +static constexpr std::string_view REPO_BRANCH = "fix/proto_concept"; +static constexpr std::string_view BUILD_PROFILE = "Release"; +static constexpr std::string_view REPO_HASH = "900c283"; } // namespace heph::utils