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
servicecppcon_add_library(service LIBRARIES Asio::asio) add_subdirectory(tests)0 码力 | 1 页 | 73.00 B | 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
Leveraging a Functional Approach for More Testable and Maintainable ROS 2 Codenodes that can ○ publish data to topics, subscribe to topics to receive data, act as a service client, act as a service server, act as an action client, or act as an action serverWhat is ROS 2? ● has a nodes that can ○ publish data to topics, subscribe to topics to receive data, act as a service client, act as a service server, act as an action client, or act as an action server ○ provide configurable nodes that can ○ publish data to topics, subscribe to topics to receive data, act as a service client, act as a service server, act as an action client, or act as an action server ○ provide configurable0 码力 | 200 页 | 1.77 MB | 6 月前3
Retiring the Singleton PatternCommWrapper { enum { SERVICE_ID = 249409 }; public : CommWrapper(int service_id = SERVICE_ID); Response send(const Request& req); private: TcpClient raw_client; }; Bloomberg 14 struct Service { static CommWrapper CommWrapper& comms=Service::comm_) Bloomberg 15 // New wrapper class to replace singleton CommWrapper.h class CommWrapper { enum { SERVICE_ID = 249409 }; public : CommWrapper(int service_id = SERVICE_ID); Response singleton CommWrapper.h class CommWrapper { enum { SERVICE_ID = 249409 }; public : CommWrapper(int service_id = SERVICE_ID):raw_client(service_id){...}; virtual Response send(const Request& req); private:0 码力 | 70 页 | 1.59 MB | 6 月前3
Conan 1.11 Documentationvariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 9.6 Virtual Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . your own server on-premises to host your private packages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application without having any on-premises infrastructure. • JFrog Bintray provides a public and free hosting service for OSS Conan packages. Users can create their own repositories under their accounts and organizations0 码力 | 490 页 | 4.05 MB | 1 年前3
Conan 1.3 Documentationvariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 9.6 Virtual Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . your own server on-premises to host your private packages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application without having any on-premises infrastructure. • JFrog Bintray provides a public and free hosting service for OSS conan packages. Users can create their own repositories under their accounts and organizations0 码力 | 397 页 | 2.77 MB | 1 年前3
Conan 1.18 Documentationvariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 10.5 Virtual Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . your own server on-premises to host your private packages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application without having any on-premises infrastructure. • JFrog Bintray provides a public and free hosting service for OSS Conan packages. Users can create their own repositories under their accounts and organizations0 码力 | 584 页 | 4.80 MB | 1 年前3
Conan 1.19 Documentationvariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 10.5 Virtual Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . your own server on-premises to host your private packages. It is also a service application that can be run as a daemon or service, behind a web server (apache, nginx), or easily as stand-alone application without having any on-premises infrastructure. • JFrog Bintray provides a public and free hosting service for OSS Conan packages. Users can create their own repositories under their accounts and organizations0 码力 | 609 页 | 4.88 MB | 1 年前3
共 200 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20













