Re: [PATCH] libstdc++: Avoid redundant assertions in std::span constructors

2025-01-08 Thread Jonathan Wakely
On Thu, 12 Dec 2024 at 00:05, Jonathan Wakely wrote: > > Any std::span constructor with a runtime length has a precondition > that the length is equal to N (except when N == std::dynamic_extent). > > Currently every constructor with a runtime length does: > > if constexpr (extent != dynamic_extent

[PATCH] libstdc++: Avoid redundant assertions in std::span constructors

2024-12-11 Thread Jonathan Wakely
Any std::span constructor with a runtime length has a precondition that the length is equal to N (except when N == std::dynamic_extent). Currently every constructor with a runtime length does: if constexpr (extent != dynamic_extent) __glibcxx_assert(n == extent); We can move those assertions i