<span>
: How cromulent is span<int, static_cast<size_t>(-2)>
?
#5280
Labels
LWG issue needed
A wording defect that should be submitted to LWG as a new issue
Raised by @frederick-vs-ja in #5274 (comment).
span<int, static_cast<size_t>(-2)>
is bogus, but how bogus? It clearly violates thesize_bytes()
precondition if called. It also violates all constructor preconditions. But can westatic_assert
when this type is instantiated? An LWG issue would be nice.There's implementation divergence: https://godbolt.org/z/7ha8rK18K
size_bytes()
emits a debug assertion:static_assert
ing (unconditionally, regardless of debug mode) when any constructor is instantiated, but not the whole type.The text was updated successfully, but these errors were encountered: