Add static assertions on the size of expected

This commit is contained in:
Baptiste Wicht 2016-09-08 12:44:29 +02:00
parent 1e8fe35905
commit e2dc653863

View File

@ -559,6 +559,10 @@ inline expected<void> make_expected(){
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
#endif