30 #ifndef _GLIBCXX_EXPERIMENTAL_FS_PATH_H
31 #define _GLIBCXX_EXPERIMENTAL_FS_PATH_H 1
33 #if __cplusplus < 201103L
47 #if __cplusplus == 201402L
51 #if defined(_WIN32) && !defined(__CYGWIN__)
52 # define _GLIBCXX_FILESYSTEM_IS_WINDOWS 1
56 namespace std _GLIBCXX_VISIBILITY(default)
58 _GLIBCXX_BEGIN_NAMESPACE_VERSION
60 namespace experimental
66 _GLIBCXX_BEGIN_NAMESPACE_CXX11
68 #if __cplusplus == 201402L
69 using std::experimental::basic_string_view;
70 #elif __cplusplus > 201402L
71 using std::basic_string_view;
82 template<
typename _CharT>
85 template<
typename _Iter,
86 typename _Iter_traits = std::iterator_traits<_Iter>>
87 using __is_path_iter_src
88 = __and_<__is_encoded_char<typename _Iter_traits::value_type>,
90 typename _Iter_traits::iterator_category>>;
92 template<
typename _Iter>
93 static __is_path_iter_src<_Iter>
94 __is_path_src(_Iter,
int);
96 template<
typename _CharT,
typename _Traits,
typename _Alloc>
97 static __is_encoded_char<_CharT>
100 #if __cplusplus >= 201402L
101 template<
typename _CharT,
typename _Traits>
102 static __is_encoded_char<_CharT>
103 __is_path_src(
const basic_string_view<_CharT, _Traits>&,
int);
106 template<
typename _Unknown>
108 __is_path_src(
const _Unknown&, ...);
110 template<
typename _Tp1,
typename _Tp2>
111 struct __constructible_from;
113 template<
typename _Iter>
114 struct __constructible_from<_Iter, _Iter>
115 : __is_path_iter_src<_Iter>
118 template<
typename _Source>
119 struct __constructible_from<_Source, void>
120 : decltype(__is_path_src(std::declval<_Source>(), 0))
123 template<
typename _Tp1,
typename _Tp2 =
void>
124 using _Path =
typename
127 __not_<is_void<_Tp1>>,
128 __constructible_from<_Tp1, _Tp2>>::value,
131 template<
typename _Source>
133 _S_range_begin(_Source __begin) {
return __begin; }
135 struct __null_terminated { };
137 template<
typename _Source>
138 static __null_terminated
139 _S_range_end(_Source) {
return {}; }
141 template<
typename _CharT,
typename _Traits,
typename _Alloc>
144 {
return __str.
data(); }
146 template<
typename _CharT,
typename _Traits,
typename _Alloc>
149 {
return __str.
data() + __str.
size(); }
151 #if __cplusplus >= 201402L
152 template<
typename _CharT,
typename _Traits>
154 _S_range_begin(
const basic_string_view<_CharT, _Traits>& __str)
155 {
return __str.data(); }
157 template<
typename _CharT,
typename _Traits>
159 _S_range_end(
const basic_string_view<_CharT, _Traits>& __str)
160 {
return __str.data() + __str.size(); }
163 template<
typename _Tp,
164 typename _Iter = decltype(_S_range_begin(std::declval<_Tp>())),
165 typename _Val =
typename std::iterator_traits<_Iter>::value_type>
166 using __value_type_is_char
170 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
171 typedef wchar_t value_type;
172 static constexpr value_type preferred_separator = L
'\\';
174 typedef char value_type;
175 static constexpr value_type preferred_separator =
'/';
186 : _M_pathname(std::move(__p._M_pathname)), _M_type(__p._M_type)
193 : _M_pathname(std::move(__source))
194 { _M_split_cmpts(); }
196 template<
typename _Source,
197 typename _Require = _Path<_Source>>
198 path(_Source
const& __source)
199 : _M_pathname(_S_convert(_S_range_begin(__source),
200 _S_range_end(__source)))
201 { _M_split_cmpts(); }
203 template<
typename _InputIterator,
204 typename _Require = _Path<_InputIterator, _InputIterator>>
205 path(_InputIterator __first, _InputIterator __last)
206 : _M_pathname(_S_convert(__first, __last))
207 { _M_split_cmpts(); }
209 template<
typename _Source,
210 typename _Require = _Path<_Source>,
211 typename _Require2 = __value_type_is_char<_Source>>
212 path(_Source
const& __source,
const locale& __loc)
213 : _M_pathname(_S_convert_loc(_S_range_begin(__source),
214 _S_range_end(__source), __loc))
215 { _M_split_cmpts(); }
217 template<
typename _InputIterator,
218 typename _Require = _Path<_InputIterator, _InputIterator>,
219 typename _Require2 = __value_type_is_char<_InputIterator>>
220 path(_InputIterator __first, _InputIterator __last,
const locale& __loc)
221 : _M_pathname(_S_convert_loc(__first, __last, __loc))
222 { _M_split_cmpts(); }
228 path& operator=(
const path& __p) =
default;
229 path& operator=(path&& __p)
noexcept;
233 template<
typename _Source>
235 operator=(_Source
const& __source)
236 {
return *
this = path(__source); }
238 template<
typename _Source>
240 assign(_Source
const& __source)
241 {
return *
this = path(__source); }
243 template<
typename _InputIterator>
244 _Path<_InputIterator, _InputIterator>&
245 assign(_InputIterator __first, _InputIterator __last)
246 {
return *
this = path(__first, __last); }
250 path& operator/=(
const path& __p) {
return _M_append(__p._M_pathname); }
252 template <
class _Source>
254 operator/=(_Source
const& __source)
255 {
return append(__source); }
257 template<
typename _Source>
259 append(_Source
const& __source)
261 return _M_append(_S_convert(_S_range_begin(__source),
262 _S_range_end(__source)));
265 template<
typename _InputIterator>
266 _Path<_InputIterator, _InputIterator>&
267 append(_InputIterator __first, _InputIterator __last)
268 {
return _M_append(_S_convert(__first, __last)); }
272 path& operator+=(
const path& __x);
274 path& operator+=(
const value_type* __x);
275 path& operator+=(value_type __x);
276 #if __cplusplus >= 201402L
277 path& operator+=(basic_string_view<value_type> __x);
280 template<
typename _Source>
282 operator+=(_Source
const& __x) {
return concat(__x); }
284 template<
typename _CharT>
285 _Path<_CharT*, _CharT*>&
286 operator+=(_CharT __x);
288 template<
typename _Source>
290 concat(_Source
const& __x)
291 {
return *
this += _S_convert(_S_range_begin(__x), _S_range_end(__x)); }
293 template<
typename _InputIterator>
294 _Path<_InputIterator, _InputIterator>&
295 concat(_InputIterator __first, _InputIterator __last)
296 {
return *
this += _S_convert(__first, __last); }
300 void clear()
noexcept { _M_pathname.
clear(); _M_split_cmpts(); }
302 path& make_preferred();
303 path& remove_filename();
304 path& replace_filename(
const path& __replacement);
305 path& replace_extension(
const path& __replacement = path());
312 const value_type* c_str()
const noexcept {
return _M_pathname.
c_str(); }
313 operator string_type()
const {
return _M_pathname; }
315 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT>,
316 typename _Allocator = std::allocator<_CharT>>
318 string(
const _Allocator& __a = _Allocator())
const;
321 #if _GLIBCXX_USE_WCHAR_T
329 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT>,
330 typename _Allocator = std::allocator<_CharT>>
332 generic_string(
const _Allocator& __a = _Allocator())
const;
335 #if _GLIBCXX_USE_WCHAR_T
344 int compare(
const path& __p)
const noexcept;
346 int compare(
const value_type* __s)
const;
347 #if __cplusplus >= 201402L
348 int compare(
const basic_string_view<value_type> __s)
const;
353 path root_name()
const;
354 path root_directory()
const;
355 path root_path()
const;
356 path relative_path()
const;
357 path parent_path()
const;
358 path filename()
const;
360 path extension()
const;
365 bool has_root_name()
const;
366 bool has_root_directory()
const;
367 bool has_root_path()
const;
368 bool has_relative_path()
const;
369 bool has_parent_path()
const;
370 bool has_filename()
const;
371 bool has_stem()
const;
372 bool has_extension()
const;
373 bool is_absolute()
const {
return has_root_directory(); }
374 bool is_relative()
const {
return !is_absolute(); }
384 enum class _Type : unsigned char {
385 _Multi, _Root_name, _Root_dir, _Filename
388 path(
string_type __str, _Type __type) : _M_pathname(__str), _M_type(__type)
390 __glibcxx_assert(!empty());
391 __glibcxx_assert(_M_type != _Type::_Multi);
394 enum class _Split { _Stem, _Extension };
398 if (!_M_pathname.
empty() && !_S_is_dir_sep(_M_pathname.
back())
399 && !__str.
empty() && !_S_is_dir_sep(__str.
front()))
400 _M_pathname += preferred_separator;
401 _M_pathname += __str;
408 template<
typename _CharT>
412 _S_convert(value_type* __src, __null_terminated)
416 _S_convert(
const value_type* __src, __null_terminated)
419 template<
typename _Iter>
421 _S_convert(_Iter __first, _Iter __last)
423 using __value_type =
typename std::iterator_traits<_Iter>::value_type;
424 return _Cvt<typename remove_cv<__value_type>::type>::
425 _S_convert(__first, __last);
428 template<
typename _InputIterator>
430 _S_convert(_InputIterator __src, __null_terminated)
432 using _Tp =
typename std::iterator_traits<_InputIterator>::value_type;
434 for (; *__src != _Tp{}; ++__src)
440 _S_convert_loc(
const char* __first,
const char* __last,
443 template<
typename _Iter>
445 _S_convert_loc(_Iter __first, _Iter __last,
const std::locale& __loc)
448 return _S_convert_loc(__str.
data(), __str.
data()+__str.
size(), __loc);
451 template<
typename _InputIterator>
453 _S_convert_loc(_InputIterator __src, __null_terminated,
457 while (*__src !=
'\0')
459 return _S_convert_loc(__tmp.
data(), __tmp.
data()+__tmp.
size(), __loc);
462 bool _S_is_dir_sep(value_type __ch)
464 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
465 return __ch == L
'/' || __ch == preferred_separator;
471 void _M_split_cmpts();
473 void _M_add_root_name(
size_t __n);
474 void _M_add_root_dir(
size_t __pos);
475 void _M_add_filename(
size_t __pos,
size_t __n);
480 using _List = _GLIBCXX_STD_C::vector<_Cmpt>;
482 _Type _M_type = _Type::_Multi;
487 size_t hash_value(
const path& __p)
noexcept;
490 inline bool operator<(
const path& __lhs,
const path& __rhs)
noexcept
491 {
return __lhs.compare(__rhs) < 0; }
494 inline bool operator<=(
const path& __lhs,
const path& __rhs)
noexcept
495 {
return !(__rhs < __lhs); }
498 inline bool operator>(
const path& __lhs,
const path& __rhs)
noexcept
499 {
return __rhs < __lhs; }
502 inline bool operator>=(
const path& __lhs,
const path& __rhs)
noexcept
503 {
return !(__lhs < __rhs); }
506 inline bool operator==(
const path& __lhs,
const path& __rhs)
noexcept
507 {
return __lhs.compare(__rhs) == 0; }
510 inline bool operator!=(
const path& __lhs,
const path& __rhs)
noexcept
511 {
return !(__lhs == __rhs); }
514 inline path
operator/(
const path& __lhs,
const path& __rhs)
516 path __result(__lhs);
522 template<
typename _CharT,
typename _Traits>
523 basic_ostream<_CharT, _Traits>&
524 operator<<(basic_ostream<_CharT, _Traits>& __os,
const path& __p)
526 auto __tmp = __p.string<_CharT, _Traits>();
527 using __quoted_string
529 __os << __quoted_string{__tmp,
'"',
'\\'};
534 template<
typename _CharT,
typename _Traits>
535 basic_istream<_CharT, _Traits>&
536 operator>>(basic_istream<_CharT, _Traits>& __is, path& __p)
538 basic_string<_CharT, _Traits> __tmp;
539 using __quoted_string
541 if (__is >> __quoted_string{ __tmp,
'"',
'\\' })
542 __p = std::move(__tmp);
547 template<
typename _Source>
549 u8path(
const _Source& __source)
551 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
552 return path{ path::string_type{__source} };
554 return path{ __source };
559 template<
typename _InputIterator>
561 u8path(_InputIterator __first, _InputIterator __last)
563 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
564 return path{ path::string_type{__first, __last} };
566 return path{ __first, __last };
573 filesystem_error(
const string& __what_arg, error_code __ec)
574 : system_error(__ec, __what_arg) { }
576 filesystem_error(
const string& __what_arg,
const path& __p1,
578 : system_error(__ec, __what_arg), _M_path1(__p1) { }
580 filesystem_error(
const string& __what_arg,
const path& __p1,
581 const path& __p2, error_code __ec)
582 : system_error(__ec, __what_arg), _M_path1(__p1), _M_path2(__p2)
587 const path& path1() const
noexcept {
return _M_path1; }
588 const path& path2() const
noexcept {
return _M_path2; }
589 const char* what() const
noexcept {
return _M_what.c_str(); }
601 {
using value_type = char; };
605 {
using value_type = wchar_t; };
609 {
using value_type = char16_t; };
613 {
using value_type = char32_t; };
615 template<
typename _Tp>
616 struct path::__is_encoded_char<const _Tp> : __is_encoded_char<_Tp> { };
618 struct path::_Cmpt : path
620 _Cmpt(string_type __s, _Type __t,
size_t __pos)
621 : path(std::move(__s), __t), _M_pos(__pos) { }
623 _Cmpt() : _M_pos(-1) { }
630 struct path::_Cvt<path::value_type>
632 template<
typename _Iter>
634 _S_convert(_Iter __first, _Iter __last)
635 {
return string_type{__first, __last}; }
638 template<
typename _CharT>
641 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
643 _S_wconvert(
const char* __f,
const char* __l,
true_type)
646 const auto& __cvt = std::use_facet<_Cvt>(
std::locale{});
648 if (__str_codecvt_in(__f, __l, __wstr, __cvt))
650 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
651 "Cannot convert character sequence",
652 std::make_error_code(errc::illegal_byte_sequence)));
656 _S_wconvert(
const _CharT* __f,
const _CharT* __l,
false_type)
658 std::codecvt_utf8<_CharT> __cvt;
660 if (__str_codecvt_out(__f, __l, __str, __cvt))
662 const char* __f2 = __str.
data();
663 const char* __l2 = __f2 + __str.
size();
664 std::codecvt_utf8<wchar_t> __wcvt;
666 if (__str_codecvt_in(__f2, __l2, __wstr, __wcvt))
669 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
670 "Cannot convert character sequence",
671 std::make_error_code(errc::illegal_byte_sequence)));
675 _S_convert(
const _CharT* __f,
const _CharT* __l)
677 return _S_wconvert(__f, __l, is_same<_CharT, char>{});
681 _S_convert(
const _CharT* __f,
const _CharT* __l)
683 std::codecvt_utf8<_CharT> __cvt;
685 if (__str_codecvt_out(__f, __l, __str, __cvt))
687 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
688 "Cannot convert character sequence",
689 std::make_error_code(errc::illegal_byte_sequence)));
694 _S_convert(_CharT* __f, _CharT* __l)
696 return _S_convert(const_cast<const _CharT*>(__f),
697 const_cast<const _CharT*>(__l));
700 template<
typename _Iter>
702 _S_convert(_Iter __first, _Iter __last)
705 return _S_convert(__str.
data(), __str.
data() + __str.
size());
708 template<
typename _Iter,
typename _Cont>
710 _S_convert(__gnu_cxx::__normal_iterator<_Iter, _Cont> __first,
711 __gnu_cxx::__normal_iterator<_Iter, _Cont> __last)
712 {
return _S_convert(__first.base(), __last.base()); }
719 using difference_type = std::ptrdiff_t;
725 iterator() : _M_path(
nullptr), _M_cur(), _M_at_end() { }
734 iterator operator++(
int) {
auto __tmp = *
this; ++*
this;
return __tmp; }
737 iterator operator--(
int) {
auto __tmp = *
this; --*
this;
return __tmp; }
740 {
return __lhs._M_equals(__rhs); }
743 {
return !__lhs._M_equals(__rhs); }
748 iterator(
const path* __path, path::_List::const_iterator __iter)
749 : _M_path(__path), _M_cur(__iter), _M_at_end()
753 : _M_path(__path), _M_cur(), _M_at_end(__at_end)
759 path::_List::const_iterator _M_cur;
767 _M_pathname = std::move(__p._M_pathname);
768 _M_cmpts = std::move(__p._M_cmpts);
769 _M_type = __p._M_type;
775 path::operator=(string_type&& __source)
776 {
return *
this =
path(std::move(__source)); }
779 path::assign(string_type&& __source)
780 {
return *
this = path(std::move(__source)); }
783 path::operator+=(
const path& __p)
785 return operator+=(__p.native());
789 path::operator+=(
const string_type& __x)
797 path::operator+=(
const value_type* __x)
805 path::operator+=(value_type __x)
812 #if __cplusplus >= 201402L
814 path::operator+=(basic_string_view<value_type> __x)
816 _M_pathname.
append(__x.data(), __x.size());
822 template<
typename _CharT>
823 inline path::_Path<_CharT*, _CharT*>&
824 path::operator+=(_CharT __x)
827 return concat(__addr, __addr + 1);
831 path::make_preferred()
833 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
835 preferred_separator);
840 inline void path::swap(path& __rhs) noexcept
842 _M_pathname.swap(__rhs._M_pathname);
843 _M_cmpts.swap(__rhs._M_cmpts);
844 std::swap(_M_type, __rhs._M_type);
847 template<
typename _CharT,
typename _Traits,
typename _Allocator>
851 if (is_same<_CharT, value_type>::value)
852 return { _M_pathname.
begin(), _M_pathname.
end(), __a };
854 const value_type* __first = _M_pathname.
data();
855 const value_type* __last = __first + _M_pathname.
size();
857 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
858 using _CharAlloc = __alloc_rebind<_Allocator, char>;
859 using _String = basic_string<char, char_traits<char>, _CharAlloc>;
860 using _WString = basic_string<_CharT, _Traits, _Allocator>;
863 codecvt_utf8<value_type> __cvt;
864 _String __u8str{_CharAlloc{__a}};
865 if (__str_codecvt_out(__first, __last, __u8str, __cvt))
870 operator()(
const _String& __from, _String&,
true_type)
874 operator()(
const _String& __from, _WString& __to,
false_type)
877 codecvt_utf8<_CharT> __cvt;
878 const char* __f = __from.data();
879 const char* __l = __f + __from.size();
880 if (__str_codecvt_in(__f, __l, __to, __cvt))
886 if (
auto* __p = __dispatch(__u8str, __wstr, is_same<_CharT, char>{}))
890 codecvt_utf8<_CharT> __cvt;
891 basic_string<_CharT, _Traits, _Allocator> __wstr{__a};
892 if (__str_codecvt_in(__first, __last, __wstr, __cvt))
895 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
896 "Cannot convert character sequence",
897 std::make_error_code(errc::illegal_byte_sequence)));
903 #if _GLIBCXX_USE_WCHAR_T
909 path::u8string()
const
911 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
914 codecvt_utf8<value_type> __cvt;
915 const value_type* __first = _M_pathname.
data();
916 const value_type* __last = __first + _M_pathname.
size();
917 if (__str_codecvt_out(__first, __last, __str, __cvt))
919 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
920 "Cannot convert character sequence",
921 std::make_error_code(errc::illegal_byte_sequence)));
933 #ifndef _GLIBCXX_FILESYSTEM_IS_WINDOWS
934 template<
typename _CharT,
typename _Traits,
typename _Allocator>
936 path::generic_string(
const _Allocator& __a)
const
937 {
return string<_CharT, _Traits, _Allocator>(__a); }
940 path::generic_string()
const {
return string(); }
942 #if _GLIBCXX_USE_WCHAR_T
944 path::generic_wstring()
const {
return wstring(); }
948 path::generic_u8string()
const {
return u8string(); }
951 path::generic_u16string()
const {
return u16string(); }
954 path::generic_u32string()
const {
return u32string(); }
958 path::compare(
const string_type& __s)
const {
return compare(path(__s)); }
961 path::compare(
const value_type* __s)
const {
return compare(path(__s)); }
963 #if __cplusplus >= 201402L
965 path::compare(basic_string_view<value_type> __s)
const
966 {
return compare(path(__s)); }
970 path::filename()
const {
return empty() ? path() : *--
end(); }
975 auto ext = _M_find_extension();
976 if (ext.first && ext.second != 0)
977 return path{ext.first->substr(0, ext.second)};
982 path::extension()
const
984 auto ext = _M_find_extension();
986 return path{ext.first->substr(ext.second)};
991 path::has_stem()
const
993 auto ext = _M_find_extension();
994 return ext.first && ext.second != 0;
998 path::has_extension()
const
1000 auto ext = _M_find_extension();
1004 inline path::iterator
1007 if (_M_type == _Type::_Multi)
1008 return iterator(
this, _M_cmpts.
begin());
1009 return iterator(
this,
false);
1012 inline path::iterator
1015 if (_M_type == _Type::_Multi)
1016 return iterator(
this, _M_cmpts.
end());
1017 return iterator(
this,
true);
1020 inline path::iterator&
1021 path::iterator::operator++()
1023 __glibcxx_assert(_M_path !=
nullptr);
1024 if (_M_path->_M_type == _Type::_Multi)
1026 __glibcxx_assert(_M_cur != _M_path->_M_cmpts.
end());
1031 __glibcxx_assert(!_M_at_end);
1037 inline path::iterator&
1038 path::iterator::operator--()
1040 __glibcxx_assert(_M_path !=
nullptr);
1041 if (_M_path->_M_type == _Type::_Multi)
1043 __glibcxx_assert(_M_cur != _M_path->_M_cmpts.begin());
1048 __glibcxx_assert(_M_at_end);
1054 inline path::iterator::reference
1055 path::iterator::operator*()
const
1057 __glibcxx_assert(_M_path !=
nullptr);
1058 if (_M_path->_M_type == _Type::_Multi)
1060 __glibcxx_assert(_M_cur != _M_path->_M_cmpts.end());
1067 path::iterator::_M_equals(iterator __rhs)
const
1069 if (_M_path != __rhs._M_path)
1071 if (_M_path ==
nullptr)
1073 if (_M_path->_M_type == path::_Type::_Multi)
1074 return _M_cur == __rhs._M_cur;
1075 return _M_at_end == __rhs._M_at_end;
1079 _GLIBCXX_END_NAMESPACE_CXX11
1084 _GLIBCXX_END_NAMESPACE_VERSION
1089 #endif // _GLIBCXX_EXPERIMENTAL_FS_PATH_H
bool empty() const noexcept
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
Class codecvt<wchar_t, char, mbstate_t> specialization.
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initializer_list. ...
Container class for localization functionality.The locale class is first a class wrapper for C librar...
size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
basic_string< wchar_t > wstring
A string of wchar_t.
enable_if< ::__array_traits< _Tp, _Nm >::_Is_swappable::value >::type noexcept(noexcept(__one.swap(__two)))
swap
basic_string & append(const basic_string &__str)
Append a string to this string.
Bidirectional iterators support a superset of forward iterator operations.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
static const size_type npos
Value returned by various member functions when they fail.
const _CharT * data() const noexcept
Return const pointer to contents.
complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
Struct holding two objects of arbitrary type.
Define a member typedef type only if a boolean constant is true.
basic_string< char > string
A string of char.
const _CharT * c_str() const noexcept
Return const pointer to null-terminated contents.
Thrown to indicate error code of underlying system.
An iterator for the components of a path.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
iterator begin() noexcept
void replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__old_value, const _Tp &__new_value)
Replace each occurrence of one value in a sequence with another value.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
basic_string< char16_t > u16string
A string of char16_t.
Managing sequences of characters and character-like objects.
basic_string< char32_t > u32string
A string of char32_t.
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initializer_list.
Struct for delimited strings.
void push_back(_CharT __c)
Append a single character.