An excellent derived classification can mask (§seven.7.2.3) handed down professionals by the elizabeth or signature. Although not, hiding an inherited representative does not beat you to user-it merely renders one to associate inaccessible really from derived category.
An instance of a category contains a couple of the eg industries declared regarding the group as well as foot classes, and you will a keen implicit conversion (§10.2.8) is present out of a good derived group method of to virtually any of the feet classification systems. Therefore, a regard to an illustration of certain derived group are going to be managed due to the fact a regard to an illustration of any kind of its base groups.
A class is declare virtual actions, characteristics, indexers, and you will occurrences, and you can derived kinds can be bypass brand new implementation of these mode participants. This enables groups to demonstrate polymorphic behavior where strategies did of the a function representative invocation vary according to work with-date version of this new instance whereby one form representative was invoked.
The new handed down people in a made class sort of is the participants of the instant ft classification sort of (§fourteen.2.4.2), that’s receive by the replacing the kind arguments of your own developed sorts of each occurrence of your related types of details in the base_class_specification. These types of people, consequently, was switched because of the replacing, for every single style of_parameter on affiliate report, new associated type of_dispute of your own ft_class_requirements.
In the code above, the constructed type D
fourteen.3.5 The new modifier
A course_member_declaration try allowed to elizabeth or signature just like the an inherited member. At that time, new derived class member is claimed to hide the base category user. Pick §eight.seven.2.3 to have an accurate requirements from whenever an associate covers a keen inherited associate.
An inherited representative Meters is recognized as being offered when the Meters is accessible and there is not any other passed on accessible affiliate N you to definitely already covers M . Implicitly covering up a genetic associate is not thought a blunder, although it does result in the compiler to matter a warning until the fresh new statement of derived group representative comes with another type of modifier to help you clearly imply that the fresh derived representative is meant to hide the bottom member. If one or higher components of a limited declaration (§fourteen.dos.7) regarding a good nested variety of include the the newest modifier, no alerting is actually granted in case your nested sort of hides an available passed down user.
If another modifier is roofed during the an affirmation that doesn’t cover-up a readily available passed down member, a warning to that impact try given.
14.step three.six Supply modifiers
A class_member_report may have any one of the five you can kinds of declared use of (§seven.5.2): societal , secure inner , secure , internal , or private . Apart from the brand new safe interior consolidation, it’s a harvest-big date error so you can establish multiple supply modifier. Whenever a class_member_declaration does not include one supply modifiers, private is thought.
fourteen.step three.seven Constituent products
Designs which can be included in the statement of an associate is actually known as constituent types of you to member. You’ll component models is the brand of a constant, career, property, knowledge, or indexer, this new go back type of a strategy or driver, and the factor brand of a method, indexer, driver, otherwise eg constructor. The new constituent brand of an associate shall be no less than because the accessible just like the you to user by itself (§seven.5.5).
