Tagged Union

Was mentioned in a CS343 assignment.

It’s a Union (C++) type, but that is tagged.

For example

enum class ShapeType { Circle, Square };
 
struct Shape {
    ShapeType type;
    union {
        double radius;  // For circles
        int sideLength; // For squares
    };