Skip to content

Commit

Permalink
Remove redundant detection of experimental string_view
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jan 12, 2024
1 parent 0cdee90 commit 3c96084
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
(FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
# include <string_view>
# define FMT_USE_STRING_VIEW
#elif FMT_HAS_INCLUDE("experimental/string_view") && FMT_CPLUSPLUS >= 201402L
# include <experimental/string_view>
# define FMT_USE_EXPERIMENTAL_STRING_VIEW
#endif

#if defined __cpp_inline_variables && __cpp_inline_variables >= 201606L
Expand Down Expand Up @@ -287,9 +284,6 @@ FMT_CONSTEXPR inline void abort_fuzzing_if(bool condition) {

#if defined(FMT_USE_STRING_VIEW)
template <typename Char> using std_string_view = std::basic_string_view<Char>;
#elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW)
template <typename Char>
using std_string_view = std::experimental::basic_string_view<Char>;
#else
template <typename T> struct std_string_view {};
#endif
Expand Down Expand Up @@ -1054,9 +1048,9 @@ constexpr auto compile_string_to_view(const Char (&s)[N])
return {s, N - (std::char_traits<Char>::to_int_type(s[N - 1]) == 0 ? 1 : 0)};
}
template <typename Char>
constexpr auto compile_string_to_view(detail::std_string_view<Char> s)
constexpr auto compile_string_to_view(basic_string_view<Char> s)
-> basic_string_view<Char> {
return {s.data(), s.size()};
return s;
}
} // namespace detail_exported

Expand Down

0 comments on commit 3c96084

Please sign in to comment.