strong_type icon indicating copy to clipboard operation
strong_type copied to clipboard

`strong::range` modifier compiler errors for `std::set` in v15

Open feltech opened this issue 11 months ago • 5 comments

Since v15, wrapping a std::set in a strong type with the strong::range modifier, causes compiler errors, i.e.

using Set = strong::type<std::set<std::string_view>, struct Set_, strong::range>;

See https://godbolt.org/z/fM6q543dc (change to v14 and the program runs fine).

feltech avatar Dec 13 '24 18:12 feltech

Ouch, that's bad. I'll look into it. Thank you for reporting.

rollbear avatar Dec 17 '24 20:12 rollbear

Can you try branch range_const_iter and let me know how it works? The solution there does not sit well with clang 16/17 with C++23, which I have to find a solution for, but it'd be good to know if I'm on the right track or if there are more problems.

rollbear avatar Dec 18 '24 17:12 rollbear

Fixed the clang issue. I had the wrong starting date for ranges-support in libstdc++

rollbear avatar Dec 22 '24 13:12 rollbear

Thanks for the quick fix!

I ended up working around the issue somewhat for the time being by making the element a strong type, rather than the whole container, so I no longer (currently) have a use-case for a strongly-typed std::set :roll_eyes:

That said, the unit test case looks bang on, and the fix itself looks reasonable to my untrained eye :+1:

feltech avatar Dec 22 '24 21:12 feltech

It's fixed on main now. I'm leaving the issue open until I have tagged a release. Thanks again for reporting the issue.

rollbear avatar Dec 23 '24 09:12 rollbear

@rollbear When do you plan a new release? :)

Viatorus avatar Jul 23 '25 18:07 Viatorus