Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
HerbSutter-Virtuality
//clang 3.8.0 #include <iostream> #include <memory> class Parent { public: virtual ~Parent() { std::cout << "Parent gone!\n"; } void Do() { actualDo(); } private: virtual void actualDo() { std::cout << "Parent did it.\n"; } }; class Son: public Parent { public: ~Son() { std::cout << "Son gone!\n"; } private: void actualDo() override { std::cout << "Son did it.\n"; } }; int main() { std::unique_ptr<Parent> p = std::make_unique<Son>(); p->Do(); }
run
|
edit
|
history
|
help
0
Template arguments may contain calls to constexpr functions.
the usual name hiding rules do apply with using directives
DESim Example with Hash Table Starter Code
simple in-memory b-tree
regex
Segment Tree Impl
regimeketopdfb
non-deduced context
Palindrome Recursive Function Example
"nearest enclosing namespace"