[libcxx-commits] [libcxx] [libc++] Reduce the amount of formatter code included in <vector> (PR #178683)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 9 07:33:13 PDT 2026


================
@@ -0,0 +1,58 @@
+// -*- 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_FORMATTER_BOOL_IMPL_H
+#define _LIBCPP___FORMAT_FORMATTER_BOOL_IMPL_H
+
+#include <__assert>
+#include <__config>
+#include <__format/concepts.h>
+#include <__format/formatter_bool.h>
+#include <__format/formatter_integral.h>
+#include <__format/parser_std_format_spec.h>
+#include <__utility/unreachable.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER >= 20
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <__fmt_char_type _CharT, class _FormatContext>
+_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
+__formatter_bool_format(bool __value, __format_spec::__parser<_CharT> __parser, _FormatContext& __ctx) {
----------------
ldionne wrote:

Let's leave a comment behind about the reason for this function's existence. Otherwise, I can easily imagine a refactoring getting rid of it.

https://github.com/llvm/llvm-project/pull/178683


More information about the libcxx-commits mailing list