https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95910
--- Comment #4 from Rene Rahn <rene.r...@fu-berlin.de> --- > Hmm, if you can't easily specify a concrete return type, then you could maybe > > try constraining the lambda appropriately. In this particular example you > could replace the static_assert with an analogous require-clause, which would > > turn the hard error into a SFINAE-friendly error. Yes, this is basically what I would do know (AFAIK also recommended to always constraint generic types). In this case I could work with an explicit return type, though. Many thanks for your support and time.