FairRoot
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
cxx11-test-class_override_final.cpp
Go to the documentation of this file.
1
class
base
{
2
public
:
3
virtual
int
foo
(
int
a)
4
{
return
4 + a; }
5
virtual
int
bar
(
int
a)
final
6
{
return
a - 2; }
7
};
8
9
class
sub
final :
public
base
{
10
public
:
11
virtual
int
foo
(
int
a)
override
12
{
return
8 + 2 * a; };
13
};
14
15
int
main
(
void
)
16
{
17
base
b;
18
sub
s;
19
20
return
(b.
foo
(2) * 2 == s.
foo
(2)) ? 0 : 1;
21
}
base::foo
virtual int foo(int a)
Definition:
cxx11-test-class_override_final.cpp:3
base
Definition:
cxx11-test-class_override_final.cpp:1
sub::foo
virtual int foo(int a) override
Definition:
cxx11-test-class_override_final.cpp:11
sub
Definition:
cxx11-test-class_override_final.cpp:9
main
int main(void)
Definition:
cxx11-test-__func__.cpp:1
base::bar
virtual int bar(int a) final
Definition:
cxx11-test-class_override_final.cpp:5
FairRoot
cmake
checks
cxx11-test-class_override_final.cpp
Generated on Mon Mar 8 2021 12:14:05 for FairRoot by
1.8.5