https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125439
Bug ID: 125439
Summary: std::in_range doesn't accept const-qualified result
type
Product: gcc
Version: 16.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: planet36 at gmail dot com
Target Milestone: ---
Created attachment 64539
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64539&action=edit
Test program demonstrating success and failure cases of in_range. Also
includes user implementation of in_range.
`std::in_range<const int>(0)` does not compile. See attached test program.
The following sources don't have a restriction on qualifiers, AFAICT.
https://eel.is/c++draft/utility.intcmp#lib:in_range
https://cppreference.com/cpp/utility/in_range
> Mandates: Each of T and R is a signed or unsigned integer type
> ([basic.fundamental]).
> [Note 1: These function templates cannot be used to compare byte, char,
> char8_t, char16_t, char32_t, wchar_t, and bool. — end note]
$ g++ -dumpfullversion
> 16.1.1
$ uname -srm
> Linux 7.0.9-arch2-1 x86_64