mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-11 13:35:03 -04:00
Add static assertions on the size of expected
This commit is contained in:
parent
1e8fe35905
commit
e2dc653863
@ -559,6 +559,10 @@ inline expected<void> make_expected(){
|
|||||||
return expected<void>();
|
return expected<void>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure the size is maintained reasonable
|
||||||
|
static_assert(sizeof(expected<void>) == 2 * sizeof(size_t), "expected<void> should not have overhead");
|
||||||
|
static_assert(sizeof(expected<size_t>) == 2 * sizeof(size_t), "expected<void> should not have overhead");
|
||||||
|
|
||||||
} //end of namespace std
|
} //end of namespace std
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user