This implements the struct `__format_arg_store` and its dependencies: * the class basic_format_arg, * the class basic_format_args, * the class basic_format_context, * the function make_format_args, * the function wmake_format_args, * the function visit_format_arg, * several Standard required typedefs. The following parts will be implemented in a later patch: * the child class `basic_format_arg::handle`, * the function `basic_format_arg::basic_format_arg(const T* p)`. The following extension has been implemented: * the class basic_format_arg supports `__[u]int128_t` on platform where libc++ supports 128 bit integrals. Implements parts of: * P0645 Text Formatting Completes: * LWG3371 visit_format_arg and make_format_args are not hidden friends * LWG3542 basic_format_arg mishandles basic_string_view with custom traits Note https://mordante.github.io/blog/2021/06/05/format.html gives a bit more information about the goals and non-goals of this initial patch series. Reviewed By: #libc, ldionne, vitaut Differential Revision: https://reviews.llvm.org/D103357
57 lines
1.6 KiB
C++
57 lines
1.6 KiB
C++
// -*- C++ -*-
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef _LIBCPP___FORMAT_FORMAT_FWD_H
|
|
#define _LIBCPP___FORMAT_FORMAT_FWD_H
|
|
|
|
#include <__availability>
|
|
#include <__config>
|
|
#include <__iterator/concepts.h>
|
|
#include <__utility/forward.h>
|
|
|
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
|
#pragma GCC system_header
|
|
#endif
|
|
|
|
_LIBCPP_PUSH_MACROS
|
|
#include <__undef_macros>
|
|
|
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
|
|
|
#if _LIBCPP_STD_VER > 17
|
|
|
|
// TODO FMT Remove this once we require compilers with proper C++20 support.
|
|
// If the compiler has no concepts support, the format header will be disabled.
|
|
// Without concepts support enable_if needs to be used and that too much effort
|
|
// to support compilers with partial C++20 support.
|
|
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
|
|
|
template <class _Context>
|
|
class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg;
|
|
|
|
template <class _Context, class... _Args>
|
|
struct _LIBCPP_TEMPLATE_VIS __format_arg_store;
|
|
|
|
template <class _Ctx, class... _Args>
|
|
_LIBCPP_HIDE_FROM_ABI __format_arg_store<_Ctx, _Args...>
|
|
make_format_args(const _Args&...);
|
|
|
|
template <class _Tp, class _CharT = char>
|
|
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter;
|
|
|
|
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
|
|
|
#endif //_LIBCPP_STD_VER > 17
|
|
|
|
_LIBCPP_END_NAMESPACE_STD
|
|
|
|
_LIBCPP_POP_MACROS
|
|
|
|
#endif // _LIBCPP___FORMAT_FORMAT_FWD_H
|