Template Metaprogramming: Type TraitsCppCon 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 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/Intermediate • Gentle Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques • Type traits part of standard library for ~10 years • Fundamentals have been in use for ~20 years ## I0 码力 | 403 页 | 5.30 MB | 1 年前3
Unraveling string_view: Basics, Benefits, and Best PracticesUnraveling string_view: Basics, Benefits, and Best Practices ## JASMINE LOPEZ & PRITHVI OKADE 20 24 September 15 - 20 ## Topics • Motivation • Performance benefits & basics • string_view: Constructors functions • string vs. string_view and their interoperability • When to use string_view • Using string_view safely • Intro to span • span vs. string_view • Case study of an optimization using string_view function foo which operates on an immutable string. • In C++ we generally will create it with the following signature. 1 void foo(const std::string& str); string existing_str; foo(existing_str); foo("hello0 码力 | 61 页 | 1.11 MB | 1 年前3
Nim 2.0.8 Manualof a certain type. The variable's type is called static type, the location's type is called dynamic type. If the static type is not the same as the dynamic type, it is a super-type or subtype of of the dynamic type. An identifier is a symbol declared as a name for a variable, type, procedure, etc. The region of the program over which a declaration applies is called the scope of the declaration statements / simpleStmt # or a simple statement ## Comments Comments start anywhere outside a string or character literal with the hash character #. Comments consist of a concatenation of comment pieces0 码力 | 132 页 | 5.73 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 15 C++ 系列课:字符与字符串1. vector 容器初体验 & 迭代器入门 (BV1qF411T7sd) 2. 你所不知道的 set 容器 & 迭代器分类 (BV1m34y157wb) 3. string, string_view, const char * 的爱恨纠葛(本期) 4. 万能的 map 容器全家桶及其妙用举例 5. 函子 functor 与 lambda 表达式知多少 6. 通过实战案例来学习 <= short <= int <= long <= long long 即可)。 ## 关于 char 类型的一个冷知识 #include#include <type_traits> int main() { if (std::is_signed ## C 语言中的字符串 • 字符串 (string) 就是由字符 (character) 组成的数组。 • C 语言中,字符串用双引号 “” 包裹,字符用单引号 “” 包裹。 • char c = 'h';::value) { printf("你的 char 是有符号的,我猜你是 bate@archer ~/Codes/course/15 (master) $ 你的 char 是有符号的,我猜你是 x86 架构 type_traits>0 码力 | 162 页 | 40.20 MB | 2 年前3
The Idris Tutorial Version 1.1.1manipulated like any other value. The standard example is the type of lists of a given length $ ^{1} $ , Vect n a, where a is the element type and n is the length of the list and can be an arbitrary term contain values, and where those values describe properties, for example the length of a list, the type of a function can begin to describe its own properties. Take for example the concatenation of two list's length is the sum of the lengths of the two input lists. We can therefore give the following type to the app function, which concatenates vectors: app : Vect n a -> Vect m a -> Vect (n + m)0 码力 | 223 页 | 1.21 MB | 2 年前3
Kotlin language specification
Version 1.9-rfc+0.1'interface' FUN: 'fun' OBJECT: 'object' VAL: 'val' VAR: 'var' TYPE_ALIAS: 'typealias' CONSTRUCTOR 'constructor' BY: 'by' COMPANION: 'companion' valid property declaration in Kotlin: val field = 2 even though field is a keyword #### 1.2.5 String mode grammar $ QUOTE\_OPEN $ TRIPLE QUOTE OPEN FieldIdentifier '$\$$ IdentifierOrSoftKey IdentifierOrSoftKey Opening a double quote ( QUOTE_OPEN ) rule puts the lexical grammar into the special “line string” mode with the following rules. Closing double quote ( QUOTE_CLOSE ) rule exits this mode. QUOTE_CLOSE0 码力 | 38 页 | 358.59 KB | 2 年前3
Julia v1.4.2 Documentation14.2 String Basics 63 14.3 Unicode and UTF-8 65 14.4 Concatenation 68 14.5 Interpolation 69 14.6 Triple-Quoted String Literals 70 14.7 Common Operations 72 14.8 Non-Standard String Literals Literals ..... 79 14.12 Raw String Literals ..... 80 15 Functions ..... 81 15.1 Argument Passing Behavior ..... 82 15.2 The return Keyword ..... 82 Return type ..... 83 Returning nothing 116 Let Blocks ..... 120 For Loops and Comprehensions ..... 121 17.3 Constants ..... 122 18.1 Type Declarations ..... 126 18.2 Abstract Types ..... 127 18.3 Primitive Types ..... 129 18.4 Composite0 码力 | 1314 页 | 4.29 MB | 2 年前3
Nim Tutorial (Part I) 0.17.1August 19, 2017 Contents 1 Introduction 2 2 The first program 2 3 Lexical elements 2 3.1 String and character literals 3 3.2 Comments 3 3.3 Numbers 3 4 The var statement 3 5 The assignment 12.2 Characters 12 12.3 Strings 12 12.4 Integers 13 12.5 Floats 13 12.6 Type Conversion 13 13 Internal type representation 14 14 Advanced types 14 14.1 Enumeriations 14 14.2 Ordinal types 14.9 Slices 18 14.10Tuples 19 14.11Reference and pointer types 20 14.12Procedural type 20 14.13Distinct type 21 15 Modules 21 15.1 Excluding symbols 22 15.2 From statement 22 15.3 Include0 码力 | 24 页 | 271.23 KB | 1 年前3
Kotlin language specification
Version 1.9-rfc+0.1Identifiers 16 1.2.5 String mode grammar 18 1.2.6 Tokens 19 1.3 Syntax grammar 23 1.4 Documentation comments 42 2 Type system 43 Glossary 43 Introduction 44 2.1 Type kinds 45 2.1.1 Built-in types 48 2.1.3 Type parameters ..... 50 Function type parameters ..... 51 Mixed-site variance ..... 51 Declaration-site variance ..... 52 Use-site variance ..... 54 2.1.4 Type capturing .... . 55 2.1.5 Type containment ..... 60 2.1.6 Function types ..... 61 Suspending function types ..... 62 2.1.7 Flexible types ..... 63 Dynamic type ..... 64 Platform types ..... 64 2.1.8 Nullable0 码力 | 310 页 | 1.39 MB | 2 年前3
Fast and small C++the program name. $ ./a.out Hello, C++! • <string> stands for a header file with the name string • [[xyz]] marks a C++ attribute with the name xyz.string> ## fertig adjective /ˈfɛrtɪç/ finished ready const noexcept 6 { 7 static_assert(0 < sizeof(T), "can't delete an incomplete type"); 8 delete ptr; 9 } 10 }; ; size_t mCapacity(); char* mData(); char mSSOBuffer[16]; bool mIsSSO{true}; }; static_assert(sizeof(string) == 48);0 码力 | 17 页 | 790.91 KB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
metaprogramming techniquestype traitsspecializationprimary templatemetafunctionsstring_viewstd::stringspan性能优化内存分配GuardsLocksModule systemIdentifiersString typeC字符串小字符串优化vectorIdrisTypeInterfaceDeclarationMonadKotlin language specificationannotationslexicallymultiline stringidentifierDocumentation systemREPLCore modulesString functionsModulesNimvar statementprocstring literalscontrol flowKotlinmultiplatformtype systemsyntaxcompatibilitySmall String Optimizationconstexprtemplatestruct压缩对联结













