From 7abd3e368ab684491a09a789b53a89e86d1cda62 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 19 Aug 2026 11:59:12 +0200 Subject: [PATCH] fix bug requiring static cast to bool in requires --- CHANGELOG.md | 4 ++++ include/mstd/types/strong_type.hpp | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18c59e8..8c2affb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## Next Release +### Types + +- as for requires g++ needs static cast to bool for flagset - this bug has been fixed + ## [0.2.0](https://github.com/repo/owner/releases/tag/0.2.0) - 2026-08-18 diff --git a/include/mstd/types/strong_type.hpp b/include/mstd/types/strong_type.hpp index 304d199..f0d031f 100644 --- a/include/mstd/types/strong_type.hpp +++ b/include/mstd/types/strong_type.hpp @@ -100,13 +100,13 @@ namespace mstd [[nodiscard]] constexpr auto operator<=>(const StrongType &) const - requires(Traits &StrongTypeTrait::ORDERED && + requires(static_cast(Traits &StrongTypeTrait::ORDERED) && std::three_way_comparable) = default; [[nodiscard]] constexpr bool operator==(const StrongType &) const - requires(Traits &StrongTypeTrait::ORDERED && + requires(static_cast(Traits &StrongTypeTrait::ORDERED) && std::equality_comparable) = default; @@ -178,7 +178,7 @@ std::ostream &operator<<( std::ostream &os, const mstd::StrongType &strongType ) -requires(Traits &mstd::StrongTypeTrait::STREAMABLE && true) +requires(static_cast(Traits &mstd::StrongTypeTrait::STREAMABLE) && true) { return os << strongType.get(); }