// executing it later:
continuation_ = std::move(continuation);
break;
+ default:
+ DIE_IMPOSSIBLE;
}
}
}
protected:
- FutureStateBase() {}
- ~FutureStateBase() {};
+ FutureStateBase() = default;
+ ~FutureStateBase() = default;
/** Set the future as ready and trigger the continuation */
void set_ready()
template<class T>
class Future {
public:
- Future() {}
+ Future() = default;
Future(std::shared_ptr<FutureState<T>> state): state_(std::move(state)) {}
// Move type:
Future(Future&& that) : state_(std::move(that.state_)) {}
Future& operator=(Future&& that)
{
- state_ = std::move(that.stat_);
+ state_ = std::move(that.state_);
+ return *this;
}
/** Whether the future is valid:.