File: string

package info (click to toggle)
cppreference-doc 20170409-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 259,872 kB
  • sloc: xml: 570,184; python: 1,923; php: 520; makefile: 168; sh: 25; cpp: 9; ansic: 9
file content (628 lines) | stat: -rw-r--r-- 23,536 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
/*  Copyright (C) 2015  Povilas Kanapickas <povilas@radix.lt>

    This file is part of cppreference-doc

    This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
    Unported License. To view a copy of this license, visit
    http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
    Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 1.3 or
    any later version published by the Free Software Foundation; with no
    Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
*/

#ifndef CPPREFERENCE_STRING_H
#define CPPREFERENCE_STRING_H

namespace std {

template<class State>
class fpos {
public:
    fpos(streamoff = streamoff());

    operator streamoff() const;

    State state() const;
    void state(State st);

    fpos& operator+=(streamoff);
    fpos operator+(streamoff) const;
    fpos& operator-=(streamoff);
    fpos operator-(streamoff) const;
};

template<class State>
streamoff operator-(const fpos<State>& x, const fpos<State>& y);

template<class State>
bool operator==(const fpos<State>& x, const fpos<State>& y);
template<class State>
bool operator!=(const fpos<State>& x, const fpos<State>& y);

typedef fpos<char_traits<char>::state_type> streampos;
typedef fpos<char_traits<wchar_t>::state_type> wstreampos;

#if CPPREFERENCE_STDVER>= 2011
typedef fpos<char_traits<char16_t>::state_type> u16streampos;
typedef fpos<char_traits<char32_t>::state_type> u32streampos;
#endif

template<class CharT>
class char_traits {
public:
    typedef CharT     char_type;
    typedef int       int_type; // impl-defined integer type
    typedef streamoff off_type; // actually impl-defined
    typedef streampos pos_type; // actually impl-defined
    typedef mbstate_t state_type; // actually impl-defined

    static void assign(char_type& r, const char_type& a);
    static char_type* assign(char_type* p, size_t count, char_type a);
    static bool eq(char_type a, char_type b);
    static bool lt(char_type a, char_type b);
    static char_type* move(char_type* desc, const char_type* src, size_t count);
    static char_type* copy(char_type* desc, const char_type* src, size_t count);

    static int compare(const char_type* s1, const char_type* s2, size_t count);
    static size_t length(const char_type* s);
    static const char_type* find(const char_type* p, size_t count, const char_type& ch);

    static char_type to_char_type(int_type c);
    static int_type  to_int_type(char_type c);
    static bool eq_int_type(int_type c1, int_type c2);
    static int_type eof();
    static int_type not_eof(int_type c);
};

template <
    class CharT,
    class Traits = std::char_traits<CharT>,
    class Allocator = std::allocator<CharT>
    > class basic_string {
public:
    typedef Traits traits_type;
#if CPPREFERENCE_SIMPLIFY_TYPEDEFS
    typedef CharT value_type;
#else
    typedef typename Traits::char_type value_type;
#endif
    typedef Allocator allocator_type;
#if CPPREFERENCE_SIMPLIFY_TYPEDEFS
    typedef size_t size_type;
    typedef ptrdiff_t difference_type;
    typedef CharT& reference;
    typedef const CharT& const_reference;
    typedef CharT* pointer;
    typedef const CharT* const_pointer;
#elif CPPREFERENCE_STDVER <2011
    typedef typename Allocator::size_type size_type;
    typedef typename Allocator::difference_type difference_type;
    typedef typename Allocator::reference reference;
    typedef typename Allocator::const_reference const_reference;
    typedef typename Allocator::pointer pointer;
    typedef typename Allocator::const_pointer const_pointer;
#else
    typedef typename std::allocator_traits<Allocator>::size_type size_type;
    typedef typename std::allocator_traits<Allocator>::difference_type difference_type;
    typedef value_type& reference;
    typedef const value_type& const_reference;
    typedef typename std::allocator_traits<Allocator>::pointer pointer;
    typedef typename std::allocator_traits<Allocator>::const_pointer const_pointer;
#endif
    typedef CharT* iterator; // actual type is unspecified
    typedef const CharT* const_iterator; // actual type is unspecified
    typedef std::reverse_iterator<iterator> reverse_iterator;
    typedef std::reverse_iterator<const_iterator> const_reverse_iterator;

    // constructor
#if CPPREFERENCE_STDVER <2014
    explicit basic_string(const Allocator& alloc = Allocator());
#else
    basic_string();
    explicit basic_string(const Allocator& alloc);
#endif

    basic_string(size_type count,
                 CharT ch,
                 const Allocator& alloc = Allocator());

    basic_string(const basic_string& other,
                 size_type pos,
                 size_type count = std::basic_string::npos,
                 const Allocator& alloc = Allocator());

    basic_string(const CharT* s,
                 size_type count,
                 const Allocator& alloc = Allocator());

    basic_string(const CharT* s,
                 const Allocator& alloc = Allocator());

    template<class InputIt>
    basic_string(InputIt first, InputIt last,
                 const Allocator& alloc = Allocator());

    basic_string(const basic_string& other);

#if CPPREFERENCE_STDVER>= 2011
    basic_string(const basic_string& other, const Allocator& alloc);
    basic_string(basic_string&& other);
    basic_string(basic_string&& other, const Allocator& alloc);
    basic_string(std::initializer_list<CharT> init,
                 const Allocator& alloc = Allocator());
#endif

    ~basic_string();

    basic_string& operator=(const basic_string& str);
    basic_string& operator=(const CharT* s);
    basic_string& operator=(CharT ch);
#if CPPREFERENCE_STDVER>= 2011
    basic_string& operator=(basic_string&& other);
    basic_string& operator=(initializer_list<CharT> ilist);
#endif

    basic_string& assign(size_type count, const CharT& ch);
    basic_string& assign(const basic_string& str);
#if CPPREFERENCE_STDVER>= 2014
    basic_string& assign(const basic_string& str,
                         size_type pos,
                         size_type count);
#else
    basic_string& assign(const basic_string& str,
                         size_type pos,
                         size_type count = npos);
#endif

    basic_string& assign(const CharT* s,
                         size_type count);

    basic_string& assign(const CharT* s);

    template<class InputIt>
    basic_string& assign(InputIt first, InputIt last);

#if CPPREFERENCE_STDVER>= 2011
    basic_string& assign(basic_string&& str);
    basic_string& assign(std::initializer_list<CharT> ilist);
#endif

    allocator_type get_allocator() const;

    // element access
    reference       at(size_type n);
    const_reference at(size_type n) const;
    reference       operator[](size_type n);
    const_reference operator[](size_type n) const;

#if CPPREFERENCE_STDVER>= 2011
    CharT& front();
    const CharT& front() const;
    CharT& back();
    const CharT& back() const;
#endif
    const CharT* data() const;
    const CharT* c_str() const;

    // iterators
    iterator begin();
    const_iterator begin() const;
    iterator end();
    const_iterator end() const;

    reverse_iterator       rbegin();
    const_reverse_iterator rbegin() const;
    reverse_iterator       rend();
    const_reverse_iterator rend() const;

#if CPPREFERENCE_STDVER>= 2011
    const_iterator         cbegin() const;
    const_iterator         cend() const;
    const_reverse_iterator crbegin() const;
    const_reverse_iterator crend() const;
#endif

    // capacity
    bool empty() const;
    size_type size() const;
    size_type length() const;
    size_type max_size() const;
    void reserve(size_type new_cap = 0);
    size_type capacity() const;

#if CPPREFERENCE_STDVER>= 2011
    void shrink_to_fit();
#endif

    void clear();

    basic_string& insert(size_type index, size_type count, CharT ch);
    basic_string& insert(size_type index, const CharT* s);
    basic_string& insert(size_type index, const CharT* s, size_type count);
    basic_string& insert(size_type index, const basic_string& str);

#if CPPREFERENCE_STDVER <2014
    basic_string& insert(size_type index, const basic_string& str,
                         size_type index_str, size_type count);
#else
    basic_string& insert(size_type index, const basic_string& str,
                         size_type index_str, size_type count = npos);
#endif

#if CPPREFERENCE_STDVER <2011
    iterator insert(iterator pos, CharT ch);
    void insert(iterator pos, size_type count, CharT ch);
    template<class InputIt>
    void insert(iterator pos, InputIt first, InputIt last);
#else
    iterator insert(const_iterator pos, CharT ch);
    iterator insert(const_iterator pos, size_type count, CharT ch);
    template<class InputIt>
    iterator insert(const_iterator pos, InputIt first, InputIt last);
    iterator insert(const_iterator pos, std::initializer_list<CharT> ilist);
#endif

    basic_string& erase(size_type index = 0, size_type count = npos);
#if CPPREFERENCE_STDVER <2011
    iterator erase(iterator pos);
    iterator erase(iterator first, iterator last);
#else
    iterator erase(const_iterator pos);
    iterator erase(const_iterator first, const_iterator last);
#endif

    void push_back(CharT ch);
#if CPPREFERENCE_STDVER>= 2011
    void pop_back();
#endif

#if CPPREFERENCE_STDVER <2011
    void resize(size_type count, T value = T());
#else
    void resize(size_type count);
    void resize(size_type count, const value_type& value);
#endif

    basic_string& append(size_type count, CharT ch);
    basic_string& append(const basic_string& str);
#if CPPREFERENCE_STDVER <2014
    basic_string& append(const basic_string& str,
                         size_type pos,
                         size_type count);
#else
    basic_string& append(const basic_string& str,
                         size_type pos,
                         size_type count = npos);
#endif
    basic_string& append(const CharT* s,
                         size_type count);
    basic_string& append(const CharT* s);
    template<class InputIt>
    basic_string& append(InputIt first, InputIt last);

#if CPPREFERENCE_STDVER> 2011
    basic_string& append(std::initializer_list<CharT> ilist);
#endif

    basic_string& operator+=(const basic_string& str);
    basic_string& operator+=(CharT ch);
    basic_string& operator+=(const CharT* s);
#if CPPREFERENCE_STDVER> 2011
    basic_string& operator+=(std::initializer_list<CharT> ilist);
#endif

    int compare(const basic_string& str) const;
    int compare(size_type pos1, size_type count1,
                const basic_string& str) const;

#if CPPREFERENCE_STDVER <2014
    int compare(size_type pos1, size_type count1,

                const basic_string& str,
                size_type pos2, size_type count2) const;
#else
    int compare(size_type pos1, size_type count1,
                const basic_string& str,
                size_type pos2, size_type count2 = npos) const;
#endif
    int compare(const CharT* s) const;
    int compare(size_type pos1, size_type count1,
                const CharT* s) const;
    int compare(size_type pos1, size_type count1,
                const CharT* s, size_type count2) const;

    basic_string& replace(size_type pos, size_type count,
                          const basic_string& str);
    basic_string& replace(const_iterator first, const_iterator last,
                          const basic_string& str);

#if CPPREFERENCE_STDVER <2014
    basic_string& replace(size_type pos, size_type count,

                          const basic_string& str,
                          size_type pos2, size_type count2);
#else
    basic_string& replace(size_type pos, size_type count,

                          const basic_string& str,
                          size_type pos2, size_type count2 = npos);
#endif

    template<class InputIt>
    basic_string& replace(const_iterator first, const_iterator last,
                          InputIt first2, InputIt last2);

    basic_string& replace(size_type pos, size_type count,
                          const CharT* cstr, size_type count2);

    basic_string& replace(const_iterator first, const_iterator last,
                          const CharT* cstr, size_type count2);

    basic_string& replace(size_type pos, size_type count,
                          const CharT* cstr);

    basic_string& replace(const_iterator first, const_iterator last,
                          const CharT* cstr);

    basic_string& replace(size_type pos, size_type count,
                          size_type count2, CharT ch);

    basic_string& replace(const_iterator first, const_iterator last,
                          size_type count2, CharT ch);

    basic_string& replace(const_iterator first, const_iterator last,
                          std::initializer_list<CharT> ilist);

    basic_string substr(size_type pos = 0,
                        size_type count = npos) const;

    size_type copy(CharT* dest,
                   size_type count,
                   size_type pos = 0) const;

    void swap(basic_string& other);

    // search
    size_type find(const basic_string& str, size_type pos = 0) const;
    size_type find(const CharT* s, size_type pos, size_type count) const;
    size_type find(const CharT* s, size_type pos = 0) const;
    size_type find(CharT ch, size_type pos = 0) const;

    size_type rfind(const basic_string& str, size_type pos = npos) const;
    size_type rfind(const CharT* s, size_type pos, size_type count) const;
    size_type rfind(const CharT* s, size_type pos = npos) const;
    size_type rfind(CharT ch, size_type pos = npos) const;

    size_type find_first_of(const basic_string& str, size_type pos = 0) const;
    size_type find_first_of(const CharT* s, size_type pos, size_type count) const;
    size_type find_first_of(const CharT* s, size_type pos = 0) const;
    size_type find_first_of(CharT ch, size_type pos = 0) const;

    size_type find_first_not_of(const basic_string& str, size_type pos = 0) const;
    size_type find_first_not_of(const CharT* s, size_type pos, size_type count) const;
    size_type find_first_not_of(const CharT* s, size_type pos = 0) const;
    size_type find_first_not_of(CharT ch, size_type pos = 0) const;

    size_type find_last_of(const basic_string& str, size_type pos = npos) const;
    size_type find_last_of(const CharT* s, size_type pos, size_type count) const;
    size_type find_last_of(const CharT* s, size_type pos = npos) const;
    size_type find_last_of(CharT ch, size_type pos = npos) const;

    size_type find_last_not_of(const basic_string& str, size_type pos = npos) const;
    size_type find_last_not_of(const CharT* s, size_type pos, size_type count) const;
    size_type find_last_not_of(const CharT* s, size_type pos = npos) const;
    size_type find_last_not_of(CharT ch, size_type pos = npos) const;

    static const size_type npos = -1;
};

typedef std::basic_string<char> string;
typedef std::basic_string<wchar_t> wstring;
#if CPPREFERENCE_STDVER>= 2011
typedef std::basic_string<char16_t> u16string;
typedef std::basic_string<char32_t> u32string;
#endif

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(const basic_string<CharT, Traits, Alloc>& lhs,
          const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(const CharT* lhs,
          const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(CharT lhs,
          const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(const basic_string<CharT, Traits, Alloc>& lhs,
          const CharT* rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(const basic_string<CharT, Traits, Alloc>& lhs,
          CharT rhs);

#if CPPREFERENCE_STDVER>= 2011
template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(basic_string<CharT, Traits, Alloc>&& lhs,
          const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(const basic_string<CharT, Traits, Alloc>& lhs,
          basic_string<CharT, Traits, Alloc>&& rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(basic_string<CharT, Traits, Alloc>&& lhs,
          basic_string<CharT, Traits, Alloc>&& rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(const CharT* lhs,
          basic_string<CharT, Traits, Alloc>&& rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(CharT lhs,
          basic_string<CharT, Traits, Alloc>&& rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(basic_string<CharT, Traits, Alloc>&& lhs,
          const CharT* rhs);

template<class CharT, class Traits, class Alloc>
basic_string<CharT, Traits, Alloc>
operator+(basic_string<CharT, Traits, Alloc>&& lhs,
          CharT rhs);
#endif // CPPREFERENCE_STDVER>= 2011

template<class CharT, class Traits, class Alloc>
bool operator==(const basic_string<CharT, Traits, Alloc>& lhs,
                const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator!=(const basic_string<CharT, Traits, Alloc>& lhs,
                const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator<(const basic_string<CharT, Traits, Alloc>& lhs,
               const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator<=(const basic_string<CharT, Traits, Alloc>& lhs,
                const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator>(const basic_string<CharT, Traits, Alloc>& lhs,
               const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator>=(const basic_string<CharT, Traits, Alloc>& lhs,
                const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator==(const CharT* lhs, const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator==(const basic_string<CharT, Traits, Alloc>& lhs, const CharT* rhs);

template<class CharT, class Traits, class Alloc>
bool operator!=(const CharT* lhs, const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator!=(const basic_string<CharT, Traits, Alloc>& lhs, const CharT* rhs);

template<class CharT, class Traits, class Alloc>
bool operator<(const CharT* lhs, const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator<(const basic_string<CharT, Traits, Alloc>& lhs,  const CharT* rhs);

template<class CharT, class Traits, class Alloc>
bool operator<=(const CharT* lhs, const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator<=(const basic_string<CharT, Traits, Alloc>& lhs, const CharT* rhs);

template<class CharT, class Traits, class Alloc>
bool operator>(const CharT* lhs, const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator>(const basic_string<CharT, Traits, Alloc>& lhs, const CharT* rhs);

template<class CharT, class Traits, class Alloc>
bool operator>=(const CharT* lhs, const basic_string<CharT, Traits, Alloc>& rhs);

template<class CharT, class Traits, class Alloc>
bool operator>=(const basic_string<CharT, Traits, Alloc>& lhs, const CharT* rhs);

template<class T, class Traits, class Alloc>
void swap(basic_string<T, Traits, Alloc>& lhs, basic_string<T, Traits, Alloc>& rhs);

template <class CharT, class Traits, class Allocator>
std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os,
           const std::basic_string<CharT, Traits, Allocator>& str);

template <class CharT, class Traits, class Allocator>
std::basic_istream<CharT, Traits>&
operator>>(std::basic_istream<CharT, Traits>& is,
           std::basic_string<CharT, Traits, Allocator>& str);

template<class CharT, class Traits, class Allocator>
std::basic_istream<CharT, Traits>& getline(std::basic_istream<CharT, Traits>& input,
        std::basic_string<CharT, Traits, Allocator>& str,
        CharT delim);

template<class CharT, class Traits, class Allocator>
std::basic_istream<CharT, Traits>& getline(std::basic_istream<CharT, Traits>& input,
        std::basic_string<CharT, Traits, Allocator>& str);

#if CPPREFERENCE_STDVER>= 2011
template<class CharT, class Traits, class Allocator>
std::basic_istream<CharT, Traits>& getline(std::basic_istream<CharT, Traits>&& input,
        std::basic_string<CharT, Traits, Allocator>& str,
        CharT delim);

template<class CharT, class Traits, class Allocator>
std::basic_istream<CharT, Traits>& getline(std::basic_istream<CharT, Traits>&& input,
        std::basic_string<CharT, Traits, Allocator>& str);
#endif

#if CPPREFERENCE_STDVER>= 2011
int       stoi(const std::string& str, std::size_t* pos = 0, int base = 10);
int       stoi(const std::wstring& str, std::size_t* pos = 0, int base = 10);

long      stol(const std::string& str, std::size_t* pos = 0, int base = 10);
long      stol(const std::wstring& str, std::size_t* pos = 0, int base = 10);

long long stoll(const std::string& str, std::size_t* pos = 0, int base = 10);
long long stoll(const std::wstring& str, std::size_t* pos = 0, int base = 10);

unsigned long      stoul(const std::string& str, std::size_t* pos = 0, int base = 10);
unsigned long      stoul(const std::wstring& str, std::size_t* pos = 0, int base = 10);
unsigned long long stoull(const std::string& str, std::size_t* pos = 0, int base = 10);
unsigned long long stoull(const std::wstring& str, std::size_t* pos = 0, int base = 10);

float       stof(const std::string& str, std::size_t* pos = 0);
float       stof(const std::wstring& str, std::size_t* pos = 0);
double      stod(const std::string& str, std::size_t* pos = 0);
double      stod(const std::wstring& str, std::size_t* pos = 0);
long double stold(const std::string& str, std::size_t* pos = 0);
long double stold(const std::wstring& str, std::size_t* pos = 0);

std::string to_string(int value);
std::string to_string(long value);
std::string to_string(long long value);
std::string to_string(unsigned value);
std::string to_string(unsigned long value);
std::string to_string(unsigned long long value);
std::string to_string(float value);
std::string to_string(double value);
std::string to_string(long double value);

std::wstring to_wstring(int value);
std::wstring to_wstring(long value);
std::wstring to_wstring(long long value);
std::wstring to_wstring(unsigned value);
std::wstring to_wstring(unsigned long value);
std::wstring to_wstring(unsigned long long value);
std::wstring to_wstring(float value);
std::wstring to_wstring(double value);
std::wstring to_wstring(long double value);
#endif
} // namespace std

#endif // CPPREFERENCE_STRING_H