diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 915dfbc..8e4a0a2 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -13484,9 +13484,19 @@ Here is an example of the last option: return p; } }; + + + class D : public B { // some derived class + public: + void f() override { /* ... */ }; - class D : public B { /* "¦ */ }; // some derived class + protected: + D() {} + template + friend shared_ptr B::Create(); + }; + shared_ptr p = D::Create(); // creating a D object This design requires the following discipline: