fix: call destructor correctly

This commit is contained in:
ToruNiina 2024-06-17 00:21:28 +09:00
parent 835d38a22b
commit fbfdb6af30

View File

@ -434,8 +434,12 @@ struct result
#if defined(__GNUC__) && ! defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wduplicated-branches"
#endif
if(this->is_ok_) {this->succ.~success_type();}
else {this->fail.~failure_type();}
#if defined(__GNUC__) && ! defined(__clang__)
#pragma GCC diagnostic pop
#endif
return;