Use a Using-Declaration Instead of an Access Declaration

Use a Using-Declaration Instead of an Access Declaration

The access specifier of a base class member can be changed in a derived class by an access declaration, as in this example:

 class A{public:  int n; };class D : public A{private:   A::n; // access declaration changes access of A::n to private; deprecated};

According the ANSI/ISO Standard, the use of access declarations is considered deprecated. Instead, you should use a using declaration for that purpose:

 class D : public A // using-declaration version{private:   using A::n; // using declaration changes the access of A::n to private};
Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular