-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
I am not sure if technically a bug, but from the documentation and talks what I understood was that in my code I can basically replace int with safe<int> and it should compile and give the same result with checks.
I get into problems related to default initialization.
1. Default Initialization
auto x = int {}; // zero initialized
auto y= safe<int> {}; // uninitialized
See on godbolt.
2. Aggregate Initialization
This is obviously related, and I want to mention it, as this is how it came to my attention.
struct Point {
int x;
int y;
};
const auto p = Point {}; // zero initialized
With safe<>
struct Point {
safe<int> x;
safe<int> y;
};
const auto p = Point {}; // uninitialized
See on godbolt
Metadata
Metadata
Assignees
Labels
No labels