From 362f442a1656e7d55878af0fe1019841b28de089 Mon Sep 17 00:00:00 2001 From: "Ralph J. Steinhagen" Date: Thu, 22 Jun 2023 07:59:25 +0200 Subject: [PATCH] fix some clang C++20 conversion issues Signed-off-by: Ralph J. Steinhagen --- include/tag.hpp | 21 +++++++++++++++++++-- test/qa_tags.cpp | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/include/tag.hpp b/include/tag.hpp index 76df6eac0..2f7d5c47c 100644 --- a/include/tag.hpp +++ b/include/tag.hpp @@ -56,8 +56,25 @@ using property_map = std::map; * so that there is only one tag per scheduler iteration. Multiple tags on the same sample shall be merged to one. */ struct alignas(hardware_constructive_interference_size) tag_t { - std::make_signed_t index = 0; - property_map map; + using signed_index_type = std::make_signed_t; + signed_index_type index{ 0 }; + property_map map{}; + + tag_t() = default; + + tag_t(signed_index_type index, property_map map_) noexcept : index(index), map(std::move(map_)) {} + + tag_t(const tag_t &other) = default; + + tag_t & + operator=(const tag_t &other) + = default; + + tag_t(tag_t &&other) noexcept = default; + + tag_t & + operator=(tag_t &&other) noexcept + = default; bool operator==(const tag_t &other) const diff --git a/test/qa_tags.cpp b/test/qa_tags.cpp index 8c80efc31..b2abfd786 100644 --- a/test/qa_tags.cpp +++ b/test/qa_tags.cpp @@ -30,7 +30,7 @@ const boost::ut::suite TagTests = [] { }; "DefaultTags"_test = [] { - tag_t testTag; + tag_t testTag{}; testTag.insert_or_assign(tag::SAMPLE_RATE, pmtv::pmt(3.0f)); testTag.insert_or_assign(tag::SAMPLE_RATE(4.0f));