A RetroSearch Logo

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

Search Query:

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

CWG Issue 1432

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

1432. Newly-ambiguous variadic template expansionsSection: 13.7.4  [temp.variadic]     Status: open     Submitter: Daniel Krügler     Date: 2011-12-17

With the new core rules in regard to variadic pack expansions the library specification of the traits template common_type is now broken, the reason is that it is defined as a series of specializations of the primary template

    template <class ...T>
    struct common_type;

The broken one is this pair:

  template <class T, class U>
  struct common_type<T, U> {
   typedef decltype(true ? declval<T>() : declval<U>()) type;
  };

  template <class T, class U, class... V>
  struct common_type<T, U, V...> {
   typedef typename common_type<typename common_type<T, U>::type, V...>::type type;
  };

With the new rules both specializations would now be ambiguous for an instantiation like common_type<X, Y>.

(See also issue 1395.)

Notes from the October, 2012 meeting:

It is possible that 13.7.6.3 [temp.spec.partial.order] may resolve this problem.

CWG 2022-11-11

Resolved by issue 1395; see the special rule about trailing packs in 13.10.3.5 [temp.deduct.partial] paragraph 11.

Additional notes (March, 2025)

Issue 1395 covers only function parameter packs, but the example in the present issue does not have any. Reopening the issue for further consideration. See also 13.10.3.6 [temp.deduct.type] bullet 9.1.


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