https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113854
--- Comment #4 from Frank Heckenbach <f.heckenb...@fh-soft.de> --- (In reply to Jonathan Wakely from comment #1 and #2) > [...] than to get errors deep inside an instantiation stack. But they are deep in the stack; maybe not an instantiation stack, but a requires stack or whatever you call it. Anyway, the text is much longer than that for plain std::find_if. > And those are not library internals, they're the public concepts defined in > the standard. is:invocable_v is standard, the rest seems to be full of __library _Internals. Perhaps I wasn't clear, that's what I'm referring to. Apart from the last line and a few others, most of the messages are not meaningful to a mere user. > 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. Those messages may not be optimal, and perhaps we've actually been conditioned in a way, but at least I've learned to understand what they mean. Deleted copy-constructor, sure, it's about non-copyable types, I have something to go on. Whereas the concepts message basically tells me I can't call it because I can't invoke it. In a simple case like this, it's clear why, but if i is not just a unique_ptr, but a struct containing one among several other members (as was the case in my actual code), it will be less obvious. And if the function takes more than one argument, there will be no indication which one is the problem, whereas the std::find_if message at least says "argument 1". Also, the message "the expression 'is_invocable_v<_Fn, _Args ...> [with _Fn = main::._anon_116&; _Args = {std::unique_ptr<int, std::default_delete<int> >&}]'" IMHO reads more like a text puzzle. (This is a more general issue, should I file another bug or two for it?) a) It introduces 3 new identifiers, resolves 2 of them right after and the last one not at all. b) It lists default parameters the user doesn't really care about. I get that gcc at this point probably doesn't know whether the parameters were defaulted or specified (and happened to match the default, which seems unlikely). It would be a big improvement if gcc could simplify that message to something like this: is_invocable_v<[] (auto), std::unique_ptr<int>> is required, but false Please note: I'm not trying to be difficult here. I'm actually having trouble understanding these kinds of messages. Finding the actual (see above) relevant messages and puzzling them together now often takes more time than ignoring them altogether and analyzing the code myself. That's why I said "something's wrong here" would be as good a message. :(