Coverage Report

Created: 2024-09-08 06:18

/src/llvm-project-16.0.6.build/include/c++/v1/istream
Line
Count
Source (jump to first uncovered line)
1
// -*- C++ -*-
2
//===----------------------------------------------------------------------===//
3
//
4
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5
// See https://llvm.org/LICENSE.txt for license information.
6
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef _LIBCPP_ISTREAM
11
#define _LIBCPP_ISTREAM
12
13
/*
14
    istream synopsis
15
16
template <class charT, class traits = char_traits<charT> >
17
class basic_istream
18
    : virtual public basic_ios<charT,traits>
19
{
20
public:
21
    // types (inherited from basic_ios (27.5.4)):
22
    typedef charT                          char_type;
23
    typedef traits                         traits_type;
24
    typedef typename traits_type::int_type int_type;
25
    typedef typename traits_type::pos_type pos_type;
26
    typedef typename traits_type::off_type off_type;
27
28
    // 27.7.1.1.1 Constructor/destructor:
29
    explicit basic_istream(basic_streambuf<char_type, traits_type>* sb);
30
    basic_istream(basic_istream&& rhs);
31
    virtual ~basic_istream();
32
33
    // 27.7.1.1.2 Assign/swap:
34
    basic_istream& operator=(basic_istream&& rhs);
35
    void swap(basic_istream& rhs);
36
37
    // 27.7.1.1.3 Prefix/suffix:
38
    class sentry;
39
40
    // 27.7.1.2 Formatted input:
41
    basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));
42
    basic_istream& operator>>(basic_ios<char_type, traits_type>&
43
                              (*pf)(basic_ios<char_type, traits_type>&));
44
    basic_istream& operator>>(ios_base& (*pf)(ios_base&));
45
    basic_istream& operator>>(basic_streambuf<char_type, traits_type>* sb);
46
    basic_istream& operator>>(bool& n);
47
    basic_istream& operator>>(short& n);
48
    basic_istream& operator>>(unsigned short& n);
49
    basic_istream& operator>>(int& n);
50
    basic_istream& operator>>(unsigned int& n);
51
    basic_istream& operator>>(long& n);
52
    basic_istream& operator>>(unsigned long& n);
53
    basic_istream& operator>>(long long& n);
54
    basic_istream& operator>>(unsigned long long& n);
55
    basic_istream& operator>>(float& f);
56
    basic_istream& operator>>(double& f);
57
    basic_istream& operator>>(long double& f);
58
    basic_istream& operator>>(void*& p);
59
60
    // 27.7.1.3 Unformatted input:
61
    streamsize gcount() const;
62
    int_type get();
63
    basic_istream& get(char_type& c);
64
    basic_istream& get(char_type* s, streamsize n);
65
    basic_istream& get(char_type* s, streamsize n, char_type delim);
66
    basic_istream& get(basic_streambuf<char_type,traits_type>& sb);
67
    basic_istream& get(basic_streambuf<char_type,traits_type>& sb, char_type delim);
68
69
    basic_istream& getline(char_type* s, streamsize n);
70
    basic_istream& getline(char_type* s, streamsize n, char_type delim);
71
72
    basic_istream& ignore(streamsize n = 1, int_type delim = traits_type::eof());
73
    int_type peek();
74
    basic_istream& read (char_type* s, streamsize n);
75
    streamsize readsome(char_type* s, streamsize n);
76
77
    basic_istream& putback(char_type c);
78
    basic_istream& unget();
79
    int sync();
80
81
    pos_type tellg();
82
    basic_istream& seekg(pos_type);
83
    basic_istream& seekg(off_type, ios_base::seekdir);
84
protected:
85
    basic_istream(const basic_istream& rhs) = delete;
86
    basic_istream(basic_istream&& rhs);
87
    // 27.7.2.1.2 Assign/swap:
88
    basic_istream& operator=(const basic_istream& rhs) = delete;
89
    basic_istream& operator=(basic_istream&& rhs);
90
    void swap(basic_istream& rhs);
91
};
92
93
// 27.7.1.2.3 character extraction templates:
94
template<class charT, class traits>
95
  basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>&, charT&);
96
97
template<class traits>
98
  basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, unsigned char&);
99
100
template<class traits>
101
  basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, signed char&);
102
103
template<class charT, class traits>
104
  basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>&, charT*);
105
106
template<class traits>
107
  basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, unsigned char*);
108
109
template<class traits>
110
  basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, signed char*);
111
112
template <class charT, class traits>
113
  void
114
  swap(basic_istream<charT, traits>& x, basic_istream<charT, traits>& y);
115
116
typedef basic_istream<char> istream;
117
typedef basic_istream<wchar_t> wistream;
118
119
template <class charT, class traits = char_traits<charT> >
120
class basic_iostream :
121
    public basic_istream<charT,traits>,
122
    public basic_ostream<charT,traits>
123
{
124
public:
125
    // types:
126
    typedef charT                          char_type;
127
    typedef traits                         traits_type;
128
    typedef typename traits_type::int_type int_type;
129
    typedef typename traits_type::pos_type pos_type;
130
    typedef typename traits_type::off_type off_type;
131
132
    // constructor/destructor
133
    explicit basic_iostream(basic_streambuf<char_type, traits_type>* sb);
134
    basic_iostream(basic_iostream&& rhs);
135
    virtual ~basic_iostream();
136
137
    // assign/swap
138
    basic_iostream& operator=(basic_iostream&& rhs);
139
    void swap(basic_iostream& rhs);
140
};
141
142
template <class charT, class traits>
143
  void
144
  swap(basic_iostream<charT, traits>& x, basic_iostream<charT, traits>& y);
145
146
typedef basic_iostream<char> iostream;
147
typedef basic_iostream<wchar_t> wiostream;
148
149
template <class charT, class traits>
150
  basic_istream<charT,traits>&
151
  ws(basic_istream<charT,traits>& is);
152
153
// rvalue stream extraction
154
template <class Stream, class T>
155
  Stream&& operator>>(Stream&& is, T&& x);
156
157
}  // std
158
159
*/
160
161
#include <__assert> // all public C++ headers provide the assertion handler
162
#include <__config>
163
#include <__iterator/istreambuf_iterator.h>
164
#include <__utility/forward.h>
165
#include <ostream>
166
#include <version>
167
168
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
169
#  pragma GCC system_header
170
#endif
171
172
_LIBCPP_PUSH_MACROS
173
#include <__undef_macros>
174
175
176
_LIBCPP_BEGIN_NAMESPACE_STD
177
178
template <class _CharT, class _Traits>
179
class _LIBCPP_TEMPLATE_VIS basic_istream
180
    : virtual public basic_ios<_CharT, _Traits>
181
{
182
    streamsize __gc_;
183
public:
184
    // types (inherited from basic_ios (27.5.4)):
185
    typedef _CharT                         char_type;
186
    typedef _Traits                        traits_type;
187
    typedef typename traits_type::int_type int_type;
188
    typedef typename traits_type::pos_type pos_type;
189
    typedef typename traits_type::off_type off_type;
190
191
    // 27.7.1.1.1 Constructor/destructor:
192
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
193
    explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb) : __gc_(0)
194
0
    { this->init(__sb); }
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::basic_istream(std::__1::basic_streambuf<char, std::__1::char_traits<char> >*)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::basic_istream(std::__1::basic_streambuf<char, std::__1::char_traits<char> >*)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::basic_istream(std::__1::basic_streambuf<wchar_t, std::__1::char_traits<wchar_t> >*)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::basic_istream(std::__1::basic_streambuf<wchar_t, std::__1::char_traits<wchar_t> >*)
195
    ~basic_istream() override;
196
protected:
197
    inline _LIBCPP_INLINE_VISIBILITY
198
    basic_istream(basic_istream&& __rhs);
199
200
    // 27.7.1.1.2 Assign/swap:
201
    inline _LIBCPP_INLINE_VISIBILITY
202
    basic_istream& operator=(basic_istream&& __rhs);
203
204
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
205
0
    void swap(basic_istream& __rhs) {
206
0
      _VSTD::swap(__gc_, __rhs.__gc_);
207
0
      basic_ios<char_type, traits_type>::swap(__rhs);
208
0
    }
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::swap(std::__1::basic_istream<char, std::__1::char_traits<char> >&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::swap(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&)
209
210
    basic_istream           (const basic_istream& __rhs) = delete;
211
    basic_istream& operator=(const basic_istream& __rhs) = delete;
212
public:
213
214
    // 27.7.1.1.3 Prefix/suffix:
215
    class _LIBCPP_TEMPLATE_VIS sentry;
216
217
    // 27.7.1.2 Formatted input:
218
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
219
    basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&))
220
0
    { return __pf(*this); }
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(std::__1::basic_istream<char, std::__1::char_traits<char> >& (*)(std::__1::basic_istream<char, std::__1::char_traits<char> >&))
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& (*)(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&))
221
222
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
223
    basic_istream& operator>>(basic_ios<char_type, traits_type>&
224
                              (*__pf)(basic_ios<char_type, traits_type>&))
225
0
    { __pf(*this); return *this; }
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(std::__1::basic_ios<char, std::__1::char_traits<char> >& (*)(std::__1::basic_ios<char, std::__1::char_traits<char> >&))
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(std::__1::basic_ios<wchar_t, std::__1::char_traits<wchar_t> >& (*)(std::__1::basic_ios<wchar_t, std::__1::char_traits<wchar_t> >&))
226
227
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
228
    basic_istream& operator>>(ios_base& (*__pf)(ios_base&))
229
0
    { __pf(*this); return *this; }
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(std::__1::ios_base& (*)(std::__1::ios_base&))
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(std::__1::ios_base& (*)(std::__1::ios_base&))
230
231
    basic_istream& operator>>(basic_streambuf<char_type, traits_type>* __sb);
232
    basic_istream& operator>>(bool& __n);
233
    basic_istream& operator>>(short& __n);
234
    basic_istream& operator>>(unsigned short& __n);
235
    basic_istream& operator>>(int& __n);
236
    basic_istream& operator>>(unsigned int& __n);
237
    basic_istream& operator>>(long& __n);
238
    basic_istream& operator>>(unsigned long& __n);
239
    basic_istream& operator>>(long long& __n);
240
    basic_istream& operator>>(unsigned long long& __n);
241
    basic_istream& operator>>(float& __f);
242
    basic_istream& operator>>(double& __f);
243
    basic_istream& operator>>(long double& __f);
244
    basic_istream& operator>>(void*& __p);
245
246
    // 27.7.1.3 Unformatted input:
247
    _LIBCPP_INLINE_VISIBILITY
248
    streamsize gcount() const {return __gc_;}
249
    int_type get();
250
251
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
252
0
    basic_istream& get(char_type& __c) {
253
0
      int_type __ch = get();
254
0
      if (__ch != traits_type::eof())
255
0
        __c = traits_type::to_char_type(__ch);
256
0
      return *this;
257
0
    }
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::get(char&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::get(wchar_t&)
258
259
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
260
    basic_istream& get(char_type* __s, streamsize __n)
261
0
    { return get(__s, __n, this->widen('\n')); }
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::get(char*, long)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::get(wchar_t*, long)
262
263
    basic_istream& get(char_type* __s, streamsize __n, char_type __dlm);
264
265
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
266
    basic_istream& get(basic_streambuf<char_type, traits_type>& __sb)
267
0
    { return get(__sb, this->widen('\n')); }
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::get(std::__1::basic_streambuf<char, std::__1::char_traits<char> >&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::get(std::__1::basic_streambuf<wchar_t, std::__1::char_traits<wchar_t> >&)
268
269
    basic_istream& get(basic_streambuf<char_type, traits_type>& __sb, char_type __dlm);
270
271
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
272
    basic_istream& getline(char_type* __s, streamsize __n)
273
0
    { return getline(__s, __n, this->widen('\n')); }
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::getline(char*, long)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::getline(wchar_t*, long)
274
275
    basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);
276
277
    basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());
278
    int_type peek();
279
    basic_istream& read (char_type* __s, streamsize __n);
280
    streamsize readsome(char_type* __s, streamsize __n);
281
282
    basic_istream& putback(char_type __c);
283
    basic_istream& unget();
284
    int sync();
285
286
    pos_type tellg();
287
    basic_istream& seekg(pos_type __pos);
288
    basic_istream& seekg(off_type __off, ios_base::seekdir __dir);
289
};
290
291
template <class _CharT, class _Traits>
292
class _LIBCPP_TEMPLATE_VIS basic_istream<_CharT, _Traits>::sentry
293
{
294
    bool __ok_;
295
296
public:
297
    explicit sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
298
//    ~sentry() = default;
299
300
    _LIBCPP_INLINE_VISIBILITY
301
5.30k
    explicit operator bool() const {return __ok_;}
std::__1::basic_istream<char, std::__1::char_traits<char> >::sentry::operator bool[abi:v160006]() const
Line
Count
Source
301
5.30k
    explicit operator bool() const {return __ok_;}
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::sentry::operator bool[abi:v160006]() const
302
303
    sentry(const sentry&) = delete;
304
    sentry& operator=(const sentry&) = delete;
305
};
306
307
template <class _CharT, class _Traits>
308
basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& __is,
309
                                               bool __noskipws)
310
    : __ok_(false)
311
5.30k
{
312
5.30k
    if (__is.good())
313
2.84k
    {
314
2.84k
        if (__is.tie())
315
0
            __is.tie()->flush();
316
2.84k
        if (!__noskipws && (__is.flags() & ios_base::skipws))
317
2.84k
        {
318
2.84k
            typedef istreambuf_iterator<_CharT, _Traits> _Ip;
319
2.84k
            const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
320
2.84k
            _Ip __i(__is);
321
2.84k
            _Ip __eof;
322
41.2k
            for (; __i != __eof; ++__i)
323
41.1k
                if (!__ct.is(__ct.space, *__i))
324
2.81k
                    break;
325
2.84k
            if (__i == __eof)
326
39
                __is.setstate(ios_base::failbit | ios_base::eofbit);
327
2.84k
        }
328
2.84k
        __ok_ = __is.good();
329
2.84k
    }
330
2.45k
    else
331
2.45k
        __is.setstate(ios_base::failbit);
332
5.30k
}
std::__1::basic_istream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_istream<char, std::__1::char_traits<char> >&, bool)
Line
Count
Source
311
5.30k
{
312
5.30k
    if (__is.good())
313
2.84k
    {
314
2.84k
        if (__is.tie())
315
0
            __is.tie()->flush();
316
2.84k
        if (!__noskipws && (__is.flags() & ios_base::skipws))
317
2.84k
        {
318
2.84k
            typedef istreambuf_iterator<_CharT, _Traits> _Ip;
319
2.84k
            const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
320
2.84k
            _Ip __i(__is);
321
2.84k
            _Ip __eof;
322
41.2k
            for (; __i != __eof; ++__i)
323
41.1k
                if (!__ct.is(__ct.space, *__i))
324
2.81k
                    break;
325
2.84k
            if (__i == __eof)
326
39
                __is.setstate(ios_base::failbit | ios_base::eofbit);
327
2.84k
        }
328
2.84k
        __ok_ = __is.good();
329
2.84k
    }
330
2.45k
    else
331
2.45k
        __is.setstate(ios_base::failbit);
332
5.30k
}
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::sentry::sentry(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, bool)
333
334
template <class _CharT, class _Traits>
335
basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
336
    : __gc_(__rhs.__gc_)
337
{
338
    __rhs.__gc_ = 0;
339
    this->move(__rhs);
340
}
341
342
template <class _CharT, class _Traits>
343
basic_istream<_CharT, _Traits>&
344
basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)
345
0
{
346
0
    swap(__rhs);
347
0
    return *this;
348
0
}
349
350
template <class _CharT, class _Traits>
351
basic_istream<_CharT, _Traits>::~basic_istream()
352
1.32k
{
353
1.32k
}
std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()
Line
Count
Source
352
1.32k
{
353
1.32k
}
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::~basic_istream()
354
355
template <class _Tp, class _CharT, class _Traits>
356
_LIBCPP_INLINE_VISIBILITY
357
basic_istream<_CharT, _Traits>&
358
5.30k
__input_arithmetic(basic_istream<_CharT, _Traits>& __is, _Tp& __n) {
359
5.30k
    ios_base::iostate __state = ios_base::goodbit;
360
5.30k
    typename basic_istream<_CharT, _Traits>::sentry __s(__is);
361
5.30k
    if (__s)
362
2.81k
    {
363
2.81k
#ifndef _LIBCPP_NO_EXCEPTIONS
364
2.81k
        try
365
2.81k
        {
366
2.81k
#endif // _LIBCPP_NO_EXCEPTIONS
367
2.81k
            typedef istreambuf_iterator<_CharT, _Traits> _Ip;
368
2.81k
            typedef num_get<_CharT, _Ip> _Fp;
369
2.81k
            std::use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __n);
370
2.81k
#ifndef _LIBCPP_NO_EXCEPTIONS
371
2.81k
        }
372
2.81k
        catch (...)
373
2.81k
        {
374
0
            __state |= ios_base::badbit;
375
0
            __is.__setstate_nothrow(__state);
376
0
            if (__is.exceptions() & ios_base::badbit)
377
0
            {
378
0
                throw;
379
0
            }
380
0
        }
381
0
#endif
382
2.81k
        __is.setstate(__state);
383
2.81k
    }
384
5.30k
    return __is;
385
5.30k
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<bool, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, bool&)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<unsigned short, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, unsigned short&)
std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<unsigned int, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, unsigned int&)
Line
Count
Source
358
5.30k
__input_arithmetic(basic_istream<_CharT, _Traits>& __is, _Tp& __n) {
359
5.30k
    ios_base::iostate __state = ios_base::goodbit;
360
5.30k
    typename basic_istream<_CharT, _Traits>::sentry __s(__is);
361
5.30k
    if (__s)
362
2.81k
    {
363
2.81k
#ifndef _LIBCPP_NO_EXCEPTIONS
364
2.81k
        try
365
2.81k
        {
366
2.81k
#endif // _LIBCPP_NO_EXCEPTIONS
367
2.81k
            typedef istreambuf_iterator<_CharT, _Traits> _Ip;
368
2.81k
            typedef num_get<_CharT, _Ip> _Fp;
369
2.81k
            std::use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __n);
370
2.81k
#ifndef _LIBCPP_NO_EXCEPTIONS
371
2.81k
        }
372
2.81k
        catch (...)
373
2.81k
        {
374
0
            __state |= ios_base::badbit;
375
0
            __is.__setstate_nothrow(__state);
376
0
            if (__is.exceptions() & ios_base::badbit)
377
0
            {
378
0
                throw;
379
0
            }
380
0
        }
381
0
#endif
382
2.81k
        __is.setstate(__state);
383
2.81k
    }
384
5.30k
    return __is;
385
5.30k
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<long, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, long&)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<unsigned long, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, unsigned long&)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<long long, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, long long&)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<unsigned long long, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, unsigned long long&)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<float, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, float&)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<double, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, double&)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<long double, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, long double&)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic[abi:v160006]<void*, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, void*&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<bool, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, bool&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<unsigned short, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, unsigned short&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<unsigned int, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, unsigned int&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<long, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, long&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<unsigned long, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, unsigned long&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<long long, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, long long&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<unsigned long long, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, unsigned long long&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<float, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, float&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<double, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, double&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<long double, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, long double&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic[abi:v160006]<void*, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, void*&)
386
387
template <class _CharT, class _Traits>
388
basic_istream<_CharT, _Traits>&
389
basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)
390
0
{
391
0
    return _VSTD::__input_arithmetic<unsigned short>(*this, __n);
392
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(unsigned short&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(unsigned short&)
393
394
template <class _CharT, class _Traits>
395
basic_istream<_CharT, _Traits>&
396
basic_istream<_CharT, _Traits>::operator>>(unsigned int& __n)
397
5.30k
{
398
5.30k
    return _VSTD::__input_arithmetic<unsigned int>(*this, __n);
399
5.30k
}
std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(unsigned int&)
Line
Count
Source
397
5.30k
{
398
5.30k
    return _VSTD::__input_arithmetic<unsigned int>(*this, __n);
399
5.30k
}
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(unsigned int&)
400
401
template <class _CharT, class _Traits>
402
basic_istream<_CharT, _Traits>&
403
basic_istream<_CharT, _Traits>::operator>>(long& __n)
404
0
{
405
0
    return _VSTD::__input_arithmetic<long>(*this, __n);
406
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(long&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(long&)
407
408
template <class _CharT, class _Traits>
409
basic_istream<_CharT, _Traits>&
410
basic_istream<_CharT, _Traits>::operator>>(unsigned long& __n)
411
0
{
412
0
    return _VSTD::__input_arithmetic<unsigned long>(*this, __n);
413
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(unsigned long&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(unsigned long&)
414
415
template <class _CharT, class _Traits>
416
basic_istream<_CharT, _Traits>&
417
basic_istream<_CharT, _Traits>::operator>>(long long& __n)
418
0
{
419
0
    return _VSTD::__input_arithmetic<long long>(*this, __n);
420
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(long long&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(long long&)
421
422
template <class _CharT, class _Traits>
423
basic_istream<_CharT, _Traits>&
424
basic_istream<_CharT, _Traits>::operator>>(unsigned long long& __n)
425
0
{
426
0
    return _VSTD::__input_arithmetic<unsigned long long>(*this, __n);
427
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(unsigned long long&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(unsigned long long&)
428
429
template <class _CharT, class _Traits>
430
basic_istream<_CharT, _Traits>&
431
basic_istream<_CharT, _Traits>::operator>>(float& __n)
432
0
{
433
0
    return _VSTD::__input_arithmetic<float>(*this, __n);
434
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(float&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(float&)
435
436
template <class _CharT, class _Traits>
437
basic_istream<_CharT, _Traits>&
438
basic_istream<_CharT, _Traits>::operator>>(double& __n)
439
0
{
440
0
    return _VSTD::__input_arithmetic<double>(*this, __n);
441
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(double&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(double&)
442
443
template <class _CharT, class _Traits>
444
basic_istream<_CharT, _Traits>&
445
basic_istream<_CharT, _Traits>::operator>>(long double& __n)
446
0
{
447
0
    return _VSTD::__input_arithmetic<long double>(*this, __n);
448
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(long double&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(long double&)
449
450
template <class _CharT, class _Traits>
451
basic_istream<_CharT, _Traits>&
452
basic_istream<_CharT, _Traits>::operator>>(bool& __n)
453
0
{
454
0
    return _VSTD::__input_arithmetic<bool>(*this, __n);
455
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(bool&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(bool&)
456
457
template <class _CharT, class _Traits>
458
basic_istream<_CharT, _Traits>&
459
basic_istream<_CharT, _Traits>::operator>>(void*& __n)
460
0
{
461
0
    return _VSTD::__input_arithmetic<void*>(*this, __n);
462
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(void*&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(void*&)
463
464
template <class _Tp, class _CharT, class _Traits>
465
_LIBCPP_INLINE_VISIBILITY
466
basic_istream<_CharT, _Traits>&
467
0
__input_arithmetic_with_numeric_limits(basic_istream<_CharT, _Traits>& __is, _Tp& __n) {
468
0
    ios_base::iostate __state = ios_base::goodbit;
469
0
    typename basic_istream<_CharT, _Traits>::sentry __s(__is);
470
0
    if (__s)
471
0
    {
472
0
#ifndef _LIBCPP_NO_EXCEPTIONS
473
0
        try
474
0
        {
475
0
#endif // _LIBCPP_NO_EXCEPTIONS
476
0
            typedef istreambuf_iterator<_CharT, _Traits> _Ip;
477
0
            typedef num_get<_CharT, _Ip> _Fp;
478
0
            long __temp;
479
0
            std::use_facet<_Fp>(__is.getloc()).get(_Ip(__is), _Ip(), __is, __state, __temp);
480
0
            if (__temp < numeric_limits<_Tp>::min())
481
0
            {
482
0
                __state |= ios_base::failbit;
483
0
                __n = numeric_limits<_Tp>::min();
484
0
            }
485
0
            else if (__temp > numeric_limits<_Tp>::max())
486
0
            {
487
0
                __state |= ios_base::failbit;
488
0
                __n = numeric_limits<_Tp>::max();
489
0
            }
490
0
            else
491
0
            {
492
0
                __n = static_cast<_Tp>(__temp);
493
0
            }
494
0
#ifndef _LIBCPP_NO_EXCEPTIONS
495
0
        }
496
0
        catch (...)
497
0
        {
498
0
            __state |= ios_base::badbit;
499
0
            __is.__setstate_nothrow(__state);
500
0
            if (__is.exceptions() & ios_base::badbit)
501
0
            {
502
0
                throw;
503
0
            }
504
0
        }
505
0
#endif // _LIBCPP_NO_EXCEPTIONS
506
0
        __is.setstate(__state);
507
0
    }
508
0
    return __is;
509
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic_with_numeric_limits[abi:v160006]<short, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, short&)
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::__input_arithmetic_with_numeric_limits[abi:v160006]<int, char, std::__1::char_traits<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, int&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic_with_numeric_limits[abi:v160006]<short, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, short&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >& std::__1::__input_arithmetic_with_numeric_limits[abi:v160006]<int, wchar_t, std::__1::char_traits<wchar_t> >(std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >&, int&)
510
511
template <class _CharT, class _Traits>
512
basic_istream<_CharT, _Traits>&
513
basic_istream<_CharT, _Traits>::operator>>(short& __n)
514
0
{
515
0
    return _VSTD::__input_arithmetic_with_numeric_limits<short>(*this, __n);
516
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(short&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(short&)
517
518
template <class _CharT, class _Traits>
519
basic_istream<_CharT, _Traits>&
520
basic_istream<_CharT, _Traits>::operator>>(int& __n)
521
0
{
522
0
    return _VSTD::__input_arithmetic_with_numeric_limits<int>(*this, __n);
523
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(int&)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(int&)
524
525
template<class _CharT, class _Traits>
526
_LIBCPP_INLINE_VISIBILITY
527
basic_istream<_CharT, _Traits>&
528
__input_c_string(basic_istream<_CharT, _Traits>& __is, _CharT* __p, size_t __n)
529
{
530
    ios_base::iostate __state = ios_base::goodbit;
531
    typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
532
    if (__sen)
533
    {
534
#ifndef _LIBCPP_NO_EXCEPTIONS
535
        try
536
        {
537
#endif
538
            _CharT* __s = __p;
539
            const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
540
            while (__s != __p + (__n-1))
541
            {
542
                typename _Traits::int_type __i = __is.rdbuf()->sgetc();
543
                if (_Traits::eq_int_type(__i, _Traits::eof()))
544
                {
545
                   __state |= ios_base::eofbit;
546
                   break;
547
                }
548
                _CharT __ch = _Traits::to_char_type(__i);
549
                if (__ct.is(__ct.space, __ch))
550
                    break;
551
                *__s++ = __ch;
552
                 __is.rdbuf()->sbumpc();
553
            }
554
            *__s = _CharT();
555
            __is.width(0);
556
            if (__s == __p)
557
               __state |= ios_base::failbit;
558
#ifndef _LIBCPP_NO_EXCEPTIONS
559
        }
560
        catch (...)
561
        {
562
            __state |= ios_base::badbit;
563
            __is.__setstate_nothrow(__state);
564
            if (__is.exceptions() & ios_base::badbit)
565
            {
566
                throw;
567
            }
568
        }
569
#endif
570
        __is.setstate(__state);
571
    }
572
    return __is;
573
}
574
575
#if _LIBCPP_STD_VER > 17
576
577
template<class _CharT, class _Traits, size_t _Np>
578
inline _LIBCPP_INLINE_VISIBILITY
579
basic_istream<_CharT, _Traits>&
580
operator>>(basic_istream<_CharT, _Traits>& __is, _CharT (&__buf)[_Np])
581
{
582
    size_t __n = _Np;
583
    if (__is.width() > 0)
584
        __n = _VSTD::min(size_t(__is.width()), _Np);
585
    return _VSTD::__input_c_string(__is, __buf, __n);
586
}
587
588
template<class _Traits, size_t _Np>
589
inline _LIBCPP_INLINE_VISIBILITY
590
basic_istream<char, _Traits>&
591
operator>>(basic_istream<char, _Traits>& __is, unsigned char (&__buf)[_Np])
592
{
593
    return __is >> (char(&)[_Np])__buf;
594
}
595
596
template<class _Traits, size_t _Np>
597
inline _LIBCPP_INLINE_VISIBILITY
598
basic_istream<char, _Traits>&
599
operator>>(basic_istream<char, _Traits>& __is, signed char (&__buf)[_Np])
600
{
601
    return __is >> (char(&)[_Np])__buf;
602
}
603
604
#else
605
606
template<class _CharT, class _Traits>
607
inline _LIBCPP_INLINE_VISIBILITY
608
basic_istream<_CharT, _Traits>&
609
operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
610
{
611
    streamsize __n = __is.width();
612
    if (__n <= 0)
613
        __n = numeric_limits<streamsize>::max() / sizeof(_CharT) - 1;
614
    return _VSTD::__input_c_string(__is, __s, size_t(__n));
615
}
616
617
template<class _Traits>
618
inline _LIBCPP_INLINE_VISIBILITY
619
basic_istream<char, _Traits>&
620
operator>>(basic_istream<char, _Traits>& __is, unsigned char* __s)
621
{
622
    return __is >> (char*)__s;
623
}
624
625
template<class _Traits>
626
inline _LIBCPP_INLINE_VISIBILITY
627
basic_istream<char, _Traits>&
628
operator>>(basic_istream<char, _Traits>& __is, signed char* __s)
629
{
630
    return __is >> (char*)__s;
631
}
632
633
#endif // _LIBCPP_STD_VER > 17
634
635
template<class _CharT, class _Traits>
636
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
637
operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
638
{
639
    ios_base::iostate __state = ios_base::goodbit;
640
    typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
641
    if (__sen)
642
    {
643
#ifndef _LIBCPP_NO_EXCEPTIONS
644
        try
645
        {
646
#endif
647
            typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
648
            if (_Traits::eq_int_type(__i, _Traits::eof()))
649
                __state |= ios_base::eofbit | ios_base::failbit;
650
            else
651
                __c = _Traits::to_char_type(__i);
652
#ifndef _LIBCPP_NO_EXCEPTIONS
653
        }
654
        catch (...)
655
        {
656
            __state |= ios_base::badbit;
657
            __is.__setstate_nothrow(__state);
658
            if (__is.exceptions() & ios_base::badbit)
659
            {
660
                throw;
661
            }
662
        }
663
#endif
664
        __is.setstate(__state);
665
    }
666
    return __is;
667
}
668
669
template<class _Traits>
670
inline _LIBCPP_INLINE_VISIBILITY
671
basic_istream<char, _Traits>&
672
operator>>(basic_istream<char, _Traits>& __is, unsigned char& __c)
673
{
674
    return __is >> (char&)__c;
675
}
676
677
template<class _Traits>
678
inline _LIBCPP_INLINE_VISIBILITY
679
basic_istream<char, _Traits>&
680
operator>>(basic_istream<char, _Traits>& __is, signed char& __c)
681
{
682
    return __is >> (char&)__c;
683
}
684
685
template<class _CharT, class _Traits>
686
basic_istream<_CharT, _Traits>&
687
basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_type>* __sb)
688
0
{
689
0
    ios_base::iostate __state = ios_base::goodbit;
690
0
    __gc_ = 0;
691
0
    sentry __s(*this, true);
692
0
    if (__s)
693
0
    {
694
0
        if (__sb)
695
0
        {
696
0
#ifndef _LIBCPP_NO_EXCEPTIONS
697
0
            try
698
0
            {
699
0
#endif // _LIBCPP_NO_EXCEPTIONS
700
0
                while (true)
701
0
                {
702
0
                    typename traits_type::int_type __i = this->rdbuf()->sgetc();
703
0
                    if (traits_type::eq_int_type(__i, _Traits::eof()))
704
0
                    {
705
0
                       __state |= ios_base::eofbit;
706
0
                       break;
707
0
                    }
708
0
                    if (traits_type::eq_int_type(
709
0
                            __sb->sputc(traits_type::to_char_type(__i)),
710
0
                            traits_type::eof()))
711
0
                        break;
712
0
                    ++__gc_;
713
0
                    this->rdbuf()->sbumpc();
714
0
                }
715
0
                if (__gc_ == 0)
716
0
                   __state |= ios_base::failbit;
717
0
#ifndef _LIBCPP_NO_EXCEPTIONS
718
0
            }
719
0
            catch (...)
720
0
            {
721
0
                __state |= ios_base::badbit;
722
0
                if (__gc_ == 0)
723
0
                    __state |= ios_base::failbit;
724
725
0
                this->__setstate_nothrow(__state);
726
0
                if (this->exceptions() & ios_base::failbit || this->exceptions() & ios_base::badbit)
727
0
                {
728
0
                    throw;
729
0
                }
730
0
            }
731
0
#endif // _LIBCPP_NO_EXCEPTIONS
732
0
        }
733
0
        else
734
0
        {
735
0
            __state |= ios_base::failbit;
736
0
        }
737
0
        this->setstate(__state);
738
0
    }
739
0
    return *this;
740
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(std::__1::basic_streambuf<char, std::__1::char_traits<char> >*)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::operator>>(std::__1::basic_streambuf<wchar_t, std::__1::char_traits<wchar_t> >*)
741
742
template<class _CharT, class _Traits>
743
typename basic_istream<_CharT, _Traits>::int_type
744
basic_istream<_CharT, _Traits>::get()
745
0
{
746
0
    ios_base::iostate __state = ios_base::goodbit;
747
0
    __gc_ = 0;
748
0
    int_type __r = traits_type::eof();
749
0
    sentry __s(*this, true);
750
0
    if (__s)
751
0
    {
752
0
#ifndef _LIBCPP_NO_EXCEPTIONS
753
0
        try
754
0
        {
755
0
#endif
756
0
            __r = this->rdbuf()->sbumpc();
757
0
            if (traits_type::eq_int_type(__r, traits_type::eof()))
758
0
               __state |= ios_base::failbit | ios_base::eofbit;
759
0
            else
760
0
                __gc_ = 1;
761
0
#ifndef _LIBCPP_NO_EXCEPTIONS
762
0
        }
763
0
        catch (...)
764
0
        {
765
0
            this->__setstate_nothrow(this->rdstate() | ios_base::badbit);
766
0
            if (this->exceptions() & ios_base::badbit)
767
0
            {
768
0
                throw;
769
0
            }
770
0
        }
771
0
#endif
772
0
        this->setstate(__state);
773
0
    }
774
0
    return __r;
775
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::get()
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::get()
776
777
template<class _CharT, class _Traits>
778
basic_istream<_CharT, _Traits>&
779
basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __dlm)
780
0
{
781
0
    ios_base::iostate __state = ios_base::goodbit;
782
0
    __gc_ = 0;
783
0
    sentry __sen(*this, true);
784
0
    if (__sen)
785
0
    {
786
0
        if (__n > 0)
787
0
        {
788
0
#ifndef _LIBCPP_NO_EXCEPTIONS
789
0
            try
790
0
            {
791
0
#endif
792
0
                while (__gc_ < __n-1)
793
0
                {
794
0
                    int_type __i = this->rdbuf()->sgetc();
795
0
                    if (traits_type::eq_int_type(__i, traits_type::eof()))
796
0
                    {
797
0
                       __state |= ios_base::eofbit;
798
0
                       break;
799
0
                    }
800
0
                    char_type __ch = traits_type::to_char_type(__i);
801
0
                    if (traits_type::eq(__ch, __dlm))
802
0
                        break;
803
0
                    *__s++ = __ch;
804
0
                    ++__gc_;
805
0
                     this->rdbuf()->sbumpc();
806
0
                }
807
0
                if (__gc_ == 0)
808
0
                   __state |= ios_base::failbit;
809
0
#ifndef _LIBCPP_NO_EXCEPTIONS
810
0
            }
811
0
            catch (...)
812
0
            {
813
0
                __state |= ios_base::badbit;
814
0
                this->__setstate_nothrow(__state);
815
0
                if (this->exceptions() & ios_base::badbit)
816
0
                {
817
0
                    if (__n > 0)
818
0
                        *__s = char_type();
819
0
                    throw;
820
0
                }
821
0
            }
822
0
#endif
823
0
        }
824
0
        else
825
0
        {
826
0
            __state |= ios_base::failbit;
827
0
        }
828
829
0
        if (__n > 0)
830
0
            *__s = char_type();
831
0
        this->setstate(__state);
832
0
    }
833
0
    if (__n > 0)
834
0
        *__s = char_type();
835
0
    return *this;
836
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::get(char*, long, char)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::get(wchar_t*, long, wchar_t)
837
838
template<class _CharT, class _Traits>
839
basic_istream<_CharT, _Traits>&
840
basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __sb,
841
                                    char_type __dlm)
842
0
{
843
0
    ios_base::iostate __state = ios_base::goodbit;
844
0
    __gc_ = 0;
845
0
    sentry __sen(*this, true);
846
0
    if (__sen)
847
0
    {
848
0
#ifndef _LIBCPP_NO_EXCEPTIONS
849
0
        try
850
0
        {
851
0
#endif // _LIBCPP_NO_EXCEPTIONS
852
0
            while (true)
853
0
            {
854
0
                typename traits_type::int_type __i = this->rdbuf()->sgetc();
855
0
                if (traits_type::eq_int_type(__i, traits_type::eof()))
856
0
                {
857
0
                   __state |= ios_base::eofbit;
858
0
                   break;
859
0
                }
860
0
                char_type __ch = traits_type::to_char_type(__i);
861
0
                if (traits_type::eq(__ch, __dlm))
862
0
                    break;
863
0
                if (traits_type::eq_int_type(__sb.sputc(__ch), traits_type::eof()))
864
0
                    break;
865
0
                ++__gc_;
866
0
                this->rdbuf()->sbumpc();
867
0
            }
868
0
#ifndef _LIBCPP_NO_EXCEPTIONS
869
0
        }
870
0
        catch (...)
871
0
        {
872
0
            __state |= ios_base::badbit;
873
            // according to the spec, exceptions here are caught but not rethrown
874
0
        }
875
0
#endif // _LIBCPP_NO_EXCEPTIONS
876
0
        if (__gc_ == 0)
877
0
           __state |= ios_base::failbit;
878
0
        this->setstate(__state);
879
0
    }
880
0
    return *this;
881
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::get(std::__1::basic_streambuf<char, std::__1::char_traits<char> >&, char)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::get(std::__1::basic_streambuf<wchar_t, std::__1::char_traits<wchar_t> >&, wchar_t)
882
883
template<class _CharT, class _Traits>
884
basic_istream<_CharT, _Traits>&
885
basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_type __dlm)
886
0
{
887
0
    ios_base::iostate __state = ios_base::goodbit;
888
0
    __gc_ = 0;
889
0
    sentry __sen(*this, true);
890
0
    if (__sen)
891
0
    {
892
0
#ifndef _LIBCPP_NO_EXCEPTIONS
893
0
        try
894
0
        {
895
0
#endif // _LIBCPP_NO_EXCEPTIONS
896
0
            while (true)
897
0
            {
898
0
                typename traits_type::int_type __i = this->rdbuf()->sgetc();
899
0
                if (traits_type::eq_int_type(__i, traits_type::eof()))
900
0
                {
901
0
                   __state |= ios_base::eofbit;
902
0
                   break;
903
0
                }
904
0
                char_type __ch = traits_type::to_char_type(__i);
905
0
                if (traits_type::eq(__ch, __dlm))
906
0
                {
907
0
                    this->rdbuf()->sbumpc();
908
0
                    ++__gc_;
909
0
                    break;
910
0
                }
911
0
                if (__gc_ >= __n-1)
912
0
                {
913
0
                    __state |= ios_base::failbit;
914
0
                    break;
915
0
                }
916
0
                *__s++ = __ch;
917
0
                this->rdbuf()->sbumpc();
918
0
                ++__gc_;
919
0
            }
920
0
#ifndef _LIBCPP_NO_EXCEPTIONS
921
0
        }
922
0
        catch (...)
923
0
        {
924
0
            __state |= ios_base::badbit;
925
0
            this->__setstate_nothrow(__state);
926
0
            if (this->exceptions() & ios_base::badbit)
927
0
            {
928
0
                if (__n > 0)
929
0
                    *__s = char_type();
930
0
                if (__gc_ == 0)
931
0
                    __state |= ios_base::failbit;
932
0
                throw;
933
0
            }
934
0
        }
935
0
#endif // _LIBCPP_NO_EXCEPTIONS
936
0
    }
937
0
    if (__n > 0)
938
0
        *__s = char_type();
939
0
    if (__gc_ == 0)
940
0
        __state |= ios_base::failbit;
941
0
    this->setstate(__state);
942
0
    return *this;
943
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::getline(char*, long, char)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::getline(wchar_t*, long, wchar_t)
944
945
template<class _CharT, class _Traits>
946
basic_istream<_CharT, _Traits>&
947
basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
948
0
{
949
0
    ios_base::iostate __state = ios_base::goodbit;
950
0
    __gc_ = 0;
951
0
    sentry __sen(*this, true);
952
0
    if (__sen)
953
0
    {
954
0
#ifndef _LIBCPP_NO_EXCEPTIONS
955
0
        try
956
0
        {
957
0
#endif // _LIBCPP_NO_EXCEPTIONS
958
0
            if (__n == numeric_limits<streamsize>::max())
959
0
            {
960
0
                while (true)
961
0
                {
962
0
                    typename traits_type::int_type __i = this->rdbuf()->sbumpc();
963
0
                    if (traits_type::eq_int_type(__i, traits_type::eof()))
964
0
                    {
965
0
                       __state |= ios_base::eofbit;
966
0
                       break;
967
0
                    }
968
0
                    ++__gc_;
969
0
                    if (traits_type::eq_int_type(__i, __dlm))
970
0
                        break;
971
0
                }
972
0
            }
973
0
            else
974
0
            {
975
0
                while (__gc_ < __n)
976
0
                {
977
0
                    typename traits_type::int_type __i = this->rdbuf()->sbumpc();
978
0
                    if (traits_type::eq_int_type(__i, traits_type::eof()))
979
0
                    {
980
0
                       __state |= ios_base::eofbit;
981
0
                       break;
982
0
                    }
983
0
                    ++__gc_;
984
0
                    if (traits_type::eq_int_type(__i, __dlm))
985
0
                        break;
986
0
                }
987
0
            }
988
0
#ifndef _LIBCPP_NO_EXCEPTIONS
989
0
        }
990
0
        catch (...)
991
0
        {
992
0
            __state |= ios_base::badbit;
993
0
            this->__setstate_nothrow(__state);
994
0
            if (this->exceptions() & ios_base::badbit)
995
0
            {
996
0
                throw;
997
0
            }
998
0
        }
999
0
#endif // _LIBCPP_NO_EXCEPTIONS
1000
0
        this->setstate(__state);
1001
0
    }
1002
0
    return *this;
1003
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::ignore(long, int)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::ignore(long, unsigned int)
1004
1005
template<class _CharT, class _Traits>
1006
typename basic_istream<_CharT, _Traits>::int_type
1007
basic_istream<_CharT, _Traits>::peek()
1008
0
{
1009
0
    ios_base::iostate __state = ios_base::goodbit;
1010
0
    __gc_ = 0;
1011
0
    int_type __r = traits_type::eof();
1012
0
    sentry __sen(*this, true);
1013
0
    if (__sen)
1014
0
    {
1015
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1016
0
        try
1017
0
        {
1018
0
#endif // _LIBCPP_NO_EXCEPTIONS
1019
0
            __r = this->rdbuf()->sgetc();
1020
0
            if (traits_type::eq_int_type(__r, traits_type::eof()))
1021
0
                __state |= ios_base::eofbit;
1022
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1023
0
        }
1024
0
        catch (...)
1025
0
        {
1026
0
            __state |= ios_base::badbit;
1027
0
            this->__setstate_nothrow(__state);
1028
0
            if (this->exceptions() & ios_base::badbit)
1029
0
            {
1030
0
                throw;
1031
0
            }
1032
0
        }
1033
0
#endif // _LIBCPP_NO_EXCEPTIONS
1034
0
        this->setstate(__state);
1035
0
    }
1036
0
    return __r;
1037
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::peek()
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::peek()
1038
1039
template<class _CharT, class _Traits>
1040
basic_istream<_CharT, _Traits>&
1041
basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
1042
0
{
1043
0
    ios_base::iostate __state = ios_base::goodbit;
1044
0
    __gc_ = 0;
1045
0
    sentry __sen(*this, true);
1046
0
    if (__sen)
1047
0
    {
1048
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1049
0
        try
1050
0
        {
1051
0
#endif // _LIBCPP_NO_EXCEPTIONS
1052
0
            __gc_ = this->rdbuf()->sgetn(__s, __n);
1053
0
            if (__gc_ != __n)
1054
0
                __state |= ios_base::failbit | ios_base::eofbit;
1055
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1056
0
        }
1057
0
        catch (...)
1058
0
        {
1059
0
            __state |= ios_base::badbit;
1060
0
            this->__setstate_nothrow(__state);
1061
0
            if (this->exceptions() & ios_base::badbit)
1062
0
            {
1063
0
                throw;
1064
0
            }
1065
0
        }
1066
0
#endif // _LIBCPP_NO_EXCEPTIONS
1067
0
    }
1068
0
    else
1069
0
    {
1070
0
        __state |= ios_base::failbit;
1071
0
    }
1072
0
    this->setstate(__state);
1073
0
    return *this;
1074
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::read(char*, long)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::read(wchar_t*, long)
1075
1076
template<class _CharT, class _Traits>
1077
streamsize
1078
basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
1079
0
{
1080
0
    ios_base::iostate __state = ios_base::goodbit;
1081
0
    __gc_ = 0;
1082
0
    sentry __sen(*this, true);
1083
0
    if (__sen)
1084
0
    {
1085
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1086
0
        try
1087
0
        {
1088
0
#endif // _LIBCPP_NO_EXCEPTIONS
1089
0
            streamsize __c = this->rdbuf()->in_avail();
1090
0
            switch (__c)
1091
0
            {
1092
0
            case -1:
1093
0
                __state |= ios_base::eofbit;
1094
0
                break;
1095
0
            case 0:
1096
0
                break;
1097
0
            default:
1098
0
                __n = _VSTD::min(__c, __n);
1099
0
                __gc_ = this->rdbuf()->sgetn(__s, __n);
1100
0
                if (__gc_ != __n)
1101
0
                    __state |= ios_base::failbit | ios_base::eofbit;
1102
0
                break;
1103
0
            }
1104
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1105
0
        }
1106
0
        catch (...)
1107
0
        {
1108
0
            __state |= ios_base::badbit;
1109
0
            this->__setstate_nothrow(__state);
1110
0
            if (this->exceptions() & ios_base::badbit)
1111
0
            {
1112
0
                throw;
1113
0
            }
1114
0
        }
1115
0
#endif // _LIBCPP_NO_EXCEPTIONS
1116
0
    }
1117
0
    else
1118
0
    {
1119
0
        __state |= ios_base::failbit;
1120
0
    }
1121
0
    this->setstate(__state);
1122
0
    return __gc_;
1123
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::readsome(char*, long)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::readsome(wchar_t*, long)
1124
1125
template<class _CharT, class _Traits>
1126
basic_istream<_CharT, _Traits>&
1127
basic_istream<_CharT, _Traits>::putback(char_type __c)
1128
0
{
1129
0
    ios_base::iostate __state = this->rdstate() & ~ios_base::eofbit;
1130
0
    __gc_ = 0;
1131
0
    this->clear(__state);
1132
0
    sentry __sen(*this, true);
1133
0
    if (__sen)
1134
0
    {
1135
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1136
0
        try
1137
0
        {
1138
0
#endif // _LIBCPP_NO_EXCEPTIONS
1139
0
            if (this->rdbuf() == nullptr || this->rdbuf()->sputbackc(__c) == traits_type::eof())
1140
0
                __state |= ios_base::badbit;
1141
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1142
0
        }
1143
0
        catch (...)
1144
0
        {
1145
0
            __state |= ios_base::badbit;
1146
0
            this->__setstate_nothrow(__state);
1147
0
            if (this->exceptions() & ios_base::badbit)
1148
0
            {
1149
0
                throw;
1150
0
            }
1151
0
        }
1152
0
#endif // _LIBCPP_NO_EXCEPTIONS
1153
0
    }
1154
0
    else
1155
0
    {
1156
0
        __state |= ios_base::failbit;
1157
0
    }
1158
0
    this->setstate(__state);
1159
0
    return *this;
1160
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::putback(char)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::putback(wchar_t)
1161
1162
template<class _CharT, class _Traits>
1163
basic_istream<_CharT, _Traits>&
1164
basic_istream<_CharT, _Traits>::unget()
1165
0
{
1166
0
    ios_base::iostate __state = this->rdstate() & ~ios_base::eofbit;
1167
0
    __gc_ = 0;
1168
0
    this->clear(__state);
1169
0
    sentry __sen(*this, true);
1170
0
    if (__sen)
1171
0
    {
1172
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1173
0
        try
1174
0
        {
1175
0
#endif // _LIBCPP_NO_EXCEPTIONS
1176
0
            if (this->rdbuf() == nullptr || this->rdbuf()->sungetc() == traits_type::eof())
1177
0
                __state |= ios_base::badbit;
1178
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1179
0
        }
1180
0
        catch (...)
1181
0
        {
1182
0
            __state |= ios_base::badbit;
1183
0
            this->__setstate_nothrow(__state);
1184
0
            if (this->exceptions() & ios_base::badbit)
1185
0
            {
1186
0
                throw;
1187
0
            }
1188
0
        }
1189
0
#endif // _LIBCPP_NO_EXCEPTIONS
1190
0
    }
1191
0
    else
1192
0
    {
1193
0
        __state |= ios_base::failbit;
1194
0
    }
1195
0
    this->setstate(__state);
1196
0
    return *this;
1197
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::unget()
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::unget()
1198
1199
template<class _CharT, class _Traits>
1200
int
1201
basic_istream<_CharT, _Traits>::sync()
1202
0
{
1203
0
    ios_base::iostate __state = ios_base::goodbit;
1204
0
    int __r = 0;
1205
0
    sentry __sen(*this, true);
1206
0
    if (__sen)
1207
0
    {
1208
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1209
0
        try
1210
0
        {
1211
0
#endif // _LIBCPP_NO_EXCEPTIONS
1212
0
            if (this->rdbuf() == nullptr)
1213
0
                return -1;
1214
0
            if (this->rdbuf()->pubsync() == -1)
1215
0
            {
1216
0
                __state |= ios_base::badbit;
1217
0
                return -1;
1218
0
            }
1219
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1220
0
        }
1221
0
        catch (...)
1222
0
        {
1223
0
            __state |= ios_base::badbit;
1224
0
            this->__setstate_nothrow(__state);
1225
0
            if (this->exceptions() & ios_base::badbit)
1226
0
            {
1227
0
                throw;
1228
0
            }
1229
0
        }
1230
0
#endif // _LIBCPP_NO_EXCEPTIONS
1231
0
        this->setstate(__state);
1232
0
    }
1233
0
    return __r;
1234
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::sync()
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::sync()
1235
1236
template<class _CharT, class _Traits>
1237
typename basic_istream<_CharT, _Traits>::pos_type
1238
basic_istream<_CharT, _Traits>::tellg()
1239
0
{
1240
0
    ios_base::iostate __state = ios_base::goodbit;
1241
0
    pos_type __r(-1);
1242
0
    sentry __sen(*this, true);
1243
0
    if (__sen)
1244
0
    {
1245
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1246
0
        try
1247
0
        {
1248
0
#endif // _LIBCPP_NO_EXCEPTIONS
1249
0
        __r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
1250
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1251
0
        }
1252
0
        catch (...)
1253
0
        {
1254
0
            __state |= ios_base::badbit;
1255
0
            this->__setstate_nothrow(__state);
1256
0
            if (this->exceptions() & ios_base::badbit)
1257
0
            {
1258
0
                throw;
1259
0
            }
1260
0
        }
1261
0
#endif // _LIBCPP_NO_EXCEPTIONS
1262
0
        this->setstate(__state);
1263
0
    }
1264
0
    return __r;
1265
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::tellg()
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::tellg()
1266
1267
template<class _CharT, class _Traits>
1268
basic_istream<_CharT, _Traits>&
1269
basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
1270
0
{
1271
0
    ios_base::iostate __state = this->rdstate() & ~ios_base::eofbit;
1272
0
    this->clear(__state);
1273
0
    sentry __sen(*this, true);
1274
0
    if (__sen)
1275
0
    {
1276
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1277
0
        try
1278
0
        {
1279
0
#endif // _LIBCPP_NO_EXCEPTIONS
1280
0
            if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
1281
0
                __state |= ios_base::failbit;
1282
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1283
0
        }
1284
0
        catch (...)
1285
0
        {
1286
0
            __state |= ios_base::badbit;
1287
0
            this->__setstate_nothrow(__state);
1288
0
            if (this->exceptions() & ios_base::badbit)
1289
0
            {
1290
0
                throw;
1291
0
            }
1292
0
        }
1293
0
#endif // _LIBCPP_NO_EXCEPTIONS
1294
0
        this->setstate(__state);
1295
0
    }
1296
0
    return *this;
1297
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::seekg(std::__1::fpos<__mbstate_t>)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::seekg(std::__1::fpos<__mbstate_t>)
1298
1299
template<class _CharT, class _Traits>
1300
basic_istream<_CharT, _Traits>&
1301
basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
1302
0
{
1303
0
    ios_base::iostate __state = this->rdstate() & ~ios_base::eofbit;
1304
0
    this->clear(__state);
1305
0
    sentry __sen(*this, true);
1306
0
    if (__sen)
1307
0
    {
1308
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1309
0
        try
1310
0
        {
1311
0
#endif // _LIBCPP_NO_EXCEPTIONS
1312
0
            if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1))
1313
0
                __state |= ios_base::failbit;
1314
0
#ifndef _LIBCPP_NO_EXCEPTIONS
1315
0
        }
1316
0
        catch (...)
1317
0
        {
1318
0
            __state |= ios_base::badbit;
1319
0
            this->__setstate_nothrow(__state);
1320
0
            if (this->exceptions() & ios_base::badbit)
1321
0
            {
1322
0
                throw;
1323
0
            }
1324
0
        }
1325
0
#endif // _LIBCPP_NO_EXCEPTIONS
1326
0
        this->setstate(__state);
1327
0
    }
1328
0
    return *this;
1329
0
}
Unexecuted instantiation: std::__1::basic_istream<char, std::__1::char_traits<char> >::seekg(long long, std::__1::ios_base::seekdir)
Unexecuted instantiation: std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >::seekg(long long, std::__1::ios_base::seekdir)
1330
1331
template <class _CharT, class _Traits>
1332
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
1333
ws(basic_istream<_CharT, _Traits>& __is)
1334
{
1335
    ios_base::iostate __state = ios_base::goodbit;
1336
    typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
1337
    if (__sen)
1338
    {
1339
#ifndef _LIBCPP_NO_EXCEPTIONS
1340
        try
1341
        {
1342
#endif // _LIBCPP_NO_EXCEPTIONS
1343
            const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
1344
            while (true)
1345
            {
1346
                typename _Traits::int_type __i = __is.rdbuf()->sgetc();
1347
                if (_Traits::eq_int_type(__i, _Traits::eof()))
1348
                {
1349
                   __state |= ios_base::eofbit;
1350
                   break;
1351
                }
1352
                if (!__ct.is(__ct.space, _Traits::to_char_type(__i)))
1353
                    break;
1354
                __is.rdbuf()->sbumpc();
1355
            }
1356
#ifndef _LIBCPP_NO_EXCEPTIONS
1357
        }
1358
        catch (...)
1359
        {
1360
            __state |= ios_base::badbit;
1361
            __is.__setstate_nothrow(__state);
1362
            if (__is.exceptions() & ios_base::badbit)
1363
            {
1364
                throw;
1365
            }
1366
        }
1367
#endif // _LIBCPP_NO_EXCEPTIONS
1368
        __is.setstate(__state);
1369
    }
1370
    return __is;
1371
}
1372
1373
template <class _Stream, class _Tp, class = void>
1374
struct __is_istreamable : false_type { };
1375
1376
template <class _Stream, class _Tp>
1377
struct __is_istreamable<_Stream, _Tp, decltype(
1378
    std::declval<_Stream>() >> std::declval<_Tp>(), void()
1379
)> : true_type { };
1380
1381
template <class _Stream, class _Tp, class = typename enable_if<
1382
    _And<is_base_of<ios_base, _Stream>,
1383
         __is_istreamable<_Stream&, _Tp&&> >::value
1384
>::type>
1385
_LIBCPP_INLINE_VISIBILITY
1386
_Stream&& operator>>(_Stream&& __is, _Tp&& __x)
1387
{
1388
    __is >> _VSTD::forward<_Tp>(__x);
1389
    return _VSTD::move(__is);
1390
}
1391
1392
template <class _CharT, class _Traits>
1393
class _LIBCPP_TEMPLATE_VIS basic_iostream
1394
    : public basic_istream<_CharT, _Traits>,
1395
      public basic_ostream<_CharT, _Traits>
1396
{
1397
public:
1398
    // types:
1399
    typedef _CharT                         char_type;
1400
    typedef _Traits                        traits_type;
1401
    typedef typename traits_type::int_type int_type;
1402
    typedef typename traits_type::pos_type pos_type;
1403
    typedef typename traits_type::off_type off_type;
1404
1405
    // constructor/destructor
1406
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
1407
    explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
1408
      : basic_istream<_CharT, _Traits>(__sb)
1409
0
    {}
Unexecuted instantiation: std::__1::basic_iostream<char, std::__1::char_traits<char> >::basic_iostream(std::__1::basic_streambuf<char, std::__1::char_traits<char> >*)
Unexecuted instantiation: std::__1::basic_iostream<char, std::__1::char_traits<char> >::basic_iostream(std::__1::basic_streambuf<char, std::__1::char_traits<char> >*)
1410
1411
    ~basic_iostream() override;
1412
protected:
1413
    inline _LIBCPP_INLINE_VISIBILITY
1414
    basic_iostream(basic_iostream&& __rhs);
1415
1416
    // assign/swap
1417
    inline _LIBCPP_INLINE_VISIBILITY
1418
    basic_iostream& operator=(basic_iostream&& __rhs);
1419
1420
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
1421
    void swap(basic_iostream& __rhs)
1422
0
    { basic_istream<char_type, traits_type>::swap(__rhs); }
1423
};
1424
1425
template <class _CharT, class _Traits>
1426
basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
1427
    : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
1428
{
1429
}
1430
1431
template <class _CharT, class _Traits>
1432
basic_iostream<_CharT, _Traits>&
1433
basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)
1434
0
{
1435
0
    swap(__rhs);
1436
0
    return *this;
1437
0
}
1438
1439
template <class _CharT, class _Traits>
1440
basic_iostream<_CharT, _Traits>::~basic_iostream()
1441
0
{
1442
0
}
1443
1444
template<class _CharT, class _Traits, class _Allocator>
1445
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
1446
operator>>(basic_istream<_CharT, _Traits>& __is,
1447
           basic_string<_CharT, _Traits, _Allocator>& __str)
1448
{
1449
    ios_base::iostate __state = ios_base::goodbit;
1450
    typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
1451
    if (__sen)
1452
    {
1453
#ifndef _LIBCPP_NO_EXCEPTIONS
1454
        try
1455
        {
1456
#endif
1457
            __str.clear();
1458
            streamsize __n = __is.width();
1459
            if (__n <= 0)
1460
                __n = __str.max_size();
1461
            if (__n <= 0)
1462
                __n = numeric_limits<streamsize>::max();
1463
            streamsize __c = 0;
1464
            const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
1465
            while (__c < __n)
1466
            {
1467
                typename _Traits::int_type __i = __is.rdbuf()->sgetc();
1468
                if (_Traits::eq_int_type(__i, _Traits::eof()))
1469
                {
1470
                   __state |= ios_base::eofbit;
1471
                   break;
1472
                }
1473
                _CharT __ch = _Traits::to_char_type(__i);
1474
                if (__ct.is(__ct.space, __ch))
1475
                    break;
1476
                __str.push_back(__ch);
1477
                ++__c;
1478
                 __is.rdbuf()->sbumpc();
1479
            }
1480
            __is.width(0);
1481
            if (__c == 0)
1482
               __state |= ios_base::failbit;
1483
#ifndef _LIBCPP_NO_EXCEPTIONS
1484
        }
1485
        catch (...)
1486
        {
1487
            __state |= ios_base::badbit;
1488
            __is.__setstate_nothrow(__state);
1489
            if (__is.exceptions() & ios_base::badbit)
1490
            {
1491
                throw;
1492
            }
1493
        }
1494
#endif
1495
        __is.setstate(__state);
1496
    }
1497
    return __is;
1498
}
1499
1500
template<class _CharT, class _Traits, class _Allocator>
1501
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
1502
getline(basic_istream<_CharT, _Traits>& __is,
1503
        basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
1504
{
1505
    ios_base::iostate __state = ios_base::goodbit;
1506
    typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
1507
    if (__sen)
1508
    {
1509
#ifndef _LIBCPP_NO_EXCEPTIONS
1510
        try
1511
        {
1512
#endif
1513
            __str.clear();
1514
            streamsize __extr = 0;
1515
            while (true)
1516
            {
1517
                typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
1518
                if (_Traits::eq_int_type(__i, _Traits::eof()))
1519
                {
1520
                   __state |= ios_base::eofbit;
1521
                   break;
1522
                }
1523
                ++__extr;
1524
                _CharT __ch = _Traits::to_char_type(__i);
1525
                if (_Traits::eq(__ch, __dlm))
1526
                    break;
1527
                __str.push_back(__ch);
1528
                if (__str.size() == __str.max_size())
1529
                {
1530
                    __state |= ios_base::failbit;
1531
                    break;
1532
                }
1533
            }
1534
            if (__extr == 0)
1535
               __state |= ios_base::failbit;
1536
#ifndef _LIBCPP_NO_EXCEPTIONS
1537
        }
1538
        catch (...)
1539
        {
1540
            __state |= ios_base::badbit;
1541
            __is.__setstate_nothrow(__state);
1542
            if (__is.exceptions() & ios_base::badbit)
1543
            {
1544
                throw;
1545
            }
1546
        }
1547
#endif
1548
        __is.setstate(__state);
1549
    }
1550
    return __is;
1551
}
1552
1553
template<class _CharT, class _Traits, class _Allocator>
1554
inline _LIBCPP_INLINE_VISIBILITY
1555
basic_istream<_CharT, _Traits>&
1556
getline(basic_istream<_CharT, _Traits>& __is,
1557
        basic_string<_CharT, _Traits, _Allocator>& __str)
1558
{
1559
    return std::getline(__is, __str, __is.widen('\n'));
1560
}
1561
1562
template<class _CharT, class _Traits, class _Allocator>
1563
inline _LIBCPP_INLINE_VISIBILITY
1564
basic_istream<_CharT, _Traits>&
1565
getline(basic_istream<_CharT, _Traits>&& __is,
1566
        basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
1567
{
1568
    return std::getline(__is, __str, __dlm);
1569
}
1570
1571
template<class _CharT, class _Traits, class _Allocator>
1572
inline _LIBCPP_INLINE_VISIBILITY
1573
basic_istream<_CharT, _Traits>&
1574
getline(basic_istream<_CharT, _Traits>&& __is,
1575
        basic_string<_CharT, _Traits, _Allocator>& __str)
1576
{
1577
    return std::getline(__is, __str, __is.widen('\n'));
1578
}
1579
1580
template <class _CharT, class _Traits, size_t _Size>
1581
_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
1582
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
1583
{
1584
    ios_base::iostate __state = ios_base::goodbit;
1585
    typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
1586
    if (__sen)
1587
    {
1588
#ifndef _LIBCPP_NO_EXCEPTIONS
1589
        try
1590
        {
1591
#endif
1592
            basic_string<_CharT, _Traits> __str;
1593
            const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
1594
            size_t __c = 0;
1595
            _CharT __zero = __ct.widen('0');
1596
            _CharT __one = __ct.widen('1');
1597
            while (__c != _Size)
1598
            {
1599
                typename _Traits::int_type __i = __is.rdbuf()->sgetc();
1600
                if (_Traits::eq_int_type(__i, _Traits::eof()))
1601
                {
1602
                   __state |= ios_base::eofbit;
1603
                   break;
1604
                }
1605
                _CharT __ch = _Traits::to_char_type(__i);
1606
                if (!_Traits::eq(__ch, __zero) && !_Traits::eq(__ch, __one))
1607
                    break;
1608
                __str.push_back(__ch);
1609
                ++__c;
1610
                 __is.rdbuf()->sbumpc();
1611
            }
1612
            __x = bitset<_Size>(__str);
1613
            if (_Size > 0 && __c == 0)
1614
               __state |= ios_base::failbit;
1615
#ifndef _LIBCPP_NO_EXCEPTIONS
1616
        }
1617
        catch (...)
1618
        {
1619
            __state |= ios_base::badbit;
1620
            __is.__setstate_nothrow(__state);
1621
            if (__is.exceptions() & ios_base::badbit)
1622
            {
1623
                throw;
1624
            }
1625
        }
1626
#endif
1627
        __is.setstate(__state);
1628
    }
1629
    return __is;
1630
}
1631
1632
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>;
1633
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
1634
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>;
1635
#endif
1636
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>;
1637
1638
_LIBCPP_END_NAMESPACE_STD
1639
1640
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
1641
#  include <concepts>
1642
#  include <type_traits>
1643
#endif
1644
1645
_LIBCPP_POP_MACROS
1646
1647
#endif // _LIBCPP_ISTREAM