Extract a string argument by index.
- Parameters
-
| index | Argument index (0-based). |
- Returns
- String value, or std::nullopt if out of range or wrong type.
Definition at line 145 of file InputBinding.cpp.
146{
148 return std::nullopt;
149 return std::visit([](const auto& v) -> std::optional<std::string> {
150 using T = std::decay_t<
decltype(v)>;
151 if constexpr (std::is_same_v<T, std::string>)
152 return v;
153 return std::nullopt;
154 },
156}