cxxopts as_optional fixup (#422)

Co-authored-by: Nigel Stewart <nigel.stewart@emesent.io>
This commit is contained in:
Nigel Stewart
2024-03-08 14:30:06 +10:00
committed by GitHub
parent 70fb4e4814
commit 3d9a4c06d9

View File

@@ -1543,6 +1543,9 @@ CXXOPTS_DIAGNOSTIC_POP
std::optional<T>
as_optional() const
{
if (m_value == nullptr) {
return std::nullopt;
}
return as<T>();
}
#endif