mirror of https://github.com/jarro2783/cxxopts.git
cxxopts as_optional fixup (#422)
Co-authored-by: Nigel Stewart <nigel.stewart@emesent.io>
This commit is contained in:
parent
70fb4e4814
commit
3d9a4c06d9
|
|
@ -1543,6 +1543,9 @@ CXXOPTS_DIAGNOSTIC_POP
|
|||
std::optional<T>
|
||||
as_optional() const
|
||||
{
|
||||
if (m_value == nullptr) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return as<T>();
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue