umbrello 2.31.70-8160ef4c8
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
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
4struct Base {
5 virtual void some_func(float);
6};
7
8struct Derived : Base {
9 virtual void some_func(int) override; // ill-formed - doesn't override a base class method
10};
11
12// #2
13struct Base1 final { };
14
15struct Derived1 : Base1 { }; // ill-formed because the class Base1 has been marked final
16
17// #3
18struct Base2 {
19 virtual void f() final;
20};
21
22struct Derived2 : Base2 {
23 void f(); // ill-formed because the virtual function Base2::f has been marked final
24};
Definition: cxx11-explicit-overrides-and-final.h:13
Definition: cxx11-explicit-overrides-and-final.h:18
virtual void f() final
Definition: cxx11-explicit-overrides-and-final.h:4
virtual void some_func(float)
Definition: cxx11-explicit-overrides-and-final.h:15
Definition: cxx11-explicit-overrides-and-final.h:22
void f()
Definition: cxx11-explicit-overrides-and-final.h:8
virtual void some_func(int) override