Skip to content

Commit

Permalink
fix some clang C++20 conversion issues
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph J. Steinhagen <[email protected]>
  • Loading branch information
RalphSteinhagen committed Jun 22, 2023
1 parent 034d854 commit 362f442
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
21 changes: 19 additions & 2 deletions include/tag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,25 @@ using property_map = std::map<std::string, pmtv::pmt, detail::transparent_less>;
* 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<std::size_t> index = 0;
property_map map;
using signed_index_type = std::make_signed_t<std::size_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
Expand Down
2 changes: 1 addition & 1 deletion test/qa_tags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 362f442

Please sign in to comment.