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 shallow depth, slow current - Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques ## I ntended Audience • Beginner/Intermediate • Gentle entry: swimming pool 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
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_nice_error_messages; 0 码力 | 130 页 | 5.79 MB | 1 年前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 “Lifts” into reflection land • function • type • variable and friends non-static data member • template • namespace ... ## ☀️ ☁️ ☁️ 1 using namespace std::meta; 3 auto magic_reflection_method(info Elevator pitch ## Enum to String ## ● ● ● 1 enum class MyEnum { VALUE_1, VALUE_2, MAX_VALUES }; templateconstexpr std::string enum_to_string(EnumT enum_value) { std::string result 0 码力 | 118 页 | 14.33 MB | 1 年前3
Compile-Time Validationif constexpr (error) { report_error<*error>(); } }; ## Error Message templateconstexpr auto report_error() { static_assert(sizeof(error) == 0); ' Compiler returned: 1 ## Error Message templateinline constexpr auto always_false = sizeof(error) == 0; template constexpr auto report_error() { s x{42}> ## fixed_str A wrapper around a fixed size array that represents a compile-time string template struct fixed_str { constexpr fixed_str(const char(&str)[N]) { std::copy(str 0 码力 | 137 页 | 1.70 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
Back to Basics: C++ Templates - Part 2## V ariadic templates: Parameter pack ## ■ Syntax: A typename|class... Ts generates a type template parameter pack with optional name. B Args... ts a function argument parameter pack with optional D ts... in the body of a function to unpack the arguments. 1 templatetemplate="" 4="" constexpr="" auto="" 5="" min(const="" t&="" a,="" const="" std::string(t); } 5 Catch all others and apply to_string 6 template auto Normalize(const T& t) { return std::to_string(t); } 7 template auto _StrCat(std::string& 0 码力 | 12 页 | 787.22 KB | 1 年前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
Django 5.0.x Documentation• Write views that actually do something • Raising a 404 error • Use the template system • Removing hardcoded URLs in templates • Namespacing URL names classes Working with form templates Further topics Templates - The Django template language - Support for template engines Class-based views - Introduction to class-based views - Built-in Django's cache framework - Setting up the cache - The per-site cache - The per-view cache - Template fragment caching - The low-level cache API - Asynchronous support - Downstream caches - Using0 码力 | 3407 页 | 3.21 MB | 2 年前3
Zabbix 6.4 ManualNew host 126 3 New item 128 4 New trigger 129 5 Receiving problem notification 131 6 New template 135 6 Zabbix appliance 137 7 Configuration 140 1 Hosts and host groups 149 2 Items 159 4 Events 347 5 Event correlation 350 6 Tagging 357 7 Visualization 360 8 Templates and template groups 387 9 Templates out of the box 388 10 Notifications upon events 397 11 Macros 442 Problem acknowledgment 544 1 Problem suppression 546 14 Configuration export/import 547 1 Template groups 549 2 Host groups 549 3 Templates 549 4 Hosts 569 5 Network maps 587 6 Media types0 码力 | 1885 页 | 29.12 MB | 2 年前3
Zabbix 4.4 Manualpackages 69 5 Installation from containers 87 6 Upgrade procedure 93 7 Known issues 102 8 Template changes 104 9 Upgrade notes for 4.4.0 105 10 Upgrade notes for 4.4.1 106 11 Upgrade notes 112 3 New item 113 4 New trigger 116 5 Receiving problem notification 118 6 New template 122 6. Zabbix appliance 124 7. Configuration 127 1 Hosts and host groups 133 templates come in three flavours: • Template OS Linux by Zabbix agent, Template OS Linux by Zabbix agent active - Linux monitored via Zabbix agent (modular) - depend on Template Module Zabbix agent, which should0 码力 | 1393 页 | 16.55 MB | 2 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
metaprogramming techniquestype traitsspecializationprimary templatemetafunctionsTemplate Metaprogrammingboost.mp11Circle-langvalue-based metaprogrammingcompile timeReflectionC++librariesboilerplate-reducingtemplate metaprogrammingCompile-Time ValidationMitziconstexprC++23Leandependent type theorytacticsmetaprogrammingautomationvariadic templatesfold expressionstemplate template parametersvariable templatesSFINAEDocumentationControl FlowMathematical OperationsMulti-ThreadingMetaprogrammingDjangoORMadmintemplateformZabbixmonitoringproxyupgradeconfiguration













