A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/2091.html below:

CWG Issue 2091

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-08-11

2091. Deducing reference non-type template argumentsSection: 13.10.3.6  [temp.deduct.type]     Status: CD4     Submitter: Richard Smith     Date: 2015-03-05

[Adopted at the June, 2016 meeting.]

According to 13.10.3.6 [temp.deduct.type] paragraph 17,

If P has a form that contains <i>, and if the type of the corresponding value of A differs from the type of i, deduction fails.

This gives the wrong result for an example like:

  template<int &> struct X;
  template<int &N> void f(X<N>&);
  int n;
  void g(X<n> &x) { f(x); }

Here, P is X<N>, which contains <i>. The type of i is int&. The corresponding value from A is n, which is a glvalue of type int. Presumably this should be valid.

I think this rule means to say something like,

If P has a form that contains <i>, and the type of i differs from the type of the corresponding template parameter of the template named by the enclosing simple-template-id, deduction fails.

Proposed resolution (March, 2016):

Change 13.10.3.6 [temp.deduct.type] paragraph 17 as follows:

If P has a form that contains <i>, and if the type of the corresponding value of A differs from the type ofi differs from the type of the corresponding template parameter of the template named by the enclosing simple-template-id, deduction fails. If P has a form that contains [i]...

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4