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
23template <class _Context>
24class basic_format_arg;
25
26template <class _OutIt, class _CharT>
27class basic_format_context;
28
29template <class _Tp, class _CharT = char>
30struct 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.
38enum class range_format { disabled, map, set, sequence, string, debug_string };
39_LIBCPP_DIAGNOSTIC_POP
40
41template <class _Rp>
42constexpr 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