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 depth, slow current - Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques ## I ntended Audience • Beginner/Intermediate • Gentle entry: swimming pool to river 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 Audience • Beginner/Intermediate0 码力 | 403 页 | 5.30 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 ## te::Metaprogramming::is_hard); // ✓ ?static_assert(Template::Metaprogramming::is_hard); // ✓ ?static_assert(Template::Metaprogramming::is_powerful); // ✓ ?static_assert(Template::Metaprogramming::is_hard); static_assert(Template::Metaprogramming::is_powerful); // ✓ ?static_assert(( Template::Metaprogramming::is_easy and Template::Metaprogramming::is_powerful and Template::Metaprogramming::has_nice_error_messages; 0 码力 | 130 页 | 5.79 MB | 1 年前3
An Introduction to Lean4.3 Induction and Calculation 42 4.4 Axioms 45 5 Using Automation in Lean 46 6 Metaprogramming in Lean 47 Bibliography # Overview This introduction offers a tour of Lean and its features results are indeed correct. Which brings us to yet another aspect of Lean, namely, its role as a metaprogramming language. Many of Lean’s internal data structures and procedures are exposed and available within language of Lean itself, via a monadic interface. We refer to the use of these procedures as “metaprogramming” because they take us outside the formal framework: the access points to the API are declared0 码力 | 48 页 | 191.92 KB | 2 年前3
Julia v1.3.1 DocumentationGlobal Variables ..... 214 Multiple Objects ..... 215 Macro-generated code ..... 215 27 Metaprogramming ..... 217 27.1 Program representation ..... 217 Symbols ..... 218 27.2 Expressions and evaluation Powerful shell-like capabilities for managing other processes • Lisp-like macros and other metaprogramming facilities Part II Julia v1.3 Release Notes Powered by TCPDF (www.tcpdf.org) ## Chapter 2 ## described below, are some examples of non-standard string literals. Other examples are given in the Metaprogramming section. ### 16.9 Regular Expressions Julia has Perl-compatible regular expressions (regexes)0 码力 | 1276 页 | 4.36 MB | 2 年前3
Reflection Based Libraries to Look Forward Tomember_info.name() << std::endl; ## How is this different from metaprogramming? ## Reflection vs metaprogramming ## • Not much:) • Operate on values instead of types ☐ Syntactic difference find function signature? ■ P3096 helps :) "Function Parameter Reflection" Can also do metaprogramming (Boost.CallableTraits etc) ## • Runtime virtual interface means cannot use template types ☀️ signature? ■ P3096 helps :) "Function Parameter Reflection in Reflection" Can also do metaprogramming (Boost.CallableTraits etc) • Runtime virtual interface means cannot use template types • Type0 码力 | 118 页 | 14.33 MB | 1 年前3
Compile-Time Validationexpected. Some C++ computations run at compile-time by using constexpr, consteval, or template metaprogramming. These compile-time components can also be tested at compile-time. ## Unit Tests Setup The using T2 = decltype(*itr); static_assert(is_same_v ## Compiler Loophole – Stateful Metaprogramming • A friend function exists outside of the class it is declared in. - When a template class record operations • Uses macros to record control flow • Uses compiler loophole for stateful metaprogramming ## C++26 Reflection Use std::meta::info to record generic actions. Query std::meta::info to0 码力 | 137 页 | 1.70 MB | 1 年前3
Expressive Compile-time Parsersuments/9/a/3/c/9a3c029d0db11594467a24cca15ee3f1/p4_1.jpg) Language Evolution API Design Metaprogramming Tricks ## About the talk • Expressiveness in C++ • Parsers • Operator overloading • Domain “…The syntax and techniques needed are pretty horrendous.” - C++ core guidelines (template metaprogramming) struct plus_exp : foldl_reject_incomplete_start_with_parser0 码力 | 134 页 | 1.73 MB | 1 年前3
EXPLORATION OF C++20 METAPROCRAMMING## EXPLORATION OF C++20 METAPROGRAMMING INBAL LEVI ## WHO AM I? • A C++ enthusiast. • An embedded software engineer at Solar Edge working on smart home. • One of the organizers of CoreCpp conference environments discourage extensive use of templates Template metaprogramming Avoid complicated template programming. (…) Decision: Template metaprogramming sometimes allows cleaner and easier-to-use interfaces I don't blame them... • We’ll see how C++20 creates a paradigm shift in the way we use metaprogramming. ## OUTLINE • Part 0: (Prologue) What are templates? • Part I: Adding templates to existing0 码力 | 50 页 | 2.59 MB | 1 年前3
The Hitchhiker’s Guide to
Logical VerificationList 105 6.10 Summary of New Lean Constructs 106 7 Metaprogramming 109 7.1 Tactics and Tactic Combinators 110 7.2 The Metaprogramming Monad 113 7.3 Names, Expressions, Declarations, and Environments axioms and quotient types, making it convenient to verify mathematics. It includes a convenient metaprogramming framework, which can be used to program custom proof automation. It includes a modern user interface 7 ## Metaprogramming Like most proof assistants, Lean can be extended with custom tactics and other functionality. Programming Lean itself is called metaprogramming. Lean's metaprogramming framework0 码力 | 215 页 | 1.95 MB | 2 年前3
Google C++ Style Guidemake it more obvious to readers, as with auto. ## Template metaprogramming Avoid complicated template programming. Template metaprogramming refers to a family of techniques that exploit the fact that and can be used to perform arbitrary compile-time computation in the type domain. Template metaprogramming allows extremely flexible interfaces that are type safe and high performance. Facilities like template metaprogramming are often obscure to anyone but language experts. Code that uses templates in complicated ways is often unreadable, and is hard to debug or maintain. Template metaprogramming often0 码力 | 83 页 | 238.71 KB | 2 年前3
共 240 条
- 1
- 2
- 3
- 4
- 5
- 6
- 24
相关搜索词
metaprogramming techniquestype traitsspecializationprimary templatemetafunctionsTemplate Metaprogrammingboost.mp11Circle-langvalue-based metaprogrammingcompile timeLeandependent type theorytacticsmetaprogrammingautomationDocumentationControl FlowMathematical OperationsMulti-ThreadingMetaprogrammingReflectionC++librariesboilerplate-reducingtemplate metaprogrammingCompile-Time ValidationMitziconstexprC++23Expressive Compile-time ParsersMetaprogramming TricksAPI DesignDomain Specific LanguagesC++20元编程模板编译时条件类型特征theorem provingtacticHoare logicformal proofC++编程规范命名约定异常处理指针和引用代码风格













