Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[namespace.std] Reopening a namespace within std #8714

Open
Labels
lwgIssue must be reviewed by LWG. not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.
@frederick-vs-ja

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    lwgIssue must be reviewed by LWG. not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /