T* value_;
// whether the value is missing.
bool value_missing_{true};
+
+ AttrInitEntry() = default;
+
+ AttrInitEntry(AttrInitEntry&& other) {
+ type_key_ = other.type_key_;
+ key_ = other.key_;
+ value_ = other.value_;
+ value_missing_ = other.value_missing_;
+ // avoid unexpected throw
+ other.value_missing_ = false;
+ }
+
// If the value is still missing in destruction time throw an error.
~AttrInitEntry() DMLC_THROW_EXCEPTION {
if (value_missing_) {
} else {
opt.value_missing_ = true;
}
- return opt;
+ return std::move(opt);
}
private: