You must type it three times
summary
Library wrappers require copying the function body three times to get correct noexcept, decltype(auto) return type and SFINAE friendliness; the talk shows a practical workaround using a returns macro that leverages the comma operator to expand into noexcept, decltype and return but breaks for compound statements and lambdas in unevaluated contexts. It explains the limitations, shows why abbreviated lambda syntax proposals (eg abbreviated lambda syntax) would avoid the repetition, and proposes compiler splitting rules to generate the triplication automatically.
AI-written summary · about
related talks
01h 04mC++ Lambda Idioms
01h 03mHigher order functions for ordinary C++ developers
06mConstraints not Satisfied
56mC++ Lambda Idioms
32mCute C++ Tricks, Part 2 of N: More code you should learn from and never write
51mModern techniques for keeping your code dry
55mCustom Overload Sets and Inline SFINAE for Truly Generic Interfaces
01h 03mBack to Basics: Templates (part 2 of 2)
