.. ot-group:: cxx11.embedded_problems Embedded Problems? Code Bloat? Type Erasure? Solutions? ======================================================= .. contents:: :local: ``virtual`` Is Bad. Is ``virtual`` Bad? (Type Erasure) ------------------------------------------------------ Type erasure appears to be a C++ hype currently. Speakers on C++ conferences beat each others in creating incomprehensible crap that solves no obvious problem. This is my personal attempt to create another solution to an unknown problem. Showing options to eliminate ``virtual``, landing in :doc:`type-erasure` .. toctree:: :maxdepth: 1 why-replace-virtual classic-virtual related-no-virtual unrelated variant-manual-if variant-manual-visit variant-automatic-visit type-erasure Another attempt is that one: * `Breaking Dependencies: Type Erasure - A Design Analysis - Klaus Iglberger - CppCon 2021 `__ .. raw:: html .. note:: **TODO** * Strip down the hacking story to a minimum. It is sufficient to * Show that a ``std::vector`` of (smart) pointers to polymorphic object is sub-optimal, memory-wise (and cache-performance-wise) * Show the final version where a ``std::variant`` holds unrelated types, and ``std::visit`` is used for dynamic dispatch. And CRTP? ......... Show that CRTP creates *unrelated* types that cannot be held in a container. Allocators ---------- .. toctree:: :maxdepth: 1 allocator * Arena allocators `Modern C++: C++ Patterns to Make Embedded Programming More Productive - Steve Bush - CppCon 2022 `__ (44:30) std::string_view ---------------- * Use as parameters instead of ``std::string`` * Never as member (obviously) More ---- * `Modern C++: C++ Patterns to Make Embedded Programming More Productive - Steve Bush - CppCon 2022 `__ .. raw:: html * `The Most Important Optimizations to Apply in Your C++ Programs - Jan Bielak - CppCon 2022 `__ .. raw:: html * `C++ in Constrained Environments - Bjarne Stroustrup - CppCon 2022 `__ .. raw:: html * `Using Modern C++ to Eliminate Virtual Functions - Jonathan Gopel - CppCon 2022 `__ .. raw:: html Dependencies ------------ .. ot-graph:: :entries: cxx11.embedded_problems