<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1021</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="1021"></A><H4>1021.
  
Definitions of namespace members
</H4>
<B>Section: </B>_N4868_.9.8.2.3&#160; [<A href="https://wg21.link/namespace.memdef">namespace.memdef</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD4
 &#160;&#160;&#160;

 <B>Submitter: </B>Michael Wong
 &#160;&#160;&#160;

 <B>Date: </B>2010-01-14<BR>


<P>[Moved to DR at the November, 2014 meeting.]</P>

<P>According to _N4868_.9.8.2.3 [<A href="https://wg21.link/namespace.memdef">namespace.memdef</A>] paragraphs 1 and 2 read,</P>

<BLOCKQUOTE>

<P>Members (including explicit specializations of templates
(13.9.4 [<A href="https://wg21.link/temp.expl.spec">temp.expl.spec</A>])) of a namespace can be defined
within that namespace.</P>

<P>Members of a named namespace can also be defined outside that
namespace by explicit qualification (6.5.5.3 [<A href="https://wg21.link/namespace.qual">namespace.qual</A>]) of the name being defined, provided that the
entity being defined was already declared in the namespace and
the definition appears after the point of declaration in a
namespace that encloses the declaration's namespace.</P>

</BLOCKQUOTE>

<P>It is not clear what these specifications mean for the
following pair of examples:</P>

<PRE>
    namespace N {
        struct A;
    }
    using N::A;
    struct A { };
</PRE>

<P>Although this does not satisfy the &#8220;by explicit
qualification&#8221; requirement, it is accepted by major
implementations.</P>

<PRE>
    struct S;
    namespace A {
        using ::S;
        struct S  { };
    }
</PRE>

<P>Is this a definition &#8220;within that namespace,&#8221; or
should that wording be interpreted as &#8220;directly within&#8221;
the namespace?</P>

<P>See also <A HREF="1838.html">issue 1838</A>.</P>

<P><B>Proposed Resolution (July, 2014):</B></P>

<P>This issue is resolved by the resolution of
<A HREF="1838.html">issue 1838</A>.</P>

<BR><BR>
</BODY>
</HTML>
