Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Can I remove the union definition in struct LinkedList? #151

@happynear

Description

@happynear

In object_pool.h, line 48, there is a struct with a union in it:

  struct LinkedList {
    union {
      LinkedList* next{nullptr};
      T t;
    };
  };

In my environment (VS2013), the compiler cannot accept a union containing a class with a copy constructor. Can I remove the union definition, such as

  struct LinkedList {
      LinkedList* next{nullptr};
      T t;
  };

, or I must use boost::variant to replace it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions