C++ Logo

std-discussion

Advanced search

requires-clause, pack expansion and constraints-ordering

From: tobi_at <tobi_at_[hidden]>
Date: Sun, 28 Mar 2021 14:10:03 +0200
While playing with concepts and parameter-packs, I tried to expand a
pack inside a requires-clause:
It worked wrt. concept-checking but it failed to create the right
constraints-ordering for overload resolution.

Here is an example, showing the problem: https://godbolt.org/z/onnTYPzzj


According to N4861, [temp.variadic] (10.4) an expansion of a
fold-expression is mere a rewrite.
So, I would have expected, that constraints-ordering also works with
packs, but it seems that clang, gcc and msvc disagree.

Tobias

Received on 2021-03-28 07:10:10