Pair Constructor Requires Everything
pair::pair() (requires-clause) template<typename F, typename S> struct pair { F f; S s; pair() requires DefaultConstructible<F> && DefaultConstructible<S> && ImplicitlyDefaultConstructible<F> && ImplicitlyDefaultConstructible<S> : f(), s() {} explicit pair() ... }; template<typename T> concept ImplicitlyDefaultConstructible = requires { [] (T) {} ({}); };
A projected C++ code slide shows an extremely elaborate default constructor for a generic `pair`, with multiple overlapping constraints and a separate concept definition. The joke is that a simple utility class has been made absurdly complicated by modern C++ template requirements, echoing the caption’s theme of waiting for concepts while becoming exhausted by the explanation. EN: A projected C++ code slide shows an extremely elaborate default constructor for a generic `pair`, with multiple overlapping constraints and a separate concept definition. The joke is that a simple utility class has been made absurdly complicated by modern C++ template requirements, echoing the caption’s theme of waiting for concepts while becoming exhausted by the explanation.
- @ithueti / 876 2019-04-20
- Type
- image
- Size
- 800×567 · 42.7 KiB
- Mood
- саркастичный, утомлённый
- Language
- en
- Added