xtd 0.2.0
Loading...
Searching...
No Matches
to_string_.hpp
Go to the documentation of this file.
1
4#pragma once
6#if !defined(__XTD_TO_STRING_INTERNAL__)
7#error "Do not include this file: Internal use only. Include <xtd/to_string> or <xtd/to_string.hpp> instead."
8#endif
10
11//#include "globalization/culture_info.hpp"
12#include "to_string.hpp"
13
15template<class value_t>
16inline xtd::string xtd::to_string(const value_t& value, const xtd::string& fmt, const std::locale& loc) {
17 return __to_string_polymorphic(value, fmt, loc, std::is_polymorphic<value_t>());
18}
19
20template<>
21inline xtd::string xtd::to_string(const bool& value, const xtd::string& fmt, const std::locale& loc) {
22 return __boolean_formatter(fmt.chars(), value, loc);
23}
24
25template<>
26inline xtd::string xtd::to_string(const sbyte& value, const xtd::string& fmt, const std::locale& loc) {
27 return __numeric_formatter(fmt.chars(), value, loc);
28}
29
30template<>
31inline xtd::string xtd::to_string(const char& value, const xtd::string& fmt, const std::locale& loc) {
32 return __character_formatter(fmt.chars(), value, loc);
33}
34
35template<>
36inline xtd::string xtd::to_string(const unsigned char& value, const xtd::string& fmt, const std::locale& loc) {
37 return __numeric_formatter(fmt.chars(), value, loc);
38}
39
40template<>
41inline xtd::string xtd::to_string(const short& value, const xtd::string& fmt, const std::locale& loc) {
42 return __numeric_formatter(fmt.chars(), value, loc);
43}
44
45template<>
46inline xtd::string xtd::to_string(const unsigned short& value, const xtd::string& fmt, const std::locale& loc) {
47 return __numeric_formatter(fmt.chars(), value, loc);
48}
49
50template<>
51inline xtd::string xtd::to_string(const int& value, const xtd::string& fmt, const std::locale& loc) {
52 return __numeric_formatter(fmt.chars(), value, loc);
53}
54
55template<>
56inline xtd::string xtd::to_string(const unsigned int& value, const xtd::string& fmt, const std::locale& loc) {
57 return __numeric_formatter(fmt.chars(), value, loc);
58}
59
60template<>
61inline xtd::string xtd::to_string(const long& value, const xtd::string& fmt, const std::locale& loc) {
62 return __numeric_formatter(fmt.chars(), value, loc);
63}
64
65template<>
66inline xtd::string xtd::to_string(const unsigned long& value, const xtd::string& fmt, const std::locale& loc) {
67 return __numeric_formatter(fmt.chars(), value, loc);
68}
69
70template<>
71inline xtd::string xtd::to_string(const long long& value, const xtd::string& fmt, const std::locale& loc) {
72 return __numeric_formatter(fmt.chars(), value, loc);
73}
74
75template<>
76inline xtd::string xtd::to_string(const unsigned long long& value, const xtd::string& fmt, const std::locale& loc) {
77 return __numeric_formatter(fmt.chars(), value, loc);
78}
79
80template<>
81inline xtd::string xtd::to_string(const float& value, const xtd::string& fmt, const std::locale& loc) {
82 return __floating_point_formatter(fmt.chars(), value, loc);
83}
84
85template<>
86inline xtd::string xtd::to_string(const double& value, const xtd::string& fmt, const std::locale& loc) {
87 return __floating_point_formatter(fmt.chars(), value, loc);
88}
89
90template<>
91inline xtd::string xtd::to_string(const long double& value, const xtd::string& fmt, const std::locale& loc) {
92 return __floating_point_formatter(fmt.chars(), value, loc);
93}
94
95template<>
96inline xtd::string xtd::to_string(const std::chrono::system_clock::time_point& value, const xtd::string& fmt, const std::locale& loc) {
97 return __date_time_formatter(fmt.chars(), std::chrono::system_clock::to_time_t(value), std::chrono::duration_cast<std::chrono::nanoseconds>(value.time_since_epoch()).count() % 1000000000, loc);
98}
99
100template<>
101inline xtd::string xtd::to_string(const std::tm& value, const xtd::string& fmt, const std::locale& loc) {
102 return __date_time_formatter(fmt.chars(), value, 0, loc);
103}
104
105template<class type_t, class period_t>
106inline xtd::string xtd::to_string(const std::chrono::duration<type_t, period_t>& value, const xtd::string& fmt, const std::locale& loc) {
107 return __duration_formatter(fmt.chars(), value, loc);
108}
109
110template<>
111inline xtd::string xtd::to_string(const char8& value, const xtd::string& fmt, const std::locale& loc) {
112 return __character_formatter(fmt.chars(), value, loc);
113}
114
115template<>
116inline xtd::string xtd::to_string(const char16& value, const xtd::string& fmt, const std::locale& loc) {
117 return __character_formatter(fmt.chars(), value, loc);
118}
119
120template<>
121inline xtd::string xtd::to_string(const char32& value, const xtd::string& fmt, const std::locale& loc) {
122 return __character_formatter(fmt.chars(), value, loc);
123}
124
125template<>
126inline xtd::string xtd::to_string(const wchar& value, const xtd::string& fmt, const std::locale& loc) {
127 return __character_formatter(fmt.chars(), value, loc);
128}
129
130template<class value_t>
131inline xtd::string xtd::to_string(const value_t& value, const xtd::string& fmt) {
132 return to_string(value, fmt, std::locale());
133}
134
135inline xtd::string xtd::to_string(const char* value, const xtd::string& fmt) {
136 return to_string(value, fmt, std::locale());
137}
138
139template<>
140inline xtd::string xtd::to_string(const std::partial_ordering& value, const xtd::string& fmt, const std::locale& loc) {
141 if (value == std::partial_ordering::less) return "less";
142 if (value == std::partial_ordering::greater) return "greater";
143 return "equivalent";
144}
145
146template<>
147inline xtd::string xtd::to_string(const std::strong_ordering& value, const xtd::string& fmt, const std::locale& loc) {
148 if (value == std::strong_ordering::less) return "less";
149 if (value == std::strong_ordering::greater) return "greater";
150 return "equivalent";
151}
152
153template<>
154inline xtd::string xtd::to_string(const std::weak_ordering& value, const xtd::string& fmt, const std::locale& loc) {
155 if (value == std::weak_ordering::less) return "less";
156 if (value == std::weak_ordering::greater) return "greater";
157 return "equivalent";
158}
159
160template<class value_t>
161inline xtd::string xtd::to_string(const value_t* value, const xtd::string& fmt, const std::locale& loc) {
162 if (!value) return "(null)";
163 return __numeric_formatter(fmt.chars(), reinterpret_cast<intptr>(value), loc);
164}
165
166template<class value_t>
167inline xtd::string xtd::to_string(value_t* const value, const xtd::string& fmt, const std::locale& loc) {
168 if (!value) return "(null)";
169 return __numeric_formatter(fmt.chars(), reinterpret_cast<intptr>(value), loc);
170}
171
172template<class type_t>
173inline xtd::string xtd::to_string(const std::shared_ptr<type_t>& value, const xtd::string& fmt, const std::locale& loc) {
174 if (!value) return "(null)";
175 return __numeric_formatter(fmt.chars(), reinterpret_cast<intptr>(value.get()), loc);
176}
177
178template<class type_t>
179inline xtd::string xtd::to_string(const std::unique_ptr<type_t>& value, const xtd::string& fmt, const std::locale& loc) {
180 if (!value) return "(null)";
181 return __numeric_formatter(fmt.chars(), reinterpret_cast<intptr>(value.get()), loc);
182}
183
184template<>
185inline xtd::string xtd::to_string(const xtd::any& value, const xtd::string& fmt, const std::locale& loc) {
186 auto iterator = __any_stringer__.find(std::type_index(value.type()));
187 return iterator != __any_stringer__.cend() ? xtd::to_string(iterator->second(value), fmt, loc) : "(unregistered)";
188}
189
190template<class type_t>
191inline xtd::string xtd::to_string(const std::optional<type_t>& value, const xtd::string& fmt, const std::locale& loc) {
192 return !value.has_value() ? "(null)" : std::string {"("} + to_string(value.value(), fmt, loc).chars() + std::string {")"};
193}
194
195template<>
196inline xtd::string xtd::to_string(const std::nullopt_t& value, const xtd::string& fmt, const std::locale& loc) {
197 return "(null)";
198}
199
200template<>
201inline xtd::string xtd::to_string(const std::nullptr_t&, const xtd::string& fmt, const std::locale& loc) {
202 return "null";
203}
204
205template<class type1_t, class type2_t>
206inline xtd::string xtd::to_string(const std::pair<type1_t, type2_t>& value, const xtd::string& fmt, const std::locale& loc) {
207 return std::string {"("} + to_string(value.first, fmt, loc).chars() + std::string {", "} + to_string(value.second, fmt, loc).chars() + std::string {")"};
208}
209
210template<class type_t, unsigned n_t, unsigned last_t>
211inline xtd::string xtd::__xtd_tuple_stringer<type_t, n_t, last_t>::to_string(const std::string& str, const type_t& value, const xtd::string& fmt, const std::locale& loc) {
212 return __xtd_tuple_stringer < type_t, n_t + 1, last_t >::to_string(str + xtd::to_string(std::get<n_t>(value), fmt, loc).chars() + ", ", value, fmt, loc);
213}
214
215template<class type_t, unsigned n_t>
216inline xtd::string xtd::__xtd_tuple_stringer<type_t, n_t, n_t>::to_string(const std::string& str, const type_t& value, const xtd::string& fmt, const std::locale& loc) {
217 return str + xtd::to_string(std::get<n_t>(value), fmt, loc).chars();
218}
219
220template<class ...types_t>
221inline xtd::string xtd::to_string(const std::tuple<types_t ...>& value, const xtd::string& fmt, const std::locale& loc) {
222 return __xtd_tuple_stringer < std::tuple<types_t ...>, 0, sizeof...(types_t) - 1 >::to_string(std::string {"("}, value, fmt, loc) + ")";
223}
224
225template<class iterator_t>
226inline std::string __xtd_iterator_to_string(const std::string& str, iterator_t iterator, const iterator_t& begin, const iterator_t& end, const xtd::string& fmt, const std::locale& loc) {
227 if (iterator == end) return str;
228 auto new_str = str + (iterator == begin ? std::string {} : std::string {", "}) + xtd::to_string(*iterator, fmt, loc).chars();
229 return __xtd_iterator_to_string(new_str, ++iterator, begin, end, fmt, loc);
230}
231
232template<class iterator_t>
233inline std::string __xtd_sequence_container_to_string(const iterator_t& begin, const iterator_t& end, const xtd::string& fmt, const std::locale& loc) {
234 return __xtd_iterator_to_string("[", begin, begin, end, fmt, loc) + "]";
235}
236
237template<class type_t, size_t size>
238inline xtd::string xtd::to_string(const std::array<type_t, size>& values, const xtd::string& fmt, const std::locale& loc) {
239 return __xtd_sequence_container_to_string(values.begin(), values.end(), fmt, loc);
240}
241
242template<size_t size>
243inline xtd::string xtd::to_string(const std::bitset<size>& values, const xtd::string& fmt, const std::locale& loc) {
244 auto result = xtd::string {"["};
245 for (auto index = size_t {0}; index < values.length(); ++index)
246 result += (index ? ", " : "") + to_string(static_cast<bool>(values[index]), fmt, loc);
247 return result + "]";
248}
249
250template<class type_t, class allocator_t>
251inline xtd::string xtd::to_string(const std::deque<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
252 return __xtd_sequence_container_to_string(values.begin(), values.end(), fmt, loc);
253}
254
255template<class type_t, class allocator_t>
256inline xtd::string xtd::to_string(const std::forward_list<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
257 return __xtd_sequence_container_to_string(values.begin(), values.end(), fmt, loc);
258}
259
260template<class type_t>
261inline xtd::string xtd::to_string(const std::initializer_list<type_t>& values, const xtd::string& fmt, const std::locale& loc) {
262 return __xtd_sequence_container_to_string(values.begin(), values.end(), fmt, loc);
263}
264
265template<class type_t, class allocator_t>
266inline xtd::string xtd::to_string(const std::list<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
267 return __xtd_sequence_container_to_string(values.begin(), values.end(), fmt, loc);
268}
269
270template<class type_t, class container_t>
271inline xtd::string xtd::to_string(const std::queue<type_t, container_t>& values, const xtd::string& fmt, const std::locale& loc) {
272 struct std_queue : public std::queue<type_t> {
273 std_queue(const std::queue<type_t>& queue) : ptr {reinterpret_cast<const std_queue*>(&queue)} {}
274 auto begin() const {return ptr->c.begin();}
275 auto end() const {return ptr->c.end();}
276 const std_queue* ptr;
277 };
278 auto items = std_queue {values};
279 return __xtd_sequence_container_to_string(items.begin(), items.end(), fmt, loc);
280}
281
282template<class type_t, class container_t>
283inline xtd::string xtd::to_string(const std::priority_queue<type_t, container_t>& values, const xtd::string& fmt, const std::locale& loc) {
284 struct std_priority_queue : public std::queue<type_t> {
285 std_priority_queue(const std::priority_queue<type_t>& queue) : ptr {reinterpret_cast<const std_priority_queue*>(&queue)} {}
286 auto begin() const {return ptr->c.begin();}
287 auto end() const {return ptr->c.end();}
288 const std_priority_queue* ptr;
289 };
290 auto items = std_priority_queue {values};
291 return __xtd_sequence_container_to_string(items.begin(), items.end(), fmt, loc);
292}
293
294template<class type_t, class container_t>
295inline xtd::string xtd::to_string(const std::stack<type_t, container_t>& values, const xtd::string& fmt, const std::locale& loc) {
296 struct std_stack : public std::stack<type_t> {
297 std_stack(const std::stack<type_t>& queue) : ptr {reinterpret_cast<const std_stack*>(&queue)} {}
298 auto begin() const {return ptr->c.begin();}
299 auto end() const {return ptr->c.end();}
300 const std_stack* ptr;
301 };
302 auto items = std_stack {values};
303 return __xtd_sequence_container_to_string(items.begin(), items.end(), fmt, loc);
304}
305
306template<class type_t>
307inline xtd::string xtd::to_string(const std::valarray<type_t>& values, const xtd::string& fmt, const std::locale& loc) {
308 return __xtd_sequence_container_to_string(std::begin(values), std::end(values), fmt, loc);
309}
310
311template<class type_t, class allocator_t>
312inline xtd::string xtd::to_string(const std::vector<type_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
313 return __xtd_sequence_container_to_string(values.begin(), values.end(), fmt, loc);
314}
315
316template<class iterator_t>
317inline std::string __xtd_associative_container_to_string(const iterator_t& begin, const iterator_t& end, const xtd::string& fmt, const std::locale& loc) {
318 return __xtd_iterator_to_string("{", begin, begin, end, fmt, loc) + "}";
319}
320
321template<class key_t, class value_t, class compare_t, class allocator_t>
322inline xtd::string xtd::to_string(const std::map<key_t, value_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
323 return __xtd_associative_container_to_string(values.begin(), values.end(), fmt, loc);
324}
325
326template<class key_t, class value_t, class compare_t, class allocator_t>
327inline xtd::string xtd::to_string(const std::multimap<key_t, value_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
328 return __xtd_associative_container_to_string(values.begin(), values.end(), fmt, loc);
329}
330
331template<class key_t, class compare_t, class allocator_t>
332inline xtd::string xtd::to_string(const std::multiset<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
333 return __xtd_associative_container_to_string(values.begin(), values.end(), fmt, loc);
334}
335
336template<class key_t, class compare_t, class allocator_t>
337inline xtd::string xtd::to_string(const std::set<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
338 return __xtd_associative_container_to_string(values.begin(), values.end(), fmt, loc);
339}
340
341template<class key_t, class value_t, class compare_t, class allocator_t>
342inline xtd::string xtd::to_string(const std::unordered_map<key_t, value_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
343 return __xtd_associative_container_to_string(values.begin(), values.end(), fmt, loc);
344}
345
346template<class key_t, class value_t, class compare_t, class allocator_t>
347inline xtd::string xtd::to_string(const std::unordered_multimap<key_t, value_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
348 return __xtd_associative_container_to_string(values.begin(), values.end(), fmt, loc);
349}
350
351template<class key_t, class compare_t, class allocator_t>
352inline xtd::string xtd::to_string(const std::unordered_multiset<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
353 return __xtd_associative_container_to_string(values.begin(), values.end(), fmt, loc);
354}
355
356template<class key_t, class compare_t, class allocator_t>
357inline xtd::string xtd::to_string(const std::unordered_set<key_t, compare_t, allocator_t>& values, const xtd::string& fmt, const std::locale& loc) {
358 return __xtd_associative_container_to_string(values.begin(), values.end(), fmt, loc);
359}
360
361template<class type_t>
362inline xtd::string xtd::to_string(type_t value, const std::initializer_list<std::pair<type_t, xtd::string>>& il) {
363 std::map<type_t, xtd::string, std::greater<type_t>> values;
364 for (auto item : il) values[item.first] = item.second;
365 return to_string(value, values);
366}
367
368#if defined(__xtd__cpp_lib_ranges)
369//template <std::ranges::range range_t>
370//inline xtd::string xtd::to_string(const range_t& values, const xtd::string& fmt, const std::locale& loc) {
371// return __xtd_sequence_container_to_string(values.begin(), values.end(), fmt, loc);
372//}
373/*
374template <std::ranges::range range_t>
375inline xtd::string to_string(const range_t& values, const xtd::string& fmt, const std::locale& loc) {
376 std::ostringstream oss;
377 oss.imbue(loc);
378
379 oss << "[";
380 bool first = true;
381 for (auto&& v : values) {
382 if (!first) oss << ", ";
383 first = false;
384 oss << xtd::to_string(v, fmt, loc);
385 }
386 oss << "]";
387 return oss.str();
388}
389*/
390#endif
391
392template<class type_t>
393inline xtd::string xtd::to_string(const xtd::collections::generic::ienumerable<type_t>& values, const xtd::string& fmt, const std::locale& loc) {
394 return __xtd_sequence_container_to_string(values.begin(), values.end(), fmt, loc);
395}
396
397template<class type_t>
398inline xtd::string xtd::to_string(const xtd::collections::generic::helpers::raw_array<type_t>& values, const xtd::string& fmt, const std::locale& loc) {
399 return __xtd_sequence_container_to_string(values.begin(), values.end(), fmt, loc);
400}
401
402template<class type_t, class string_t>
403inline string_t xtd::to_string(type_t value, const std::map<type_t, string_t, std::greater<type_t>>& values) {
404 auto it = values.find(value);
405 if (it != values.end()) return it->second;
406 string_t result;
407 long long rest = static_cast<long long>(value);
408 for (auto item : values) {
409 if (static_cast<long long>(item.first) != 0 && (rest & static_cast<long long>(item.first)) == static_cast<long long>(item.first)) {
410 if (!result.empty()) result = string_t {',', ' '} + result;
411 result = item.second + result;
412 rest -= static_cast<long long>(item.first);
413 }
414 }
415 if (!result.empty()) return result;
416 return to_string(static_cast<long long>(value), string_t {'G'}, std::locale());
417}
418
419template<class type_t, class string_t>
420inline string_t xtd::to_string(type_t value, const std::map<type_t, string_t>& values) {
421 std::map<type_t, string_t, std::greater<type_t>> descending_values;
422 for (auto item : values) descending_values[item.first] = item.second;
423 return to_string(value, descending_values);
424}
425
426template<class char_t, class value_t>
427inline std::basic_string<char_t> __string_formatter(const std::basic_string<char_t>& fmt, value_t value, const std::locale& loc) {
428 return __format_stringer<char_t>(value);
429}
430
431template < >
432inline std::string __format_stringer < char, bool& > (bool& value) {
433 return xtd::to_string(value, "G", std::locale());
434}
435
436template < >
437inline std::string __format_stringer < char, xtd::sbyte& > (xtd::sbyte& value) {
438 return xtd::to_string(value, "G", std::locale());
439}
440
441template < >
442inline std::string __format_stringer < char, const unsigned char& > (const unsigned char& value) {
443 return xtd::to_string(value, "G", std::locale());
444}
445
446template < >
447inline std::string __format_stringer < char, unsigned char& > (unsigned char& value) {
448 return xtd::to_string(value, "G", std::locale());
449}
450
451template < >
452inline std::string __format_stringer < char, short& > (short& value) {
453 return xtd::to_string(value, "G", std::locale());
454}
455
456template < >
457inline std::string __format_stringer < char, unsigned short& > (unsigned short& value) {
458 return xtd::to_string(value, "G", std::locale());
459}
460
461template < >
462inline std::string __format_stringer < char, int& > (int& value) {
463 return xtd::to_string(value, "G", std::locale());
464}
465
466template < >
467inline std::string __format_stringer < char, unsigned int& > (unsigned int& value) {
468 return xtd::to_string(value, "G", std::locale());
469}
470
471template < >
472inline std::string __format_stringer < char, long& > (long& value) {
473 return xtd::to_string(value, "G", std::locale());
474}
475
476template < >
477inline std::string __format_stringer < char, unsigned long& > (unsigned long& value) {
478 return xtd::to_string(value, "G", std::locale());
479}
480
481template < >
482inline std::string __format_stringer < char, long long& > (long long& value) {
483 return xtd::to_string(value, "G", std::locale());
484}
485
486template < >
487inline std::string __format_stringer < char, unsigned long long& > (unsigned long long& value) {
488 return xtd::to_string(value, "G", std::locale());
489}
490
491template < >
492inline std::string __format_stringer < char, float& > (float& value) {
493 return xtd::to_string(value, "G", std::locale());
494}
495
496template < >
497inline std::string __format_stringer < char, double& > (double& value) {
498 return xtd::to_string(value, "G", std::locale());
499}
500
501template < >
502inline std::string __format_stringer < char, long double& > (long double& value) {
503 return xtd::to_string(value, "G", std::locale());
504}
505
506template < >
507inline std::string __format_stringer < char, std::chrono::system_clock::time_point& > (std::chrono::system_clock::time_point& value) {
508 return xtd::to_string(value, "G", std::locale());
509}
510
511template < >
512inline std::string __format_stringer < char, std::tm& > (tm& value) {
513 return xtd::to_string(value, "G", std::locale());
514}
515
516template < >
517inline std::string __format_stringer < char, xtd::wchar& > (xtd::wchar& value) {
518 return xtd::to_string(value, "G", std::locale());
519}
520
521template < >
522inline std::string __format_stringer < char, xtd::char8& > (xtd::char8& value) {
523 return xtd::to_string(value, "G", std::locale());
524}
525
526template < >
527inline std::string __format_stringer < char, xtd::char16& > (xtd::char16& value) {
528 return xtd::to_string(value, "G", std::locale());
529}
530
531template < >
532inline std::string __format_stringer < char, xtd::char32& > (xtd::char32& value) {
533 return xtd::to_string(value, "G", std::locale());
534}
535
536template<class char_t, class type_t, class period_t = std::ratio<1>>
537std::basic_ostream<char_t>& operator <<(std::basic_ostream<char_t>& os, const std::chrono::duration<type_t, period_t>& value) {
538 return os << xtd::to_string(value, std::basic_string<char_t> {'G'}, std::locale());
539}
540
541template < class char_t, class type_t >
542struct __enum_ostream__ < char_t, type_t, std::false_type > {
543 std::basic_ostream < char_t >& to_stream(std::basic_ostream < char_t >& os, const type_t& value) noexcept {
544 //return os << value;
545 return os << xtd::to_string(value, std::basic_string < char_t > {}, std::locale {});
546 }
547};
size_type find(const basic_string &str) const
Finds the first substring equal to the given character sequence. Search begins at 0,...
Definition basic_string.hpp:631
virtual auto begin() const -> const_iterator
Returns an iterator to the first element of the enumerable.
Definition enumerable_iterators.hpp:140
virtual auto end() const -> const_iterator
Returns an iterator to the element following the last element of the enumerable.
Definition enumerable_iterators.hpp:155
auto count() const noexcept -> xtd::size
Returns the number of elements in current sequence.
Definition enumerable.hpp:209
Internal vector-like container used as a storage backend for xtd collections.
Definition raw_array.hpp:29
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Definition ienumerable.hpp:40
generic::queue< xtd::any_object > queue
Represents a first-in, first-out collection of objects.
Definition queue.hpp:27
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
char8_t char8
Represents a 8-bit unicode character.
Definition char8.hpp:26
std::int8_t sbyte
Represents a 8-bit signed integer.
Definition sbyte.hpp:23
wchar_t wchar
Represents a wide character.
Definition wchar.hpp:24
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
char16_t char16
Represents a 16-bit unicode character.
Definition char16.hpp:26
xtd::sptr< type_t > ptr
The xtd::ptr object is a shared pointer.
Definition ptr.hpp:27
char32_t char32
Represents a 32-bit unicode character.
Definition char32.hpp:23
std::any any
Represents the any alias on std::any.
Definition any.hpp:24
const_iterator begin() const
Returns an iterator to the beginning.
Definition read_only_span.hpp:183
string to_string() const noexcept override
Returns the string representation of this xtd::read_only_span <type_t> object.
Definition read_only_span.hpp:375
const_iterator end() const
Returns an iterator to the end.
Definition read_only_span.hpp:213
Contains xtd::to_string methods.