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 月前3Secrets of C++ Scripting Bindings
about SWIG Learned that Python is wrong for embedding (Global state), chose Lua 2008 - Created SWIG Starter Kit SWIG is great for binding to other languages, but requires a second build step (Side note: this and through its development and via bug reports and contributions from users, I learned about: Template Meta Programming 7 . 4Copyright Jason Turner @le�icus emptycrate.com/idocpp ChaiScript ChaiScript and through its development and via bug reports and contributions from users, I learned about: Template Meta Programming Lambdas 7 . 4Copyright Jason Turner @le�icus emptycrate.com/idocpp ChaiScript0 码力 | 177 页 | 1.65 MB | 5 月前3Oracle VM VirtualBox 4.1.40 User Manual
VirtualBox VNIC template is a VNIC whose name starts with “vboxvnic_template”. Here is an example of how to use a VNIC template to configure a VLAN for VMs. Create a VirtualBox VNIC template, by executing executing as root: dladm create-vnic -t -l nge0 -v 23 vboxvnic_template0 3Support for Crossbow based bridged networking was introduced with VirtualBox 4.1 and requires Solaris 11 build 159 or above. 161 9 Advanced -- -- vboxvnic_template0 vnic 1500 up -- nge0 $ dladm show-vnic LINK OVER SPEED MACADDRESS MACADDRTYPE VID vboxvnic_template0 nge0 1000 2:8:20:25:12:75 random 23 Once the VNIC template is created, all0 码力 | 310 页 | 4.87 MB | 6 月前3Oracle VM VirtualBox 4.2.32 User Manual
Guest Additions 4.2 and later). VBoxManage guestcontrolcreatetemp[orary]|mktemp <template> --username [--passwordfile | --password ] [--directory] [--secure] [--tmpdir [--mode ] [--verbose] where the parameters mean: uuid|vmname The VM UUID or VM name. Mandatory. template A file name without a path and with at least three consecutive ’X’ characters or ending in ’X’ --username VirtualBox VNIC template is a VNIC whose name starts with “vboxvnic_template”. Here is an example of how to use a VNIC template to configure a VLAN for VMs. Create a VirtualBox VNIC template, by executing 0 码力 | 348 页 | 5.93 MB | 6 月前3Oracle VM VirtualBox 5.2.40 User Manual
mktemp|createtemp[orary] [common-options] [--secure] [--mode ] [--tmpdir ] <template> stat [common-options] [...] guestcontrol [--verbose|-v] [--quiet|-q] list word] [--dry-run] [--auxiliary-base-path=path] [--image-index=number] [--script-template=file] [--post-install-template=file [--post-install-command=command] [--extra-install-kernel-parameters=params] ] <template> The parameters are: Specifies the VM UUID or VM name. Mandatory. --directory Creates a temporary directory instead of a file, specified by the <template> parameter. 0 码力 | 387 页 | 4.27 MB | 6 月前3Oracle VM VirtualBox 5.2.12 User Manual
mktemp|createtemp[orary] [common-options] [--secure] [--mode ] [--tmpdir ] <template> stat [common-options] [...] guestcontrol [--verbose|-v] [--quiet|-q] list word] [--dry-run] [--auxiliary-base-path=path] [--image-index=number] [--script-template=file] [--post-install-template=file [--post-install-command=command] [--extra-install-kernel-parameters=params] ] <template> The parameters are: Specifies the VM UUID or VM name. Mandatory. --directory Creates a temporary directory instead of a file, specified by the <template> parameter. 0 码力 | 380 页 | 4.23 MB | 6 月前3Oracle VM VirtualBox 4.3.36 User Manual
--password] [--domain ] [--verbose] createtemp[orary]|mktemp 120 8 VBoxManage <template> --username [--passwordfile | --password ] [--directory] [--secure] [--tmpdir Guest Additions 4.2 and later). VBoxManage guestcontrol createtemp[orary]|mktemp <template> --username [--passwordfile | --password ] [--directory] [--secure] [--tmpdir [--mode ] [--verbose] where the parameters mean: uuid|vmname The VM UUID or VM name. Mandatory. template A file name without a path and with at least three consecutive ’X’ characters or ending in ’X’ --username 0 码力 | 380 页 | 3.79 MB | 6 月前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 月前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 月前3
共 249 条
- 1
- 2
- 3
- 4
- 5
- 6
- 25