-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
Platform 1 04/03/15
This would be analogous to std::make_unique/make_shared/make_optional
There would be two overloads - one that takes a variadic pack and forwards it to T's constructor, returning an engaged StatusWith<T>.
The second would take an errorCode and return a disengaged StatusWith<T>.
This would make it possible to write:
return makeStatusWith<StringData>{str, len};
instead of:
return StatusWith<StringData>{StringData{str, len}};
Tack on work: add an of overload uassertStatusOK that takes a StatusWith<T>