[namespace.std] Reopening a namespace within `std`
Open
@jwakely is already working on this.
Since Jan 29, 2026.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
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; // OK
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.