implement exception handling in some complicated cases

This commit is contained in:
2022-09-14 15:25:08 +09:00
parent d6a9c62a63
commit 46ddb16128
7 changed files with 13 additions and 17 deletions

View File

@@ -8,11 +8,6 @@
namespace nf7 {
class LifeExpiredException final : public nf7::Exception {
public:
using nf7::Exception::Exception;
};
template <typename T>
class Life final {
public:
@@ -57,7 +52,7 @@ class Life<T>::Ref final {
void EnforceAlive() const {
if (!data_->ptr) {
throw LifeExpiredException {"target expired"};
throw nf7::ExpiredException {"target expired"};
}
}