| 77 | |
| 78 | /// Return true value if T has std::string interface, like std::string_view. |
| 79 | template <typename T> class is_like_std_string { |
| 80 | template <typename U> |
| 81 | static auto check(U* p) |
| 82 | -> decltype((void)p->find('a'), p->length(), (void)p->data(), int()); |
| 83 | template <typename> static void check(...); |
| 84 | |
| 85 | public: |
| 86 | static FMT_CONSTEXPR_DECL const bool value = |
| 87 | is_string<T>::value || !std::is_void<decltype(check<T>(nullptr))>::value; |
| 88 | }; |
| 89 | |
| 90 | template <typename Char> |
| 91 | struct is_like_std_string<fmt::basic_string_view<Char>> : std::true_type {}; |