Modern C++ Tutorial: C++11/14/17/20 On the Flystd::unique_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 5.4 std::weak_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . std::cout << "Foo::~Foo" << std::endl; } void foo() { std::cout << "Foo::foo" << std::endl; } }; 59 5.4 std::weak_ptr CHAPTER 05 SMART POINTERS AND MEMORY MANAGEMENT void f(const Foo &) { std::cout << not empty, prints if (p1) p1->foo(); // Foo instance will be destroyed when leaving the scope } 5.4 std::weak_ptr If you think about std::shared_ptr carefully, you will still find that there is still0 码力 | 92 页 | 1.79 MB | 1 年前3
Using Modern C++ to Build XOffsetDatastructuremaximum memory needs. Fanchen Su, XOffsetDatastructure, CppCon 2024 88 Per-allocation with Trimming5.4 Auto-Resizing Mechanisms • 2. Auto-Resizing: • For greater ease of use, we've also implemented auto-resizing entire buffer to be moved in memory. Fanchen Su, XOffsetDatastructure, CppCon 2024 89 Auto-Resizing5.4 Auto-Resizing Mechanisms • We've implemented the auto-resizing functionality using three different CppCon 2024 90 Method Time (ms) Exception 1735 longjmp 1395 Leaf 3177 Performance Comparison5.4 Auto-Resizing Mechanisms • We've implemented the auto-resizing functionality using three different0 码力 | 111 页 | 3.03 MB | 6 月前3
现代C++ 教程:高速上手C++11/14/17/20std::unique_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.4 std::weak_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 以利用 std::move 将其转移给其他的 unique_ptr,例如: #include#include struct Foo { 54 5.4 std::weak_ptr 第 5 章智能指针与内存管理 Foo() { std::cout << "Foo::Foo" << std::endl; } ~Foo() { std::cout << 的实例会在离开作用域时被销毁 } 5.4 std::weak_ptr 如果你仔细思考 std::shared_ptr 就会发现依然存在着资源无法释放的问题。看下面这个例子: struct A; struct B; struct A { std::shared_ptr pointer; ~A() { std::cout << "A 被销毁" << std::endl; 55 5.4 std::weak_ptr 0 码力 | 83 页 | 2.42 MB | 1 年前3
Conan 1.16 Documentationand Sources in the Same Repo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.4 Packaging Existing Binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . packages to a remote. 5.3. Recipe and Sources in the Same Repo 39 conan Documentation, Release 1.16.1 5.4 Packaging Existing Binaries There are specific scenarios in which it is necessary to create packages them on your own Conan server, so that the builds do not rely on third party URL being available. 5.4. Packaging Existing Binaries 41 conan Documentation, Release 1.16.1 5.5 Understanding Packaging0 码力 | 545 页 | 4.34 MB | 1 年前3
Conan 1.15 Documentationand Sources in the Same Repo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.4 Packaging Existing Binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . local repository. 5.3. Recipe and Sources in the Same Repo 39 conan Documentation, Release 1.15.1 5.4 Packaging Existing Binaries There are specific scenarios in which it is necessary to create packages them on your own Conan server, so that the builds do not rely on third party URL being available. 5.4. Packaging Existing Binaries 41 conan Documentation, Release 1.15.1 5.5 Understanding Packaging0 码力 | 540 页 | 4.22 MB | 1 年前3
Conan 1.17 Documentationand Sources in the Same Repo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.4 Packaging Existing Binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . packages to a remote. 5.3. Recipe and Sources in the Same Repo 39 conan Documentation, Release 1.17.2 5.4 Packaging Existing Binaries There are specific scenarios in which it is necessary to create packages them on your own Conan server, so that the builds do not rely on third party URL being available. 5.4. Packaging Existing Binaries 41 conan Documentation, Release 1.17.2 5.5 Understanding Packaging0 码力 | 567 页 | 4.53 MB | 1 年前3
Conan 1.6 Documentationsources in the same repo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.4 Packaging existing binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . changes. It allows to speed up the development of your packages cloning from a local repository. 5.4 Packaging existing binaries Sometimes, it is necessary to create packages from existing binaries, package(self): self.copy("*") def package_info(self): self.cpp_info.libs = self.collect_libs() 5.4. Packaging existing binaries 37 conan Documentation, Release 1.6.1 The provided package_info() method0 码力 | 428 页 | 2.87 MB | 1 年前3
Conan 1.7 Documentationand Sources in the Same Repo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.4 Packaging Existing Binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . This allows you to speed up the development of your packages when cloning from a local repository. 5.4 Packaging Existing Binaries There are specific scenarios in which it is necessary to create packages package(self): self.copy("*") def package_info(self): self.cpp_info.libs = self.collect_libs() 5.4. Packaging Existing Binaries 37 conan Documentation, Release 1.7.4 The provided package_info() method0 码力 | 433 页 | 2.95 MB | 1 年前3
Conan 1.18 Documentationand Sources in the Same Repo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.4 Packaging Existing Binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . with its packages to a remote. 40 Chapter 5. Creating Packages conan Documentation, Release 1.18.5 5.4 Packaging Existing Binaries There are specific scenarios in which it is necessary to create packages customize test_package project # customize package recipe if necessary (continues on next page) 5.4. Packaging Existing Binaries 41 conan Documentation, Release 1.18.5 (continued from previous page)0 码力 | 584 页 | 4.80 MB | 1 年前3
Conan 1.19 Documentationand Sources in the Same Repo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.4 Packaging Existing Binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . You can use conan upload --force to force uploading the recipe with the “auto” values un-replaced. 5.4 Packaging Existing Binaries There are specific scenarios in which it is necessary to create packages export-pkg . Hello/0.1@myuser/testing -s os=Windows -s compiler=gcc -s compiler. ˓→version=4.9 ... 5.4. Packaging Existing Binaries 41 Conan Documentation, Release 1.19.3 Having a test_package folder0 码力 | 609 页 | 4.88 MB | 1 年前3
共 87 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9













