C++20 Modules: The Packaging and Binary Redistribution Story
them in our projects?The include directive ● Include directive: “Tells the preprocessor to include the contents of a specified file at the point where the directive appears.” #includeerror generated. Around ~350k lines after the include is replaced by the contentsThe include directive - cont’d When invoking the compiler, it needs to be able to resolve the location of #included ○ Typically handled by build system / package manager hello_world.cpp hello_world.oThe include directive - cont’d clang++ -std=c++20 -o hello_world.cpp.o -c hello_world.cpp hello_world.cpp:1:10: fatal 0 码力 | 76 页 | 2.09 MB | 5 月前3Contracts for C++
assertion in a program should not alter the correctness of that program The Contracts Prime Directive130 Copyright (c) Timur Doumler | @timur_audio | https://timur.audio • The presence Adding a contract assertion that is not checked can't cause runtime overhead The Contracts Prime Directive131 Copyright (c) Timur Doumler | @timur_audio | https://timur.audio • The presence contract assertion, or a subsequent check of the same contract assertion The Contracts Prime Directive132 Copyright (c) Timur Doumler | @timur_audio | https://timur.audio • The presence0 码力 | 181 页 | 4.44 MB | 5 月前3Tornado 6.5 Documentation
Application or tornado.template.Loader constructors, for a template file with the {% autoescape None %} directive, or for a single expression by replacing {{ ... }} with {% raw ...%}. Additionally, in each of these only available in templates invoked via {% module Template(...) %}. Unlike the {% include ... %} directive, template modules have a distinct namespace from their containing template - they can only see the through. Defaults to "xhtml_escape". Can be changed on a per-template basis with the {% autoescape %} directive. • compiled_template_cache: Default is True; if False templates will be recompiled on every re-0 码力 | 272 页 | 1.12 MB | 2 月前3cppcon 2021 safety guidelines for C parallel and concurrency
false positive May be bad rule for tools Hard Easy MISRA tools, CG Meta Hard Hard Neither, META directive; Code guidelines Obvious rules, but hard to verify Might not be a good rule anyway Need a new [[intention::] [[intention::] attribute Stage 2: collate • Category • Mandatory: 8 • Required: 12 • Advisory: 12 • Directive: 5 • Decidable by humans • Easy: 27 • Medium: 1 • Complex: 20 • Unknown yet: 9 • Decidable via automated It is not visible in code and is not visible for code analysis tools Too high level for C++CG? Directive for tools/MISRA Agenda 1. Current status of C++ safety: MISRA and C++ CG 2. Parallel Safety rules0 码力 | 52 页 | 3.14 MB | 5 月前3C++20: An (Almost) Complete Overview
Test Macros Immediate Functions – consteval constinit Class Enums and using Directive Text Formatting Math Constants std::source_location [[nodiscard(reason)]] Bit Operations Forces constant initialization ✔ E.g.: constinit const char* a { ... };74 Class Enums and using Directive Example: enum class CardTypeSuit { Clubs, Diamonds, Hearts, Spades }; std::string_view GetString(const Feature Test Macros Immediate Functions – consteval constinit Class Enums and using Directive Text Formatting Math Constants std::source_location [[nodiscard(reason)]] Bit Operations 0 码力 | 85 页 | 512.18 KB | 5 月前3Tornado 6.5 Documentation
Application or tornado.template.Loader constructors, for a template file with the {% autoescape None %} directive, or for a single expression by replacing {{ ... }} with {% raw ...%}. Additionally, in each of these only available in templates invoked via {% module Template(...) %}. Unlike the {% include ... %} directive, template modules have a distinct namespace from their containing template - they can only see the through. Defaults to "xhtml_escape". Can be changed on a per-template basis with the {% autoescape %} directive. compiled_template_cache: Default is True; if False templates will be recompiled on every request0 码力 | 437 页 | 405.14 KB | 2 月前3Leveraging C++20/23 Features for Low Level Interactions
uint32_t value = 0; value |= 0x1; value &= ~(0x1);Break from your #defined habits Preprocessor directive #de�ne is incredibly dangerous …But it’s also not unusual to come across macros and constants via REPLACE_BITS(x, mask, bits) ((x & (~(mask))) | (bits &Break from your #defined habits Preprocessor directive #de�ne is incredibly dangerous …But it’s also not unusual to come across macros and constants via0 码力 | 56 页 | 5.39 MB | 5 月前3Back to Basics: The structure of a Program
(roughly) as • A source file, • Plus with all the headers and source files included via the #include directive, • Minus any source lines skipped by conditional inclusion preprocessing directives (#ifdef), directives are executed, and macro invocations are expanded • each file included by an #include directive is processed by Phases 1 through 4, recursively • all preprocessing directives are removedCopyright0 码力 | 64 页 | 390.34 KB | 5 月前3Dynamically Loaded Libraries Outside the Standard
etc. In case you don’t know…8 CppCon 2021 | • Apache httpd modules (DSO modules) – LoadModule directive • C extension for CPython (.pyd on Windows) – import module_name • Java Native Interface (JNI)0 码力 | 100 页 | 3.98 MB | 5 月前3LITERALS SAFELY for Types that Behave as though Built-in - Pablo Halpern - CppCon 2021
inline namespace, std::literals; they must be imported into the current scope by means of a using directive: – using namespace std; imports everything in the standard library, including all the literals0 码力 | 66 页 | 1.47 MB | 5 月前3
共 21 条
- 1
- 2
- 3
相关搜索词
C++20ModulesThePackagingandBinaryRedistributionStoryContractsforTornado6.5Documentationcppcon2021safetyguidelinesparallelconcurrencyAnAlmostCompleteOverviewLeveraging23FeaturesLowLevelInteractionsBacktoBasicsstructureofProgramDynamicallyLoadedLibrariesOutsidetheStandardLITERALSSAFELYTypesthatBehaveasthoughBuiltinPabloHalpernCppCon