DEDUCING this PATTERNS## DEDUCING this PATTERNS  BEN DEANE / @ben_deane CPPCON 2021 ## OVERVIEW This presentation is about P0847, "Deducing Gašper Ažman, Sy Brand, Ben Deane, Barry Revzin "We propose a new mechanism for specifying or deducing the value category of the expression that a member-function is invoked on. In other words, a way write) - a closure object (the object the compiler generates by evaluating the lambda expression) ## DEDUCING this AND LAMBDAS First, uniformity of syntax between regular member functions and lambda expressions0 码力 | 126 页 | 5.15 MB | 1 年前3
Embracing CTADCTAD? ## Deducing function-template template argument templatevoid myFunc(const T&){} myFunc ## Deducing function-template T&){} myFunc(1); // deduces T = int, invokes myFunc(1); // invokes myFunc specialisation specialisation ## Deducing function-template template argument templatevoid myFunc(const T&){} Template deduction myFunc(1); // deduces T = int, invokes myFunc ## Deducing class-template template argument - pre C++17 templatespecialisation struct myStruct myStruct(const 0 码力 | 98 页 | 4.62 MB | 1 年前3
Newer Isn't Always BetterNetwork Connection ## Derived 1 TCP ## Derived 2 UDP ## Timeline ## V irtual Functions • ~1986 ## Deducing This • C++23 ## Curiously Recurring Template Pattern (CRTP) • ~1995 ## Original Trend – Virtual ed*> ## New Trend – Explicit Object Parameter/Deducing This C++23 Feature • Simplifies Compile Time Polymorphism ## New Code – Deducing This struct NetworkConnection { public: void returned: 0 tcp tcp ## Multi-Level Inheritance – Deducing This Attempt // https://godbolt.org/z/ccsoaf3ec struct NetworkConnection void init(this auto&&0 码力 | 60 页 | 1.34 MB | 1 年前3
Design Patternsd/p27_2.jpg) Ben Deane Deducing this Patterns ## The Future of CRTP?  Ben Deane Deducing this Patterns ## CRTP Pre /b/2/a/2/b2a240cc83d862dcb67951e72bae578d/p32_2.jpg) ## C++23: Explicit Object Parameter AKA, Deducing This struct Shape { templatevoid draw(this T&& self) { self.draw_impl();  ## Ben Deane Deducing this Patterns ## OK, THAT WAS A SIMPLE WIN There's more. Template deduction is unchanged. 0 码力 | 136 页 | 7.95 MB | 1 年前3
Connecting User And Library CodeCPs Methods  + @@ Deducing this removes the need for CRTP ## Part II: An Overview Of CPs Methods • C++ was “born” with Customization >Inheritance CTS CPs (ADL) CPOs Concepts (+nominal) Deducing This tag_invoke Custom functions Reflection 0 码力 | 58 页 | 18.82 MB | 1 年前 3
What's New in Visual Studio 2022Feature complete • C++23 • Deducing this (compiler support) •• std::expected • Many ranges features Coming next for C++23 • Standard library modules • Deducing this (modules support) std::print • Ranges: • to • zip and enumerate • cartesian product ## Coming next for C++23 • Deducing this (modules support) • 9 remaining C++ STL features ## Announcing In Visual Studio 2022 version 0 码力 | 55 页 | 3.27 MB | 1 年前3
C++23: An Overview of Almost All New and Updated Featuresbe avoided by delegating to helper methods → Cumbersome ☐ C++23: ☐ Explicit object parameters → deducing this ☐ Replace all 3 overloads with: templateauto&& GetName(this in a lambda accesses the object that contains the lambda, not the lambda instance itself! ☐ With deducing this: auto fibonacci = [](this auto self, int n) { if (n < 2) { return n; } return self(n 0 码力 | 105 页 | 759.96 KB | 1 年前3
A Journey Into Non-Virtual Polymorphismwait_for( Power::isAwake ); ## C++23: Explicit Object Parameter AKA, Deducing This struct Shape { templatevoid draw(this T&& self) { self.draw_impl(); 0 码力 | 43 页 | 536.84 KB | 1 年前3
Applicative: The Forgotten Functional Pattern> ## PARTIAL APPLICATION, C++ STYLE (Now you see one of my personal incentives for P0847 Deducing this) See also C++Weekly Episode 318: My Meetup Got Nerd Sniped! Tip: attend your local meetup0 码力 | 141 页 | 11.33 MB | 1 年前3
Debian GNU/Linux 安裝手冊 January 8, 2024with the same key always produces a unique cipher text. The idea is to prevent the attacker from deducing information from repeated patterns in the encrypted data. From the provided alternatives, the default0 码力 | 120 页 | 643.51 KB | 2 年前3共 142 条- 1
- 2
- 3
- 4
- 5
- 6
- 15
相关搜索词Deducing thistemplate deductionmember functionvalue categorylvaluervalue类模板参数推断模板参数推断模板参数类模板模板元编程Legacy Design TrendsModern ReplacementsC++23Software EngineerATOMOS设计模式依赖结构虚拟函数CRTP模式桥接模式Customization PointsLibrary CodeUser CodeIntegrationHooksVisual Studio 2022C++ARM64Address SanitizervcpkgExplicit Object ParametersString Formatting Improvementsstd::mdspanstd::generatorstd::expectedCuriously Recurring Template Pattern (CRTP)std::variantstd::anystd::tuplePolymorphic InvokableApplicative FunctorsFunctorMonadFunction ApplicationDebianDebianInstallerDebian GNU/LinuxDebian GNU/Hurd硬件需求













