Such as for example constructors, finalizers, and you may fixed constructors are not handed down, but various other members is actually, regardless of its proclaimed the means to access (§7

Such as for example constructors, finalizers, and you may fixed constructors are not handed down, but various other members is actually, regardless of its proclaimed the means to access (§7

A good derived group can be cover-up (§seven.eight.dos.3) passed down members because of the e otherwise signature. But not, concealing an inherited representative cannot clean out you to definitely affiliate-it just tends to make you to definitely representative inaccessible actually from derived category.

An exemplory instance of a category includes a set of all eg industries proclaimed on group and its own ft kinds, and you can a keen implicit sales (§10.dos.8) exists away from an effective derived classification sort of to almost any of its legs classification products. Therefore, a regard to an instance of particular derived class should be addressed given that a reference to an exemplory instance of any kind of its base classes.

A course is also claim virtual methods, services, indexers, and you can situations, and derived groups can bypass the fresh implementation of such function members. This enables categories to display polymorphic conclusion where the actions did of the a features associate invocation are very different according to the run-go out style of brand new such as whereby you to definitely form member is invoked.

The fresh new passed on people in a made category sorts of are definitely the participants of one’s immediate foot category form of (§14.dos.cuatro.2), that is discovered of the substituting the sort arguments of your own constructed form of each density of the related types of details regarding base_class_specs. These members, therefore, are transformed by the replacing, for each type of_parameter throughout the user declaration, the newest involved variety of_disagreement of one’s foot_class_requirements.

In the code above, the constructed type D has a non-inherited member public int G(string s) obtained by substituting the type argument int for the type parameter T . D also has an inherited member from the class declaration B . This inherited member is determined by first determining the base class type B of D by substituting int for T in the base class specification B . Then, as a type argument to B , int[] is substituted for U in public U F(long index) , yielding the inherited member public int[] F(long index) . end example

fourteen.step 3.5 The fresh new modifier

A category_member_statement is actually allowed to elizabeth or signature as a hereditary member. When this occurs, the derived category member is considered to full cover up the bottom category member. Look for §eight.eight.2.3 to own an accurate requirements away from when a member covers an enthusiastic passed on associate.

An inherited affiliate M is recognized as being available in the event that Yards is available as there are not one handed down available associate Letter one to currently covers Yards . Implicitly covering up a genetic affiliate is not experienced an error, however it does result in the compiler to help you procedure a warning except if the fresh new statement of the derived group user includes another modifier so you’re able to clearly imply that the new derived representative is meant to cover-up the base member. If a person or more components of a limited statement (§fourteen.2.7) out-of good nested types of are the the new modifier, no alerting is actually issued if the nested type hides an offered inherited associate.

In the event that a separate modifier is included within the a declaration that doesn’t hide an available inherited associate, an alert compared to that impression is actually issued.

14.step three.6 Accessibility modifiers

A category_member_statement can have any one of the five you’ll categories of proclaimed use of (§7.5.2): public , protected inner , secure , internal , or personal . Except for the new safe internal combination, it is a harvest-day mistake in order to indicate more than one supply modifier. Whenever a course_member_report does not include one availability modifiers, individual is believed.

14.step three.eight Constituent brands

Items that are found in brand new statement out of a part are known as constituent style of you to user. You’ll constituent items could be the type of a reliable, job, assets, experiences, otherwise indexer, this new come back brand of a strategy otherwise driver, as well as the factor seniorblackpeoplemeet type of a technique, indexer, driver, otherwise like constructor. This new component variety of an associate will likely be at least given that available because that representative by itself (§seven.5.5).

Bir cevap yazın

E-posta hesabınız yayımlanmayacak.