-
Notifications
You must be signed in to change notification settings - Fork 805
Open
Description
Is the following example well-defined?
#include <ranges>
class MyClass;
namespace std::ranges {
template<>
inline constexpr bool disable_sized_range<MyClass> = true;
}It seemingly violates [namespace.std]/1 by defining the ranges namespace in std. I guess an LWG issue would be needed if we want to allow it.
If we want to keep it disallowed, perhaps it would be helpful to add an example with correction.
E.g.
#include <ranges>
class MyClass;
namespace std::ranges { // undefined behavior (or ill-formed, no diagnostic required): defining a namespace in std
template<>
inline constexpr bool disable_sized_range<MyClass> = true;
}
template<>
inline constexpr bool std::ranges::disable_sized_range<MyClass> = true; // OKMetadata
Metadata
Assignees
Labels
No labels