Skip to content

the use of “union” in all derived classes #1

@wangbw1116

Description

@wangbw1116

It's extremely awsome to realize all design pattern by C,but I'm wondering why there is a union type in each derived class,such as

struct _FindPwdMessage
{
	union
	{
		AbstractMessage;
		AbstractMessage abstractMessage;
	};
};

why it not been expressed like

struct _FindPwdMessage
{
	AbstractMessage abstractMessage;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions