aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__format/formatter.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/__format/formatter.h')
-rw-r--r--libcxx/include/__format/formatter.h25
1 files changed, 8 insertions, 17 deletions
diff --git a/libcxx/include/__format/formatter.h b/libcxx/include/__format/formatter.h
index 38b73bba32f3..c39e25b354eb 100644
--- a/libcxx/include/__format/formatter.h
+++ b/libcxx/include/__format/formatter.h
@@ -12,32 +12,27 @@
#include <__algorithm/copy.h>
#include <__algorithm/fill_n.h>
+#include <__algorithm/transform.h>
+#include <__assert>
#include <__availability>
+#include <__concepts/same_as.h>
#include <__config>
#include <__format/format_error.h>
#include <__format/format_fwd.h>
#include <__format/format_string.h>
#include <__format/parser_std_format_spec.h>
-#include <concepts>
+#include <__utility/move.h>
+#include <__utility/unreachable.h>
#include <string_view>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC 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)
-
/// The default formatter template.
///
/// [format.formatter.spec]/5
@@ -120,7 +115,7 @@ __padding_size(size_t __size, size_t __width,
size_t __fill = __width - __size;
switch (__align) {
case __format_spec::_Flags::_Alignment::__default:
- _LIBCPP_UNREACHABLE();
+ __libcpp_unreachable();
case __format_spec::_Flags::_Alignment::__left:
return {0, __fill};
@@ -136,7 +131,7 @@ __padding_size(size_t __size, size_t __width,
case __format_spec::_Flags::_Alignment::__right:
return {__fill, 0};
}
- _LIBCPP_UNREACHABLE();
+ __libcpp_unreachable();
}
/**
@@ -279,12 +274,8 @@ __write_unicode(output_iterator<const _CharT&> auto __out_it,
} // namespace __formatter
-#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
-
#endif //_LIBCPP_STD_VER > 17
_LIBCPP_END_NAMESPACE_STD
-_LIBCPP_POP_MACROS
-
#endif // _LIBCPP___FORMAT_FORMATTER_H