#pragma once #include #ifdef HAVE_STRING_VIEW #include namespace celestia { namespace compat { using std::basic_string_view; using std::string_view; } } #elif defined(HAVE_EXPERIMENTAL_STRING_VIEW) #include namespace celestia { namespace compat { using std::experimental::basic_string_view; using std::experimental::string_view; } } #else #include #include "sv.h" template<> struct fmt::formatter : formatter { template auto format(celestia::compat::string_view v, FormatContext& ctx) { fmt::string_view f{v.data(), v.size()}; return formatter::format(f, ctx); } }; #endif