cplusplus / cplusplus/draft

Are members of a nested class be members of the enclosing class?

Open
#4,932 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

Consider the example that follows [temp.dep.type] p3

template<class T> struct A {
  typedef int M;
  struct B {
    typedef void M;
    struct C;
  };
};

template<class T> struct A<T>::B::C : A<T> {
  M m;                          // OK, A<T>​::​M
};

The example implies that A<T> is a current instantiation class in the definition of A<T>::B::C. However, according to [temp.dep.type#1.2]

A name or template-id refers to the current instantiation if it is

  • [...]
  • in the definition of a primary class template or a member of a primary class template, the name of the class template followed by the template argument list of its template-head ([temp.arg]) enclosed in <> (or an equivalent template alias specialization),
  • [...]

In this example, the primary class template is A, Is that saying the member class C of the nested class B is a member of class template A?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read [temp.dep.type] p3 and [temp.dep.type#1.2] alongside the quoted nested-class example. Determine whether the wording treats A::B::C as a member of primary template A, and document the resolution or required wording change; no specific draft file or test is named.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.