final in c 2b 2b

Solutions on MaxInterview for final in c 2b 2b by the best coders in the world

showing results for - "final in c 2b 2b"
Isabel
02 Jun 2016
1const int x = 8;
2x = 10; // Error. x is final variable now
Jan
16 Feb 2017
1struct Base
2{
3    virtual void foo();
4};
5 
6struct A : Base
7{
8    void foo() final; // Base::foo is overridden and A::foo is the final override
9    void bar() final; // Error: bar cannot be final as it is non-virtual
10};
11 
12struct B final : A // struct B is final
13{
14    void foo() override; // Error: foo cannot be overridden as it is final in A
15};
16 
17struct C : B // Error: B is final
18{
19};