<div dir="ltr"><div>Thanks for your feedback Tom.  You&#39;ll find my questions and comments below...</div><div dir="ltr"><br></div><div dir="ltr">On Tue, Sep 24, 2019 at 11:59 PM Tom Honermann &lt;<a href="mailto:tom@honermann.net">tom@honermann.net</a>&gt; wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <div class="gmail-m_-5692207485065104996moz-cite-prefix">I have some sympathy for the problem
      this proposal purports to address.</div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix">I think the proposed distinction for
      initial namespace templates and namespace template extensions is
      not well motivated, introduces gratuitous deviation from existing
      template syntax, and introduces the following new problems:</div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix">1) Lookup is confusing.  Consider the
      following:</div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>template&lt;int i&gt;</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>namespace N {}</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>int i;</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>namespace template N {</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  void f() {</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>    i;  // Ambiguous, ::i, or the i
        parameter of N?</tt><tt><br>
      </tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  }</tt><tt><br>
      </tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>}</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix">I think this would be a novel and
      confusing lookup rule no matter which way the above question is
      resolved.  Some existing cases that require such semantic lookup
      as opposed to lexical lookup are for class members in out of line
      class member definitions and ADL.  For the former, some guidelines
      require prefixing class data members with &#39;m_&#39; or similar to
      remind programmers that they are referencing something defined
      outside of the lexical context.  For the latter, well, issues with
      ADL are well known.<br></div></div></blockquote><div><br></div><div>I don&#39;t see why you&#39;re reading this any differently than:</div><div><br></div><div><div class="gmail-m_-5692207485065104996moz-cite-prefix"><font face="monospace">namespace N { int i; }</font></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>int i;</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>namespace N {</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  void f() {</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>    i;</tt><tt><br>
      </tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  }</tt><tt><br>
      </tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>}</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"></div></div><div><br></div><div>Anyway - let&#39;s say, for sake of argument, I agreed with you.  What change to the proposal are you suggesting?  The motivation of having the template parameters implicitly declared in namespace template extensions is so that you only have to define the library configuration once, in one source file.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><div class="gmail-m_-5692207485065104996moz-cite-prefix">
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix">2) Parameters of namespace templates
      can effectively never be omitted since names are not re-introduced
      in extensions.</div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix">The ability to omit names for
      unreferenced parameters within a given scope has a long history in
      C and C++ and is useful in some cases to prevent unintended
      references or to allow different names to be used in different
      contexts.  In particular for this proposal, I can imagine that
      some parameters of namespace templates would only be needed in
      some namespace extensions.  The traditional template declaration
      syntax allows the following:<br>
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>template&lt;typename, int&gt;</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>namespace N {}</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>template&lt;typename T, int&gt;</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>namespace N {</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  void foo(T);</tt><tt><br>
      </tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>}</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>template&lt;typename, int I&gt;</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>namespace N {</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  int bar() { return I; }</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  template&lt;typename T&gt;  // No
        possible confusion with an outer &#39;T&#39;.</tt><tt><br>
      </tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  void ft(T) { ... }</tt><tt><br>
      </tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>}</tt></div></div></blockquote><div><br></div><div>As proposed the above is ill-formed as you can only have a single initial namespace template, the remainder must be namespace template extensions - in order to maintain a single definition of the library configuration.</div><div><br></div><div>If your point is that if we modified the proposal to have namespace template extensions redeclare their template parameters, then this would allow finer-grained name omission - then I don&#39;t think this trumps the point above. ie It&#39;s more important that we define the library configuration once.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><div class="gmail-m_-5692207485065104996moz-cite-prefix">
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix">Unrelated to the above, I think the
      proposal might benefit from some mechanism for a member of the
      namespace template to opt out of template dependency.  This would
      avoid having to introduce additional, effectively implementation
      detail namespaces like in the following example (though, perhaps
      this approach wouldn&#39;t be so bad either):</div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt><br>
      </tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>namespace
        non_dependent_things_for_N {</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  void baz();</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>}</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>template&lt;typename&gt;</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>namespace N {</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>  using namespace </tt><tt>non_dependent_things_for_N;</tt></div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><tt>}</tt></div></div></blockquote><div><br></div><div>By what mechanism (if any) can you opt out members of class templates from template dependency?</div><div><br></div><div>What is your motivation for wanting to do that?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><div class="gmail-m_-5692207485065104996moz-cite-prefix">
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix">Tom.<br>
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix"><br>
    </div>
    <div class="gmail-m_-5692207485065104996moz-cite-prefix">On 9/24/19 2:17 AM, Andrew Tomazos via
      Std-Proposals wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Please find attached DRAFT 1 of:
        <div><br>
        </div>
        <div>     Proposal of Namespace Templates</div>
        <div><br>
        </div>
        <div>Feedback appreciated.</div>
        <div>   -Andrew.</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="gmail-m_-5692207485065104996mimeAttachmentHeader"></fieldset>
    </blockquote>
    <p><br>
    </p>
  </div>

</blockquote></div></div>

