Skip to content

Tag of a single-type SumType wastes space #9378

Closed
@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

maxsamukha (@maxsamukha) reported this on 2024-10-15T12:47:15Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=24818

Description

import std.sumtype;

static assert(SumType!int.sizeof == 4);
----
Error: static assert:  `8LU == 4LU` is false

No need to store a tag for such SumTypes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions