A Journey Into Non-Virtual PolymorphismRud Merriam | A Journey into Non-Virtual Polymorphism 2 Who Doesn’t Recognize This?? 1990 Borland Turbo C++Cppcon 2023 | Rud Merriam | A Journey into Non-Virtual Polymorphism 3 Background ● Experience – Medium.com (https://medium.com/@rudmerriam)Cppcon 2023 | Rud Merriam | A Journey into Non-Virtual Polymorphism 4 Polymorphism ● Greek: “many forms” (Obligatory statement) ● The use of a single variableCppcon 2023 | Rud Merriam | A Journey into Non-Virtual Polymorphism 5 Polymorphic Variables ● Base class pointer to derived class – Virtual functions are not bad! ● Standard Template Library0 码力 | 43 页 | 536.84 KB | 6 月前3
Optimizing Away Virtual Functions May Be PointlesscarePhoto by Tech Nick on unsplashSimple benchmark class Base { public: int concrete() const; virtual int virt() const; }; void benchmark(Base *b, size_t num_iterations) { auto start = Clock::now(); virt_duration = end-start;There are interesting technical details and surprising conclusions that virtual functions can be actually faster. Since CPU architectures are mentioned, I'd expect to see deep nt-vs-inheritance-vs-other- ways-performanceDoes it even matter?Conclusions ● The notion that “virtual functions are slower” is flat out wrong. ○ Which is not to say they are faster ○ Some of the suggested0 码力 | 20 页 | 1.19 MB | 6 月前3
BehaviorTree.CPP: Task Planning for Robots and Virtual Agentsname, const NodeConfig& config) : SyncActionNode(name, config) {} // You must override this virtual function NodeStatus tick() override { std::cout << "Type: [ApproachEnemy]. Instance:" <<0 码力 | 59 页 | 7.97 MB | 6 月前3
Common Package Specification (CPS) in Practice: A Full Round Trip Implementation in Conan C++ Package ManagerPackage Specification (CPS) in practice: A full round trip implementation in Conan C++ package manager CppCon24Outline - Introduction to Common Package Specification (CPS) - Creation of CPS files from0 码力 | 66 页 | 1.76 MB | 6 月前3
Oracle VM VirtualBox 4.2.32 User Manual. . . . . . . . . . . . . 17 1.7 Creating your first virtual machine . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.8 Running your virtual machine . . . . . . . . . . . . . . . . . . . . . . . special characters . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.8.4 Changing removable media . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.8.5 Resizing the machine’s window . . . . . . . . . . . . . . . . . . . . . . 28 1.11 Virtual machine configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 1.12 Removing virtual machines . . . . . . . . . . . . . . . . . .0 码力 | 348 页 | 5.93 MB | 6 月前3
Oracle VM VirtualBox 4.1.40 User Manual. . . . . . . . . . . . . 16 1.7 Creating your first virtual machine . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.8 Running your virtual machine . . . . . . . . . . . . . . . . . . . . . . . special characters . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.8.4 Changing removable media . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.8.5 Resizing the machine’s window . . . . . . . . . . . . . . . . . . . . . . 26 1.10 Virtual machine configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.11 Removing virtual machines . . . . . . . . . . . . . . . . . .0 码力 | 310 页 | 4.87 MB | 6 月前3
Oracle VM VirtualBox 4.3.36 User Manual. . . . . . . . . . . . . 17 1.7 Creating your first virtual machine . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.8 Running your virtual machine . . . . . . . . . . . . . . . . . . . . . . . special characters . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.8.4 Changing removable media . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.8.5 Resizing the machine’s window . . . . . . . . . . . . . . . . . . . . . . 29 1.11 Virtual machine configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 1.12 Removing virtual machines . . . . . . . . . . . . . . . . . .0 码力 | 380 页 | 3.79 MB | 6 月前3
Oracle VM VirtualBox 5.2.40 User Manual. . . . . . . . . . . . . 18 1.8 Creating your first virtual machine . . . . . . . . . . . . . . . . . . . . . . . . . 19 1.9 Running your virtual machine . . . . . . . . . . . . . . . . . . . . . . . special characters . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.9.4 Changing removable media . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.9.5 Resizing the machine’s window . . . . . . . . . . . . . . . . . . . . . . 30 1.12 Virtual machine configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.13 Removing virtual machines . . . . . . . . . . . . . . . . . .0 码力 | 387 页 | 4.27 MB | 6 月前3
Oracle VM VirtualBox 5.2.12 User Manual. . . . . . . . . . . . . 18 1.8 Creating your first virtual machine . . . . . . . . . . . . . . . . . . . . . . . . . 19 1.9 Running your virtual machine . . . . . . . . . . . . . . . . . . . . . . . special characters . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.9.4 Changing removable media . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.9.5 Resizing the machine’s window . . . . . . . . . . . . . . . . . . . . . . 30 1.12 Virtual machine configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.13 Removing virtual machines . . . . . . . . . . . . . . . . . .0 码力 | 380 页 | 4.23 MB | 6 月前3
Oracle VM VirtualBox 4.1.40 Programming Guide and ReferenceChanging machine settings. Sessions . . . . . . . . . . . . . . . . . . . . . . . . 39 3.3 Launching virtual machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.4 VirtualBox events . . ueType . . . . . . . . . . . . . . . . . . . . . . . . . 284 7 Host-Guest Communication Manager 285 7.1 Virtual hardware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 285 7.2 Protocol stack resides the hypervisor – the core of the virtualization engine, con- trolling execution of the virtual machines and making sure they do not conflict with each other or whatever the host computer is doing0 码力 | 306 页 | 1.92 MB | 6 月前3
共 283 条
- 1
- 2
- 3
- 4
- 5
- 6
- 29













