Back To Basics: The Rule of FiveAgenda ● Background ● Core Guidelines ● What is the Rule of Five ● Compiler provided functions ● What is the Rule of Zero 3Copyright © 2023 Andre Kostur C++ is a net> C++ Core Guidelines 6Copyright © 2023 Andre Kostur Guideline C.21 is “The Rule of Five” 7Copyright © 2023 Andre Kostur Simple String 8Copyright © 2023 Andre nullptr; return *this; } // … char * data_; }; 19Copyright © 2023 Andre Kostur The Rule of Five C.21: “If you define or =delete any copy, move, or destructor function, define or =delete 0 码力 | 42 页 | 623.10 KB | 6 月前3
Cache-Friendly Design in Robot Path Planning158 wr) ==131579== LLd misses: 3,336,167 ( 2,266,653 rd + 1,069,514 wr) ==131579== D1 miss rate: 7.9% ( 9.6% + 0.7% ) ==131579== LLd miss rate: 158 wr) ==131579== LLd misses: 3,336,167 ( 2,266,653 rd + 1,069,514 wr) ==131579== D1 miss rate: 7.9% ( 9.6% + 0.7% ) ==131579== LLd miss rate: ==131579== LLd misses: 3,336,167 ( 2,266,653 rd + 1,069,514 wr) 12 ==131579== D1 miss rate: 7.9% ( 9.6% + 0.7% ) 13 ==131579== LLd miss rate:0 码力 | 216 页 | 10.68 MB | 6 月前3
Back to Basics: The structure of a Programwrite • The phases of translation • Declarations, definitions, and linkage • The one-definition rule (ODR) • Storage duration • ABIs and name-mangling • Linking and loading CppCon 2020 - The Structure use Build Tools Source Code Tools Dependency Packages Dependency Tools ld, ld.bfd, ld.gold, lld, link.exe, …Copyright © 2020 Bob Steagall K E W B C O M P U T I N G C++ Programming Ecosystem – Building and z have no linkageCopyright © 2020 Bob Steagall K E W B C O M P U T I N G The One-Definition Rule (ODR) • A given translation unit can contain at most one definition of any: • variable • function0 码力 | 64 页 | 390.34 KB | 6 月前3
Shared Librarieswith – • --no-allow-shlib-undefined (on the exe) • Operates recursively on ld, not on gold/lld. • -z defs (on the shlib) • --no-undefined (on the shlib) 19 bar foo exe lib1 lib2 lib3 lib4 Mach-O and PE/COFF have many problems but this may be a place where they got right.” Fangrui Song, LLD maintainer https://maskray.me/blog/2021-06-13-dependency-related-linker-options 21Position Independent thegreenplace.net/2011/11/03/position-independent-code-pic-in-shared-libraries/ • Fangrui Song, LLVM/LLD contributor: • https://maskray.me/blog/ • SystemV ABI spec and mailing list • https://groups.google0 码力 | 69 页 | 1.40 MB | 6 月前3
Shared Libraries and Where To Find Themof the systemThe linker [ld] ● Program is typically called ld ○ other implementations: ld.gold, lld, mold ● On Linux, typically invoked by gcc itself via the collect2 tool g++ my_program.cpp -o the collect2 invocation with -v ● GNU Linker is typically the default, there’s others: ○ gold, lld, mold ○ They may have slightly different behaviorsThe linker [ld] - search procedure (cont’d)The dynamic0 码力 | 94 页 | 6.49 MB | 6 月前3
Kotlin Language Documentation 1.9.20available in modern Linux distributions. In addition to the LLVM update, Kotlin/Native now uses the LLD linker (a linker from the LLVM project) for MingGW targets. It provides various benefits over the runtime performance of produced binaries and support compiler caches for MinGW targets. Note that LLD requires import libraries for DLL linkage. Learn more in this Stack Overflow thread. Performance improvements interoperability. Deprecation of linkage against DLLs without import libraries for MinGW targets LLD is a linker from the LLVM project, which we plan to start using in Kotlin/Native for MinGW targets0 码力 | 1299 页 | 32.44 MB | 1 年前3
Kotlin 1.9.10 官方文档 中文版
available in modern Linux distributions. In addition to the LLVM update, Kotlin/Native now uses the LLD linker (a linker from the LLVM project) for MingGW targets. It provides various benefits over the runtime performance of produced binaries and support compiler caches for MinGW targets. Note that LLD requires import libraries for DLL linkage. Learn more in this Stack Overflow thread. 性能提升 Kotlin/Native Companion.shared Learn more about Swift/Objective-C interoperability. 对于 MinGW 目标弃用了链接到 DLL 而未导入库的用 法 LLD is a linker from the LLVM project, which we plan to start using in Kotlin/Native for MinGW targets0 码力 | 3753 页 | 29.69 MB | 1 年前3
Julia 1.11.4unit sequences. This convention allows to treat any byte sequence as a String. In such situations a rule is that when parsing a sequence of code units from left to right characters are formed by the longest prefixes thereof are treated as a single invalid character rather than multiple invalid characters. This rule may be best explained with an example: julia> s = "\xc0\xa0\xe2\x88\xe2|" "\xc0\xa0\xe2\x88\xe2|" local, the value (or lack thereof) of the global x is unaffected by calling greet. The hard scope rule doesn't care whether a global named x exists or not: assignment to x in a hard scope is local (unless0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentationunit sequences. This convention allows to treat any byte sequence as a String. In such situations a rule is that when parsing a sequence of code units from left to right characters are formed by the longest prefixes thereof are treated as a single invalid character rather than multiple invalid characters. This rule may be best explained with an example: julia> s = "\xc0\xa0\xe2\x88\xe2|" "\xc0\xa0\xe2\x88\xe2|" local, the value (or lack thereof) of the global x is unaffected by calling greet. The hard scope rule doesn't care whether a global named x exists or not: assignment to x in a hard scope is local (unless0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.6 Release Notesunit sequences. This convention allows to treat any byte sequence as a String. In such situations a rule is that when parsing a sequence of code units from left to right characters are formed by the longest prefixes thereof are treated as a single invalid character rather than multiple invalid characters. This rule may be best explained with an example: julia> s = "\xc0\xa0\xe2\x88\xe2|" "\xc0\xa0\xe2\x88\xe2|" local, the value (or lack thereof) of the global x is unaffected by calling greet. The hard scope rule doesn't care whether a global named x exists or not: assignment to x in a hard scope is local (unless0 码力 | 2007 页 | 6.73 MB | 3 月前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100













