diff --git a/toml/get.hpp b/toml/get.hpp index c0e47bb..344519f 100644 --- a/toml/get.hpp +++ b/toml/get.hpp @@ -108,6 +108,18 @@ inline std::string get(value&& v) return std::move(v.cast().str); } +// ============================================================================ +// std::string_view + +#if __cplusplus >= 201703L +template::value, std::nullptr_t>::type = nullptr> +inline std::string_view get(const value& v) +{ + return std::string_view(v.cast().str); +} +#endif + // ============================================================================ // std::chrono::duration from toml::local_time.