Zero-Cost Abstraction, Expensive Compilation
function_ref Vittorio Romeo Template parameters template <typename F> auto operation (F&& f) -> decltype(std::forward<F>(f)(1, 2)) { return std::forward<F>(f)(1, 2); } Works with any FunctionObject (or Callable, using std::invoke) Zero-cost abstraction Hard to constrain (less true in C++20) Might degrade compilation time
A projected C++ presentation slide explains a generic function template that accepts any callable object. The joke is the contrast between “zero-cost abstraction” and the warning that it might degrade compilation time, poking fun at the trade-offs of advanced C++ abstractions. EN: A projected C++ presentation slide explains a generic function template that accepts any callable object. The joke is the contrast between “zero-cost abstraction” and the warning that it might degrade compilation time, poking fun at the trade-offs of advanced C++ abstractions.
- @ithueti / 868 2019-04-20
- Type
- image
- Size
- 800×600 · 44.9 KiB
- Mood
- технический юмор
- Language
- en
- Added