File: usingbase.yo

package info (click to toggle)
c%2B%2B-annotations 10.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,536 kB
  • ctags: 3,247
  • sloc: cpp: 19,157; makefile: 1,521; ansic: 165; sh: 128; perl: 90
file content (30 lines) | stat: -rw-r--r-- 1,170 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Derived classes can be constructed without
        hi(inheritance: no derived class constructors)
    explicitly defining derived class constructors. In those cases the
available base class constructors are called.

This feature is either used or not. It is not possible to omit some of the
derived class constructors, using the corresponding base class constructors
instead. To use this feature for classes that are derived from multiple base
classes (cf. section ref(MULTIPLE)) all the base class constructors must
have different signatures. Considering the complexities that are involved here
it's probably best to avoid using base class constructors for classes using
multiple inheritance.

    The construction of derived class objects can be delegated to
 hi(construction: delegate to base classes) base class constructor(s) using
the following syntax:
        verb(
    class BaseClass
    {
        public:
            // BaseClass constructor(s)
    };

    class DerivedClass: public BaseClass
    {
        public:
            using BaseClass::BaseClass; // No DerivedClass constructors
                                        // are defined
    };
        )