//============================================================================ // Author : Sven Göthel // Copyright : 2022 Göthel Software e.K. // License : MIT // Description : C++ Lesson 2.3 OOP (dreaded diamond problem, inheritance w/ virtual base classes, showing ctor/dtor) //============================================================================ #include /** * test01 demos inheritance of two OO trees (wrong utilization): * - exception, runtime_error, system_error: Mimiks non-virtual inheritance of std::exception * - ExceptionBase, RuntimeException, RuntimeSystemException: User virtual derived OO tree additionally inheriting from exception * * Problem: * - runtime_error, system_error not using virtual base class * leading to multiple exception and runtime_error instances and ctor/dtor calls */ namespace test01 { class exception { public: exception() { std::cout<< "exception::ctor" <