Coverage Report

Created: 2020-07-11 14:00

/Users/buildslave/jenkins/workspace/coverage/llvm-project/libcxx/include/ostream
Line
Count
Source (jump to first uncovered line)
1
// -*- C++ -*-
2
//===-------------------------- ostream -----------------------------------===//
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_OSTREAM
11
#define _LIBCPP_OSTREAM
12
13
/*
14
    ostream synopsis
15
16
template <class charT, class traits = char_traits<charT> >
17
class basic_ostream
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.2.2 Constructor/destructor:
29
    explicit basic_ostream(basic_streambuf<char_type,traits>* sb);
30
    basic_ostream(basic_ostream&& rhs);
31
    virtual ~basic_ostream();
32
33
    // 27.7.2.3 Assign/swap
34
    basic_ostream& operator=(const basic_ostream& rhs) = delete; // C++14
35
    basic_ostream& operator=(basic_ostream&& rhs);
36
    void swap(basic_ostream& rhs);
37
38
    // 27.7.2.4 Prefix/suffix:
39
    class sentry;
40
41
    // 27.7.2.6 Formatted output:
42
    basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&));
43
    basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT,traits>&));
44
    basic_ostream& operator<<(ios_base& (*pf)(ios_base&));
45
    basic_ostream& operator<<(bool n);
46
    basic_ostream& operator<<(short n);
47
    basic_ostream& operator<<(unsigned short n);
48
    basic_ostream& operator<<(int n);
49
    basic_ostream& operator<<(unsigned int n);
50
    basic_ostream& operator<<(long n);
51
    basic_ostream& operator<<(unsigned long n);
52
    basic_ostream& operator<<(long long n);
53
    basic_ostream& operator<<(unsigned long long n);
54
    basic_ostream& operator<<(float f);
55
    basic_ostream& operator<<(double f);
56
    basic_ostream& operator<<(long double f);
57
    basic_ostream& operator<<(const void* p);
58
    basic_ostream& operator<<(basic_streambuf<char_type,traits>* sb);
59
    basic_ostream& operator<<(nullptr_t);
60
61
    // 27.7.2.7 Unformatted output:
62
    basic_ostream& put(char_type c);
63
    basic_ostream& write(const char_type* s, streamsize n);
64
    basic_ostream& flush();
65
66
    // 27.7.2.5 seeks:
67
    pos_type tellp();
68
    basic_ostream& seekp(pos_type);
69
    basic_ostream& seekp(off_type, ios_base::seekdir);
70
protected:
71
    basic_ostream(const basic_ostream& rhs) = delete;
72
    basic_ostream(basic_ostream&& rhs);
73
    // 27.7.3.3 Assign/swap
74
    basic_ostream& operator=(basic_ostream& rhs) = delete;
75
    basic_ostream& operator=(const basic_ostream&& rhs);
76
    void swap(basic_ostream& rhs);
77
};
78
79
// 27.7.2.6.4 character inserters
80
81
template<class charT, class traits>
82
  basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, charT);
83
84
template<class charT, class traits>
85
  basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, char);
86
87
template<class traits>
88
  basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, char);
89
90
// signed and unsigned
91
92
template<class traits>
93
  basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, signed char);
94
95
template<class traits>
96
  basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, unsigned char);
97
98
// NTBS
99
template<class charT, class traits>
100
  basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, const charT*);
101
102
template<class charT, class traits>
103
  basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, const char*);
104
105
template<class traits>
106
  basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, const char*);
107
108
// signed and unsigned
109
template<class traits>
110
basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, const signed char*);
111
112
template<class traits>
113
  basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, const unsigned char*);
114
115
// swap:
116
template <class charT, class traits>
117
  void swap(basic_ostream<charT, traits>& x, basic_ostream<charT, traits>& y);
118
119
template <class charT, class traits>
120
  basic_ostream<charT,traits>& endl(basic_ostream<charT,traits>& os);
121
122
template <class charT, class traits>
123
  basic_ostream<charT,traits>& ends(basic_ostream<charT,traits>& os);
124
125
template <class charT, class traits>
126
  basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os);
127
128
// rvalue stream insertion
129
template <class charT, class traits, class T>
130
  basic_ostream<charT, traits>&
131
  operator<<(basic_ostream<charT, traits>&& os, const T& x);
132
133
}  // std
134
135
*/
136
137
#include <__config>
138
#include <ios>
139
#include <streambuf>
140
#include <locale>
141
#include <iterator>
142
#include <bitset>
143
#include <version>
144
145
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
146
#pragma GCC system_header
147
#endif
148
149
_LIBCPP_BEGIN_NAMESPACE_STD
150
151
template <class _CharT, class _Traits>
152
class _LIBCPP_TEMPLATE_VIS basic_ostream
153
    : virtual public basic_ios<_CharT, _Traits>
154
{
155
public:
156
    // types (inherited from basic_ios (27.5.4)):
157
    typedef _CharT                         char_type;
158
    typedef _Traits                        traits_type;
159
    typedef typename traits_type::int_type int_type;
160
    typedef typename traits_type::pos_type pos_type;
161
    typedef typename traits_type::off_type off_type;
162
163
    // 27.7.2.2 Constructor/destructor:
164
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
165
    explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb)
166
54.1k
    { this->init(__sb); }
std::__1::basic_ostream<char, std::__1::char_traits<char> >::basic_ostream(std::__1::basic_streambuf<char, std::__1::char_traits<char> >*)
Line
Count
Source
166
3.09k
    { this->init(__sb); }
std::__1::basic_ostream<char, std::__1::char_traits<char> >::basic_ostream(std::__1::basic_streambuf<char, std::__1::char_traits<char> >*)
Line
Count
Source
166
25.5k
    { this->init(__sb); }
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::basic_ostream(std::__1::basic_streambuf<wchar_t, std::__1::char_traits<wchar_t> >*)
std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::basic_ostream(std::__1::basic_streambuf<wchar_t, std::__1::char_traits<wchar_t> >*)
Line
Count
Source
166
25.5k
    { this->init(__sb); }
167
    virtual ~basic_ostream();
168
protected:
169
#ifndef _LIBCPP_CXX03_LANG
170
    inline _LIBCPP_INLINE_VISIBILITY
171
    basic_ostream(basic_ostream&& __rhs);
172
173
    // 27.7.2.3 Assign/swap
174
    inline _LIBCPP_INLINE_VISIBILITY
175
    basic_ostream& operator=(basic_ostream&& __rhs);
176
#endif
177
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
178
    void swap(basic_ostream& __rhs)
179
0
    { basic_ios<char_type, traits_type>::swap(__rhs); }
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::swap(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::swap(std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >&)
180
181
#ifndef _LIBCPP_CXX03_LANG
182
    basic_ostream           (const basic_ostream& __rhs) = delete;
183
    basic_ostream& operator=(const basic_ostream& __rhs) = delete;
184
#else
185
    basic_ostream           (const basic_ostream& __rhs); // not defined
186
    basic_ostream& operator=(const basic_ostream& __rhs); // not defined
187
#endif
188
public:
189
190
    // 27.7.2.4 Prefix/suffix:
191
    class _LIBCPP_TEMPLATE_VIS sentry;
192
193
    // 27.7.2.6 Formatted output:
194
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
195
    basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&))
196
2.12k
    { return __pf(*this); }
std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >& (*)(std::__1::basic_ostream<char, std::__1::char_traits<char> >&))
Line
Count
Source
196
2.12k
    { return __pf(*this); }
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >& (*)(std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >&))
197
198
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
199
    basic_ostream& operator<<(basic_ios<char_type, traits_type>&
200
                              (*__pf)(basic_ios<char_type,traits_type>&))
201
0
    { __pf(*this); return *this; }
Unexecuted instantiation: std::__1::basic_ostream<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_ostream<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> >&))
202
203
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
204
    basic_ostream& operator<<(ios_base& (*__pf)(ios_base&))
205
108k
    { __pf(*this); return *this; }
std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(std::__1::ios_base& (*)(std::__1::ios_base&))
Line
Count
Source
205
108k
    { __pf(*this); return *this; }
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(std::__1::ios_base& (*)(std::__1::ios_base&))
206
207
    basic_ostream& operator<<(bool __n);
208
    basic_ostream& operator<<(short __n);
209
    basic_ostream& operator<<(unsigned short __n);
210
    basic_ostream& operator<<(int __n);
211
    basic_ostream& operator<<(unsigned int __n);
212
    basic_ostream& operator<<(long __n);
213
    basic_ostream& operator<<(unsigned long __n);
214
    basic_ostream& operator<<(long long __n);
215
    basic_ostream& operator<<(unsigned long long __n);
216
    basic_ostream& operator<<(float __f);
217
    basic_ostream& operator<<(double __f);
218
    basic_ostream& operator<<(long double __f);
219
    basic_ostream& operator<<(const void* __p);
220
    basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb);
221
222
    _LIBCPP_INLINE_VISIBILITY
223
    basic_ostream& operator<<(nullptr_t)
224
    { return *this << "nullptr"; }
225
226
    // 27.7.2.7 Unformatted output:
227
    basic_ostream& put(char_type __c);
228
    basic_ostream& write(const char_type* __s, streamsize __n);
229
    basic_ostream& flush();
230
231
    // 27.7.2.5 seeks:
232
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
233
    pos_type tellp();
234
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
235
    basic_ostream& seekp(pos_type __pos);
236
    inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1
237
    basic_ostream& seekp(off_type __off, ios_base::seekdir __dir);
238
239
protected:
240
    _LIBCPP_INLINE_VISIBILITY
241
42.8M
    basic_ostream() {}  // extension, intentially does not initialize
242
};
243
244
template <class _CharT, class _Traits>
245
class _LIBCPP_TEMPLATE_VIS basic_ostream<_CharT, _Traits>::sentry
246
{
247
    bool __ok_;
248
    basic_ostream<_CharT, _Traits>& __os_;
249
250
    sentry(const sentry&); // = delete;
251
    sentry& operator=(const sentry&); // = delete;
252
253
public:
254
    explicit sentry(basic_ostream<_CharT, _Traits>& __os);
255
    ~sentry();
256
257
    _LIBCPP_INLINE_VISIBILITY
258
        _LIBCPP_EXPLICIT
259
326M
        operator bool() const {return __ok_;}
std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::operator bool() const
Line
Count
Source
259
326M
        operator bool() const {return __ok_;}
std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::sentry::operator bool() const
Line
Count
Source
259
17.0k
        operator bool() const {return __ok_;}
260
};
261
262
template <class _CharT, class _Traits>
263
basic_ostream<_CharT, _Traits>::sentry::sentry(basic_ostream<_CharT, _Traits>& __os)
264
    : __ok_(false),
265
      __os_(__os)
266
322M
{
267
322M
    if (__os.good())
268
322M
    {
269
322M
        if (__os.tie())
270
0
            __os.tie()->flush();
271
322M
        __ok_ = true;
272
322M
    }
273
322M
}
std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)
Line
Count
Source
266
322M
{
267
322M
    if (__os.good())
268
322M
    {
269
322M
        if (__os.tie())
270
0
            __os.tie()->flush();
271
322M
        __ok_ = true;
272
322M
    }
273
322M
}
std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::sentry::sentry(std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >&)
Line
Count
Source
266
17.0k
{
267
17.0k
    if (__os.good())
268
17.0k
    {
269
17.0k
        if (__os.tie())
270
0
            __os.tie()->flush();
271
17.0k
        __ok_ = true;
272
17.0k
    }
273
17.0k
}
274
275
template <class _CharT, class _Traits>
276
basic_ostream<_CharT, _Traits>::sentry::~sentry()
277
322M
{
278
322M
    if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf)
279
322M
                      && 
!uncaught_exception()0
)
280
0
    {
281
0
#ifndef _LIBCPP_NO_EXCEPTIONS
282
0
        try
283
0
        {
284
0
#endif  // _LIBCPP_NO_EXCEPTIONS
285
0
            if (__os_.rdbuf()->pubsync() == -1)
286
0
                __os_.setstate(ios_base::badbit);
287
0
#ifndef _LIBCPP_NO_EXCEPTIONS
288
0
        }
289
0
        catch (...)
290
0
        {
291
0
        }
292
0
#endif  // _LIBCPP_NO_EXCEPTIONS
293
0
    }
294
322M
}
std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()
Line
Count
Source
277
322M
{
278
322M
    if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf)
279
322M
                      && 
!uncaught_exception()0
)
280
0
    {
281
0
#ifndef _LIBCPP_NO_EXCEPTIONS
282
0
        try
283
0
        {
284
0
#endif  // _LIBCPP_NO_EXCEPTIONS
285
0
            if (__os_.rdbuf()->pubsync() == -1)
286
0
                __os_.setstate(ios_base::badbit);
287
0
#ifndef _LIBCPP_NO_EXCEPTIONS
288
0
        }
289
0
        catch (...)
290
0
        {
291
0
        }
292
0
#endif  // _LIBCPP_NO_EXCEPTIONS
293
0
    }
294
322M
}
std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::sentry::~sentry()
Line
Count
Source
277
17.0k
{
278
17.0k
    if (__os_.rdbuf() && __os_.good() && (__os_.flags() & ios_base::unitbuf)
279
17.0k
                      && 
!uncaught_exception()0
)
280
0
    {
281
0
#ifndef _LIBCPP_NO_EXCEPTIONS
282
0
        try
283
0
        {
284
0
#endif  // _LIBCPP_NO_EXCEPTIONS
285
0
            if (__os_.rdbuf()->pubsync() == -1)
286
0
                __os_.setstate(ios_base::badbit);
287
0
#ifndef _LIBCPP_NO_EXCEPTIONS
288
0
        }
289
0
        catch (...)
290
0
        {
291
0
        }
292
0
#endif  // _LIBCPP_NO_EXCEPTIONS
293
0
    }
294
17.0k
}
295
296
#ifndef _LIBCPP_CXX03_LANG
297
298
template <class _CharT, class _Traits>
299
basic_ostream<_CharT, _Traits>::basic_ostream(basic_ostream&& __rhs)
300
{
301
    this->move(__rhs);
302
}
303
304
template <class _CharT, class _Traits>
305
basic_ostream<_CharT, _Traits>&
306
basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs)
307
0
{
308
0
    swap(__rhs);
309
0
    return *this;
310
0
}
311
312
#endif  // _LIBCPP_CXX03_LANG
313
314
template <class _CharT, class _Traits>
315
basic_ostream<_CharT, _Traits>::~basic_ostream()
316
39.8M
{
317
39.8M
}
std::__1::basic_ostream<char, std::__1::char_traits<char> >::~basic_ostream()
Line
Count
Source
316
39.8M
{
317
39.8M
}
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::~basic_ostream()
318
319
template <class _CharT, class _Traits>
320
basic_ostream<_CharT, _Traits>&
321
basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_type>* __sb)
322
0
{
323
0
#ifndef _LIBCPP_NO_EXCEPTIONS
324
0
    try
325
0
    {
326
0
#endif  // _LIBCPP_NO_EXCEPTIONS
327
0
        sentry __s(*this);
328
0
        if (__s)
329
0
        {
330
0
            if (__sb)
331
0
            {
332
0
#ifndef _LIBCPP_NO_EXCEPTIONS
333
0
                try
334
0
                {
335
0
#endif  // _LIBCPP_NO_EXCEPTIONS
336
0
                    typedef istreambuf_iterator<_CharT, _Traits> _Ip;
337
0
                    typedef ostreambuf_iterator<_CharT, _Traits> _Op;
338
0
                    _Ip __i(__sb);
339
0
                    _Ip __eof;
340
0
                    _Op __o(*this);
341
0
                    size_t __c = 0;
342
0
                    for (; __i != __eof; ++__i, ++__o, ++__c)
343
0
                    {
344
0
                        *__o = *__i;
345
0
                        if (__o.failed())
346
0
                            break;
347
0
                    }
348
0
                    if (__c == 0)
349
0
                        this->setstate(ios_base::failbit);
350
0
#ifndef _LIBCPP_NO_EXCEPTIONS
351
0
                }
352
0
                catch (...)
353
0
                {
354
0
                    this->__set_failbit_and_consider_rethrow();
355
0
                }
356
0
#endif  // _LIBCPP_NO_EXCEPTIONS
357
0
            }
358
0
            else
359
0
                this->setstate(ios_base::badbit);
360
0
        }
361
0
#ifndef _LIBCPP_NO_EXCEPTIONS
362
0
    }
363
0
    catch (...)
364
0
    {
365
0
        this->__set_badbit_and_consider_rethrow();
366
0
    }
367
0
#endif  // _LIBCPP_NO_EXCEPTIONS
368
0
    return *this;
369
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(std::__1::basic_streambuf<char, std::__1::char_traits<char> >*)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(std::__1::basic_streambuf<wchar_t, std::__1::char_traits<wchar_t> >*)
370
371
template <class _CharT, class _Traits>
372
basic_ostream<_CharT, _Traits>&
373
basic_ostream<_CharT, _Traits>::operator<<(bool __n)
374
0
{
375
0
#ifndef _LIBCPP_NO_EXCEPTIONS
376
0
    try
377
0
    {
378
0
#endif  // _LIBCPP_NO_EXCEPTIONS
379
0
        sentry __s(*this);
380
0
        if (__s)
381
0
        {
382
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
383
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
384
0
            if (__f.put(*this, *this, this->fill(), __n).failed())
385
0
                this->setstate(ios_base::badbit | ios_base::failbit);
386
0
        }
387
0
#ifndef _LIBCPP_NO_EXCEPTIONS
388
0
    }
389
0
    catch (...)
390
0
    {
391
0
        this->__set_badbit_and_consider_rethrow();
392
0
    }
393
0
#endif  // _LIBCPP_NO_EXCEPTIONS
394
0
    return *this;
395
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(bool)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(bool)
396
397
template <class _CharT, class _Traits>
398
basic_ostream<_CharT, _Traits>&
399
basic_ostream<_CharT, _Traits>::operator<<(short __n)
400
0
{
401
0
#ifndef _LIBCPP_NO_EXCEPTIONS
402
0
    try
403
0
    {
404
0
#endif  // _LIBCPP_NO_EXCEPTIONS
405
0
        sentry __s(*this);
406
0
        if (__s)
407
0
        {
408
0
            ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield;
409
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
410
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
411
0
            if (__f.put(*this, *this, this->fill(),
412
0
                        __flags == ios_base::oct || __flags == ios_base::hex ?
413
0
                        static_cast<long>(static_cast<unsigned short>(__n))  :
414
0
                        static_cast<long>(__n)).failed())
415
0
                this->setstate(ios_base::badbit | ios_base::failbit);
416
0
        }
417
0
#ifndef _LIBCPP_NO_EXCEPTIONS
418
0
    }
419
0
    catch (...)
420
0
    {
421
0
        this->__set_badbit_and_consider_rethrow();
422
0
    }
423
0
#endif  // _LIBCPP_NO_EXCEPTIONS
424
0
    return *this;
425
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(short)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(short)
426
427
template <class _CharT, class _Traits>
428
basic_ostream<_CharT, _Traits>&
429
basic_ostream<_CharT, _Traits>::operator<<(unsigned short __n)
430
0
{
431
0
#ifndef _LIBCPP_NO_EXCEPTIONS
432
0
    try
433
0
    {
434
0
#endif  // _LIBCPP_NO_EXCEPTIONS
435
0
        sentry __s(*this);
436
0
        if (__s)
437
0
        {
438
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
439
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
440
0
            if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
441
0
                this->setstate(ios_base::badbit | ios_base::failbit);
442
0
        }
443
0
#ifndef _LIBCPP_NO_EXCEPTIONS
444
0
    }
445
0
    catch (...)
446
0
    {
447
0
        this->__set_badbit_and_consider_rethrow();
448
0
    }
449
0
#endif  // _LIBCPP_NO_EXCEPTIONS
450
0
    return *this;
451
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(unsigned short)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(unsigned short)
452
453
template <class _CharT, class _Traits>
454
basic_ostream<_CharT, _Traits>&
455
basic_ostream<_CharT, _Traits>::operator<<(int __n)
456
0
{
457
0
#ifndef _LIBCPP_NO_EXCEPTIONS
458
0
    try
459
0
    {
460
0
#endif  // _LIBCPP_NO_EXCEPTIONS
461
0
        sentry __s(*this);
462
0
        if (__s)
463
0
        {
464
0
            ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield;
465
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
466
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
467
0
            if (__f.put(*this, *this, this->fill(),
468
0
                        __flags == ios_base::oct || __flags == ios_base::hex ?
469
0
                        static_cast<long>(static_cast<unsigned int>(__n))  :
470
0
                        static_cast<long>(__n)).failed())
471
0
                this->setstate(ios_base::badbit | ios_base::failbit);
472
0
        }
473
0
#ifndef _LIBCPP_NO_EXCEPTIONS
474
0
    }
475
0
    catch (...)
476
0
    {
477
0
        this->__set_badbit_and_consider_rethrow();
478
0
    }
479
0
#endif  // _LIBCPP_NO_EXCEPTIONS
480
0
    return *this;
481
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(int)
482
483
template <class _CharT, class _Traits>
484
basic_ostream<_CharT, _Traits>&
485
basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n)
486
82
{
487
82
#ifndef _LIBCPP_NO_EXCEPTIONS
488
82
    try
489
82
    {
490
82
#endif  // _LIBCPP_NO_EXCEPTIONS
491
82
        sentry __s(*this);
492
82
        if (__s)
493
82
        {
494
82
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
495
82
            const _Fp& __f = use_facet<_Fp>(this->getloc());
496
82
            if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
497
0
                this->setstate(ios_base::badbit | ios_base::failbit);
498
82
        }
499
82
#ifndef _LIBCPP_NO_EXCEPTIONS
500
82
    }
501
82
    catch (...)
502
82
    {
503
0
        this->__set_badbit_and_consider_rethrow();
504
0
    }
505
82
#endif  // _LIBCPP_NO_EXCEPTIONS
506
82
    return *this;
507
82
}
std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(unsigned int)
Line
Count
Source
486
82
{
487
82
#ifndef _LIBCPP_NO_EXCEPTIONS
488
82
    try
489
82
    {
490
82
#endif  // _LIBCPP_NO_EXCEPTIONS
491
82
        sentry __s(*this);
492
82
        if (__s)
493
82
        {
494
82
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
495
82
            const _Fp& __f = use_facet<_Fp>(this->getloc());
496
82
            if (__f.put(*this, *this, this->fill(), static_cast<unsigned long>(__n)).failed())
497
0
                this->setstate(ios_base::badbit | ios_base::failbit);
498
82
        }
499
82
#ifndef _LIBCPP_NO_EXCEPTIONS
500
82
    }
501
82
    catch (...)
502
82
    {
503
0
        this->__set_badbit_and_consider_rethrow();
504
0
    }
505
82
#endif  // _LIBCPP_NO_EXCEPTIONS
506
82
    return *this;
507
82
}
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(unsigned int)
508
509
template <class _CharT, class _Traits>
510
basic_ostream<_CharT, _Traits>&
511
basic_ostream<_CharT, _Traits>::operator<<(long __n)
512
0
{
513
0
#ifndef _LIBCPP_NO_EXCEPTIONS
514
0
    try
515
0
    {
516
0
#endif  // _LIBCPP_NO_EXCEPTIONS
517
0
        sentry __s(*this);
518
0
        if (__s)
519
0
        {
520
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
521
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
522
0
            if (__f.put(*this, *this, this->fill(), __n).failed())
523
0
                this->setstate(ios_base::badbit | ios_base::failbit);
524
0
        }
525
0
#ifndef _LIBCPP_NO_EXCEPTIONS
526
0
    }
527
0
    catch (...)
528
0
    {
529
0
        this->__set_badbit_and_consider_rethrow();
530
0
    }
531
0
#endif  // _LIBCPP_NO_EXCEPTIONS
532
0
    return *this;
533
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(long)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(long)
534
535
template <class _CharT, class _Traits>
536
basic_ostream<_CharT, _Traits>&
537
basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
538
57.3k
{
539
57.3k
#ifndef _LIBCPP_NO_EXCEPTIONS
540
57.3k
    try
541
57.3k
    {
542
57.3k
#endif  // _LIBCPP_NO_EXCEPTIONS
543
57.3k
        sentry __s(*this);
544
57.3k
        if (__s)
545
57.3k
        {
546
57.3k
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
547
57.3k
            const _Fp& __f = use_facet<_Fp>(this->getloc());
548
57.3k
            if (__f.put(*this, *this, this->fill(), __n).failed())
549
0
                this->setstate(ios_base::badbit | ios_base::failbit);
550
57.3k
        }
551
57.3k
#ifndef _LIBCPP_NO_EXCEPTIONS
552
57.3k
    }
553
57.3k
    catch (...)
554
57.3k
    {
555
0
        this->__set_badbit_and_consider_rethrow();
556
0
    }
557
57.3k
#endif  // _LIBCPP_NO_EXCEPTIONS
558
57.3k
    return *this;
559
57.3k
}
std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(unsigned long)
Line
Count
Source
538
57.3k
{
539
57.3k
#ifndef _LIBCPP_NO_EXCEPTIONS
540
57.3k
    try
541
57.3k
    {
542
57.3k
#endif  // _LIBCPP_NO_EXCEPTIONS
543
57.3k
        sentry __s(*this);
544
57.3k
        if (__s)
545
57.3k
        {
546
57.3k
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
547
57.3k
            const _Fp& __f = use_facet<_Fp>(this->getloc());
548
57.3k
            if (__f.put(*this, *this, this->fill(), __n).failed())
549
0
                this->setstate(ios_base::badbit | ios_base::failbit);
550
57.3k
        }
551
57.3k
#ifndef _LIBCPP_NO_EXCEPTIONS
552
57.3k
    }
553
57.3k
    catch (...)
554
57.3k
    {
555
0
        this->__set_badbit_and_consider_rethrow();
556
0
    }
557
57.3k
#endif  // _LIBCPP_NO_EXCEPTIONS
558
57.3k
    return *this;
559
57.3k
}
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(unsigned long)
560
561
template <class _CharT, class _Traits>
562
basic_ostream<_CharT, _Traits>&
563
basic_ostream<_CharT, _Traits>::operator<<(long long __n)
564
0
{
565
0
#ifndef _LIBCPP_NO_EXCEPTIONS
566
0
    try
567
0
    {
568
0
#endif  // _LIBCPP_NO_EXCEPTIONS
569
0
        sentry __s(*this);
570
0
        if (__s)
571
0
        {
572
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
573
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
574
0
            if (__f.put(*this, *this, this->fill(), __n).failed())
575
0
                this->setstate(ios_base::badbit | ios_base::failbit);
576
0
        }
577
0
#ifndef _LIBCPP_NO_EXCEPTIONS
578
0
    }
579
0
    catch (...)
580
0
    {
581
0
        this->__set_badbit_and_consider_rethrow();
582
0
    }
583
0
#endif  // _LIBCPP_NO_EXCEPTIONS
584
0
    return *this;
585
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(long long)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(long long)
586
587
template <class _CharT, class _Traits>
588
basic_ostream<_CharT, _Traits>&
589
basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
590
0
{
591
0
#ifndef _LIBCPP_NO_EXCEPTIONS
592
0
    try
593
0
    {
594
0
#endif  // _LIBCPP_NO_EXCEPTIONS
595
0
        sentry __s(*this);
596
0
        if (__s)
597
0
        {
598
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
599
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
600
0
            if (__f.put(*this, *this, this->fill(), __n).failed())
601
0
                this->setstate(ios_base::badbit | ios_base::failbit);
602
0
        }
603
0
#ifndef _LIBCPP_NO_EXCEPTIONS
604
0
    }
605
0
    catch (...)
606
0
    {
607
0
        this->__set_badbit_and_consider_rethrow();
608
0
    }
609
0
#endif  // _LIBCPP_NO_EXCEPTIONS
610
0
    return *this;
611
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(unsigned long long)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(unsigned long long)
612
613
template <class _CharT, class _Traits>
614
basic_ostream<_CharT, _Traits>&
615
basic_ostream<_CharT, _Traits>::operator<<(float __n)
616
0
{
617
0
#ifndef _LIBCPP_NO_EXCEPTIONS
618
0
    try
619
0
    {
620
0
#endif  // _LIBCPP_NO_EXCEPTIONS
621
0
        sentry __s(*this);
622
0
        if (__s)
623
0
        {
624
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
625
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
626
0
            if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed())
627
0
                this->setstate(ios_base::badbit | ios_base::failbit);
628
0
        }
629
0
#ifndef _LIBCPP_NO_EXCEPTIONS
630
0
    }
631
0
    catch (...)
632
0
    {
633
0
        this->__set_badbit_and_consider_rethrow();
634
0
    }
635
0
#endif  // _LIBCPP_NO_EXCEPTIONS
636
0
    return *this;
637
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(float)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(float)
638
639
template <class _CharT, class _Traits>
640
basic_ostream<_CharT, _Traits>&
641
basic_ostream<_CharT, _Traits>::operator<<(double __n)
642
0
{
643
0
#ifndef _LIBCPP_NO_EXCEPTIONS
644
0
    try
645
0
    {
646
0
#endif  // _LIBCPP_NO_EXCEPTIONS
647
0
        sentry __s(*this);
648
0
        if (__s)
649
0
        {
650
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
651
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
652
0
            if (__f.put(*this, *this, this->fill(), __n).failed())
653
0
                this->setstate(ios_base::badbit | ios_base::failbit);
654
0
        }
655
0
#ifndef _LIBCPP_NO_EXCEPTIONS
656
0
    }
657
0
    catch (...)
658
0
    {
659
0
        this->__set_badbit_and_consider_rethrow();
660
0
    }
661
0
#endif  // _LIBCPP_NO_EXCEPTIONS
662
0
    return *this;
663
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(double)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(double)
664
665
template <class _CharT, class _Traits>
666
basic_ostream<_CharT, _Traits>&
667
basic_ostream<_CharT, _Traits>::operator<<(long double __n)
668
0
{
669
0
#ifndef _LIBCPP_NO_EXCEPTIONS
670
0
    try
671
0
    {
672
0
#endif  // _LIBCPP_NO_EXCEPTIONS
673
0
        sentry __s(*this);
674
0
        if (__s)
675
0
        {
676
0
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
677
0
            const _Fp& __f = use_facet<_Fp>(this->getloc());
678
0
            if (__f.put(*this, *this, this->fill(), __n).failed())
679
0
                this->setstate(ios_base::badbit | ios_base::failbit);
680
0
        }
681
0
#ifndef _LIBCPP_NO_EXCEPTIONS
682
0
    }
683
0
    catch (...)
684
0
    {
685
0
        this->__set_badbit_and_consider_rethrow();
686
0
    }
687
0
#endif  // _LIBCPP_NO_EXCEPTIONS
688
0
    return *this;
689
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(long double)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(long double)
690
691
template <class _CharT, class _Traits>
692
basic_ostream<_CharT, _Traits>&
693
basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
694
3.01M
{
695
3.01M
#ifndef _LIBCPP_NO_EXCEPTIONS
696
3.01M
    try
697
3.01M
    {
698
3.01M
#endif  // _LIBCPP_NO_EXCEPTIONS
699
3.01M
        sentry __s(*this);
700
3.01M
        if (__s)
701
3.01M
        {
702
3.01M
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
703
3.01M
            const _Fp& __f = use_facet<_Fp>(this->getloc());
704
3.01M
            if (__f.put(*this, *this, this->fill(), __n).failed())
705
0
                this->setstate(ios_base::badbit | ios_base::failbit);
706
3.01M
        }
707
3.01M
#ifndef _LIBCPP_NO_EXCEPTIONS
708
3.01M
    }
709
3.01M
    catch (...)
710
3.01M
    {
711
0
        this->__set_badbit_and_consider_rethrow();
712
0
    }
713
3.01M
#endif  // _LIBCPP_NO_EXCEPTIONS
714
3.01M
    return *this;
715
3.01M
}
std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(void const*)
Line
Count
Source
694
3.01M
{
695
3.01M
#ifndef _LIBCPP_NO_EXCEPTIONS
696
3.01M
    try
697
3.01M
    {
698
3.01M
#endif  // _LIBCPP_NO_EXCEPTIONS
699
3.01M
        sentry __s(*this);
700
3.01M
        if (__s)
701
3.01M
        {
702
3.01M
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
703
3.01M
            const _Fp& __f = use_facet<_Fp>(this->getloc());
704
3.01M
            if (__f.put(*this, *this, this->fill(), __n).failed())
705
0
                this->setstate(ios_base::badbit | ios_base::failbit);
706
3.01M
        }
707
3.01M
#ifndef _LIBCPP_NO_EXCEPTIONS
708
3.01M
    }
709
3.01M
    catch (...)
710
3.01M
    {
711
0
        this->__set_badbit_and_consider_rethrow();
712
0
    }
713
3.01M
#endif  // _LIBCPP_NO_EXCEPTIONS
714
3.01M
    return *this;
715
3.01M
}
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::operator<<(void const*)
716
717
template<class _CharT, class _Traits>
718
basic_ostream<_CharT, _Traits>&
719
__put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
720
                          const _CharT* __str, size_t __len)
721
{
722
#ifndef _LIBCPP_NO_EXCEPTIONS
723
    try
724
    {
725
#endif  // _LIBCPP_NO_EXCEPTIONS
726
        typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
727
        if (__s)
728
        {
729
            typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
730
            if (__pad_and_output(_Ip(__os),
731
                                 __str,
732
                                 (__os.flags() & ios_base::adjustfield) == ios_base::left ?
733
                                     __str + __len :
734
                                     __str,
735
                                 __str + __len,
736
                                 __os,
737
                                 __os.fill()).failed())
738
                __os.setstate(ios_base::badbit | ios_base::failbit);
739
        }
740
#ifndef _LIBCPP_NO_EXCEPTIONS
741
    }
742
    catch (...)
743
    {
744
        __os.__set_badbit_and_consider_rethrow();
745
    }
746
#endif  // _LIBCPP_NO_EXCEPTIONS
747
    return __os;
748
}
749
750
751
template<class _CharT, class _Traits>
752
basic_ostream<_CharT, _Traits>&
753
operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
754
{
755
    return _VSTD::__put_character_sequence(__os, &__c, 1);
756
}
757
758
template<class _CharT, class _Traits>
759
basic_ostream<_CharT, _Traits>&
760
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
761
{
762
#ifndef _LIBCPP_NO_EXCEPTIONS
763
    try
764
    {
765
#endif  // _LIBCPP_NO_EXCEPTIONS
766
        typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
767
        if (__s)
768
        {
769
            _CharT __c = __os.widen(__cn);
770
            typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
771
            if (__pad_and_output(_Ip(__os),
772
                                 &__c,
773
                                 (__os.flags() & ios_base::adjustfield) == ios_base::left ?
774
                                     &__c + 1 :
775
                                     &__c,
776
                                 &__c + 1,
777
                                 __os,
778
                                 __os.fill()).failed())
779
                __os.setstate(ios_base::badbit | ios_base::failbit);
780
        }
781
#ifndef _LIBCPP_NO_EXCEPTIONS
782
    }
783
    catch (...)
784
    {
785
        __os.__set_badbit_and_consider_rethrow();
786
    }
787
#endif  // _LIBCPP_NO_EXCEPTIONS
788
    return __os;
789
}
790
791
template<class _Traits>
792
basic_ostream<char, _Traits>&
793
operator<<(basic_ostream<char, _Traits>& __os, char __c)
794
{
795
    return _VSTD::__put_character_sequence(__os, &__c, 1);
796
}
797
798
template<class _Traits>
799
basic_ostream<char, _Traits>&
800
operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
801
{
802
    return _VSTD::__put_character_sequence(__os, (char *) &__c, 1);
803
}
804
805
template<class _Traits>
806
basic_ostream<char, _Traits>&
807
operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
808
{
809
    return _VSTD::__put_character_sequence(__os, (char *) &__c, 1);
810
}
811
812
template<class _CharT, class _Traits>
813
basic_ostream<_CharT, _Traits>&
814
operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str)
815
{
816
    return _VSTD::__put_character_sequence(__os, __str, _Traits::length(__str));
817
}
818
819
template<class _CharT, class _Traits>
820
basic_ostream<_CharT, _Traits>&
821
operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
822
{
823
#ifndef _LIBCPP_NO_EXCEPTIONS
824
    try
825
    {
826
#endif  // _LIBCPP_NO_EXCEPTIONS
827
        typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
828
        if (__s)
829
        {
830
            typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
831
            size_t __len = char_traits<char>::length(__strn);
832
            const int __bs = 100;
833
            _CharT __wbb[__bs];
834
            _CharT* __wb = __wbb;
835
            unique_ptr<_CharT, void(*)(void*)> __h(0, free);
836
            if (__len > __bs)
837
            {
838
                __wb = (_CharT*)malloc(__len*sizeof(_CharT));
839
                if (__wb == 0)
840
                    __throw_bad_alloc();
841
                __h.reset(__wb);
842
            }
843
            for (_CharT* __p = __wb; *__strn != '\0'; ++__strn, ++__p)
844
                *__p = __os.widen(*__strn);
845
            if (__pad_and_output(_Ip(__os),
846
                                 __wb,
847
                                 (__os.flags() & ios_base::adjustfield) == ios_base::left ?
848
                                     __wb + __len :
849
                                     __wb,
850
                                 __wb + __len,
851
                                 __os,
852
                                 __os.fill()).failed())
853
                __os.setstate(ios_base::badbit | ios_base::failbit);
854
        }
855
#ifndef _LIBCPP_NO_EXCEPTIONS
856
    }
857
    catch (...)
858
    {
859
        __os.__set_badbit_and_consider_rethrow();
860
    }
861
#endif  // _LIBCPP_NO_EXCEPTIONS
862
    return __os;
863
}
864
865
template<class _Traits>
866
basic_ostream<char, _Traits>&
867
operator<<(basic_ostream<char, _Traits>& __os, const char* __str)
868
{
869
    return _VSTD::__put_character_sequence(__os, __str, _Traits::length(__str));
870
}
871
872
template<class _Traits>
873
basic_ostream<char, _Traits>&
874
operator<<(basic_ostream<char, _Traits>& __os, const signed char* __str)
875
{
876
    const char *__s = (const char *) __str;
877
    return _VSTD::__put_character_sequence(__os, __s, _Traits::length(__s));
878
}
879
880
template<class _Traits>
881
basic_ostream<char, _Traits>&
882
operator<<(basic_ostream<char, _Traits>& __os, const unsigned char* __str)
883
{
884
    const char *__s = (const char *) __str;
885
    return _VSTD::__put_character_sequence(__os, __s, _Traits::length(__s));
886
}
887
888
template <class _CharT, class _Traits>
889
basic_ostream<_CharT, _Traits>&
890
basic_ostream<_CharT, _Traits>::put(char_type __c)
891
0
{
892
0
#ifndef _LIBCPP_NO_EXCEPTIONS
893
0
    try
894
0
    {
895
0
#endif  // _LIBCPP_NO_EXCEPTIONS
896
0
        sentry __s(*this);
897
0
        if (__s)
898
0
        {
899
0
            typedef ostreambuf_iterator<_CharT, _Traits> _Op;
900
0
            _Op __o(*this);
901
0
            *__o = __c;
902
0
            if (__o.failed())
903
0
                this->setstate(ios_base::badbit);
904
0
        }
905
0
#ifndef _LIBCPP_NO_EXCEPTIONS
906
0
    }
907
0
    catch (...)
908
0
    {
909
0
        this->__set_badbit_and_consider_rethrow();
910
0
    }
911
0
#endif  // _LIBCPP_NO_EXCEPTIONS
912
0
    return *this;
913
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::put(char)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::put(wchar_t)
914
915
template <class _CharT, class _Traits>
916
basic_ostream<_CharT, _Traits>&
917
basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n)
918
55.4M
{
919
55.4M
#ifndef _LIBCPP_NO_EXCEPTIONS
920
55.4M
    try
921
55.4M
    {
922
55.4M
#endif  // _LIBCPP_NO_EXCEPTIONS
923
55.4M
        sentry __sen(*this);
924
55.4M
        if (__sen && __n)
925
55.4M
        {
926
55.4M
            if (this->rdbuf()->sputn(__s, __n) != __n)
927
0
                this->setstate(ios_base::badbit);
928
55.4M
        }
929
55.4M
#ifndef _LIBCPP_NO_EXCEPTIONS
930
55.4M
    }
931
55.4M
    catch (...)
932
55.4M
    {
933
0
        this->__set_badbit_and_consider_rethrow();
934
0
    }
935
55.4M
#endif  // _LIBCPP_NO_EXCEPTIONS
936
55.4M
    return *this;
937
55.4M
}
std::__1::basic_ostream<char, std::__1::char_traits<char> >::write(char const*, long)
Line
Count
Source
918
55.4M
{
919
55.4M
#ifndef _LIBCPP_NO_EXCEPTIONS
920
55.4M
    try
921
55.4M
    {
922
55.4M
#endif  // _LIBCPP_NO_EXCEPTIONS
923
55.4M
        sentry __sen(*this);
924
55.4M
        if (__sen && __n)
925
55.4M
        {
926
55.4M
            if (this->rdbuf()->sputn(__s, __n) != __n)
927
0
                this->setstate(ios_base::badbit);
928
55.4M
        }
929
55.4M
#ifndef _LIBCPP_NO_EXCEPTIONS
930
55.4M
    }
931
55.4M
    catch (...)
932
55.4M
    {
933
0
        this->__set_badbit_and_consider_rethrow();
934
0
    }
935
55.4M
#endif  // _LIBCPP_NO_EXCEPTIONS
936
55.4M
    return *this;
937
55.4M
}
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::write(wchar_t const*, long)
938
939
template <class _CharT, class _Traits>
940
basic_ostream<_CharT, _Traits>&
941
basic_ostream<_CharT, _Traits>::flush()
942
34.0k
{
943
34.0k
#ifndef _LIBCPP_NO_EXCEPTIONS
944
34.0k
    try
945
34.0k
    {
946
34.0k
#endif  // _LIBCPP_NO_EXCEPTIONS
947
34.0k
        if (this->rdbuf())
948
34.0k
        {
949
34.0k
            sentry __s(*this);
950
34.0k
            if (__s)
951
34.0k
            {
952
34.0k
                if (this->rdbuf()->pubsync() == -1)
953
0
                    this->setstate(ios_base::badbit);
954
34.0k
            }
955
34.0k
        }
956
34.0k
#ifndef _LIBCPP_NO_EXCEPTIONS
957
34.0k
    }
958
34.0k
    catch (...)
959
34.0k
    {
960
0
        this->__set_badbit_and_consider_rethrow();
961
0
    }
962
34.0k
#endif  // _LIBCPP_NO_EXCEPTIONS
963
34.0k
    return *this;
964
34.0k
}
std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()
Line
Count
Source
942
17.0k
{
943
17.0k
#ifndef _LIBCPP_NO_EXCEPTIONS
944
17.0k
    try
945
17.0k
    {
946
17.0k
#endif  // _LIBCPP_NO_EXCEPTIONS
947
17.0k
        if (this->rdbuf())
948
17.0k
        {
949
17.0k
            sentry __s(*this);
950
17.0k
            if (__s)
951
17.0k
            {
952
17.0k
                if (this->rdbuf()->pubsync() == -1)
953
0
                    this->setstate(ios_base::badbit);
954
17.0k
            }
955
17.0k
        }
956
17.0k
#ifndef _LIBCPP_NO_EXCEPTIONS
957
17.0k
    }
958
17.0k
    catch (...)
959
17.0k
    {
960
0
        this->__set_badbit_and_consider_rethrow();
961
0
    }
962
17.0k
#endif  // _LIBCPP_NO_EXCEPTIONS
963
17.0k
    return *this;
964
17.0k
}
std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::flush()
Line
Count
Source
942
17.0k
{
943
17.0k
#ifndef _LIBCPP_NO_EXCEPTIONS
944
17.0k
    try
945
17.0k
    {
946
17.0k
#endif  // _LIBCPP_NO_EXCEPTIONS
947
17.0k
        if (this->rdbuf())
948
17.0k
        {
949
17.0k
            sentry __s(*this);
950
17.0k
            if (__s)
951
17.0k
            {
952
17.0k
                if (this->rdbuf()->pubsync() == -1)
953
0
                    this->setstate(ios_base::badbit);
954
17.0k
            }
955
17.0k
        }
956
17.0k
#ifndef _LIBCPP_NO_EXCEPTIONS
957
17.0k
    }
958
17.0k
    catch (...)
959
17.0k
    {
960
0
        this->__set_badbit_and_consider_rethrow();
961
0
    }
962
17.0k
#endif  // _LIBCPP_NO_EXCEPTIONS
963
17.0k
    return *this;
964
17.0k
}
965
966
template <class _CharT, class _Traits>
967
typename basic_ostream<_CharT, _Traits>::pos_type
968
basic_ostream<_CharT, _Traits>::tellp()
969
0
{
970
0
    if (this->fail())
971
0
        return pos_type(-1);
972
0
    return this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
973
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::tellp()
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::tellp()
974
975
template <class _CharT, class _Traits>
976
basic_ostream<_CharT, _Traits>&
977
basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
978
0
{
979
0
    sentry __s(*this);
980
0
    if (!this->fail())
981
0
    {
982
0
        if (this->rdbuf()->pubseekpos(__pos, ios_base::out) == pos_type(-1))
983
0
            this->setstate(ios_base::failbit);
984
0
    }
985
0
    return *this;
986
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::seekp(std::__1::fpos<__mbstate_t>)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::seekp(std::__1::fpos<__mbstate_t>)
987
988
template <class _CharT, class _Traits>
989
basic_ostream<_CharT, _Traits>&
990
basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
991
0
{
992
0
    sentry __s(*this);
993
0
    if (!this->fail())
994
0
    {
995
0
        if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::out) == pos_type(-1))
996
0
            this->setstate(ios_base::failbit);
997
0
    }
998
0
    return *this;
999
0
}
Unexecuted instantiation: std::__1::basic_ostream<char, std::__1::char_traits<char> >::seekp(long long, std::__1::ios_base::seekdir)
Unexecuted instantiation: std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::seekp(long long, std::__1::ios_base::seekdir)
1000
1001
template <class _CharT, class _Traits>
1002
inline _LIBCPP_INLINE_VISIBILITY
1003
basic_ostream<_CharT, _Traits>&
1004
endl(basic_ostream<_CharT, _Traits>& __os)
1005
{
1006
    __os.put(__os.widen('\n'));
1007
    __os.flush();
1008
    return __os;
1009
}
1010
1011
template <class _CharT, class _Traits>
1012
inline _LIBCPP_INLINE_VISIBILITY
1013
basic_ostream<_CharT, _Traits>&
1014
ends(basic_ostream<_CharT, _Traits>& __os)
1015
{
1016
    __os.put(_CharT());
1017
    return __os;
1018
}
1019
1020
template <class _CharT, class _Traits>
1021
inline _LIBCPP_INLINE_VISIBILITY
1022
basic_ostream<_CharT, _Traits>&
1023
flush(basic_ostream<_CharT, _Traits>& __os)
1024
{
1025
    __os.flush();
1026
    return __os;
1027
}
1028
1029
#ifndef _LIBCPP_CXX03_LANG
1030
1031
template <class _Stream, class _Tp>
1032
inline _LIBCPP_INLINE_VISIBILITY
1033
typename enable_if
1034
<
1035
    !is_lvalue_reference<_Stream>::value &&
1036
    is_base_of<ios_base, _Stream>::value,
1037
    _Stream&&
1038
>::type
1039
operator<<(_Stream&& __os, const _Tp& __x)
1040
{
1041
    __os << __x;
1042
    return _VSTD::move(__os);
1043
}
1044
1045
#endif  // _LIBCPP_CXX03_LANG
1046
1047
template<class _CharT, class _Traits, class _Allocator>
1048
basic_ostream<_CharT, _Traits>&
1049
operator<<(basic_ostream<_CharT, _Traits>& __os,
1050
           const basic_string<_CharT, _Traits, _Allocator>& __str)
1051
{
1052
    return _VSTD::__put_character_sequence(__os, __str.data(), __str.size());
1053
}
1054
1055
template<class _CharT, class _Traits>
1056
basic_ostream<_CharT, _Traits>&
1057
operator<<(basic_ostream<_CharT, _Traits>& __os,
1058
           basic_string_view<_CharT, _Traits> __sv)
1059
{
1060
    return _VSTD::__put_character_sequence(__os, __sv.data(), __sv.size());
1061
}
1062
1063
template <class _CharT, class _Traits>
1064
inline _LIBCPP_INLINE_VISIBILITY
1065
basic_ostream<_CharT, _Traits>&
1066
operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec)
1067
{
1068
    return __os << __ec.category().name() << ':' << __ec.value();
1069
}
1070
1071
template<class _CharT, class _Traits, class _Yp>
1072
inline _LIBCPP_INLINE_VISIBILITY
1073
basic_ostream<_CharT, _Traits>&
1074
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
1075
{
1076
    return __os << __p.get();
1077
}
1078
1079
template<class _CharT, class _Traits, class _Yp, class _Dp>
1080
inline _LIBCPP_INLINE_VISIBILITY
1081
typename enable_if
1082
<
1083
    is_same<void, typename __void_t<decltype((declval<basic_ostream<_CharT, _Traits>&>() << declval<typename unique_ptr<_Yp, _Dp>::pointer>()))>::type>::value,
1084
    basic_ostream<_CharT, _Traits>&
1085
>::type
1086
operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p)
1087
{
1088
    return __os << __p.get();
1089
}
1090
1091
template <class _CharT, class _Traits, size_t _Size>
1092
basic_ostream<_CharT, _Traits>&
1093
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
1094
{
1095
    return __os << __x.template to_string<_CharT, _Traits>
1096
                        (use_facet<ctype<_CharT> >(__os.getloc()).widen('0'),
1097
                         use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
1098
}
1099
1100
#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
1101
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
1102
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
1103
#endif
1104
1105
_LIBCPP_END_NAMESPACE_STD
1106
1107
#endif  // _LIBCPP_OSTREAM