Skip to content

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

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;
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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