https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113854

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And those are not library internals, they're the public concepts defined in the
standard. You can look them up to see what they mean, but the problem boils
down to what's shown at the end: your predicate can't be used with that
argument type.

I think that's actually a more accurate description of the problem than telling
you that a deleted copy constructor can't be used. We've just been conditioned
by years of bad errors to know what it means. But really what you're trying to
do is call a function, not copy a unique_ptr. The concept error tells you what
part of the API is not satisfied. The second error tells you about a symptom,
not the cause, and leaves to to infer the cause: it's trying to copy a move
only object because the lambda requires a copy.

There are plenty of cases where being told which concept failed is much clearer
than being told about some unintended symptom feel inside a template. The
existence of counterexamples doesn't mean concepts aren't an improvement.

Reply via email to