Skip to content

Rework error_code internal data members #126

@pdimov

Description

@pdimov

Instead of

    struct data
    {
        int val_;
        const error_category * cat_;
    };

    union
    {
        data d1_;
        unsigned char d2_[ sizeof(std::error_code) ];
    };

it might be better to have

int val_;
void const* cat_; // error_category or std::error_category

which could both simplify the code (esp. when we transition the std::error_code case to (value, unknown_category)) and help with GCC false -Wmaybe-uninitialized positives.

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