umbrello 26.03.70-f7b1fd3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

cxx11-explicit-overrides-and-final.h
Go to the documentation of this file.
1// https://en.wikipedia.org/wiki/C%2B%2B11#Explicit_overrides_and_final
2
3// #1
4 struct Base {
5 virtual void some_func(float);
6};
7
8 struct Derived : Base {
9 virtual void some_func(int) override; // ill-formed - doesn't override a base class method
10};
11
12// #2
13 struct Base1 final { };
14
15 struct Derived1 : Base1 { }; // ill-formed because the class Base1 has been marked final
16
17// #3
18 struct Base2 {
19 virtual bool c() const final override; // from
20 virtual bool d() const override final; // https://bugs.kde.org/show_bug.cgi?id=397666
21 virtual void f() final;
22};
23
24struct Derived2 : Base2 {
25 void f(); // ill-formed because the virtual function Base2::f has been marked final
26};
Base1
Definition: cxx11-explicit-overrides-and-final.h:13
Base2
Definition: cxx11-explicit-overrides-and-final.h:18
Base2::f
virtual void f() final
Base2::d
virtual bool d() const override final
Base2::c
virtual bool c() const final override
Base
Definition: cxx11-explicit-overrides-and-final.h:4
Base::some_func
virtual void some_func(float)
Derived1
Definition: cxx11-explicit-overrides-and-final.h:15
Derived2
Definition: cxx11-explicit-overrides-and-final.h:24
Derived2::f
void f()
Derived
Definition: cxx11-explicit-overrides-and-final.h:8
Derived::some_func
virtual void some_func(int) override