forked from TartanLlama/optional
Add emplace test
This commit is contained in:
@@ -1258,6 +1258,7 @@ public:
|
||||
|
||||
*this = nullopt;
|
||||
this->construct(std::forward<Args>(args)...);
|
||||
return value();
|
||||
}
|
||||
|
||||
/// \group emplace
|
||||
@@ -1269,6 +1270,7 @@ public:
|
||||
emplace(std::initializer_list<U> il, Args &&... args) {
|
||||
*this = nullopt;
|
||||
this->construct(il, std::forward<Args>(args)...);
|
||||
return value();
|
||||
}
|
||||
|
||||
/// Swaps this optional with the other.
|
||||
|
||||
Reference in New Issue
Block a user