The Many Shades of reference_wrappersome_object; if (cond) dialog = some_other_object; // ?? process(dialog); 3 CppCon 2020C++ reference can only be bound once auto& dialog = [&]() -> auto& { if (cond) return some_object; else return 2020Reference “assignment” 8 CppCon 2020 Python dialog = some_object if cond: dialog = some_other_object C++ auto& dialog = some_object; if (cond) dialog = some_other_object;C++ reference • initialization initialization binds the object to the reference • assignment assigns to the bounded object (so called “assign-through”) 9 CppCon 2020What if initialization and assignment both bind objects? • initialization0 码力 | 49 页 | 575.61 KB | 6 月前3
Lock-Free Atomic Shared Pointers Without a Split Reference Count? It Can Be Done!Atomics and concurrency patterns • How existing atomicare implemented (the split reference count technique) • Deferred reclamation, i.e., garbage collection in C++ Some assumed knowledge Atomics and concurrency patterns • How existing atomic are implemented (the split reference count technique) • Deferred reclamation, i.e., garbage collection in C++ Some assumed knowledge control_block pointer as a lock26 Daniel Anderson -- danielanderson.net Solution #2: The split reference count • Used by Folly (Facebook open-source library, used in production), • Used by JustThreads 0 码力 | 45 页 | 5.12 MB | 6 月前3
Custom Views for the Rest of Usbase_reference = std::ranges::range_reference_t; /* ... */ public: using value_type = std::pair ; using reference = std::pair reference, base_reference>; base_reference>; using difference_type = std::ptrdiff_t; using iterator_category = std::forward_iterator_tag; /* ... */ }; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 30class inner_iterator base_reference = std::ranges::range_reference_t ; /* ... */ public: using value_type = std::pair ; using reference = std::pair reference, base_reference>; 0 码力 | 187 页 | 13.25 MB | 6 月前3
Modern C++ Tutorial: C++11/14/17/20 On the Flyand std::placeholder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.3 rvalue Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 lvalue, xvalue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 rvalue reference and lvalue reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Move semantics . . . . . . . . . . . . . . . . 57 Chapter 05 Smart Pointers and Memory Management 57 5.1 RAII and Reference Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.2 std::shared_ptr0 码力 | 92 页 | 1.79 MB | 1 年前3
Conan 1.19 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 15 Reference 297 15.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ˓→txt). config Manages Conan configuration. get Gets a file or list a directory of a given reference or package. info Gets information about the dependency graph of a recipe. ... Tip: If you are 9.0@pocoproject/stable zlib/1.2.11@conan/stable To inspect the different binary packages of a reference run: $ conan search Poco/1.9.0@pocoproject/stable Existing packages for recipe Poco/1.9.0@pocoproject/stable:0 码力 | 609 页 | 4.88 MB | 1 年前3
Conan 1.20 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 15 Reference 297 15.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ˓→txt). config Manages Conan configuration. get Gets a file or list a directory of a given reference or package. info Gets information about the dependency graph of a recipe. ... Tip: If you are 9.0@pocoproject/stable zlib/1.2.11@conan/stable To inspect the different binary packages of a reference run: $ conan search Poco/1.9.0@pocoproject/stable Existing packages for recipe Poco/1.9.0@pocoproject/stable:0 码力 | 611 页 | 4.89 MB | 1 年前3
Conan 1.16 Documentationwith Conan and Artifactory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 14 Reference 259 14.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Edits the conan.conf or installs config files. get Gets a file or list a directory of a given reference or package. info Gets information about the dependency graph of a recipe. ... 2.6 Install from 9.0@pocoproject/stable zlib/1.2.11@conan/stable To inspect the different binary packages of a reference run: $ conan search Poco/1.9.0@pocoproject/stable Existing packages for recipe Poco/1.9.0@pocoproject/stable:0 码力 | 545 页 | 4.34 MB | 1 年前3
Conan 1.15 Documentationwith Conan and Artifactory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 14 Reference 257 14.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Edits the conan.conf or installs config files. get Gets a file or list a directory of a given reference or package. info Gets information about the dependency graph of a recipe. ... 2.6 Install from 9.0@pocoproject/stable zlib/1.2.11@conan/stable To inspect the different binary packages of a reference run: $ conan search Poco/1.9.0@pocoproject/stable Existing packages for recipe Poco/1.9.0@pocoproject/stable:0 码力 | 540 页 | 4.22 MB | 1 年前3
Conan 1.18 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 15 Reference 289 15.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ˓→txt). config Manages Conan configuration. get Gets a file or list a directory of a given reference or package. info Gets information about the dependency graph of a recipe. ... Tip: If you are 9.0@pocoproject/stable zlib/1.2.11@conan/stable To inspect the different binary packages of a reference run: $ conan search Poco/1.9.0@pocoproject/stable Existing packages for recipe Poco/1.9.0@pocoproject/stable:0 码力 | 584 页 | 4.80 MB | 1 年前3
Conan 1.26 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 16 Reference 319 16.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ˓→txt). config Manages Conan configuration. get Gets a file or list a directory of a given reference or package. info Gets information about the dependency graph of a recipe. ... Tip: If you are recipes: openssl/1.0.2t poco/1.9.4 zlib/1.2.11 To inspect the different binary packages of a reference run: $ conan search poco/1.9.4@ Existing packages for recipe poco/1.9.4: Package_ID: 645aaff00 码力 | 669 页 | 5.51 MB | 1 年前3
共 213 条
- 1
- 2
- 3
- 4
- 5
- 6
- 22













