C++ Logo

std-discussion

Advanced search

Re: Partial ordering of function template which have a place holder for deduced class type in the template parameter list.

From: Jefferson Carpenter <jeffersoncarpenter2_at_[hidden]>
Date: Sun, 2 Aug 2020 06:20:59 +0000
On 7/28/2020 11:55 AM, Olivier Kannengieser via Std-Discussion wrote:
> thought that this code should compile under C++20:
>
> template <class> struct A {};
> template <class, A> struct B {};
> template <A x> struct B <int, x> {};
>

You might have meant

     template <typename T, A<T> x> struct B <int, x> {};

Since A does not name a type, it names a family of types.

Received on 2020-08-02 01:24:24