Skip to content

Question on P3074R5: trivial destructor #227

Description

@huixie90

The paper presented that the union has to have an empty destructor. However, to solve the triviality problem, we can just have two overloads of the destructor. And that is what we did in std::expected.
https://github.com/llvm/llvm-project/blob/0cb2fe5183c9b25bb96140c27d12b1ad4a80aa92/libcxx/include/__expected/expected.h#L250

(And we are still very keen on seeing this paper solving the issue of starting lifetime of an array)

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