| 1 | // -*- C++ -*- |
| 2 | //===----------------------------------------------------------------------===// |
| 3 | // |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP___FWD_FORMAT_H |
| 11 | #define _LIBCPP___FWD_FORMAT_H |
| 12 | |
| 13 | #include <__config> |
| 14 | |
| 15 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 16 | # pragma GCC system_header |
| 17 | #endif |
| 18 | |
| 19 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 20 | |
| 21 | #if _LIBCPP_STD_VER >= 20 |
| 22 | |
| 23 | template <class _Context> |
| 24 | class basic_format_arg; |
| 25 | |
| 26 | template <class _OutIt, class _CharT> |
| 27 | class basic_format_context; |
| 28 | |
| 29 | template <class _Tp, class _CharT = char> |
| 30 | struct formatter; |
| 31 | |
| 32 | # if _LIBCPP_STD_VER >= 23 |
| 33 | |
| 34 | _LIBCPP_DIAGNOSTIC_PUSH |
| 35 | _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wshadow" ) |
| 36 | _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshadow" ) |
| 37 | // This shadows map, set, and string. |
| 38 | enum class range_format { disabled, map, set, sequence, string, debug_string }; |
| 39 | _LIBCPP_DIAGNOSTIC_POP |
| 40 | |
| 41 | template <class _Rp> |
| 42 | constexpr range_format format_kind = [] { |
| 43 | // [format.range.fmtkind]/1 |
| 44 | // A program that instantiates the primary template of format_kind is ill-formed. |
| 45 | static_assert(sizeof(_Rp) != sizeof(_Rp), "create a template specialization of format_kind for your type" ); |
| 46 | return range_format::disabled; |
| 47 | }(); |
| 48 | |
| 49 | # endif // _LIBCPP_STD_VER >= 23 |
| 50 | |
| 51 | #endif // _LIBCPP_STD_VER >= 20 |
| 52 | |
| 53 | _LIBCPP_END_NAMESPACE_STD |
| 54 | |
| 55 | #endif // _LIBCPP___FWD_FORMAT_H |
| 56 | |