You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After span's comparison functions have been made free functions in release 0.9.0, they now give incorrect results when comparing spans differing in constness:
char data[] = {'a', 'b'};
gsl::string_span a = gsl::as_span(data);
gsl::cstring_span b = gsl::as_span(data).last(1);
assert(a != b); // previously worked as expected, now converts to bool and compares equal!
The text was updated successfully, but these errors were encountered:
Note: The C++ standard does not allow to compare containers that only differ in cv-ness.
This also holds for M-GSL. However M-GSL does allow to compare string_span with cstring_span.
The comparation of string_span in GSL Lite (as it is now) is the same as that of span.
To continue allowing to compare string_span with cstring_span in GSL Lite, it is now possible to compare spans differing in cv-ness.
Perhaps a configuration flag that allows to switch between this behavior and the strict behavior is in order.
After span's comparison functions have been made free functions in release 0.9.0, they now give incorrect results when comparing spans differing in constness:
The text was updated successfully, but these errors were encountered: