boostorg / boostorg/system

Rework error_code internal data members

Open
#126 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
45
Forks
96
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.