aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__format
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__format')
-rw-r--r--contrib/llvm-project/libcxx/include/__format/buffer.h44
-rw-r--r--contrib/llvm-project/libcxx/include/__format/escaped_output_table.h2
-rw-r--r--contrib/llvm-project/libcxx/include/__format/extended_grapheme_cluster_table.h2
-rw-r--r--contrib/llvm-project/libcxx/include/__format/format_arg.h42
-rw-r--r--contrib/llvm-project/libcxx/include/__format/format_arg_store.h16
-rw-r--r--contrib/llvm-project/libcxx/include/__format/format_context.h24
-rw-r--r--contrib/llvm-project/libcxx/include/__format/format_error.h2
-rw-r--r--contrib/llvm-project/libcxx/include/__format/format_functions.h151
-rw-r--r--contrib/llvm-project/libcxx/include/__format/formatter_char.h16
-rw-r--r--contrib/llvm-project/libcxx/include/__format/formatter_floating_point.h64
-rw-r--r--contrib/llvm-project/libcxx/include/__format/formatter_integral.h22
-rw-r--r--contrib/llvm-project/libcxx/include/__format/formatter_output.h50
-rw-r--r--contrib/llvm-project/libcxx/include/__format/parser_std_format_spec.h10
-rw-r--r--contrib/llvm-project/libcxx/include/__format/range_default_formatter.h12
-rw-r--r--contrib/llvm-project/libcxx/include/__format/range_formatter.h9
-rw-r--r--contrib/llvm-project/libcxx/include/__format/write_escaped.h10
16 files changed, 250 insertions, 226 deletions
diff --git a/contrib/llvm-project/libcxx/include/__format/buffer.h b/contrib/llvm-project/libcxx/include/__format/buffer.h
index 45f9da801722..8aa58d6464bb 100644
--- a/contrib/llvm-project/libcxx/include/__format/buffer.h
+++ b/contrib/llvm-project/libcxx/include/__format/buffer.h
@@ -95,7 +95,7 @@ public:
_LIBCPP_HIDE_FROM_ABI void __copy(basic_string_view<_InCharT> __str) {
// When the underlying iterator is a simple iterator the __capacity_ is
// infinite. For a string or container back_inserter it isn't. This means
- // adding a large string the the buffer can cause some overhead. In that
+ // that adding a large string to the buffer can cause some overhead. In that
// case a better approach could be:
// - flush the buffer
// - container.append(__str.begin(), __str.end());
@@ -108,7 +108,7 @@ public:
__flush_on_overflow(__n);
if (__n < __capacity_) { // push_back requires the buffer to have room for at least one character (so use <).
- _VSTD::copy_n(__str.data(), __n, _VSTD::addressof(__ptr_[__size_]));
+ std::copy_n(__str.data(), __n, std::addressof(__ptr_[__size_]));
__size_ += __n;
return;
}
@@ -118,8 +118,8 @@ public:
_LIBCPP_ASSERT_UNCATEGORIZED(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
const _InCharT* __first = __str.data();
do {
- size_t __chunk = _VSTD::min(__n, __capacity_);
- _VSTD::copy_n(__first, __chunk, _VSTD::addressof(__ptr_[__size_]));
+ size_t __chunk = std::min(__n, __capacity_);
+ std::copy_n(__first, __chunk, std::addressof(__ptr_[__size_]));
__size_ = __chunk;
__first += __chunk;
__n -= __chunk;
@@ -137,7 +137,7 @@ public:
size_t __n = static_cast<size_t>(__last - __first);
__flush_on_overflow(__n);
if (__n < __capacity_) { // push_back requires the buffer to have room for at least one character (so use <).
- _VSTD::transform(__first, __last, _VSTD::addressof(__ptr_[__size_]), _VSTD::move(__operation));
+ std::transform(__first, __last, std::addressof(__ptr_[__size_]), std::move(__operation));
__size_ += __n;
return;
}
@@ -146,8 +146,8 @@ public:
// Transform the data in "__capacity_" sized chunks.
_LIBCPP_ASSERT_UNCATEGORIZED(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
do {
- size_t __chunk = _VSTD::min(__n, __capacity_);
- _VSTD::transform(__first, __first + __chunk, _VSTD::addressof(__ptr_[__size_]), __operation);
+ size_t __chunk = std::min(__n, __capacity_);
+ std::transform(__first, __first + __chunk, std::addressof(__ptr_[__size_]), __operation);
__size_ = __chunk;
__first += __chunk;
__n -= __chunk;
@@ -159,7 +159,7 @@ public:
_LIBCPP_HIDE_FROM_ABI void __fill(size_t __n, _CharT __value) {
__flush_on_overflow(__n);
if (__n < __capacity_) { // push_back requires the buffer to have room for at least one character (so use <).
- _VSTD::fill_n(_VSTD::addressof(__ptr_[__size_]), __n, __value);
+ std::fill_n(std::addressof(__ptr_[__size_]), __n, __value);
__size_ += __n;
return;
}
@@ -168,8 +168,8 @@ public:
// Fill the buffer in "__capacity_" sized chunks.
_LIBCPP_ASSERT_UNCATEGORIZED(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
do {
- size_t __chunk = _VSTD::min(__n, __capacity_);
- _VSTD::fill_n(_VSTD::addressof(__ptr_[__size_]), __chunk, __value);
+ size_t __chunk = std::min(__n, __capacity_);
+ std::fill_n(std::addressof(__ptr_[__size_]), __chunk, __value);
__size_ = __chunk;
__n -= __chunk;
__flush();
@@ -282,7 +282,7 @@ template <class _OutIt, __fmt_char_type _CharT>
class _LIBCPP_TEMPLATE_VIS __writer_iterator {
public:
_LIBCPP_HIDE_FROM_ABI explicit __writer_iterator(_OutIt __out_it)
- : __out_it_{_VSTD::move(__out_it)} {}
+ : __out_it_{std::move(__out_it)} {}
_LIBCPP_HIDE_FROM_ABI _OutIt __out_it() && { return std::move(__out_it_); }
@@ -359,12 +359,12 @@ requires(output_iterator<_OutIt, const _CharT&>) class _LIBCPP_TEMPLATE_VIS
public:
_LIBCPP_HIDE_FROM_ABI explicit __format_buffer(_OutIt __out_it)
requires(same_as<_Storage, __internal_storage<_CharT>>)
- : __output_(__storage_.__begin(), __storage_.__buffer_size, this), __writer_(_VSTD::move(__out_it)) {}
+ : __output_(__storage_.__begin(), __storage_.__buffer_size, this), __writer_(std::move(__out_it)) {}
_LIBCPP_HIDE_FROM_ABI explicit __format_buffer(_OutIt __out_it) requires(
same_as<_Storage, __direct_storage<_CharT>>)
- : __output_(_VSTD::__unwrap_iter(__out_it), size_t(-1), this),
- __writer_(_VSTD::move(__out_it)) {}
+ : __output_(std::__unwrap_iter(__out_it), size_t(-1), this),
+ __writer_(std::move(__out_it)) {}
_LIBCPP_HIDE_FROM_ABI auto __make_output_iterator() { return __output_.__make_output_iterator(); }
@@ -372,7 +372,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _OutIt __out_it() && {
__output_.__flush();
- return _VSTD::move(__writer_).__out_it();
+ return std::move(__writer_).__out_it();
}
private:
@@ -411,11 +411,11 @@ struct _LIBCPP_TEMPLATE_VIS __format_to_n_buffer_base {
public:
_LIBCPP_HIDE_FROM_ABI explicit __format_to_n_buffer_base(_OutIt __out_it, _Size __max_size)
- : __writer_(_VSTD::move(__out_it)), __max_size_(_VSTD::max(_Size(0), __max_size)) {}
+ : __writer_(std::move(__out_it)), __max_size_(std::max(_Size(0), __max_size)) {}
_LIBCPP_HIDE_FROM_ABI void __flush(_CharT* __ptr, size_t __n) {
if (_Size(__size_) <= __max_size_)
- __writer_.__flush(__ptr, _VSTD::min(_Size(__n), __max_size_ - __size_));
+ __writer_.__flush(__ptr, std::min(_Size(__n), __max_size_ - __size_));
__size_ += __n;
}
@@ -441,8 +441,8 @@ class _LIBCPP_TEMPLATE_VIS __format_to_n_buffer_base<_OutIt, _CharT, true> {
public:
_LIBCPP_HIDE_FROM_ABI explicit __format_to_n_buffer_base(_OutIt __out_it, _Size __max_size)
- : __output_(_VSTD::__unwrap_iter(__out_it), __max_size, this),
- __writer_(_VSTD::move(__out_it)),
+ : __output_(std::__unwrap_iter(__out_it), __max_size, this),
+ __writer_(std::move(__out_it)),
__max_size_(__max_size) {
if (__max_size <= 0) [[unlikely]]
__output_.__reset(__storage_.__begin(), __storage_.__buffer_size);
@@ -466,7 +466,7 @@ public:
} else if (__size_ < __max_size_) {
// Copies a part of the internal buffer to the output up to n characters.
// See __output_buffer<_CharT>::__flush_on_overflow for more information.
- _Size __s = _VSTD::min(_Size(__n), __max_size_ - __size_);
+ _Size __s = std::min(_Size(__n), __max_size_ - __size_);
std::copy_n(__ptr, __s, __writer_.__out_it());
__writer_.__flush(__ptr, __s);
}
@@ -493,12 +493,12 @@ struct _LIBCPP_TEMPLATE_VIS __format_to_n_buffer final
public:
_LIBCPP_HIDE_FROM_ABI explicit __format_to_n_buffer(_OutIt __out_it, _Size __max_size)
- : _Base(_VSTD::move(__out_it), __max_size) {}
+ : _Base(std::move(__out_it), __max_size) {}
_LIBCPP_HIDE_FROM_ABI auto __make_output_iterator() { return this->__output_.__make_output_iterator(); }
_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __result() && {
this->__output_.__flush();
- return {_VSTD::move(this->__writer_).__out_it(), this->__size_};
+ return {std::move(this->__writer_).__out_it(), this->__size_};
}
};
diff --git a/contrib/llvm-project/libcxx/include/__format/escaped_output_table.h b/contrib/llvm-project/libcxx/include/__format/escaped_output_table.h
index 222847e6af67..495a2fbc7b03 100644
--- a/contrib/llvm-project/libcxx/include/__format/escaped_output_table.h
+++ b/contrib/llvm-project/libcxx/include/__format/escaped_output_table.h
@@ -75,6 +75,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 23
namespace __escaped_output_table {
+// clang-format off
/// The entries of the characters to escape in format's debug string.
///
@@ -1029,6 +1030,7 @@ inline constexpr uint32_t __unallocated_region_lower_bound = 0x000323b0;
return __code_point <= __upper_bound;
}
+// clang-format on
} // namespace __escaped_output_table
#endif //_LIBCPP_STD_VER >= 23
diff --git a/contrib/llvm-project/libcxx/include/__format/extended_grapheme_cluster_table.h b/contrib/llvm-project/libcxx/include/__format/extended_grapheme_cluster_table.h
index bd6d39fdc7c2..9616dfecd604 100644
--- a/contrib/llvm-project/libcxx/include/__format/extended_grapheme_cluster_table.h
+++ b/contrib/llvm-project/libcxx/include/__format/extended_grapheme_cluster_table.h
@@ -124,6 +124,7 @@ enum class __property : uint8_t {
/// this approach uses less space for the data and is about 4% faster in the
/// following benchmark.
/// libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp
+// clang-format off
inline constexpr uint32_t __entries[1496] = {
0x00000091,
0x00005005,
@@ -1621,6 +1622,7 @@ inline constexpr uint32_t __entries[1496] = {
0x707787f1,
0x707b87f1,
0x707f80f1};
+// clang-format on
/// Returns the extended grapheme cluster bondary property of a code point.
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __property __get_property(const char32_t __code_point) noexcept {
diff --git a/contrib/llvm-project/libcxx/include/__format/format_arg.h b/contrib/llvm-project/libcxx/include/__format/format_arg.h
index 5cbfe812341b..cc6be7a25660 100644
--- a/contrib/llvm-project/libcxx/include/__format/format_arg.h
+++ b/contrib/llvm-project/libcxx/include/__format/format_arg.h
@@ -53,7 +53,7 @@ namespace __format {
/// handle to satisfy the user observable behaviour. The internal function
/// __visit_format_arg doesn't do this wrapping. So in the format functions
/// this function is used to avoid unneeded overhead.
-enum class _LIBCPP_ENUM_VIS __arg_t : uint8_t {
+enum class __arg_t : uint8_t {
__none,
__boolean,
__char_type,
@@ -100,45 +100,45 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto)
__visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
switch (__arg.__type_) {
case __format::__arg_t::__none:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__monostate_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__monostate_);
case __format::__arg_t::__boolean:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__boolean_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__boolean_);
case __format::__arg_t::__char_type:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__char_type_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__char_type_);
case __format::__arg_t::__int:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__int_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__int_);
case __format::__arg_t::__long_long:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__long_long_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__long_long_);
case __format::__arg_t::__i128:
# ifndef _LIBCPP_HAS_NO_INT128
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__i128_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__i128_);
# else
__libcpp_unreachable();
# endif
case __format::__arg_t::__unsigned:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__unsigned_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__unsigned_);
case __format::__arg_t::__unsigned_long_long:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__unsigned_long_long_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__unsigned_long_long_);
case __format::__arg_t::__u128:
# ifndef _LIBCPP_HAS_NO_INT128
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__u128_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__u128_);
# else
__libcpp_unreachable();
# endif
case __format::__arg_t::__float:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__float_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__float_);
case __format::__arg_t::__double:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__double_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__double_);
case __format::__arg_t::__long_double:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__long_double_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__long_double_);
case __format::__arg_t::__const_char_type_ptr:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__const_char_type_ptr_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__const_char_type_ptr_);
case __format::__arg_t::__string_view:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__string_view_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__string_view_);
case __format::__arg_t::__ptr:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__value_.__ptr_);
+ return std::invoke(std::forward<_Visitor>(__vis), __arg.__value_.__ptr_);
case __format::__arg_t::__handle:
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis),
+ return std::invoke(std::forward<_Visitor>(__vis),
typename basic_format_arg<_Context>::handle{__arg.__value_.__handle_});
}
@@ -158,7 +158,7 @@ public:
struct __handle {
template <class _Tp>
_LIBCPP_HIDE_FROM_ABI explicit __handle(_Tp& __v) noexcept
- : __ptr_(_VSTD::addressof(__v)),
+ : __ptr_(std::addressof(__v)),
__format_([](basic_format_parse_context<_CharT>& __parse_ctx, _Context& __ctx, const void* __ptr) {
using _Dp = remove_const_t<_Tp>;
using _Qp = conditional_t<__formattable_with<const _Dp, _Context>, const _Dp, _Dp>;
@@ -278,16 +278,16 @@ visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
# ifndef _LIBCPP_HAS_NO_INT128
case __format::__arg_t::__i128: {
typename __basic_format_arg_value<_Context>::__handle __h{__arg.__value_.__i128_};
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), typename basic_format_arg<_Context>::handle{__h});
+ return std::invoke(std::forward<_Visitor>(__vis), typename basic_format_arg<_Context>::handle{__h});
}
case __format::__arg_t::__u128: {
typename __basic_format_arg_value<_Context>::__handle __h{__arg.__value_.__u128_};
- return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), typename basic_format_arg<_Context>::handle{__h});
+ return std::invoke(std::forward<_Visitor>(__vis), typename basic_format_arg<_Context>::handle{__h});
}
# endif
default:
- return _VSTD::__visit_format_arg(_VSTD::forward<_Visitor>(__vis), __arg);
+ return std::__visit_format_arg(std::forward<_Visitor>(__vis), __arg);
}
}
diff --git a/contrib/llvm-project/libcxx/include/__format/format_arg_store.h b/contrib/llvm-project/libcxx/include/__format/format_arg_store.h
index 15ec8eb0a7d8..64ee12440b62 100644
--- a/contrib/llvm-project/libcxx/include/__format/format_arg_store.h
+++ b/contrib/llvm-project/libcxx/include/__format/format_arg_store.h
@@ -172,9 +172,13 @@ _LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp& __valu
// __basic_format_arg_value. First handle all types needing adjustment, the
// final else requires no adjustment.
if constexpr (__arg == __arg_t::__char_type)
- // On some platforms initializing a wchar_t from a char is a narrowing
- // conversion.
- return basic_format_arg<_Context>{__arg, static_cast<typename _Context::char_type>(__value)};
+
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+ if constexpr (same_as<typename _Context::char_type, wchar_t> && same_as<_Dp, char>)
+ return basic_format_arg<_Context>{__arg, static_cast<wchar_t>(static_cast<unsigned char>(__value))};
+ else
+# endif
+ return basic_format_arg<_Context>{__arg, __value};
else if constexpr (__arg == __arg_t::__int)
return basic_format_arg<_Context>{__arg, static_cast<int>(__value)};
else if constexpr (__arg == __arg_t::__long_long)
@@ -202,8 +206,8 @@ _LIBCPP_HIDE_FROM_ABI basic_format_arg<_Context> __create_format_arg(_Tp& __valu
}
template <class _Context, class... _Args>
-_LIBCPP_HIDE_FROM_ABI void __create_packed_storage(uint64_t& __types, __basic_format_arg_value<_Context>* __values,
- _Args&&... __args) noexcept {
+_LIBCPP_HIDE_FROM_ABI void
+__create_packed_storage(uint64_t& __types, __basic_format_arg_value<_Context>* __values, _Args&... __args) noexcept {
int __shift = 0;
(
[&] {
@@ -220,7 +224,7 @@ _LIBCPP_HIDE_FROM_ABI void __create_packed_storage(uint64_t& __types, __basic_fo
}
template <class _Context, class... _Args>
-_LIBCPP_HIDE_FROM_ABI void __store_basic_format_arg(basic_format_arg<_Context>* __data, _Args&&... __args) noexcept {
+_LIBCPP_HIDE_FROM_ABI void __store_basic_format_arg(basic_format_arg<_Context>* __data, _Args&... __args) noexcept {
([&] { *__data++ = __format::__create_format_arg<_Context>(__args); }(), ...);
}
diff --git a/contrib/llvm-project/libcxx/include/__format/format_context.h b/contrib/llvm-project/libcxx/include/__format/format_context.h
index 9d50cee2483f..4e3d15ec862e 100644
--- a/contrib/llvm-project/libcxx/include/__format/format_context.h
+++ b/contrib/llvm-project/libcxx/include/__format/format_context.h
@@ -54,8 +54,8 @@ _LIBCPP_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT>
__format_context_create(
_OutIt __out_it,
basic_format_args<basic_format_context<_OutIt, _CharT>> __args,
- optional<_VSTD::locale>&& __loc = nullopt) {
- return _VSTD::basic_format_context(_VSTD::move(__out_it), __args, _VSTD::move(__loc));
+ optional<std::locale>&& __loc = nullopt) {
+ return std::basic_format_context(std::move(__out_it), __args, std::move(__loc));
}
#else
template <class _OutIt, class _CharT>
@@ -63,7 +63,7 @@ _LIBCPP_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT>
__format_context_create(
_OutIt __out_it,
basic_format_args<basic_format_context<_OutIt, _CharT>> __args) {
- return _VSTD::basic_format_context(_VSTD::move(__out_it), __args);
+ return std::basic_format_context(std::move(__out_it), __args);
}
#endif
@@ -95,9 +95,9 @@ public:
return __args_.get(__id);
}
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
- _LIBCPP_HIDE_FROM_ABI _VSTD::locale locale() {
+ _LIBCPP_HIDE_FROM_ABI std::locale locale() {
if (!__loc_)
- __loc_ = _VSTD::locale{};
+ __loc_ = std::locale{};
return *__loc_;
}
#endif
@@ -118,20 +118,20 @@ private:
// locale() is called and the optional has no value the value will be created.
// This allows the implementation to lazily create the locale.
// TODO FMT Validate whether lazy creation is the best solution.
- optional<_VSTD::locale> __loc_;
+ optional<std::locale> __loc_;
template <class _OtherOutIt, class _OtherCharT>
friend _LIBCPP_HIDE_FROM_ABI basic_format_context<_OtherOutIt, _OtherCharT>
__format_context_create(_OtherOutIt, basic_format_args<basic_format_context<_OtherOutIt, _OtherCharT>>,
- optional<_VSTD::locale>&&);
+ optional<std::locale>&&);
// Note: the Standard doesn't specify the required constructors.
_LIBCPP_HIDE_FROM_ABI
explicit basic_format_context(_OutIt __out_it,
basic_format_args<basic_format_context> __args,
- optional<_VSTD::locale>&& __loc)
- : __out_it_(_VSTD::move(__out_it)), __args_(__args),
- __loc_(_VSTD::move(__loc)) {}
+ optional<std::locale>&& __loc)
+ : __out_it_(std::move(__out_it)), __args_(__args),
+ __loc_(std::move(__loc)) {}
#else
template <class _OtherOutIt, class _OtherCharT>
friend _LIBCPP_HIDE_FROM_ABI basic_format_context<_OtherOutIt, _OtherCharT>
@@ -140,7 +140,7 @@ private:
_LIBCPP_HIDE_FROM_ABI
explicit basic_format_context(_OutIt __out_it,
basic_format_args<basic_format_context> __args)
- : __out_it_(_VSTD::move(__out_it)), __args_(__args) {}
+ : __out_it_(std::move(__out_it)), __args_(__args) {}
#endif
};
@@ -198,7 +198,7 @@ public:
return __arg_(__ctx_, __id);
}
# ifndef _LIBCPP_HAS_NO_LOCALIZATION
- _LIBCPP_HIDE_FROM_ABI _VSTD::locale locale() { return __loc_(__ctx_); }
+ _LIBCPP_HIDE_FROM_ABI std::locale locale() { return __loc_(__ctx_); }
# endif
_LIBCPP_HIDE_FROM_ABI iterator out() { return std::move(__out_it_); }
_LIBCPP_HIDE_FROM_ABI void advance_to(iterator __it) { __out_it_ = std::move(__it); }
diff --git a/contrib/llvm-project/libcxx/include/__format/format_error.h b/contrib/llvm-project/libcxx/include/__format/format_error.h
index f22cb0b81ec2..51d6c5823091 100644
--- a/contrib/llvm-project/libcxx/include/__format/format_error.h
+++ b/contrib/llvm-project/libcxx/include/__format/format_error.h
@@ -30,6 +30,8 @@ public:
: runtime_error(__s) {}
_LIBCPP_HIDE_FROM_ABI explicit format_error(const char* __s)
: runtime_error(__s) {}
+ _LIBCPP_HIDE_FROM_ABI format_error(const format_error&) = default;
+ _LIBCPP_HIDE_FROM_ABI format_error& operator=(const format_error&) = default;
_LIBCPP_HIDE_FROM_ABI_VIRTUAL
~format_error() noexcept override = default;
};
diff --git a/contrib/llvm-project/libcxx/include/__format/format_functions.h b/contrib/llvm-project/libcxx/include/__format/format_functions.h
index bb62c1ce10c1..8b2111f0e287 100644
--- a/contrib/llvm-project/libcxx/include/__format/format_functions.h
+++ b/contrib/llvm-project/libcxx/include/__format/format_functions.h
@@ -63,14 +63,14 @@ using wformat_args = basic_format_args<wformat_context>;
#endif
template <class _Context = format_context, class... _Args>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&&... __args) {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&... __args) {
return _VSTD::__format_arg_store<_Context, _Args...>(__args...);
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...>
-make_wformat_args(_Args&&... __args) {
+make_wformat_args(_Args&... __args) {
return _VSTD::__format_arg_store<wformat_context, _Args...>(__args...);
}
# endif
@@ -271,7 +271,7 @@ __handle_replacement_field(_Iterator __begin, _Iterator __end,
else if (__parse)
__format::__compile_time_visit_format_arg(__parse_ctx, __ctx, __type);
} else
- _VSTD::__visit_format_arg(
+ std::__visit_format_arg(
[&](auto __arg) {
if constexpr (same_as<decltype(__arg), monostate>)
std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
@@ -310,7 +310,7 @@ __vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) {
std::__throw_format_error("The format string terminates at a '{'");
if (*__begin != _CharT('{')) [[likely]] {
- __ctx.advance_to(_VSTD::move(__out_it));
+ __ctx.advance_to(std::move(__out_it));
__begin =
__format::__handle_replacement_field(__begin, __end, __parse_ctx, __ctx);
__out_it = __ctx.out();
@@ -338,6 +338,30 @@ __vformat_to(_ParseCtx&& __parse_ctx, _Ctx&& __ctx) {
} // namespace __format
+# if _LIBCPP_STD_VER >= 26
+template <class _CharT>
+struct _LIBCPP_TEMPLATE_VIS __runtime_format_string {
+private:
+ basic_string_view<_CharT> __str_;
+
+ template <class _Cp, class... _Args>
+ friend struct _LIBCPP_TEMPLATE_VIS basic_format_string;
+
+public:
+ _LIBCPP_HIDE_FROM_ABI __runtime_format_string(basic_string_view<_CharT> __s) noexcept : __str_(__s) {}
+
+ __runtime_format_string(const __runtime_format_string&) = delete;
+ __runtime_format_string& operator=(const __runtime_format_string&) = delete;
+};
+
+_LIBCPP_HIDE_FROM_ABI inline __runtime_format_string<char> runtime_format(string_view __fmt) noexcept { return __fmt; }
+# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+_LIBCPP_HIDE_FROM_ABI inline __runtime_format_string<wchar_t> runtime_format(wstring_view __fmt) noexcept {
+ return __fmt;
+}
+# endif
+# endif //_LIBCPP_STD_VER >= 26
+
template <class _CharT, class... _Args>
struct _LIBCPP_TEMPLATE_VIS basic_format_string {
template <class _Tp>
@@ -350,6 +374,9 @@ struct _LIBCPP_TEMPLATE_VIS basic_format_string {
_LIBCPP_HIDE_FROM_ABI constexpr basic_string_view<_CharT> get() const noexcept {
return __str_;
}
+# if _LIBCPP_STD_VER >= 26
+ _LIBCPP_HIDE_FROM_ABI basic_format_string(__runtime_format_string<_CharT> __s) noexcept : __str_(__s.__str_) {}
+# endif
private:
basic_string_view<_CharT> __str_;
@@ -383,13 +410,13 @@ requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt
_OutIt __out_it, basic_string_view<_CharT> __fmt,
basic_format_args<basic_format_context<_FormatOutIt, _CharT>> __args) {
if constexpr (same_as<_OutIt, _FormatOutIt>)
- return _VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
- _VSTD::__format_context_create(_VSTD::move(__out_it), __args));
+ return std::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
+ std::__format_context_create(std::move(__out_it), __args));
else {
- __format::__format_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it)};
- _VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
- _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args));
- return _VSTD::move(__buffer).__out_it();
+ __format::__format_buffer<_OutIt, _CharT> __buffer{std::move(__out_it)};
+ std::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
+ std::__format_context_create(__buffer.__make_output_iterator(), __args));
+ return std::move(__buffer).__out_it();
}
}
@@ -399,30 +426,30 @@ requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt
template <output_iterator<const char&> _OutIt>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
vformat_to(_OutIt __out_it, string_view __fmt, format_args __args) {
- return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
+ return std::__vformat_to(std::move(__out_it), __fmt, __args);
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
vformat_to(_OutIt __out_it, wstring_view __fmt, wformat_args __args) {
- return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
+ return std::__vformat_to(std::move(__out_it), __fmt, __args);
}
#endif
template <output_iterator<const char&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, format_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::vformat_to(_VSTD::move(__out_it), __fmt.get(),
- _VSTD::make_format_args(__args...));
+ return std::vformat_to(std::move(__out_it), __fmt.get(),
+ std::make_format_args(__args...));
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, wformat_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::vformat_to(_VSTD::move(__out_it), __fmt.get(),
- _VSTD::make_wformat_args(__args...));
+ return std::vformat_to(std::move(__out_it), __fmt.get(),
+ std::make_wformat_args(__args...));
}
#endif
@@ -432,7 +459,7 @@ template <class = void>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string
vformat(string_view __fmt, format_args __args) {
string __res;
- _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args);
+ std::vformat_to(std::back_inserter(__res), __fmt, __args);
return __res;
}
@@ -443,7 +470,7 @@ template <class = void>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring
vformat(wstring_view __fmt, wformat_args __args) {
wstring __res;
- _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args);
+ std::vformat_to(std::back_inserter(__res), __fmt, __args);
return __res;
}
# endif
@@ -451,14 +478,14 @@ vformat(wstring_view __fmt, wformat_args __args) {
template <class... _Args>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string
format(format_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::vformat(__fmt.get(), _VSTD::make_format_args(__args...));
+ return std::vformat(__fmt.get(), std::make_format_args(__args...));
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring
format(wformat_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::vformat(__fmt.get(), _VSTD::make_wformat_args(__args...));
+ return std::vformat(__fmt.get(), std::make_wformat_args(__args...));
}
# endif
@@ -466,16 +493,16 @@ template <class _Context, class _OutIt, class _CharT>
_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n,
basic_string_view<_CharT> __fmt,
basic_format_args<_Context> __args) {
- __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it), __n};
- _VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
- _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args));
- return _VSTD::move(__buffer).__result();
+ __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{std::move(__out_it), __n};
+ std::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
+ std::__format_context_create(__buffer.__make_output_iterator(), __args));
+ return std::move(__buffer).__result();
}
template <output_iterator<const char&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, format_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::__vformat_to_n<format_context>(_VSTD::move(__out_it), __n, __fmt.get(), _VSTD::make_format_args(__args...));
+ return std::__vformat_to_n<format_context>(std::move(__out_it), __n, __fmt.get(), std::make_format_args(__args...));
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -483,29 +510,29 @@ template <output_iterator<const wchar_t&> _OutIt, class... _Args>
_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, wformat_string<_Args...> __fmt,
_Args&&... __args) {
- return _VSTD::__vformat_to_n<wformat_context>(_VSTD::move(__out_it), __n, __fmt.get(), _VSTD::make_wformat_args(__args...));
+ return std::__vformat_to_n<wformat_context>(std::move(__out_it), __n, __fmt.get(), std::make_wformat_args(__args...));
}
#endif
template <class _CharT>
_LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(basic_string_view<_CharT> __fmt, auto __args) {
__format::__formatted_size_buffer<_CharT> __buffer;
- _VSTD::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
- _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args));
- return _VSTD::move(__buffer).__result();
+ std::__format::__vformat_to(basic_format_parse_context{__fmt, __args.__size()},
+ std::__format_context_create(__buffer.__make_output_iterator(), __args));
+ return std::move(__buffer).__result();
}
template <class... _Args>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(format_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::__vformatted_size(__fmt.get(), basic_format_args{_VSTD::make_format_args(__args...)});
+ return std::__vformatted_size(__fmt.get(), basic_format_args{std::make_format_args(__args...)});
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(wformat_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::__vformatted_size(__fmt.get(), basic_format_args{_VSTD::make_wformat_args(__args...)});
+ return std::__vformatted_size(__fmt.get(), basic_format_args{std::make_wformat_args(__args...)});
}
# endif
@@ -517,22 +544,22 @@ requires(output_iterator<_OutIt, const _CharT&>) _LIBCPP_HIDE_FROM_ABI _OutIt
_OutIt __out_it, locale __loc, basic_string_view<_CharT> __fmt,
basic_format_args<basic_format_context<_FormatOutIt, _CharT>> __args) {
if constexpr (same_as<_OutIt, _FormatOutIt>)
- return _VSTD::__format::__vformat_to(
+ return std::__format::__vformat_to(
basic_format_parse_context{__fmt, __args.__size()},
- _VSTD::__format_context_create(_VSTD::move(__out_it), __args, _VSTD::move(__loc)));
+ std::__format_context_create(std::move(__out_it), __args, std::move(__loc)));
else {
- __format::__format_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it)};
- _VSTD::__format::__vformat_to(
+ __format::__format_buffer<_OutIt, _CharT> __buffer{std::move(__out_it)};
+ std::__format::__vformat_to(
basic_format_parse_context{__fmt, __args.__size()},
- _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args, _VSTD::move(__loc)));
- return _VSTD::move(__buffer).__out_it();
+ std::__format_context_create(__buffer.__make_output_iterator(), __args, std::move(__loc)));
+ return std::move(__buffer).__out_it();
}
}
template <output_iterator<const char&> _OutIt>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt vformat_to(
_OutIt __out_it, locale __loc, string_view __fmt, format_args __args) {
- return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt,
+ return std::__vformat_to(std::move(__out_it), std::move(__loc), __fmt,
__args);
}
@@ -540,7 +567,7 @@ _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt vformat_to(
template <output_iterator<const wchar_t&> _OutIt>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt vformat_to(
_OutIt __out_it, locale __loc, wstring_view __fmt, wformat_args __args) {
- return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt,
+ return std::__vformat_to(std::move(__out_it), std::move(__loc), __fmt,
__args);
}
#endif
@@ -548,16 +575,16 @@ _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt vformat_to(
template <output_iterator<const char&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt.get(),
- _VSTD::make_format_args(__args...));
+ return std::vformat_to(std::move(__out_it), std::move(__loc), __fmt.get(),
+ std::make_format_args(__args...));
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <output_iterator<const wchar_t&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI _OutIt
format_to(_OutIt __out_it, locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt.get(),
- _VSTD::make_wformat_args(__args...));
+ return std::vformat_to(std::move(__out_it), std::move(__loc), __fmt.get(),
+ std::make_wformat_args(__args...));
}
#endif
@@ -567,7 +594,7 @@ template <class = void>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string
vformat(locale __loc, string_view __fmt, format_args __args) {
string __res;
- _VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt,
+ std::vformat_to(std::back_inserter(__res), std::move(__loc), __fmt,
__args);
return __res;
}
@@ -579,7 +606,7 @@ template <class = void>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI wstring
vformat(locale __loc, wstring_view __fmt, wformat_args __args) {
wstring __res;
- _VSTD::vformat_to(_VSTD::back_inserter(__res), _VSTD::move(__loc), __fmt,
+ std::vformat_to(std::back_inserter(__res), std::move(__loc), __fmt,
__args);
return __res;
}
@@ -588,16 +615,16 @@ vformat(locale __loc, wstring_view __fmt, wformat_args __args) {
template <class... _Args>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI string
format(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::vformat(_VSTD::move(__loc), __fmt.get(),
- _VSTD::make_format_args(__args...));
+ return std::vformat(std::move(__loc), __fmt.get(),
+ std::make_format_args(__args...));
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI wstring
format(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::vformat(_VSTD::move(__loc), __fmt.get(),
- _VSTD::make_wformat_args(__args...));
+ return std::vformat(std::move(__loc), __fmt.get(),
+ std::make_wformat_args(__args...));
}
# endif
@@ -605,19 +632,19 @@ template <class _Context, class _OutIt, class _CharT>
_LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt> __vformat_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n,
locale __loc, basic_string_view<_CharT> __fmt,
basic_format_args<_Context> __args) {
- __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{_VSTD::move(__out_it), __n};
- _VSTD::__format::__vformat_to(
+ __format::__format_to_n_buffer<_OutIt, _CharT> __buffer{std::move(__out_it), __n};
+ std::__format::__vformat_to(
basic_format_parse_context{__fmt, __args.__size()},
- _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args, _VSTD::move(__loc)));
- return _VSTD::move(__buffer).__result();
+ std::__format_context_create(__buffer.__make_output_iterator(), __args, std::move(__loc)));
+ return std::move(__buffer).__result();
}
template <output_iterator<const char&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, format_string<_Args...> __fmt,
_Args&&... __args) {
- return _VSTD::__vformat_to_n<format_context>(_VSTD::move(__out_it), __n, _VSTD::move(__loc), __fmt.get(),
- _VSTD::make_format_args(__args...));
+ return std::__vformat_to_n<format_context>(std::move(__out_it), __n, std::move(__loc), __fmt.get(),
+ std::make_format_args(__args...));
}
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -625,31 +652,31 @@ template <output_iterator<const wchar_t&> _OutIt, class... _Args>
_LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI format_to_n_result<_OutIt>
format_to_n(_OutIt __out_it, iter_difference_t<_OutIt> __n, locale __loc, wformat_string<_Args...> __fmt,
_Args&&... __args) {
- return _VSTD::__vformat_to_n<wformat_context>(_VSTD::move(__out_it), __n, _VSTD::move(__loc), __fmt.get(),
- _VSTD::make_wformat_args(__args...));
+ return std::__vformat_to_n<wformat_context>(std::move(__out_it), __n, std::move(__loc), __fmt.get(),
+ std::make_wformat_args(__args...));
}
#endif
template <class _CharT>
_LIBCPP_HIDE_FROM_ABI size_t __vformatted_size(locale __loc, basic_string_view<_CharT> __fmt, auto __args) {
__format::__formatted_size_buffer<_CharT> __buffer;
- _VSTD::__format::__vformat_to(
+ std::__format::__vformat_to(
basic_format_parse_context{__fmt, __args.__size()},
- _VSTD::__format_context_create(__buffer.__make_output_iterator(), __args, _VSTD::move(__loc)));
- return _VSTD::move(__buffer).__result();
+ std::__format_context_create(__buffer.__make_output_iterator(), __args, std::move(__loc)));
+ return std::move(__buffer).__result();
}
template <class... _Args>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(locale __loc, format_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::__vformatted_size(_VSTD::move(__loc), __fmt.get(), basic_format_args{_VSTD::make_format_args(__args...)});
+ return std::__vformatted_size(std::move(__loc), __fmt.get(), basic_format_args{std::make_format_args(__args...)});
}
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
template <class... _Args>
_LIBCPP_NODISCARD_EXT _LIBCPP_ALWAYS_INLINE _LIBCPP_HIDE_FROM_ABI size_t
formatted_size(locale __loc, wformat_string<_Args...> __fmt, _Args&&... __args) {
- return _VSTD::__vformatted_size(_VSTD::move(__loc), __fmt.get(), basic_format_args{_VSTD::make_wformat_args(__args...)});
+ return std::__vformatted_size(std::move(__loc), __fmt.get(), basic_format_args{std::make_wformat_args(__args...)});
}
# endif
diff --git a/contrib/llvm-project/libcxx/include/__format/formatter_char.h b/contrib/llvm-project/libcxx/include/__format/formatter_char.h
index d6e61e865449..3358d422252f 100644
--- a/contrib/llvm-project/libcxx/include/__format/formatter_char.h
+++ b/contrib/llvm-project/libcxx/include/__format/formatter_char.h
@@ -21,7 +21,7 @@
#include <__format/parser_std_format_spec.h>
#include <__format/write_escaped.h>
#include <__type_traits/conditional.h>
-#include <__type_traits/is_signed.h>
+#include <__type_traits/make_unsigned.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -51,22 +51,21 @@ public:
return __formatter::__format_escaped_char(__value, __ctx.out(), __parser_.__get_parsed_std_specifications(__ctx));
# endif
- if constexpr (sizeof(_CharT) <= sizeof(int))
- // Promotes _CharT to an integral type. This reduces the number of
- // instantiations of __format_integer reducing code size.
+ if constexpr (sizeof(_CharT) <= sizeof(unsigned))
return __formatter::__format_integer(
- static_cast<conditional_t<is_signed_v<_CharT>, int, unsigned>>(__value),
+ static_cast<unsigned>(static_cast<make_unsigned_t<_CharT>>(__value)),
__ctx,
__parser_.__get_parsed_std_specifications(__ctx));
else
- return __formatter::__format_integer(__value, __ctx, __parser_.__get_parsed_std_specifications(__ctx));
+ return __formatter::__format_integer(
+ static_cast<make_unsigned_t<_CharT>>(__value), __ctx, __parser_.__get_parsed_std_specifications(__ctx));
}
template <class _FormatContext>
_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(char __value, _FormatContext& __ctx) const
requires(same_as<_CharT, wchar_t>)
{
- return format(static_cast<wchar_t>(__value), __ctx);
+ return format(static_cast<wchar_t>(static_cast<unsigned char>(__value)), __ctx);
}
# if _LIBCPP_STD_VER >= 23
@@ -84,8 +83,7 @@ template <>
struct _LIBCPP_TEMPLATE_VIS formatter<char, wchar_t> : public __formatter_char<wchar_t> {};
template <>
-struct _LIBCPP_TEMPLATE_VIS formatter<wchar_t, wchar_t> : public __formatter_char<wchar_t> {
-};
+struct _LIBCPP_TEMPLATE_VIS formatter<wchar_t, wchar_t> : public __formatter_char<wchar_t> {};
# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
diff --git a/contrib/llvm-project/libcxx/include/__format/formatter_floating_point.h b/contrib/llvm-project/libcxx/include/__format/formatter_floating_point.h
index fbb8aa9200a7..b45c2a6ebd39 100644
--- a/contrib/llvm-project/libcxx/include/__format/formatter_floating_point.h
+++ b/contrib/llvm-project/libcxx/include/__format/formatter_floating_point.h
@@ -56,21 +56,21 @@ namespace __formatter {
template <floating_point _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value) {
- to_chars_result __r = _VSTD::to_chars(__first, __last, __value);
+ to_chars_result __r = std::to_chars(__first, __last, __value);
_LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
template <floating_point _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt) {
- to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __fmt);
+ to_chars_result __r = std::to_chars(__first, __last, __value, __fmt);
_LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
template <floating_point _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt, int __precision) {
- to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __fmt, __precision);
+ to_chars_result __r = std::to_chars(__first, __last, __value, __fmt, __precision);
_LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
@@ -136,7 +136,7 @@ struct __traits<double> {
/// Helper class to store the conversion buffer.
///
-/// Depending on the maxium size required for a value, the buffer is allocated
+/// Depending on the maximum size required for a value, the buffer is allocated
/// on the stack or the heap.
template <floating_point _Fp>
class _LIBCPP_TEMPLATE_VIS __float_buffer {
@@ -224,7 +224,7 @@ struct __float_result {
constexpr inline _LIBCPP_HIDE_FROM_ABI char* __find_exponent(char* __first, char* __last) {
ptrdiff_t __size = __last - __first;
if (__size >= 4) {
- __first = __last - _VSTD::min(__size, ptrdiff_t(6));
+ __first = __last - std::min(__size, ptrdiff_t(6));
for (; __first != __last - 3; ++__first) {
if (*__first == 'e')
return __first;
@@ -245,7 +245,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_default(const __float_buffe
// Constrains:
// - There's at least one decimal digit before the radix point.
// - The radix point, when present, is placed before the exponent.
- __result.__radix_point = _VSTD::find(__result.__integral + 1, __result.__exponent, '.');
+ __result.__radix_point = std::find(__result.__integral + 1, __result.__exponent, '.');
// When the radix point isn't found its position is the exponent instead of
// __result.__last.
@@ -299,7 +299,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_lower_case(cons
char* __last = __result.__last - 2;
__first = __last - __traits<_Fp>::__hex_precision_digits;
- __result.__exponent = _VSTD::find(__first, __last, 'p');
+ __result.__exponent = std::find(__first, __last, 'p');
} else {
__result.__radix_point = __result.__last;
__result.__exponent = __first;
@@ -321,7 +321,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_hexadecimal_upper_case(cons
char* __integral) {
__float_result __result =
__formatter::__format_buffer_hexadecimal_lower_case(__buffer, __value, __precision, __integral);
- _VSTD::transform(__result.__integral, __result.__exponent, __result.__integral, __hex_to_upper);
+ std::transform(__result.__integral, __result.__exponent, __result.__integral, __hex_to_upper);
*__result.__exponent = 'P';
return __result;
}
@@ -411,7 +411,7 @@ _LIBCPP_HIDE_FROM_ABI __float_result __format_buffer_general_lower_case(__float_
// In fixed mode the algorithm truncates trailing spaces and possibly the
// radix point. There's no good guess for the position of the radix point
// therefore scan the output after the first digit.
- __result.__radix_point = _VSTD::find(__first, __result.__last, '.');
+ __result.__radix_point = std::find(__first, __result.__last, '.');
}
}
@@ -502,13 +502,13 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
_OutIt __out_it,
const __float_buffer<_Fp>& __buffer,
const __float_result& __result,
- _VSTD::locale __loc,
+ std::locale __loc,
__format_spec::__parsed_specifications<_CharT> __specs) {
const auto& __np = std::use_facet<numpunct<_CharT>>(__loc);
string __grouping = __np.grouping();
char* __first = __result.__integral;
// When no radix point or exponent are present __last will be __result.__last.
- char* __last = _VSTD::min(__result.__radix_point, __result.__exponent);
+ char* __last = std::min(__result.__radix_point, __result.__exponent);
ptrdiff_t __digits = __last - __first;
if (!__grouping.empty()) {
@@ -538,13 +538,13 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
// sign and (zero padding or alignment)
if (__zero_padding && __first != __buffer.begin())
*__out_it++ = *__buffer.begin();
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
+ __out_it = __formatter::__fill(std::move(__out_it), __padding.__before_, __specs.__fill_);
if (!__zero_padding && __first != __buffer.begin())
*__out_it++ = *__buffer.begin();
// integral part
if (__grouping.empty()) {
- __out_it = __formatter::__copy(__first, __digits, _VSTD::move(__out_it));
+ __out_it = __formatter::__copy(__first, __digits, std::move(__out_it));
} else {
auto __r = __grouping.rbegin();
auto __e = __grouping.rend() - 1;
@@ -556,7 +556,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
// This loop achieves that process by testing the termination condition
// midway in the loop.
while (true) {
- __out_it = __formatter::__copy(__first, *__r, _VSTD::move(__out_it));
+ __out_it = __formatter::__copy(__first, *__r, std::move(__out_it));
__first += *__r;
if (__r == __e)
@@ -570,16 +570,16 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_locale_specific_form(
// fractional part
if (__result.__radix_point != __result.__last) {
*__out_it++ = __np.decimal_point();
- __out_it = __formatter::__copy(__result.__radix_point + 1, __result.__exponent, _VSTD::move(__out_it));
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __buffer.__num_trailing_zeros(), _CharT('0'));
+ __out_it = __formatter::__copy(__result.__radix_point + 1, __result.__exponent, std::move(__out_it));
+ __out_it = __formatter::__fill(std::move(__out_it), __buffer.__num_trailing_zeros(), _CharT('0'));
}
// exponent
if (__result.__exponent != __result.__last)
- __out_it = __formatter::__copy(__result.__exponent, __result.__last, _VSTD::move(__out_it));
+ __out_it = __formatter::__copy(__result.__exponent, __result.__last, std::move(__out_it));
// alignment
- return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+ return __formatter::__fill(std::move(__out_it), __padding.__after_, __specs.__fill_);
}
# endif // _LIBCPP_HAS_NO_LOCALIZATION
@@ -597,7 +597,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_floating_point_non_finite(
__specs.__std_.__type_ == __format_spec::__type::__scientific_upper_case ||
__specs.__std_.__type_ == __format_spec::__type::__fixed_upper_case ||
__specs.__std_.__type_ == __format_spec::__type::__general_upper_case;
- __last = _VSTD::copy_n(&("infnanINFNAN"[6 * __upper_case + 3 * __isnan]), 3, __last);
+ __last = std::copy_n(&("infnanINFNAN"[6 * __upper_case + 3 * __isnan]), 3, __last);
// [format.string.std]/13
// A zero (0) character preceding the width field pads the field with
@@ -606,7 +606,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __format_floating_point_non_finite(
if (__specs.__alignment_ == __format_spec::__alignment::__zero_padding)
__specs.__alignment_ = __format_spec::__alignment::__right;
- return __formatter::__write(__buffer, __last, _VSTD::move(__out_it), __specs);
+ return __formatter::__write(__buffer, __last, std::move(__out_it), __specs);
}
/// Writes additional zero's for the precision before the exponent.
@@ -632,21 +632,21 @@ _LIBCPP_HIDE_FROM_ABI auto __write_using_trailing_zeros(
__padding_size_result __padding =
__formatter::__padding_size(__size + __num_trailing_zeros, __specs.__width_, __specs.__alignment_);
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
- __out_it = __formatter::__copy(__first, __exponent, _VSTD::move(__out_it));
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __num_trailing_zeros, _CharT('0'));
- __out_it = __formatter::__copy(__exponent, __last, _VSTD::move(__out_it));
- return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+ __out_it = __formatter::__fill(std::move(__out_it), __padding.__before_, __specs.__fill_);
+ __out_it = __formatter::__copy(__first, __exponent, std::move(__out_it));
+ __out_it = __formatter::__fill(std::move(__out_it), __num_trailing_zeros, _CharT('0'));
+ __out_it = __formatter::__copy(__exponent, __last, std::move(__out_it));
+ return __formatter::__fill(std::move(__out_it), __padding.__after_, __specs.__fill_);
}
template <floating_point _Tp, class _CharT, class _FormatContext>
_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator
__format_floating_point(_Tp __value, _FormatContext& __ctx, __format_spec::__parsed_specifications<_CharT> __specs) {
- bool __negative = _VSTD::signbit(__value);
+ bool __negative = std::signbit(__value);
- if (!_VSTD::isfinite(__value)) [[unlikely]]
- return __formatter::__format_floating_point_non_finite(__ctx.out(), __specs, __negative, _VSTD::isnan(__value));
+ if (!std::isfinite(__value)) [[unlikely]]
+ return __formatter::__format_floating_point_non_finite(__ctx.out(), __specs, __negative, std::isnan(__value));
// Depending on the std-format-spec string the sign and the value
// might not be outputted together:
@@ -672,7 +672,7 @@ __format_floating_point(_Tp __value, _FormatContext& __ctx, __format_spec::__par
// When there is an exponent the point needs to be moved before the
// exponent. When there's no exponent the rotate does nothing. Since
// rotate tests whether the operation is a nop, call it unconditionally.
- _VSTD::rotate(__result.__exponent, __result.__last - 1, __result.__last);
+ std::rotate(__result.__exponent, __result.__last - 1, __result.__last);
__result.__radix_point = __result.__exponent;
// The radix point is always placed before the exponent.
@@ -697,7 +697,7 @@ __format_floating_point(_Tp __value, _FormatContext& __ctx, __format_spec::__par
// Let P equal the precision if nonzero, 6 if the precision is not
// specified, or 1 if the precision is 0. Then, if a conversion with
// style E would have an exponent of X:
- int __p = _VSTD::max(1, (__specs.__has_precision() ? __specs.__precision_ : 6));
+ int __p = std::max(1, (__specs.__has_precision() ? __specs.__precision_ : 6));
if (__result.__exponent == __result.__last)
// if P > X >= -4, the conversion is with style f or F and precision P - 1 - X.
// By including the radix point it calculates P - (1 + X)
@@ -749,9 +749,9 @@ __format_floating_point(_Tp __value, _FormatContext& __ctx, __format_spec::__par
if (__num_trailing_zeros)
return __formatter::__write_using_trailing_zeros(
- __first, __result.__last, _VSTD::move(__out_it), __specs, __size, __result.__exponent, __num_trailing_zeros);
+ __first, __result.__last, std::move(__out_it), __specs, __size, __result.__exponent, __num_trailing_zeros);
- return __formatter::__write(__first, __result.__last, _VSTD::move(__out_it), __specs, __size);
+ return __formatter::__write(__first, __result.__last, std::move(__out_it), __specs, __size);
}
} // namespace __formatter
diff --git a/contrib/llvm-project/libcxx/include/__format/formatter_integral.h b/contrib/llvm-project/libcxx/include/__format/formatter_integral.h
index 54246aa02718..598decb0a95e 100644
--- a/contrib/llvm-project/libcxx/include/__format/formatter_integral.h
+++ b/contrib/llvm-project/libcxx/include/__format/formatter_integral.h
@@ -141,7 +141,7 @@ _LIBCPP_HIDE_FROM_ABI auto __format_char(
}
const auto __c = static_cast<_CharT>(__value);
- return __formatter::__write(_VSTD::addressof(__c), _VSTD::addressof(__c) + 1, _VSTD::move(__out_it), __specs);
+ return __formatter::__write(std::addressof(__c), std::addressof(__c) + 1, std::move(__out_it), __specs);
}
//
@@ -153,7 +153,7 @@ template <integral _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, int __base) {
// TODO FMT Evaluate code overhead due to not calling the internal function
// directly. (Should be zero overhead.)
- to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __base);
+ to_chars_result __r = std::to_chars(__first, __last, __value, __base);
_LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
@@ -214,22 +214,22 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, c
__padding_size_result __padding = {0, 0};
if (__specs.__alignment_ == __format_spec::__alignment::__zero_padding) {
// Write [sign][prefix].
- __out_it = __formatter::__copy(__begin, __first, _VSTD::move(__out_it));
+ __out_it = __formatter::__copy(__begin, __first, std::move(__out_it));
if (__specs.__width_ > __size) {
// Write zero padding.
__padding.__before_ = __specs.__width_ - __size;
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __specs.__width_ - __size, _CharT('0'));
+ __out_it = __formatter::__fill(std::move(__out_it), __specs.__width_ - __size, _CharT('0'));
}
} else {
if (__specs.__width_ > __size) {
// Determine padding and write padding.
__padding = __formatter::__padding_size(__size, __specs.__width_, __specs.__alignment_);
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
+ __out_it = __formatter::__fill(std::move(__out_it), __padding.__before_, __specs.__fill_);
}
// Write [sign][prefix].
- __out_it = __formatter::__copy(__begin, __first, _VSTD::move(__out_it));
+ __out_it = __formatter::__copy(__begin, __first, std::move(__out_it));
}
auto __r = __grouping.rbegin();
@@ -250,10 +250,10 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, c
while (true) {
if (__specs.__std_.__type_ == __format_spec::__type::__hexadecimal_upper_case) {
__last = __first + *__r;
- __out_it = __formatter::__transform(__first, __last, _VSTD::move(__out_it), __hex_to_upper);
+ __out_it = __formatter::__transform(__first, __last, std::move(__out_it), __hex_to_upper);
__first = __last;
} else {
- __out_it = __formatter::__copy(__first, *__r, _VSTD::move(__out_it));
+ __out_it = __formatter::__copy(__first, *__r, std::move(__out_it));
__first += *__r;
}
@@ -264,7 +264,7 @@ _LIBCPP_HIDE_FROM_ABI _OutIt __write_using_decimal_separators(_OutIt __out_it, c
*__out_it++ = __sep;
}
- return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+ return __formatter::__fill(std::move(__out_it), __padding.__after_, __specs.__fill_);
}
@@ -315,12 +315,12 @@ _LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator __format_integer(
// The zero padding is done like:
// - Write [sign][prefix]
// - Write data right aligned with '0' as fill character.
- __out_it = __formatter::__copy(__begin, __first, _VSTD::move(__out_it));
+ __out_it = __formatter::__copy(__begin, __first, std::move(__out_it));
__specs.__alignment_ = __format_spec::__alignment::__right;
__specs.__fill_.__data[0] = _CharT('0');
int32_t __size = __first - __begin;
- __specs.__width_ -= _VSTD::min(__size, __specs.__width_);
+ __specs.__width_ -= std::min(__size, __specs.__width_);
}
if (__specs.__std_.__type_ != __format_spec::__type::__hexadecimal_upper_case) [[likely]]
diff --git a/contrib/llvm-project/libcxx/include/__format/formatter_output.h b/contrib/llvm-project/libcxx/include/__format/formatter_output.h
index 072305b6dbca..2909fcd9baf1 100644
--- a/contrib/llvm-project/libcxx/include/__format/formatter_output.h
+++ b/contrib/llvm-project/libcxx/include/__format/formatter_output.h
@@ -98,15 +98,15 @@ __padding_size(size_t __size, size_t __width, __format_spec::__alignment __align
template <__fmt_char_type _CharT, __fmt_char_type _OutCharT = _CharT>
_LIBCPP_HIDE_FROM_ABI auto __copy(basic_string_view<_CharT> __str, output_iterator<const _OutCharT&> auto __out_it)
-> decltype(__out_it) {
- if constexpr (_VSTD::same_as<decltype(__out_it), _VSTD::back_insert_iterator<__format::__output_buffer<_OutCharT>>>) {
+ if constexpr (std::same_as<decltype(__out_it), std::back_insert_iterator<__format::__output_buffer<_OutCharT>>>) {
__out_it.__get_container()->__copy(__str);
return __out_it;
- } else if constexpr (_VSTD::same_as<decltype(__out_it),
+ } else if constexpr (std::same_as<decltype(__out_it),
typename __format::__retarget_buffer<_OutCharT>::__iterator>) {
__out_it.__buffer_->__copy(__str);
return __out_it;
} else {
- return std::ranges::copy(__str, _VSTD::move(__out_it)).out;
+ return std::ranges::copy(__str, std::move(__out_it)).out;
}
}
@@ -114,13 +114,13 @@ template <__fmt_char_type _CharT, __fmt_char_type _OutCharT = _CharT>
_LIBCPP_HIDE_FROM_ABI auto
__copy(const _CharT* __first, const _CharT* __last, output_iterator<const _OutCharT&> auto __out_it)
-> decltype(__out_it) {
- return __formatter::__copy(basic_string_view{__first, __last}, _VSTD::move(__out_it));
+ return __formatter::__copy(basic_string_view{__first, __last}, std::move(__out_it));
}
template <__fmt_char_type _CharT, __fmt_char_type _OutCharT = _CharT>
_LIBCPP_HIDE_FROM_ABI auto __copy(const _CharT* __first, size_t __n, output_iterator<const _OutCharT&> auto __out_it)
-> decltype(__out_it) {
- return __formatter::__copy(basic_string_view{__first, __n}, _VSTD::move(__out_it));
+ return __formatter::__copy(basic_string_view{__first, __n}, std::move(__out_it));
}
/// Transform wrapper.
@@ -132,15 +132,15 @@ __transform(const _CharT* __first,
const _CharT* __last,
output_iterator<const _OutCharT&> auto __out_it,
_UnaryOperation __operation) -> decltype(__out_it) {
- if constexpr (_VSTD::same_as<decltype(__out_it), _VSTD::back_insert_iterator<__format::__output_buffer<_OutCharT>>>) {
- __out_it.__get_container()->__transform(__first, __last, _VSTD::move(__operation));
+ if constexpr (std::same_as<decltype(__out_it), std::back_insert_iterator<__format::__output_buffer<_OutCharT>>>) {
+ __out_it.__get_container()->__transform(__first, __last, std::move(__operation));
return __out_it;
- } else if constexpr (_VSTD::same_as<decltype(__out_it),
+ } else if constexpr (std::same_as<decltype(__out_it),
typename __format::__retarget_buffer<_OutCharT>::__iterator>) {
- __out_it.__buffer_->__transform(__first, __last, _VSTD::move(__operation));
+ __out_it.__buffer_->__transform(__first, __last, std::move(__operation));
return __out_it;
} else {
- return std::ranges::transform(__first, __last, _VSTD::move(__out_it), __operation).out;
+ return std::ranges::transform(__first, __last, std::move(__out_it), __operation).out;
}
}
@@ -149,14 +149,14 @@ __transform(const _CharT* __first,
/// This uses a "mass output function" of __format::__output_buffer when possible.
template <__fmt_char_type _CharT, output_iterator<const _CharT&> _OutIt>
_LIBCPP_HIDE_FROM_ABI _OutIt __fill(_OutIt __out_it, size_t __n, _CharT __value) {
- if constexpr (_VSTD::same_as<decltype(__out_it), _VSTD::back_insert_iterator<__format::__output_buffer<_CharT>>>) {
+ if constexpr (std::same_as<decltype(__out_it), std::back_insert_iterator<__format::__output_buffer<_CharT>>>) {
__out_it.__get_container()->__fill(__n, __value);
return __out_it;
- } else if constexpr (_VSTD::same_as<decltype(__out_it), typename __format::__retarget_buffer<_CharT>::__iterator>) {
+ } else if constexpr (std::same_as<decltype(__out_it), typename __format::__retarget_buffer<_CharT>::__iterator>) {
__out_it.__buffer_->__fill(__n, __value);
return __out_it;
} else {
- return std::ranges::fill_n(_VSTD::move(__out_it), __n, __value);
+ return std::ranges::fill_n(std::move(__out_it), __n, __value);
}
}
@@ -228,12 +228,12 @@ __write(basic_string_view<_CharT> __str,
__format_spec::__parsed_specifications<_ParserCharT> __specs,
ptrdiff_t __size) -> decltype(__out_it) {
if (__size >= __specs.__width_)
- return __formatter::__copy(__str, _VSTD::move(__out_it));
+ return __formatter::__copy(__str, std::move(__out_it));
__padding_size_result __padding = __formatter::__padding_size(__size, __specs.__width_, __specs.__std_.__alignment_);
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
- __out_it = __formatter::__copy(__str, _VSTD::move(__out_it));
- return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+ __out_it = __formatter::__fill(std::move(__out_it), __padding.__before_, __specs.__fill_);
+ __out_it = __formatter::__copy(__str, std::move(__out_it));
+ return __formatter::__fill(std::move(__out_it), __padding.__after_, __specs.__fill_);
}
template <contiguous_iterator _Iterator, class _ParserCharT>
@@ -244,7 +244,7 @@ __write(_Iterator __first,
__format_spec::__parsed_specifications<_ParserCharT> __specs,
ptrdiff_t __size) -> decltype(__out_it) {
_LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
- return __formatter::__write(basic_string_view{__first, __last}, _VSTD::move(__out_it), __specs, __size);
+ return __formatter::__write(basic_string_view{__first, __last}, std::move(__out_it), __specs, __size);
}
/// \overload
@@ -257,7 +257,7 @@ __write(_Iterator __first,
output_iterator<const iter_value_t<_Iterator>&> auto __out_it,
__format_spec::__parsed_specifications<_ParserCharT> __specs) -> decltype(__out_it) {
_LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
- return __formatter::__write(__first, __last, _VSTD::move(__out_it), __specs, __last - __first);
+ return __formatter::__write(__first, __last, std::move(__out_it), __specs, __last - __first);
}
template <class _CharT, class _ParserCharT, class _UnaryOperation>
@@ -269,12 +269,12 @@ _LIBCPP_HIDE_FROM_ABI auto __write_transformed(const _CharT* __first, const _Cha
ptrdiff_t __size = __last - __first;
if (__size >= __specs.__width_)
- return __formatter::__transform(__first, __last, _VSTD::move(__out_it), __op);
+ return __formatter::__transform(__first, __last, std::move(__out_it), __op);
__padding_size_result __padding = __formatter::__padding_size(__size, __specs.__width_, __specs.__alignment_);
- __out_it = __formatter::__fill(_VSTD::move(__out_it), __padding.__before_, __specs.__fill_);
- __out_it = __formatter::__transform(__first, __last, _VSTD::move(__out_it), __op);
- return __formatter::__fill(_VSTD::move(__out_it), __padding.__after_, __specs.__fill_);
+ __out_it = __formatter::__fill(std::move(__out_it), __padding.__before_, __specs.__fill_);
+ __out_it = __formatter::__transform(__first, __last, std::move(__out_it), __op);
+ return __formatter::__fill(std::move(__out_it), __padding.__after_, __specs.__fill_);
}
/// Writes a string using format's width estimation algorithm.
@@ -292,7 +292,7 @@ _LIBCPP_HIDE_FROM_ABI auto __write_string_no_precision(
// No padding -> copy the string
if (!__specs.__has_width())
- return __formatter::__copy(__str, _VSTD::move(__out_it));
+ return __formatter::__copy(__str, std::move(__out_it));
// Note when the estimated width is larger than size there's no padding. So
// there's no reason to get the real size when the estimate is larger than or
@@ -300,7 +300,7 @@ _LIBCPP_HIDE_FROM_ABI auto __write_string_no_precision(
size_t __size =
__format_spec::__estimate_column_width(__str, __specs.__width_, __format_spec::__column_width_rounding::__up)
.__width_;
- return __formatter::__write(__str, _VSTD::move(__out_it), __specs, __size);
+ return __formatter::__write(__str, std::move(__out_it), __specs, __size);
}
template <class _CharT>
diff --git a/contrib/llvm-project/libcxx/include/__format/parser_std_format_spec.h b/contrib/llvm-project/libcxx/include/__format/parser_std_format_spec.h
index c01e5866a431..ea5dfdf30511 100644
--- a/contrib/llvm-project/libcxx/include/__format/parser_std_format_spec.h
+++ b/contrib/llvm-project/libcxx/include/__format/parser_std_format_spec.h
@@ -92,7 +92,7 @@ __substitute_arg_id(basic_format_arg<_Context> __format_arg) {
// This means the 128-bit will not be valid anymore.
// TODO FMT Verify this resolution is accepted and add a test to verify
// 128-bit integrals fail and switch to visit_format_arg.
- return _VSTD::__visit_format_arg(
+ return std::__visit_format_arg(
[](auto __arg) -> uint32_t {
using _Type = decltype(__arg);
if constexpr (same_as<_Type, monostate>)
@@ -176,7 +176,7 @@ inline constexpr __fields __fields_range{.__use_range_fill_ = true, .__clear_bra
inline constexpr __fields __fields_fill_align_width{};
# endif
-enum class _LIBCPP_ENUM_VIS __alignment : uint8_t {
+enum class __alignment : uint8_t {
/// No alignment is set in the format string.
__default,
__left,
@@ -185,7 +185,7 @@ enum class _LIBCPP_ENUM_VIS __alignment : uint8_t {
__zero_padding
};
-enum class _LIBCPP_ENUM_VIS __sign : uint8_t {
+enum class __sign : uint8_t {
/// No sign is set in the format string.
///
/// The sign isn't allowed for certain format-types. By using this value
@@ -197,7 +197,7 @@ enum class _LIBCPP_ENUM_VIS __sign : uint8_t {
__space
};
-enum class _LIBCPP_ENUM_VIS __type : uint8_t {
+enum class __type : uint8_t {
__default = 0,
__string,
__binary_lower_case,
@@ -1158,7 +1158,7 @@ __estimate_column_width(basic_string_view<_CharT> __str, size_t __maximum, __col
// When Unicode isn't supported assume ASCII and every code unit is one code
// point. In ASCII the estimated column width is always one. Thus there's no
// need for rounding.
- size_t __width_ = _VSTD::min(__str.size(), __maximum);
+ size_t __width_ = std::min(__str.size(), __maximum);
return {__width_, __str.begin() + __width_};
}
diff --git a/contrib/llvm-project/libcxx/include/__format/range_default_formatter.h b/contrib/llvm-project/libcxx/include/__format/range_default_formatter.h
index bcab5d6afdd3..b35223ae9332 100644
--- a/contrib/llvm-project/libcxx/include/__format/range_default_formatter.h
+++ b/contrib/llvm-project/libcxx/include/__format/range_default_formatter.h
@@ -24,6 +24,7 @@
#include <__iterator/back_insert_iterator.h>
#include <__ranges/concepts.h>
#include <__ranges/data.h>
+#include <__ranges/from_range.h>
#include <__ranges/size.h>
#include <__type_traits/conditional.h>
#include <__type_traits/remove_cvref.h>
@@ -197,15 +198,8 @@ public:
// specialization is the "basic" string formatter in libc++.
if constexpr (ranges::contiguous_range<_Rp> && std::ranges::sized_range<_Rp>)
return __underlying_.format(basic_string_view<_CharT>{ranges::data(__range), ranges::size(__range)}, __ctx);
- else {
- // P2106's from_range has not been implemented yet. Instead use a simple
- // copy operation.
- // TODO FMT use basic_string's "from_range" constructor.
- // return __underlying_.format(basic_string<_CharT>{from_range, __range}, __ctx);
- basic_string<_CharT> __str;
- std::ranges::copy(__range, back_insert_iterator{__str});
- return __underlying_.format(static_cast<basic_string_view<_CharT>>(__str), __ctx);
- }
+ else
+ return __underlying_.format(basic_string<_CharT>{from_range, __range}, __ctx);
}
};
diff --git a/contrib/llvm-project/libcxx/include/__format/range_formatter.h b/contrib/llvm-project/libcxx/include/__format/range_formatter.h
index 27870972c9d5..d13278009fcf 100644
--- a/contrib/llvm-project/libcxx/include/__format/range_formatter.h
+++ b/contrib/llvm-project/libcxx/include/__format/range_formatter.h
@@ -28,6 +28,7 @@
#include <__iterator/back_insert_iterator.h>
#include <__ranges/concepts.h>
#include <__ranges/data.h>
+#include <__ranges/from_range.h>
#include <__ranges/size.h>
#include <__type_traits/remove_cvref.h>
#include <string_view>
@@ -184,13 +185,7 @@ struct _LIBCPP_TEMPLATE_VIS range_formatter {
std::formatter<basic_string<_CharT>, _CharT> __formatter;
if (__debug_format)
__formatter.set_debug_format();
- // P2106's from_range has not been implemented yet. Instead use a simple
- // copy operation.
- // TODO FMT use basic_string's "from_range" constructor.
- // return std::formatter<basic_string<_CharT>, _CharT>{}.format(basic_string<_CharT>{from_range, __range}, __ctx);
- basic_string<_CharT> __str;
- ranges::copy(__range, back_insert_iterator{__str});
- return __formatter.format(__str, __ctx);
+ return __formatter.format(basic_string<_CharT>{from_range, __range}, __ctx);
}
}
diff --git a/contrib/llvm-project/libcxx/include/__format/write_escaped.h b/contrib/llvm-project/libcxx/include/__format/write_escaped.h
index 8c51d0b1f148..51bae3cb238f 100644
--- a/contrib/llvm-project/libcxx/include/__format/write_escaped.h
+++ b/contrib/llvm-project/libcxx/include/__format/write_escaped.h
@@ -47,11 +47,11 @@ _LIBCPP_HIDE_FROM_ABI auto __write_string(
output_iterator<const _CharT&> auto __out_it,
__format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
if (!__specs.__has_precision())
- return __formatter::__write_string_no_precision(__str, _VSTD::move(__out_it), __specs);
+ return __formatter::__write_string_no_precision(__str, std::move(__out_it), __specs);
int __size = __formatter::__truncate(__str, __specs.__precision_);
- return __formatter::__write(__str.begin(), __str.end(), _VSTD::move(__out_it), __specs, __size);
+ return __formatter::__write(__str.begin(), __str.end(), std::move(__out_it), __specs, __size);
}
# endif // _LIBCPP_STD_VER >= 20
@@ -118,7 +118,7 @@ template <class _CharT>
return static_cast<make_unsigned_t<_CharT>>(__value);
}
-enum class _LIBCPP_ENUM_VIS __escape_quotation_mark { __apostrophe, __double_quote };
+enum class __escape_quotation_mark { __apostrophe, __double_quote };
// [format.string.escaped]/2
template <class _CharT>
@@ -198,7 +198,7 @@ __format_escaped_char(_CharT __value,
__str += _CharT('\'');
__formatter::__escape(__str, basic_string_view{std::addressof(__value), 1}, __escape_quotation_mark::__apostrophe);
__str += _CharT('\'');
- return __formatter::__write(__str.data(), __str.data() + __str.size(), _VSTD::move(__out_it), __specs, __str.size());
+ return __formatter::__write(__str.data(), __str.data() + __str.size(), std::move(__out_it), __specs, __str.size());
}
template <class _CharT>
@@ -210,7 +210,7 @@ __format_escaped_string(basic_string_view<_CharT> __values,
__str += _CharT('"');
__formatter::__escape(__str, __values, __escape_quotation_mark::__double_quote);
__str += _CharT('"');
- return __formatter::__write_string(basic_string_view{__str}, _VSTD::move(__out_it), __specs);
+ return __formatter::__write_string(basic_string_view{__str}, std::move(__out_it), __specs);
}
# endif // _LIBCPP_STD_VER >= 23