Ada Programming/Attributes/'Tag

Description
X'Tag is an Ada attribute where X is any tagged type. This attribute returns a value of the private type .Tag which identifies the tagged type.

This attribute is useful to check for membership of a type in a class hierarchy. It can also be used if it is known the type is in a class hierarchy and type-specific processing must take place.

Example
Ref : My_Tagged_Type_Reference; ... Ref. My_Tagged_Type'Class Ref.'Tag = My_Tagged_Type'Tag ; ;

Wikibook

 * Ada Programming
 * Ada Programming/Object Orientation
 * Ada Programming/Attributes/'Class

Ada Reference Manual


|Tag