Template Metaprogramming: Type Traits
Template Metaprogramming: Type Traits Part 1 CppCon 2020 1 Jody Hagins jhagins@maystreet.com coachhagins@gmail.comTemplate Metaprogramming: Type Traits CppCon 2020 2 IntroductionIntended Audience oriented: shallow depth, slow current • Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques 3Intended 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 3Intended Audience0 码力 | 403 页 | 5.30 MB | 5 月前3Template-Less Meta-Programming
1 / 58Template Metaprogramming (TMP) Template Metaprogramming (TMP) templateusing meta_fun = this_talk ; 2 / 58❓static_assert(Template::Metaprogramming::is_hard); // ✔ 3 / 58❓s 58❓static_assert(Template::Metaprogramming::is_hard); // ✔ ❓static_assert(Template::Metaprogramming::is_powerful); // ✔ 3 / 58❓static_assert(Template::Metaprogramming::is_hard); // ✔ ❓static_assert( ❓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 | 5 月前3THE FIRST EXPLORATION OF PROJECT SPARROW
0 码力 | 68 页 | 13.14 MB | 1 年前3Back to Basics: Generic Programming
Programming CppCon 2024 Define a Template template <template-parameters> declaration; declaration can be • class / struct • function • type alias • variable • concept template-parameter is class | typename typename identifier [= default-value] Template definition should be in a header file12 David Olsen – Generic Programming CppCon 2024 Class Template Definition templateclass pair { T https://godbolt.org/z/rejh9YPhK13 David Olsen – Generic Programming CppCon 2024 Class Template Definition template class pair { T m0; U m1; public: pair() { } pair(T v0, U v1) : m0(v0) 0 码力 | 175 页 | 1.16 MB | 5 月前3Jinja2 Documentation Release 2.10
API 7 3 Sandbox 39 4 Native Python Types 45 5 Template Designer Documentation 47 6 Extensions 89 7 Integration 107 8 Switching from other Template Engines 109 9 Tips and Tricks 115 II Additional that is designed to be flexible, fast and secure. If you have any exposure to other text-based template languages, such as Smarty or Django, you should feel right at home with Jinja2. It’s both designer introduction to the Python API for Jinja2 templates. The most basic way to create a template and render it is through Template. This how- ever is not the recommended way to work with it if your templates are0 码力 | 148 页 | 475.08 KB | 1 年前3Back to Basics: Templates - Part 1
Basics: Templates – Part 1 Copyright © 2021 Bob Steagall Overview • Rationale • Template fundamentals • Template categories in detail 2CppCon 2021 – Back to Basics: Templates – Part 1 Copyright © Bob Steagall Template Categories 15CppCon 2021 – Back to Basics: Templates – Part 1 Copyright © 2021 Bob Steagall Function Templates (C++98/03) • Recipes for making functions 16 templateT T const& min(T const& a, T const& b); { return (a < b) ? a : b; } template void swap(T& a, T& b); template void sort(RandomIt first, RandomIt last, Compare 0 码力 | 68 页 | 436.75 KB | 5 月前3Back to Basics: Templates Part 2
Templates • C++ supports generic programming with templates • A template is a parametrized description of a family of some facility • A template is not a thing – it is a recipe for making things • C++ provides kinds of templates • Function templates • Class templates • Member function templates • Alias template • Variable templates • Lambda templates 2CppCon 2021 – Back to Basics: Templates – Part 2 Copyright name is an identifier that denotes an entity • Every template has a name • Every template specialization has a name, formally known as a template-id • A declaration introduces one or more names into0 码力 | 80 页 | 490.15 KB | 5 月前3Django 1.11.x Documentation
Overview Writing more views Write views that actually do something Raising a 404 error Use the template system Removing hardcoded URLs in templates Namespacing URL names Writing your first Django app Django Form classes Working with form templates Further topics Templates Support for template engines The Django template language Class-based views Introduction to class-based views Built-in class-based Installation Usage Django’s cache framework Setting up the cache The per-site cache The per-view cache Template fragment caching The low-level cache API Downstream caches Using Vary headers Controlling cache:0 码力 | 2747 页 | 2.67 MB | 1 年前3Django 1.11.x Documentation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.6 The template layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561 4.5 Custom template tags and filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566 Generating CSV | Generating PDF • Middleware: Overview | Built-in middleware classes 1.6 The template layer The template layer provides a designer-friendly syntax for rendering the information to be presented0 码力 | 1878 页 | 6.40 MB | 1 年前3Django 2.2.x Documentation
Overview Writing more views Write views that actually do something Raising a 404 error Use the template system Removing hardcoded URLs in templates Namespacing URL names Writing your first Django app Django Form classes Working with form templates Further topics Templates Support for template engines The Django template language Class-based views Introduction to class-based views Built-in class-based Installation Usage Django’s cache framework Setting up the cache The per-site cache The per-view cache Template fragment caching The low-level cache API Downstream caches Using Vary headers Controlling cache:0 码力 | 2915 页 | 2.83 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100