30#ifndef _GLIBCXX_UNICODE_H
31#define _GLIBCXX_UNICODE_H 1
33#if __cplusplus >= 202002L
42namespace std _GLIBCXX_VISIBILITY(default)
44_GLIBCXX_BEGIN_NAMESPACE_VERSION
49 __is_scalar_value(
char32_t __c)
51 if (__c < 0xD800) [[likely]]
53 return 0xDFFF < __c && __c <= 0x10FFFF;
57 template<
typename _CharT>
59 __is_single_code_unit(
char32_t __c)
64 return __c < __gnu_cxx::__int_traits<_CharT>::__max
65 && __is_scalar_value(__c);
73 operator()() const noexcept
77 struct _Null_sentinel_t
79 template<input_iterator _It>
80 requires default_initializable<iter_value_t<_It>>
81 && equality_comparable_with<iter_reference_t<_It>, iter_value_t<_It>>
83 operator==(_It __it, _Null_sentinel_t)
84 {
return *__it == iter_value_t<_It>{}; }
87 template<
typename _FromFmt,
typename _ToFmt,
88 input_iterator _Iter, sentinel_for<_Iter> _Sent = _Iter,
89 typename _ErrorHandler = _Repl>
90 requires convertible_to<iter_value_t<_Iter>, _FromFmt>
93 static_assert(forward_iterator<_Iter> ||
noexcept(_ErrorHandler()()));
96 using value_type = _ToFmt;
97 using difference_type = iter_difference_t<_Iter>;
98 using reference = value_type;
99 using iterator_concept
100 = std::__detail::__clamp_iter_cat<__iter_category_t<_Iter>,
101 bidirectional_iterator_tag>;
103 constexpr _Utf_iterator() =
default;
106 _Utf_iterator(_Iter __first, _Iter __it, _Sent __last)
107 requires bidirectional_iterator<_Iter>
108 : _M_first_and_curr{__first, __it}, _M_last(__last)
110 if (_M_curr() != _M_last)
117 _Utf_iterator(_Iter __it, _Sent __last)
118 requires (!bidirectional_iterator<_Iter>)
119 : _M_first_and_curr{__it}, _M_last(__last)
121 if (_M_curr() != _M_last)
127 template<
class _Iter2,
class _Sent2>
128 requires convertible_to<_Iter2, _Iter> && convertible_to<_Sent2, _Sent>
130 _Utf_iterator(
const _Utf_iterator<_FromFmt, _ToFmt, _Iter2, _Sent2,
131 _ErrorHandler>& __other)
132 : _M_buf(__other._M_buf), _M_first_and_curr(__other._M_first_and_curr),
133 _M_buf_index(__other._M_buf_index), _M_buf_last(__other._M_buf_last),
134 _M_last(__other._M_last)
139 begin() const requires bidirectional_iterator<_Iter>
140 {
return _M_first(); }
144 end()
const {
return _M_last; }
148 base() const requires forward_iterator<_Iter>
149 {
return _M_curr(); }
153 operator*()
const {
return _M_buf[_M_buf_index]; }
155 constexpr _Utf_iterator&
158 if (_M_buf_index + 1 == _M_buf_last && _M_curr() != _M_last)
160 if constexpr (forward_iterator<_Iter>)
162 if (_M_curr() == _M_last)
167 else if (_M_buf_index + 1 < _M_buf_last)
172 constexpr _Utf_iterator
180 constexpr _Utf_iterator&
181 operator--()
requires bidirectional_iterator<_Iter>
183 if (!_M_buf_index && _M_curr() != _M_first())
185 else if (_M_buf_index)
190 constexpr _Utf_iterator
199 friend constexpr bool
200 operator==(_Utf_iterator __lhs, _Utf_iterator __rhs)
201 requires forward_iterator<_Iter> ||
requires (_Iter __i) { __i != __i; }
203 if constexpr (forward_iterator<_Iter>)
204 return __lhs._M_curr() == __rhs._M_curr()
205 && __lhs._M_buf_index == __rhs._M_buf_index;
206 else if (__lhs._M_curr() != __rhs._M_curr())
208 else if (__lhs._M_buf_index == __rhs._M_buf_index
209 && __lhs._M_buf_last == __rhs._M_buf_last)
212 return __lhs._M_buf_index == __lhs._M_buf_last
213 && __rhs._M_buf_index == __rhs._M_buf_last;
217 friend constexpr bool
218 operator==(_Utf_iterator __lhs, _Sent __rhs)
220 if constexpr (forward_iterator<_Iter>)
221 return __lhs._M_curr() == __rhs;
223 return __lhs._M_curr() == __rhs
224 && __lhs._M_buf_index == __lhs._M_buf_last;
231 if constexpr (
sizeof(_FromFmt) ==
sizeof(uint8_t))
233 else if constexpr (
sizeof(_FromFmt) ==
sizeof(uint16_t))
237 static_assert(
sizeof(_FromFmt) ==
sizeof(uint32_t));
248 _Guard(
void*, _Iter&) { }
251 template<
typename _It>
requires forward_iterator<_It>
254 constexpr ~_Guard() { _M_this->_M_curr() =
std::move(_M_orig); }
255 _Utf_iterator* _M_this;
262 _Guard<_Iter> __g{
this, _M_curr()};
264 uint8_t __u = *_M_curr()++;
265 const uint8_t __lo_bound = 0x80, __hi_bound = 0xBF;
266 uint8_t __to_incr = 1;
268 if (__u <= 0x7F) [[likely]]
270 else if (__u < 0xC2) [[unlikely]]
272 else if (_M_curr() == _M_last) [[unlikely]]
274 else if (__u <= 0xDF)
279 if (__u < __lo_bound || __u > __hi_bound) [[unlikely]]
283 __c = (__c << 6) | (__u & 0x3F);
288 else if (__u <= 0xEF)
290 const uint8_t __lo_bound_2 = __u == 0xE0 ? 0xA0 : __lo_bound;
291 const uint8_t __hi_bound_2 = __u == 0xED ? 0x9F : __hi_bound;
296 if (__u < __lo_bound_2 || __u > __hi_bound_2) [[unlikely]]
298 else if (++_M_curr() == _M_last) [[unlikely]]
303 __c = (__c << 6) | (__u & 0x3F);
306 if (__u < __lo_bound || __u > __hi_bound) [[unlikely]]
310 __c = (__c << 6) | (__u & 0x3F);
316 else if (__u <= 0xF4)
318 const uint8_t __lo_bound_2 = __u == 0xF0 ? 0x90 : __lo_bound;
319 const uint8_t __hi_bound_2 = __u == 0xF4 ? 0x8F : __hi_bound;
324 if (__u < __lo_bound_2 || __u > __hi_bound_2) [[unlikely]]
326 else if (++_M_curr() == _M_last) [[unlikely]]
331 __c = (__c << 6) | (__u & 0x3F);
334 if (__u < __lo_bound || __u > __hi_bound) [[unlikely]]
336 else if (++_M_curr() == _M_last) [[unlikely]]
341 __c = (__c << 6) | (__u & 0x3F);
344 if (__u < __lo_bound || __u > __hi_bound) [[unlikely]]
348 __c = (__c << 6) | (__u & 0x3F);
358 _M_update(__c, __to_incr);
364 _Guard<_Iter> __g{
this, _M_curr()};
366 uint16_t __u = *_M_curr()++;
367 uint8_t __to_incr = 1;
369 if (__u < 0xD800 || __u > 0xDFFF) [[likely]]
371 else if (__u < 0xDC00 && _M_curr() != _M_last)
373 uint16_t __u2 = *_M_curr();
374 if (__u2 < 0xDC00 || __u2 > 0xDFFF) [[unlikely]]
380 uint32_t __x = (__u & 0x3F) << 10 | __u2 & 0x3FF;
381 uint32_t __w = (__u >> 6) & 0x1F;
382 __c = (__w + 1) << 16 | __x;
388 _M_update(__c, __to_incr);
394 _Guard<_Iter> __g{
this, _M_curr()};
395 char32_t __c = *_M_curr()++;
396 if (!__is_scalar_value(__c)) [[unlikely]]
403 _M_update(
char32_t __c, uint8_t __to_incr)
405 _M_to_increment = __to_incr;
407 if constexpr (
sizeof(_ToFmt) ==
sizeof(uint32_t))
412 else if constexpr (
sizeof(_ToFmt) ==
sizeof(uint16_t))
414 if (__is_single_code_unit<_ToFmt>(__c))
423 const char32_t __lead_offset = 0xD800 - (0x10000 >> 10);
424 char16_t __lead = __lead_offset + (__c >> 10);
425 char16_t __trail = 0xDC00 + (__c & 0x3FF);
433 static_assert(
sizeof(_ToFmt) == 1);
434 int __bits = std::bit_width((uint32_t)__c);
435 if (__bits <= 7) [[likely]]
438 _M_buf[1] = _M_buf[2] = _M_buf[3] = 0;
441 else if (__bits <= 11)
443 _M_buf[0] = 0xC0 | (__c >> 6);
444 _M_buf[1] = 0x80 | (__c & 0x3F);
445 _M_buf[2] = _M_buf[3] = 0;
448 else if (__bits <= 16)
450 _M_buf[0] = 0xE0 | (__c >> 12);
451 _M_buf[1] = 0x80 | ((__c >> 6) & 0x3F);
452 _M_buf[2] = 0x80 | (__c & 0x3F);
458 _M_buf[0] = 0xF0 | ((__c >> 18) & 0x07);
459 _M_buf[1] = 0x80 | ((__c >> 12) & 0x3F);
460 _M_buf[2] = 0x80 | ((__c >> 6) & 0x3F);
461 _M_buf[3] = 0x80 | (__c & 0x3F);
470 char32_t __c = _ErrorHandler()();
471 __glibcxx_assert(__is_scalar_value(__c));
476 _M_first() const requires bidirectional_iterator<_Iter>
477 {
return _M_first_and_curr._M_first; }
480 _M_curr() {
return _M_first_and_curr._M_curr; }
483 _M_curr()
const {
return _M_first_and_curr._M_curr; }
485 array<value_type, 4 /
sizeof(_ToFmt)> _M_buf;
487 template<
typename _It>
488 struct _First_and_curr
490 _First_and_curr() =
default;
493 _First_and_curr(_It __curr) : _M_curr(__curr) { }
495 template<convertible_to<_It> _It2>
497 _First_and_curr(
const _First_and_curr<_It2>& __other)
498 : _M_curr(__other._M_curr) { }
503 template<
typename _It>
requires bidirectional_iterator<_It>
504 struct _First_and_curr<_It>
506 _First_and_curr() =
default;
509 _First_and_curr(_It __first, _It __curr)
510 : _M_first(__first), _M_curr(__curr) { }
512 template<convertible_to<_It> _It2>
514 _First_and_curr(
const _First_and_curr<_It2>& __other)
515 : _M_first(__other._M_first), _M_curr(__other._M_curr) { }
521 _First_and_curr<_Iter> _M_first_and_curr;
523 uint8_t _M_buf_index = 0;
524 uint8_t _M_buf_last = 0;
525 uint8_t _M_to_increment = 0;
527 [[no_unique_address]] _Sent _M_last;
529 template<
typename _FromFmt2,
typename _ToFmt2,
530 input_iterator _Iter2, sentinel_for<_Iter2> _Sent2,
531 typename _ErrHandler>
532 requires convertible_to<iter_value_t<_Iter2>, _FromFmt2>
533 friend class _Utf_iterator;
536 template<
typename _ToFormat, ranges::input_range _Range>
538 :
public ranges::view_interface<_Utf_view<_ToFormat, _Range>>
540 using _Iterator = _Utf_iterator<ranges::range_value_t<_Range>,
541 _ToFormat, ranges::iterator_t<_Range>,
542 ranges::sentinel_t<_Range>>;
544 template<
typename _Iter,
typename _Sent>
546 _M_begin(_Iter __first, _Sent __last)
548 if constexpr (bidirectional_iterator<_Iter>)
549 return _Iterator(__first, __first, __last);
551 return _Iterator(__first, __last);
554 template<
typename _Iter,
typename _Sent>
556 _M_end(_Iter __first, _Sent __last)
558 if constexpr (!is_same_v<_Iter, _Sent>)
560 else if constexpr (bidirectional_iterator<_Iter>)
561 return _Iterator(__first, __last, __last);
563 return _Iterator(__last, __last);
570 _Utf_view(_Range&& __r) : _M_base(
std::
forward<_Range>(__r)) { }
572 constexpr auto begin()
573 {
return _M_begin(ranges::begin(_M_base), ranges::end(_M_base)); }
576 {
return _M_end(ranges::begin(_M_base), ranges::end(_M_base)); }
578 constexpr bool empty()
const {
return ranges::empty(_M_base); }
581 template<
typename _View>
582 using _Utf8_view = _Utf_view<char8_t, _View>;
583 template<
typename _View>
584 using _Utf16_view = _Utf_view<char16_t, _View>;
585 template<
typename _View>
586 using _Utf32_view = _Utf_view<char32_t, _View>;
588inline namespace __v15_1_0
590#define _GLIBCXX_GET_UNICODE_DATA 150100
591#include "unicode-data.h"
592#ifdef _GLIBCXX_GET_UNICODE_DATA
593# error "Invalid unicode data"
598 __field_width(
char32_t __c)
noexcept
600 if (__c < __width_edges[0]) [[likely]]
603 auto* __p = std::upper_bound(__width_edges,
std::end(__width_edges), __c);
604 return (__p - __width_edges) % 2 + 1;
608 constexpr _Gcb_property
609 __grapheme_cluster_break_property(
char32_t __c)
noexcept
611 constexpr uint32_t __mask = (1 << __gcb_shift_bits) - 1;
612 auto* __end =
std::end(__gcb_edges);
613 auto* __p = std::lower_bound(__gcb_edges, __end,
614 (__c << __gcb_shift_bits) | __mask);
615 return _Gcb_property(__p[-1] & __mask);
619 __is_incb_linker(
char32_t __c)
noexcept
621 const auto __end =
std::end(__incb_linkers);
623 return std::find(__incb_linkers, __end, __c) != __end;
628 __incb_property(
char32_t __c)
noexcept
630 if ((__c << 2) < __incb_edges[0]) [[likely]]
633 constexpr uint32_t __mask = 0x3;
634 auto* __end =
std::end(__incb_edges);
635 auto* __p = std::lower_bound(__incb_edges, __end, (__c << 2) | __mask);
636 return _InCB(__p[-1] & __mask);
640 __is_extended_pictographic(
char32_t __c)
642 if (__c < __xpicto_edges[0]) [[likely]]
645 auto* __p = std::upper_bound(__xpicto_edges,
std::end(__xpicto_edges), __c);
646 return (__p - __xpicto_edges) % 2;
649 struct _Grapheme_cluster_iterator_base
652 _Gcb_property _M_prop;
653 enum class _XPicto :
unsigned char { _Init, _Zwj, _Matched, _Failed };
654 _XPicto _M_xpicto_seq_state = _XPicto::_Init;
655 unsigned char _M_RI_count = 0;
656 bool _M_incb_linker_seen =
false;
659 _M_reset(
char32_t __c, _Gcb_property __p)
663 _M_xpicto_seq_state = _XPicto::_Init;
665 _M_incb_linker_seen =
false;
669 _M_update_xpicto_seq_state(
char32_t __c, _Gcb_property __p)
671 if (_M_xpicto_seq_state == _XPicto::_Failed)
674 auto __next_state = _XPicto::_Failed;
675 if (_M_xpicto_seq_state != _XPicto::_Zwj)
677 if (__p == _Gcb_property::_Gcb_ZWJ)
679 if (_M_xpicto_seq_state == _XPicto::_Matched)
680 __next_state = _XPicto::_Zwj;
683 else if (__is_extended_pictographic(_M_c))
684 __next_state = _XPicto::_Zwj;
686 else if (__p == _Gcb_property::_Gcb_Extend)
687 __next_state = _M_xpicto_seq_state;
693 if (__p == _Gcb_property::_Gcb_Other
694 && __is_extended_pictographic(__c))
695 __next_state = _XPicto::_Matched;
697 _M_xpicto_seq_state = __next_state;
701 _M_update_ri_count(_Gcb_property __p)
703 if (__p == _Gcb_property::_Gcb_Regional_Indicator)
710 _M_update_incb_state(
char32_t __c, _Gcb_property)
712 if (__is_incb_linker(__c))
713 _M_incb_linker_seen =
true;
718 template<ranges::forward_range _View>
requires ranges::view<_View>
719 class _Grapheme_cluster_view
720 :
public ranges::view_interface<_Grapheme_cluster_view<_View>>
725 _Grapheme_cluster_view(_View __v)
729 constexpr auto begin()
const {
return _M_begin; }
730 constexpr auto end()
const {
return _M_begin.end(); }
733 struct _Iterator :
private _Grapheme_cluster_iterator_base
737 using _U32_iterator = ranges::iterator_t<_Utf32_view<_View>>;
745 using value_type = char32_t;
746 using iterator_concept = forward_iterator_tag;
747 using difference_type = ptrdiff_t;
750 _Iterator(_U32_iterator __i)
753 if (__i != __i.end())
756 _M_prop = __grapheme_cluster_break_property(_M_c);
773 const auto __end = _M_base.end();
774 if (_M_base != __end)
776 auto __p_prev = _M_prop;
778 while (++__it != __end)
780 char32_t __c = *__it;
781 auto __p = __grapheme_cluster_break_property(*__it);
782 _M_update_xpicto_seq_state(__c, __p);
783 _M_update_ri_count(__p);
784 _M_update_incb_state(__c, __p);
785 if (_M_is_break(__p_prev, __p, __it))
807 operator==(
const _Iterator& __i)
const
808 {
return _M_base == __i._M_base; }
812 operator==(
const ranges::sentinel_t<_View>& __i)
const
813 {
return _M_base == __i; }
816 constexpr auto base()
const {
return _M_base.base(); }
819 constexpr auto end()
const {
return _M_base.end(); }
823 width() const noexcept
824 {
return __field_width(_M_c); }
827 _U32_iterator _M_base;
835 _M_is_break(_Gcb_property __p1, _Gcb_property __p2,
836 _U32_iterator __curr)
const
838 using enum _Gcb_property;
840 if (__p1 == _Gcb_Control || __p1 == _Gcb_LF)
844 return __p2 != _Gcb_LF;
847 if (__p2 == _Gcb_Control || __p2 == _Gcb_CR || __p2 == _Gcb_LF)
864 if (__p1 == _Gcb_LV || __p1 == _Gcb_V)
875 if (__p1 == _Gcb_LVT || __p1 == _Gcb_T)
876 return __p2 != _Gcb_T;
879 if (__p2 == _Gcb_Extend || __p2 == _Gcb_ZWJ)
886 if (__p2 == _Gcb_SpacingMark)
889 if (__p1 == _Gcb_Prepend)
895 if (_M_incb_linker_seen
896 && __incb_property(_M_c) == _InCB::_Consonant
897 && __incb_property(*__curr) == _InCB::_Consonant)
901 bool __have_linker =
false;
903 while (++__it != __curr)
905 if (__is_incb_linker(*__it))
906 __have_linker =
true;
909 auto __incb = __incb_property(*__it);
910 if (__incb == _InCB::_Consonant)
911 __have_linker =
false;
912 else if (__incb != _InCB::_Extend)
916 if (__it == __curr && __have_linker)
923 if (__p1 == _Gcb_ZWJ && _M_xpicto_seq_state == _XPicto::_Matched)
930 if (__p1 == _Gcb_property::_Gcb_Regional_Indicator && __p1 == __p2)
931 return (_M_RI_count & 1) == 0;
944 template<
typename _CharT>
946 __field_width(basic_string_view<_CharT> __s)
948 if (__s.empty()) [[unlikely]]
950 _Grapheme_cluster_view<basic_string_view<_CharT>> __gc(__s);
951 auto __it = __gc.begin();
952 const auto __end = __gc.end();
953 size_t __n = __it.width();
954 while (++__it != __end)
961 template<
typename _CharT>
963 __truncate(basic_string_view<_CharT>& __s,
size_t __max)
965 if (__s.empty()) [[unlikely]]
968 _Grapheme_cluster_view<basic_string_view<_CharT>> __gc(__s);
969 auto __it = __gc.begin();
970 const auto __end = __gc.end();
971 size_t __n = __it.width();
977 while (++__it != __end)
979 size_t __n2 = __n + __it.width();
982 __s = basic_string_view<_CharT>(__s.begin(), __it.base());
990 template<
typename _CharT>
992 __literal_encoding_is_unicode()
994 if constexpr (is_same_v<_CharT, char8_t>)
996 else if constexpr (is_same_v<_CharT, char16_t>)
998 else if constexpr (is_same_v<_CharT, char32_t>)
1001 const char* __enc =
"";
1003#ifdef __GNUC_EXECUTION_CHARSET_NAME
1004 auto __remove_iso10646_prefix = [](
const char* __s) {
1006 if (__s[0] ==
'I' || __s[0] ==
'i')
1007 if (__s[1] ==
'S' || __s[1] ==
's')
1008 if (__s[2] ==
'O' || __s[2] ==
'o')
1009 if (string_view(__s + 3).starts_with(
"-10646/"))
1014 if constexpr (is_same_v<_CharT, char>)
1015 __enc = __remove_iso10646_prefix(__GNUC_EXECUTION_CHARSET_NAME);
1016# if defined _GLIBCXX_USE_WCHAR_T && defined __GNUC_WIDE_EXECUTION_CHARSET_NAME
1018 __enc = __remove_iso10646_prefix(__GNUC_WIDE_EXECUTION_CHARSET_NAME);
1021 if ((__enc[0] ==
'U' || __enc[0] ==
'u')
1022 && (__enc[1] ==
'T' || __enc[1] ==
't')
1023 && (__enc[2] ==
'F' || __enc[2] ==
'f'))
1026 if (__enc[0] ==
'-')
1028 if (__enc[0] ==
'8')
1029 return __enc[1] ==
'\0' || string_view(__enc + 1) ==
"//";
1030 else if constexpr (!is_same_v<_CharT, char>)
1032 string_view __s(__enc);
1033 if (__s.ends_with(
"//"))
1034 __s.remove_suffix(2);
1035 return __s ==
"16" || __s ==
"32";
1038#elif defined __clang_literal_encoding__
1039 if constexpr (is_same_v<_CharT, char>)
1040 __enc = __clang_literal_encoding__;
1041# if defined _GLIBCXX_USE_WCHAR_T && defined __clang_wide_literal_encoding__
1043 __enc = __clang_wide_literal_encoding__;
1046 string_view __s(__enc);
1049 else if constexpr (!is_same_v<_CharT, char>)
1050 return __s ==
"UTF-16" || __s ==
"UTF-32";
1057 __literal_encoding_is_utf8()
1058 {
return __literal_encoding_is_unicode<char>(); }
1061 __literal_encoding_is_extended_ascii()
1063 return '0' == 0x30 &&
'A' == 0x41 &&
'Z' == 0x5a
1064 &&
'a' == 0x61 &&
'z' == 0x7a;
1069 __charset_alias_match(string_view __a, string_view __b)
1072 auto __map = [](
char __c,
bool& __num) ->
unsigned char {
1073 if (__c ==
'0') [[unlikely]]
1074 return __num ? 0 : 127;
1075 const auto __v = __detail::__from_chars_alnum_to_val(__c);
1080 auto __ptr_a = __a.begin(), __end_a = __a.end();
1081 auto __ptr_b = __b.begin(), __end_b = __b.end();
1082 bool __num_a =
false, __num_b =
false;
1087 unsigned char __val_a{}, __val_b{};
1088 while (__ptr_a != __end_a
1089 && (__val_a = __map(*__ptr_a, __num_a)) == 127)
1091 while (__ptr_b != __end_b
1092 && (__val_b = __map(*__ptr_b, __num_b)) == 127)
1095 if (__ptr_a == __end_a)
1096 return __ptr_b == __end_b;
1097 else if (__ptr_b == __end_b)
1099 else if (__val_a != __val_b)
1111 template<
typename _To,
typename _Range>
1112 inline constexpr bool
1113 enable_borrowed_range<std::__unicode::_Utf_view<_To, _Range>>
1114 = enable_borrowed_range<_Range>;
1116 template<
typename _Range>
1117 inline constexpr bool
1118 enable_borrowed_range<std::__unicode::_Grapheme_cluster_view<_Range>>
1119 = enable_borrowed_range<_Range>;
1122_GLIBCXX_END_NAMESPACE_VERSION
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
_Tp * end(valarray< _Tp > &__va) noexcept
Return an iterator pointing to one past the last element of the valarray.
_Tp * begin(valarray< _Tp > &__va) noexcept
Return an iterator pointing to the first element of the valarray.
ISO C++ entities toplevel namespace is std.
constexpr void advance(_InputIterator &__i, _Distance __n)
A generalization of pointer arithmetic.
__numeric_traits_integer< _Tp > __int_traits
Convenience alias for __numeric_traits<integer-type>.