A Journey Into Non-Virtual PolymorphismPolymorphic Variables • Base class pointer to derived class – Virtual functions are not bad! • Standard Template Library - std::any - std::variant - std::tuple ## Polymorphic Invokables • Overloaded functions plus = [](T, T) template plus(T, T); template template="" u=""> plus(T, U); • Curiously Recurring Template Pattern (CRTP) Cppcon 2023 | Rud Merriam | A ## std::variant Type Safe Union ##### std::variant< class... Types > • Types enumerated in template parameter list • Values are stored in the variant – No dynamic memory allocation – Types may 0 码力 | 43 页 | 536.84 KB | 1 年前3
Template Metaprogramming: Type Traits## CppCon 2020 Template Metaprogramming: Type Traits Part 1 Jody Hagins jhagins@maystreet.com coachhagins@gmail.com ## CppCon 2020 Template Metaprogramming: Type Traits Introduction ## I ntended Audience oriented: shallow depth, slow current - Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques ## I ntended Audience • Beginner/Intermediate • Gentle entry: swimming oriented: shallow depth, slow current - Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques • Type traits part of standard library for ~10 years ## I ntended Audience0 码力 | 403 页 | 5.30 MB | 1 年前3
Retiring the Singleton Pattern## Retiring the Singleton Pattern Engineering ## Concrete suggestions for what to use instead CppCon 2020 September 18, 2020 Peter Muldoon Senior Software Developer TechAtBloomberg.com © 2020 Bloomberg .com/questions/137975/what-is-so-bad-about-singletons ## Talk outline 1. Examine the Singleton Pattern 2. Refactoring out the Singleton in an example function • Ensuring the callers of that function types 4. Dealing with delayed construction 5. Dealing with phased introduction of the replacement pattern 6. Dealing with initialization order of interdependent Singletons 7. Dealing with groups of Singleton0 码力 | 70 页 | 1.59 MB | 1 年前3
Template-Less Meta-Programming## Template-Less MetaProgramming 0 ## +24 ## KRIS JUSIAK 2024 September 15 - 20 ## Template Metaprogramming (TMP) templateusing meta_fun = this_talk ## static_assert(Template::Metaprogramming::is_hard); // ✓ ?static_assert(Template::Metaprogramming::is_hard); // ✓ ?static_assert(Template::Metaprogramming::is_powerful); // ✓ ?static_assert(Template::Metapr // ✓ ?static_assert(Template::Metaprogramming::is_powerful); // ✓ ?static_assert(( Template::Metaprogramming::is_easy and Template::Metaprogramming::is_powerful and Template::Metaprogramming::has; 0 码力 | 130 页 | 5.79 MB | 1 年前3
Back to Basics: The Factory Pattern## Back to Basics: The Factory Pattern ## MIKE SHAH 2021 October 24-29 ## Please do not redistribute slides without prior permission ## Software Design: Factory Pattern Mike Shah, Ph.D. @MichaelShah there is a common pattern that can help solve this problem--the factory design pattern. In this talk, we are going to discuss a creationally designed pattern known as a factory. The pattern can be as simple the factory pattern, and discuss which scenarios you may not actually want to use a factory. Attendees will leave this talk with the knowledge to go forward and implement the factory pattern, as well as0 码力 | 93 页 | 3.92 MB | 1 年前3
Applicative: The Forgotten Functional Pattern## Applicative: The Forgotten Functional Pattern ## +23 ## BEN DEANE ## 20 23 October 01 - 06 ## APPLICATIVE THE FORGOTTEN FUNCTIONAL PATTERN  FUNCTIONS A functor is a parameterized type (a class template) of one (free) argument. expected (with error type bound) The characteristic function is fmap. ## fmap IN C++ templatetemplate="" typename Functor, typename T> constexpr auto 0 码力 | 141 页 | 11.33 MB | 1 年前3
Design Patterns[Image](/uploads/documents/b/2/a/2/b2a240cc83d862dcb67951e72bae578d/p3_1.jpg) Term #3 Bridge Term #4 Design Pattern ## The 2nd in a Row ## Meeting C++ 2023 Design Patterns - the most common misconceptions (1 of n) n) Klaus Iglberger Term #1 Builder Term #2 Factory Method Term #3 Bridge Term #4 Design Pattern think-cell  ## Let's Pointless ## SHACHAR SHEMESH ## Issue #1 CRTP Issue #2 std::variant ## Issue #1 CRTP ## CRTP - Curiously Recurring Template Pattern # Curiously Recurring Template Patterns James O. Coplien Software Production0 码力 | 136 页 | 7.95 MB | 1 年前3
Go Programming Pattern in Kubernetes Philosophy# Go Programming Pattern in Kubernetes Philosophy Harry Zhang @resouer ## Contents ## • What I will talk? • Kubernetes basic in 1 min • For Kubernetes developers: - The Golang programming patterns gPRC based interface design in Kubernetes (CRI as example) • For Kubernetes users: • Effective pattern of programming based on Kubernetes • 广告(Don't worry, it's not that kind of AD) ## • What apiVersion: apps/v1beta1 kind: Deployment metadata: name: nginx-deployment spec: replicas: 3 template: metadata: labels: app: nginx spec: containers: - name: nginx0 码力 | 29 页 | 2.12 MB | 2 年前3
Newer Isn't Always Betterdouble y) { // ... } private: PlottingSingleton(); ## Original Code – Singleton Wrapper templateclass Singleton { public: static T& getInstance() { static T Dependency Injection (DI) • Inject the dependency into the object • Injected 3 ways • Interface/Template Parameter Injection (Type 1) • Setter (Type 2) • Constructor (Type 3) • One Object being shared dt); ## Usage Example Continued template inline constexpr OutputType runge_kutta4(std::fu 0 码力 | 60 页 | 1.34 MB | 1 年前3
CppCon2021 Concurrency TS2 hazard_pointer_domain & domain = hazard_pointer_default_domain()) noexcept; ## Hazard Pointers TS2 Interface template> class hazard_pointer_obj_base { public: noexcept; template T* protect(const atomic & src) noexcept; template bool try_protect(T*& ptr, const atomic & src) noexcept; template template > class hazard_pointer_obj_base { public: 0 码力 | 58 页 | 1.62 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
Curiously Recurring Template Pattern (CRTP)std::variantstd::anystd::tuplePolymorphic Invokablemetaprogramming techniquestype traitsspecializationprimary templatemetafunctionsSingleton PatternDependency InjectionSource CompatibilityStateful GroupingsInterdependent SingletonsTemplate Metaprogrammingboost.mp11Circle-langvalue-based metaprogrammingcompile time工厂模式工厂方法模式抽象工厂模式创建对象枚举类Applicative FunctorsFunctorMonadFunction ApplicationC++设计模式依赖结构虚拟函数CRTP模式桥接模式KubernetesGo编程模式控制器代码生成gRPC接口Legacy Design TrendsModern ReplacementsC++23Software EngineerATOMOSConcurrency TS2hazard ptrRCUshared_ptratomic_shared_ptr













