2 //===--------------------------- istream ----------------------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef _LIBCPP_ISTREAM
12 #define _LIBCPP_ISTREAM
17 template <class charT, class traits = char_traits<charT> >
19 : virtual public basic_ios<charT,traits>
22 // types (inherited from basic_ios (27.5.4)):
23 typedef charT char_type;
24 typedef traits traits_type;
25 typedef typename traits_type::int_type int_type;
26 typedef typename traits_type::pos_type pos_type;
27 typedef typename traits_type::off_type off_type;
29 // 27.7.1.1.1 Constructor/destructor:
30 explicit basic_istream(basic_streambuf<char_type, traits_type>* sb);
31 basic_istream(basic_istream&& rhs);
32 virtual ~basic_istream();
34 // 27.7.1.1.2 Assign/swap:
35 basic_istream& operator=(basic_istream&& rhs);
36 void swap(basic_istream& rhs);
38 // 27.7.1.1.3 Prefix/suffix:
41 // 27.7.1.2 Formatted input:
42 basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));
43 basic_istream& operator>>(basic_ios<char_type, traits_type>&
44 (*pf)(basic_ios<char_type, traits_type>&));
45 basic_istream& operator>>(ios_base& (*pf)(ios_base&));
46 basic_istream& operator>>(basic_streambuf<char_type, traits_type>* sb);
47 basic_istream& operator>>(bool& n);
48 basic_istream& operator>>(short& n);
49 basic_istream& operator>>(unsigned short& n);
50 basic_istream& operator>>(int& n);
51 basic_istream& operator>>(unsigned int& n);
52 basic_istream& operator>>(long& n);
53 basic_istream& operator>>(unsigned long& n);
54 basic_istream& operator>>(long long& n);
55 basic_istream& operator>>(unsigned long long& n);
56 basic_istream& operator>>(float& f);
57 basic_istream& operator>>(double& f);
58 basic_istream& operator>>(long double& f);
59 basic_istream& operator>>(void*& p);
61 // 27.7.1.3 Unformatted input:
62 streamsize gcount() const;
64 basic_istream& get(char_type& c);
65 basic_istream& get(char_type* s, streamsize n);
66 basic_istream& get(char_type* s, streamsize n, char_type delim);
67 basic_istream& get(basic_streambuf<char_type,traits_type>& sb);
68 basic_istream& get(basic_streambuf<char_type,traits_type>& sb, char_type delim);
70 basic_istream& getline(char_type* s, streamsize n);
71 basic_istream& getline(char_type* s, streamsize n, char_type delim);
73 basic_istream& ignore(streamsize n = 1, int_type delim = traits_type::eof());
75 basic_istream& read (char_type* s, streamsize n);
76 streamsize readsome(char_type* s, streamsize n);
78 basic_istream& putback(char_type c);
79 basic_istream& unget();
83 basic_istream& seekg(pos_type);
84 basic_istream& seekg(off_type, ios_base::seekdir);
86 basic_istream(const basic_istream& rhs) = delete;
87 basic_istream(basic_istream&& rhs);
88 // 27.7.2.1.2 Assign/swap:
89 basic_istream& operator=(const basic_istream& rhs) = delete;
90 basic_istream& operator=(basic_istream&& rhs);
91 void swap(basic_istream& rhs);
94 // 27.7.1.2.3 character extraction templates:
95 template<class charT, class traits>
96 basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>&, charT&);
98 template<class traits>
99 basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, unsigned char&);
101 template<class traits>
102 basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, signed char&);
104 template<class charT, class traits>
105 basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>&, charT*);
107 template<class traits>
108 basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, unsigned char*);
110 template<class traits>
111 basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, signed char*);
113 template <class charT, class traits>
115 swap(basic_istream<charT, traits>& x, basic_istream<charT, traits>& y);
117 typedef basic_istream<char> istream;
118 typedef basic_istream<wchar_t> wistream;
120 template <class charT, class traits = char_traits<charT> >
121 class basic_iostream :
122 public basic_istream<charT,traits>,
123 public basic_ostream<charT,traits>
127 typedef charT char_type;
128 typedef traits traits_type;
129 typedef typename traits_type::int_type int_type;
130 typedef typename traits_type::pos_type pos_type;
131 typedef typename traits_type::off_type off_type;
133 // constructor/destructor
134 explicit basic_iostream(basic_streambuf<char_type, traits_type>* sb);
135 basic_iostream(basic_iostream&& rhs);
136 virtual ~basic_iostream();
139 basic_iostream& operator=(basic_iostream&& rhs);
140 void swap(basic_iostream& rhs);
143 template <class charT, class traits>
145 swap(basic_iostream<charT, traits>& x, basic_iostream<charT, traits>& y);
147 typedef basic_iostream<char> iostream;
148 typedef basic_iostream<wchar_t> wiostream;
150 template <class charT, class traits>
151 basic_istream<charT,traits>&
152 ws(basic_istream<charT,traits>& is);
154 template <class charT, class traits, class T>
155 basic_istream<charT, traits>&
156 operator>>(basic_istream<charT, traits>&& is, T& x);
165 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
166 #pragma GCC system_header
170 #include <__undef_macros>
173 _LIBCPP_BEGIN_NAMESPACE_STD
175 template <class _CharT, class _Traits>
176 class _LIBCPP_TEMPLATE_VIS basic_istream
177 : virtual public basic_ios<_CharT, _Traits>
181 // types (inherited from basic_ios (27.5.4)):
182 typedef _CharT char_type;
183 typedef _Traits traits_type;
184 typedef typename traits_type::int_type int_type;
185 typedef typename traits_type::pos_type pos_type;
186 typedef typename traits_type::off_type off_type;
188 // 27.7.1.1.1 Constructor/destructor:
189 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
190 explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb) : __gc_(0)
191 { this->init(__sb); }
192 virtual ~basic_istream();
194 #ifndef _LIBCPP_CXX03_LANG
195 inline _LIBCPP_INLINE_VISIBILITY
196 basic_istream(basic_istream&& __rhs);
198 // 27.7.1.1.2 Assign/swap:
199 inline _LIBCPP_INLINE_VISIBILITY
200 basic_istream& operator=(basic_istream&& __rhs);
203 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
204 void swap(basic_istream& __rhs) {
205 _VSTD::swap(__gc_, __rhs.__gc_);
206 basic_ios<char_type, traits_type>::swap(__rhs);
209 #ifndef _LIBCPP_CXX03_LANG
210 basic_istream (const basic_istream& __rhs) = delete;
211 basic_istream& operator=(const basic_istream& __rhs) = delete;
215 // 27.7.1.1.3 Prefix/suffix:
216 class _LIBCPP_TEMPLATE_VIS sentry;
218 // 27.7.1.2 Formatted input:
219 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
220 basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&))
221 { return __pf(*this); }
223 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
224 basic_istream& operator>>(basic_ios<char_type, traits_type>&
225 (*__pf)(basic_ios<char_type, traits_type>&))
226 { __pf(*this); return *this; }
228 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
229 basic_istream& operator>>(ios_base& (*__pf)(ios_base&))
230 { __pf(*this); return *this; }
232 basic_istream& operator>>(basic_streambuf<char_type, traits_type>* __sb);
233 basic_istream& operator>>(bool& __n);
234 basic_istream& operator>>(short& __n);
235 basic_istream& operator>>(unsigned short& __n);
236 basic_istream& operator>>(int& __n);
237 basic_istream& operator>>(unsigned int& __n);
238 basic_istream& operator>>(long& __n);
239 basic_istream& operator>>(unsigned long& __n);
240 basic_istream& operator>>(long long& __n);
241 basic_istream& operator>>(unsigned long long& __n);
242 basic_istream& operator>>(float& __f);
243 basic_istream& operator>>(double& __f);
244 basic_istream& operator>>(long double& __f);
245 basic_istream& operator>>(void*& __p);
247 // 27.7.1.3 Unformatted input:
248 _LIBCPP_INLINE_VISIBILITY
249 streamsize gcount() const {return __gc_;}
252 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
253 basic_istream& get(char_type& __c) {
254 int_type __ch = get();
255 if (__ch != traits_type::eof())
256 __c = traits_type::to_char_type(__ch);
260 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
261 basic_istream& get(char_type* __s, streamsize __n)
262 { return get(__s, __n, this->widen('\n')); }
264 basic_istream& get(char_type* __s, streamsize __n, char_type __dlm);
266 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
267 basic_istream& get(basic_streambuf<char_type, traits_type>& __sb)
268 { return get(__sb, this->widen('\n')); }
270 basic_istream& get(basic_streambuf<char_type, traits_type>& __sb, char_type __dlm);
272 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
273 basic_istream& getline(char_type* __s, streamsize __n)
274 { return getline(__s, __n, this->widen('\n')); }
276 basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);
278 basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());
280 basic_istream& read (char_type* __s, streamsize __n);
281 streamsize readsome(char_type* __s, streamsize __n);
283 basic_istream& putback(char_type __c);
284 basic_istream& unget();
288 basic_istream& seekg(pos_type __pos);
289 basic_istream& seekg(off_type __off, ios_base::seekdir __dir);
292 template <class _CharT, class _Traits>
293 class _LIBCPP_TEMPLATE_VIS basic_istream<_CharT, _Traits>::sentry
297 sentry(const sentry&); // = delete;
298 sentry& operator=(const sentry&); // = delete;
301 explicit sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
302 // ~sentry() = default;
304 _LIBCPP_INLINE_VISIBILITY
306 operator bool() const {return __ok_;}
309 template <class _CharT, class _Traits>
310 basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& __is,
318 if (!__noskipws && (__is.flags() & ios_base::skipws))
320 typedef istreambuf_iterator<_CharT, _Traits> _Ip;
321 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
324 for (; __i != __eof; ++__i)
325 if (!__ct.is(__ct.space, *__i))
328 __is.setstate(ios_base::failbit | ios_base::eofbit);
333 __is.setstate(ios_base::failbit);
336 #ifndef _LIBCPP_CXX03_LANG
338 template <class _CharT, class _Traits>
339 basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
346 template <class _CharT, class _Traits>
347 basic_istream<_CharT, _Traits>&
348 basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)
354 #endif // _LIBCPP_CXX03_LANG
356 template <class _CharT, class _Traits>
357 basic_istream<_CharT, _Traits>::~basic_istream()
361 template <class _CharT, class _Traits>
362 basic_istream<_CharT, _Traits>&
363 basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)
365 #ifndef _LIBCPP_NO_EXCEPTIONS
368 #endif // _LIBCPP_NO_EXCEPTIONS
372 typedef istreambuf_iterator<char_type, traits_type> _Ip;
373 typedef num_get<char_type, _Ip> _Fp;
374 ios_base::iostate __err = ios_base::goodbit;
375 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
376 this->setstate(__err);
378 #ifndef _LIBCPP_NO_EXCEPTIONS
382 this->__set_badbit_and_consider_rethrow();
384 #endif // _LIBCPP_NO_EXCEPTIONS
388 template <class _CharT, class _Traits>
389 basic_istream<_CharT, _Traits>&
390 basic_istream<_CharT, _Traits>::operator>>(unsigned int& __n)
392 #ifndef _LIBCPP_NO_EXCEPTIONS
395 #endif // _LIBCPP_NO_EXCEPTIONS
399 typedef istreambuf_iterator<char_type, traits_type> _Ip;
400 typedef num_get<char_type, _Ip> _Fp;
401 ios_base::iostate __err = ios_base::goodbit;
402 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
403 this->setstate(__err);
405 #ifndef _LIBCPP_NO_EXCEPTIONS
409 this->__set_badbit_and_consider_rethrow();
411 #endif // _LIBCPP_NO_EXCEPTIONS
415 template <class _CharT, class _Traits>
416 basic_istream<_CharT, _Traits>&
417 basic_istream<_CharT, _Traits>::operator>>(long& __n)
419 #ifndef _LIBCPP_NO_EXCEPTIONS
422 #endif // _LIBCPP_NO_EXCEPTIONS
426 typedef istreambuf_iterator<char_type, traits_type> _Ip;
427 typedef num_get<char_type, _Ip> _Fp;
428 ios_base::iostate __err = ios_base::goodbit;
429 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
430 this->setstate(__err);
432 #ifndef _LIBCPP_NO_EXCEPTIONS
436 this->__set_badbit_and_consider_rethrow();
438 #endif // _LIBCPP_NO_EXCEPTIONS
442 template <class _CharT, class _Traits>
443 basic_istream<_CharT, _Traits>&
444 basic_istream<_CharT, _Traits>::operator>>(unsigned long& __n)
446 #ifndef _LIBCPP_NO_EXCEPTIONS
449 #endif // _LIBCPP_NO_EXCEPTIONS
453 typedef istreambuf_iterator<char_type, traits_type> _Ip;
454 typedef num_get<char_type, _Ip> _Fp;
455 ios_base::iostate __err = ios_base::goodbit;
456 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
457 this->setstate(__err);
459 #ifndef _LIBCPP_NO_EXCEPTIONS
463 this->__set_badbit_and_consider_rethrow();
465 #endif // _LIBCPP_NO_EXCEPTIONS
469 template <class _CharT, class _Traits>
470 basic_istream<_CharT, _Traits>&
471 basic_istream<_CharT, _Traits>::operator>>(long long& __n)
473 #ifndef _LIBCPP_NO_EXCEPTIONS
476 #endif // _LIBCPP_NO_EXCEPTIONS
480 typedef istreambuf_iterator<char_type, traits_type> _Ip;
481 typedef num_get<char_type, _Ip> _Fp;
482 ios_base::iostate __err = ios_base::goodbit;
483 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
484 this->setstate(__err);
486 #ifndef _LIBCPP_NO_EXCEPTIONS
490 this->__set_badbit_and_consider_rethrow();
492 #endif // _LIBCPP_NO_EXCEPTIONS
496 template <class _CharT, class _Traits>
497 basic_istream<_CharT, _Traits>&
498 basic_istream<_CharT, _Traits>::operator>>(unsigned long long& __n)
500 #ifndef _LIBCPP_NO_EXCEPTIONS
503 #endif // _LIBCPP_NO_EXCEPTIONS
507 typedef istreambuf_iterator<char_type, traits_type> _Ip;
508 typedef num_get<char_type, _Ip> _Fp;
509 ios_base::iostate __err = ios_base::goodbit;
510 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
511 this->setstate(__err);
513 #ifndef _LIBCPP_NO_EXCEPTIONS
517 this->__set_badbit_and_consider_rethrow();
519 #endif // _LIBCPP_NO_EXCEPTIONS
523 template <class _CharT, class _Traits>
524 basic_istream<_CharT, _Traits>&
525 basic_istream<_CharT, _Traits>::operator>>(float& __n)
527 #ifndef _LIBCPP_NO_EXCEPTIONS
530 #endif // _LIBCPP_NO_EXCEPTIONS
534 typedef istreambuf_iterator<char_type, traits_type> _Ip;
535 typedef num_get<char_type, _Ip> _Fp;
536 ios_base::iostate __err = ios_base::goodbit;
537 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
538 this->setstate(__err);
540 #ifndef _LIBCPP_NO_EXCEPTIONS
544 this->__set_badbit_and_consider_rethrow();
546 #endif // _LIBCPP_NO_EXCEPTIONS
550 template <class _CharT, class _Traits>
551 basic_istream<_CharT, _Traits>&
552 basic_istream<_CharT, _Traits>::operator>>(double& __n)
554 #ifndef _LIBCPP_NO_EXCEPTIONS
557 #endif // _LIBCPP_NO_EXCEPTIONS
561 typedef istreambuf_iterator<char_type, traits_type> _Ip;
562 typedef num_get<char_type, _Ip> _Fp;
563 ios_base::iostate __err = ios_base::goodbit;
564 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
565 this->setstate(__err);
567 #ifndef _LIBCPP_NO_EXCEPTIONS
571 this->__set_badbit_and_consider_rethrow();
573 #endif // _LIBCPP_NO_EXCEPTIONS
577 template <class _CharT, class _Traits>
578 basic_istream<_CharT, _Traits>&
579 basic_istream<_CharT, _Traits>::operator>>(long double& __n)
581 #ifndef _LIBCPP_NO_EXCEPTIONS
584 #endif // _LIBCPP_NO_EXCEPTIONS
588 typedef istreambuf_iterator<char_type, traits_type> _Ip;
589 typedef num_get<char_type, _Ip> _Fp;
590 ios_base::iostate __err = ios_base::goodbit;
591 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
592 this->setstate(__err);
594 #ifndef _LIBCPP_NO_EXCEPTIONS
598 this->__set_badbit_and_consider_rethrow();
600 #endif // _LIBCPP_NO_EXCEPTIONS
604 template <class _CharT, class _Traits>
605 basic_istream<_CharT, _Traits>&
606 basic_istream<_CharT, _Traits>::operator>>(bool& __n)
608 #ifndef _LIBCPP_NO_EXCEPTIONS
611 #endif // _LIBCPP_NO_EXCEPTIONS
615 typedef istreambuf_iterator<char_type, traits_type> _Ip;
616 typedef num_get<char_type, _Ip> _Fp;
617 ios_base::iostate __err = ios_base::goodbit;
618 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
619 this->setstate(__err);
621 #ifndef _LIBCPP_NO_EXCEPTIONS
625 this->__set_badbit_and_consider_rethrow();
627 #endif // _LIBCPP_NO_EXCEPTIONS
631 template <class _CharT, class _Traits>
632 basic_istream<_CharT, _Traits>&
633 basic_istream<_CharT, _Traits>::operator>>(void*& __n)
635 #ifndef _LIBCPP_NO_EXCEPTIONS
638 #endif // _LIBCPP_NO_EXCEPTIONS
642 typedef istreambuf_iterator<char_type, traits_type> _Ip;
643 typedef num_get<char_type, _Ip> _Fp;
644 ios_base::iostate __err = ios_base::goodbit;
645 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);
646 this->setstate(__err);
648 #ifndef _LIBCPP_NO_EXCEPTIONS
652 this->__set_badbit_and_consider_rethrow();
654 #endif // _LIBCPP_NO_EXCEPTIONS
658 template <class _CharT, class _Traits>
659 basic_istream<_CharT, _Traits>&
660 basic_istream<_CharT, _Traits>::operator>>(short& __n)
662 #ifndef _LIBCPP_NO_EXCEPTIONS
665 #endif // _LIBCPP_NO_EXCEPTIONS
669 typedef istreambuf_iterator<char_type, traits_type> _Ip;
670 typedef num_get<char_type, _Ip> _Fp;
671 ios_base::iostate __err = ios_base::goodbit;
673 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __temp);
674 if (__temp < numeric_limits<short>::min())
676 __err |= ios_base::failbit;
677 __n = numeric_limits<short>::min();
679 else if (__temp > numeric_limits<short>::max())
681 __err |= ios_base::failbit;
682 __n = numeric_limits<short>::max();
685 __n = static_cast<short>(__temp);
686 this->setstate(__err);
688 #ifndef _LIBCPP_NO_EXCEPTIONS
692 this->__set_badbit_and_consider_rethrow();
694 #endif // _LIBCPP_NO_EXCEPTIONS
698 template <class _CharT, class _Traits>
699 basic_istream<_CharT, _Traits>&
700 basic_istream<_CharT, _Traits>::operator>>(int& __n)
702 #ifndef _LIBCPP_NO_EXCEPTIONS
705 #endif // _LIBCPP_NO_EXCEPTIONS
709 typedef istreambuf_iterator<char_type, traits_type> _Ip;
710 typedef num_get<char_type, _Ip> _Fp;
711 ios_base::iostate __err = ios_base::goodbit;
713 use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __temp);
714 if (__temp < numeric_limits<int>::min())
716 __err |= ios_base::failbit;
717 __n = numeric_limits<int>::min();
719 else if (__temp > numeric_limits<int>::max())
721 __err |= ios_base::failbit;
722 __n = numeric_limits<int>::max();
725 __n = static_cast<int>(__temp);
726 this->setstate(__err);
728 #ifndef _LIBCPP_NO_EXCEPTIONS
732 this->__set_badbit_and_consider_rethrow();
734 #endif // _LIBCPP_NO_EXCEPTIONS
738 template<class _CharT, class _Traits>
739 basic_istream<_CharT, _Traits>&
740 operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
742 #ifndef _LIBCPP_NO_EXCEPTIONS
745 #endif // _LIBCPP_NO_EXCEPTIONS
746 typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
749 streamsize __n = __is.width();
751 __n = numeric_limits<streamsize>::max() / sizeof(_CharT) - 1;
753 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
754 ios_base::iostate __err = ios_base::goodbit;
757 typename _Traits::int_type __i = __is.rdbuf()->sgetc();
758 if (_Traits::eq_int_type(__i, _Traits::eof()))
760 __err |= ios_base::eofbit;
763 _CharT __ch = _Traits::to_char_type(__i);
764 if (__ct.is(__ct.space, __ch))
768 __is.rdbuf()->sbumpc();
773 __err |= ios_base::failbit;
774 __is.setstate(__err);
776 #ifndef _LIBCPP_NO_EXCEPTIONS
780 __is.__set_badbit_and_consider_rethrow();
782 #endif // _LIBCPP_NO_EXCEPTIONS
786 template<class _Traits>
787 inline _LIBCPP_INLINE_VISIBILITY
788 basic_istream<char, _Traits>&
789 operator>>(basic_istream<char, _Traits>& __is, unsigned char* __s)
791 return __is >> (char*)__s;
794 template<class _Traits>
795 inline _LIBCPP_INLINE_VISIBILITY
796 basic_istream<char, _Traits>&
797 operator>>(basic_istream<char, _Traits>& __is, signed char* __s)
799 return __is >> (char*)__s;
802 template<class _CharT, class _Traits>
803 basic_istream<_CharT, _Traits>&
804 operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
806 #ifndef _LIBCPP_NO_EXCEPTIONS
809 #endif // _LIBCPP_NO_EXCEPTIONS
810 typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
813 typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
814 if (_Traits::eq_int_type(__i, _Traits::eof()))
815 __is.setstate(ios_base::eofbit | ios_base::failbit);
817 __c = _Traits::to_char_type(__i);
819 #ifndef _LIBCPP_NO_EXCEPTIONS
823 __is.__set_badbit_and_consider_rethrow();
825 #endif // _LIBCPP_NO_EXCEPTIONS
829 template<class _Traits>
830 inline _LIBCPP_INLINE_VISIBILITY
831 basic_istream<char, _Traits>&
832 operator>>(basic_istream<char, _Traits>& __is, unsigned char& __c)
834 return __is >> (char&)__c;
837 template<class _Traits>
838 inline _LIBCPP_INLINE_VISIBILITY
839 basic_istream<char, _Traits>&
840 operator>>(basic_istream<char, _Traits>& __is, signed char& __c)
842 return __is >> (char&)__c;
845 template<class _CharT, class _Traits>
846 basic_istream<_CharT, _Traits>&
847 basic_istream<_CharT, _Traits>::operator>>(basic_streambuf<char_type, traits_type>* __sb)
850 #ifndef _LIBCPP_NO_EXCEPTIONS
853 #endif // _LIBCPP_NO_EXCEPTIONS
854 sentry __s(*this, true);
859 #ifndef _LIBCPP_NO_EXCEPTIONS
862 #endif // _LIBCPP_NO_EXCEPTIONS
863 ios_base::iostate __err = ios_base::goodbit;
866 typename traits_type::int_type __i = this->rdbuf()->sgetc();
867 if (traits_type::eq_int_type(__i, _Traits::eof()))
869 __err |= ios_base::eofbit;
872 if (traits_type::eq_int_type(
873 __sb->sputc(traits_type::to_char_type(__i)),
877 this->rdbuf()->sbumpc();
880 __err |= ios_base::failbit;
881 this->setstate(__err);
882 #ifndef _LIBCPP_NO_EXCEPTIONS
887 this->__set_failbit_and_consider_rethrow();
889 #endif // _LIBCPP_NO_EXCEPTIONS
892 this->setstate(ios_base::failbit);
894 #ifndef _LIBCPP_NO_EXCEPTIONS
898 this->__set_badbit_and_consider_rethrow();
900 #endif // _LIBCPP_NO_EXCEPTIONS
904 template<class _CharT, class _Traits>
905 typename basic_istream<_CharT, _Traits>::int_type
906 basic_istream<_CharT, _Traits>::get()
909 int_type __r = traits_type::eof();
910 #ifndef _LIBCPP_NO_EXCEPTIONS
913 #endif // _LIBCPP_NO_EXCEPTIONS
914 sentry __s(*this, true);
917 __r = this->rdbuf()->sbumpc();
918 if (traits_type::eq_int_type(__r, traits_type::eof()))
919 this->setstate(ios_base::failbit | ios_base::eofbit);
923 #ifndef _LIBCPP_NO_EXCEPTIONS
927 this->__set_badbit_and_consider_rethrow();
929 #endif // _LIBCPP_NO_EXCEPTIONS
933 template<class _CharT, class _Traits>
934 basic_istream<_CharT, _Traits>&
935 basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __dlm)
938 #ifndef _LIBCPP_NO_EXCEPTIONS
941 #endif // _LIBCPP_NO_EXCEPTIONS
942 sentry __sen(*this, true);
947 ios_base::iostate __err = ios_base::goodbit;
948 while (__gc_ < __n-1)
950 int_type __i = this->rdbuf()->sgetc();
951 if (traits_type::eq_int_type(__i, traits_type::eof()))
953 __err |= ios_base::eofbit;
956 char_type __ch = traits_type::to_char_type(__i);
957 if (traits_type::eq(__ch, __dlm))
961 this->rdbuf()->sbumpc();
965 __err |= ios_base::failbit;
966 this->setstate(__err);
969 this->setstate(ios_base::failbit);
971 #ifndef _LIBCPP_NO_EXCEPTIONS
975 this->__set_badbit_and_consider_rethrow();
977 #endif // _LIBCPP_NO_EXCEPTIONS
981 template<class _CharT, class _Traits>
982 basic_istream<_CharT, _Traits>&
983 basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __sb,
987 #ifndef _LIBCPP_NO_EXCEPTIONS
990 #endif // _LIBCPP_NO_EXCEPTIONS
991 sentry __sen(*this, true);
994 ios_base::iostate __err = ios_base::goodbit;
995 #ifndef _LIBCPP_NO_EXCEPTIONS
998 #endif // _LIBCPP_NO_EXCEPTIONS
1001 typename traits_type::int_type __i = this->rdbuf()->sgetc();
1002 if (traits_type::eq_int_type(__i, traits_type::eof()))
1004 __err |= ios_base::eofbit;
1007 char_type __ch = traits_type::to_char_type(__i);
1008 if (traits_type::eq(__ch, __dlm))
1010 if (traits_type::eq_int_type(__sb.sputc(__ch), traits_type::eof()))
1013 this->rdbuf()->sbumpc();
1015 #ifndef _LIBCPP_NO_EXCEPTIONS
1020 #endif // _LIBCPP_NO_EXCEPTIONS
1022 __err |= ios_base::failbit;
1023 this->setstate(__err);
1025 #ifndef _LIBCPP_NO_EXCEPTIONS
1029 this->__set_badbit_and_consider_rethrow();
1031 #endif // _LIBCPP_NO_EXCEPTIONS
1035 template<class _CharT, class _Traits>
1036 basic_istream<_CharT, _Traits>&
1037 basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_type __dlm)
1040 #ifndef _LIBCPP_NO_EXCEPTIONS
1043 #endif // _LIBCPP_NO_EXCEPTIONS
1044 sentry __sen(*this, true);
1047 ios_base::iostate __err = ios_base::goodbit;
1050 typename traits_type::int_type __i = this->rdbuf()->sgetc();
1051 if (traits_type::eq_int_type(__i, traits_type::eof()))
1053 __err |= ios_base::eofbit;
1056 char_type __ch = traits_type::to_char_type(__i);
1057 if (traits_type::eq(__ch, __dlm))
1059 this->rdbuf()->sbumpc();
1065 __err |= ios_base::failbit;
1069 this->rdbuf()->sbumpc();
1073 __err |= ios_base::failbit;
1074 this->setstate(__err);
1078 #ifndef _LIBCPP_NO_EXCEPTIONS
1084 this->__set_badbit_and_consider_rethrow();
1086 #endif // _LIBCPP_NO_EXCEPTIONS
1090 template<class _CharT, class _Traits>
1091 basic_istream<_CharT, _Traits>&
1092 basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
1095 #ifndef _LIBCPP_NO_EXCEPTIONS
1098 #endif // _LIBCPP_NO_EXCEPTIONS
1099 sentry __sen(*this, true);
1102 ios_base::iostate __err = ios_base::goodbit;
1103 if (__n == numeric_limits<streamsize>::max())
1107 typename traits_type::int_type __i = this->rdbuf()->sbumpc();
1108 if (traits_type::eq_int_type(__i, traits_type::eof()))
1110 __err |= ios_base::eofbit;
1114 if (traits_type::eq_int_type(__i, __dlm))
1122 typename traits_type::int_type __i = this->rdbuf()->sbumpc();
1123 if (traits_type::eq_int_type(__i, traits_type::eof()))
1125 __err |= ios_base::eofbit;
1129 if (traits_type::eq_int_type(__i, __dlm))
1133 this->setstate(__err);
1135 #ifndef _LIBCPP_NO_EXCEPTIONS
1139 this->__set_badbit_and_consider_rethrow();
1141 #endif // _LIBCPP_NO_EXCEPTIONS
1145 template<class _CharT, class _Traits>
1146 typename basic_istream<_CharT, _Traits>::int_type
1147 basic_istream<_CharT, _Traits>::peek()
1150 int_type __r = traits_type::eof();
1151 #ifndef _LIBCPP_NO_EXCEPTIONS
1154 #endif // _LIBCPP_NO_EXCEPTIONS
1155 sentry __sen(*this, true);
1158 __r = this->rdbuf()->sgetc();
1159 if (traits_type::eq_int_type(__r, traits_type::eof()))
1160 this->setstate(ios_base::eofbit);
1162 #ifndef _LIBCPP_NO_EXCEPTIONS
1166 this->__set_badbit_and_consider_rethrow();
1168 #endif // _LIBCPP_NO_EXCEPTIONS
1172 template<class _CharT, class _Traits>
1173 basic_istream<_CharT, _Traits>&
1174 basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)
1177 #ifndef _LIBCPP_NO_EXCEPTIONS
1180 #endif // _LIBCPP_NO_EXCEPTIONS
1181 sentry __sen(*this, true);
1184 __gc_ = this->rdbuf()->sgetn(__s, __n);
1186 this->setstate(ios_base::failbit | ios_base::eofbit);
1189 this->setstate(ios_base::failbit);
1190 #ifndef _LIBCPP_NO_EXCEPTIONS
1194 this->__set_badbit_and_consider_rethrow();
1196 #endif // _LIBCPP_NO_EXCEPTIONS
1200 template<class _CharT, class _Traits>
1202 basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
1205 #ifndef _LIBCPP_NO_EXCEPTIONS
1208 #endif // _LIBCPP_NO_EXCEPTIONS
1209 sentry __sen(*this, true);
1212 streamsize __c = this->rdbuf()->in_avail();
1216 this->setstate(ios_base::eofbit);
1221 read(__s, _VSTD::min(__c, __n));
1226 this->setstate(ios_base::failbit);
1227 #ifndef _LIBCPP_NO_EXCEPTIONS
1231 this->__set_badbit_and_consider_rethrow();
1233 #endif // _LIBCPP_NO_EXCEPTIONS
1237 template<class _CharT, class _Traits>
1238 basic_istream<_CharT, _Traits>&
1239 basic_istream<_CharT, _Traits>::putback(char_type __c)
1242 #ifndef _LIBCPP_NO_EXCEPTIONS
1245 #endif // _LIBCPP_NO_EXCEPTIONS
1246 this->clear(this->rdstate() & ~ios_base::eofbit);
1247 sentry __sen(*this, true);
1250 if (this->rdbuf() == 0 || this->rdbuf()->sputbackc(__c) == traits_type::eof())
1251 this->setstate(ios_base::badbit);
1254 this->setstate(ios_base::failbit);
1255 #ifndef _LIBCPP_NO_EXCEPTIONS
1259 this->__set_badbit_and_consider_rethrow();
1261 #endif // _LIBCPP_NO_EXCEPTIONS
1265 template<class _CharT, class _Traits>
1266 basic_istream<_CharT, _Traits>&
1267 basic_istream<_CharT, _Traits>::unget()
1270 #ifndef _LIBCPP_NO_EXCEPTIONS
1273 #endif // _LIBCPP_NO_EXCEPTIONS
1274 this->clear(this->rdstate() & ~ios_base::eofbit);
1275 sentry __sen(*this, true);
1278 if (this->rdbuf() == 0 || this->rdbuf()->sungetc() == traits_type::eof())
1279 this->setstate(ios_base::badbit);
1282 this->setstate(ios_base::failbit);
1283 #ifndef _LIBCPP_NO_EXCEPTIONS
1287 this->__set_badbit_and_consider_rethrow();
1289 #endif // _LIBCPP_NO_EXCEPTIONS
1293 template<class _CharT, class _Traits>
1295 basic_istream<_CharT, _Traits>::sync()
1298 #ifndef _LIBCPP_NO_EXCEPTIONS
1301 #endif // _LIBCPP_NO_EXCEPTIONS
1302 sentry __sen(*this, true);
1305 if (this->rdbuf() == 0)
1307 if (this->rdbuf()->pubsync() == -1)
1309 this->setstate(ios_base::badbit);
1313 #ifndef _LIBCPP_NO_EXCEPTIONS
1317 this->__set_badbit_and_consider_rethrow();
1319 #endif // _LIBCPP_NO_EXCEPTIONS
1323 template<class _CharT, class _Traits>
1324 typename basic_istream<_CharT, _Traits>::pos_type
1325 basic_istream<_CharT, _Traits>::tellg()
1328 #ifndef _LIBCPP_NO_EXCEPTIONS
1331 #endif // _LIBCPP_NO_EXCEPTIONS
1332 sentry __sen(*this, true);
1334 __r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
1335 #ifndef _LIBCPP_NO_EXCEPTIONS
1339 this->__set_badbit_and_consider_rethrow();
1341 #endif // _LIBCPP_NO_EXCEPTIONS
1345 template<class _CharT, class _Traits>
1346 basic_istream<_CharT, _Traits>&
1347 basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
1349 #ifndef _LIBCPP_NO_EXCEPTIONS
1352 #endif // _LIBCPP_NO_EXCEPTIONS
1353 this->clear(this->rdstate() & ~ios_base::eofbit);
1354 sentry __sen(*this, true);
1357 if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
1358 this->setstate(ios_base::failbit);
1360 #ifndef _LIBCPP_NO_EXCEPTIONS
1364 this->__set_badbit_and_consider_rethrow();
1366 #endif // _LIBCPP_NO_EXCEPTIONS
1370 template<class _CharT, class _Traits>
1371 basic_istream<_CharT, _Traits>&
1372 basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)
1374 #ifndef _LIBCPP_NO_EXCEPTIONS
1377 #endif // _LIBCPP_NO_EXCEPTIONS
1378 this->clear(this->rdstate() & ~ios_base::eofbit);
1379 sentry __sen(*this, true);
1382 if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1))
1383 this->setstate(ios_base::failbit);
1385 #ifndef _LIBCPP_NO_EXCEPTIONS
1389 this->__set_badbit_and_consider_rethrow();
1391 #endif // _LIBCPP_NO_EXCEPTIONS
1395 template <class _CharT, class _Traits>
1396 basic_istream<_CharT, _Traits>&
1397 ws(basic_istream<_CharT, _Traits>& __is)
1399 #ifndef _LIBCPP_NO_EXCEPTIONS
1402 #endif // _LIBCPP_NO_EXCEPTIONS
1403 typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
1406 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
1409 typename _Traits::int_type __i = __is.rdbuf()->sgetc();
1410 if (_Traits::eq_int_type(__i, _Traits::eof()))
1412 __is.setstate(ios_base::eofbit);
1415 if (!__ct.is(__ct.space, _Traits::to_char_type(__i)))
1417 __is.rdbuf()->sbumpc();
1420 #ifndef _LIBCPP_NO_EXCEPTIONS
1424 __is.__set_badbit_and_consider_rethrow();
1426 #endif // _LIBCPP_NO_EXCEPTIONS
1430 #ifndef _LIBCPP_CXX03_LANG
1432 template <class _CharT, class _Traits, class _Tp>
1433 inline _LIBCPP_INLINE_VISIBILITY
1434 basic_istream<_CharT, _Traits>&
1435 operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp&& __x)
1437 __is >> _VSTD::forward<_Tp>(__x);
1441 #endif // _LIBCPP_CXX03_LANG
1443 template <class _CharT, class _Traits>
1444 class _LIBCPP_TEMPLATE_VIS basic_iostream
1445 : public basic_istream<_CharT, _Traits>,
1446 public basic_ostream<_CharT, _Traits>
1450 typedef _CharT char_type;
1451 typedef _Traits traits_type;
1452 typedef typename traits_type::int_type int_type;
1453 typedef typename traits_type::pos_type pos_type;
1454 typedef typename traits_type::off_type off_type;
1456 // constructor/destructor
1457 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
1458 explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
1459 : basic_istream<_CharT, _Traits>(__sb)
1462 virtual ~basic_iostream();
1464 #ifndef _LIBCPP_CXX03_LANG
1465 inline _LIBCPP_INLINE_VISIBILITY
1466 basic_iostream(basic_iostream&& __rhs);
1469 inline _LIBCPP_INLINE_VISIBILITY
1470 basic_iostream& operator=(basic_iostream&& __rhs);
1472 inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
1473 void swap(basic_iostream& __rhs)
1474 { basic_istream<char_type, traits_type>::swap(__rhs); }
1478 #ifndef _LIBCPP_CXX03_LANG
1480 template <class _CharT, class _Traits>
1481 basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
1482 : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
1486 template <class _CharT, class _Traits>
1487 basic_iostream<_CharT, _Traits>&
1488 basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)
1494 #endif // _LIBCPP_CXX03_LANG
1496 template <class _CharT, class _Traits>
1497 basic_iostream<_CharT, _Traits>::~basic_iostream()
1501 template<class _CharT, class _Traits, class _Allocator>
1502 basic_istream<_CharT, _Traits>&
1503 operator>>(basic_istream<_CharT, _Traits>& __is,
1504 basic_string<_CharT, _Traits, _Allocator>& __str)
1506 #ifndef _LIBCPP_NO_EXCEPTIONS
1509 #endif // _LIBCPP_NO_EXCEPTIONS
1510 typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
1514 streamsize __n = __is.width();
1516 __n = __str.max_size();
1518 __n = numeric_limits<streamsize>::max();
1520 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
1521 ios_base::iostate __err = ios_base::goodbit;
1524 typename _Traits::int_type __i = __is.rdbuf()->sgetc();
1525 if (_Traits::eq_int_type(__i, _Traits::eof()))
1527 __err |= ios_base::eofbit;
1530 _CharT __ch = _Traits::to_char_type(__i);
1531 if (__ct.is(__ct.space, __ch))
1533 __str.push_back(__ch);
1535 __is.rdbuf()->sbumpc();
1539 __err |= ios_base::failbit;
1540 __is.setstate(__err);
1543 __is.setstate(ios_base::failbit);
1544 #ifndef _LIBCPP_NO_EXCEPTIONS
1548 __is.__set_badbit_and_consider_rethrow();
1550 #endif // _LIBCPP_NO_EXCEPTIONS
1554 template<class _CharT, class _Traits, class _Allocator>
1555 basic_istream<_CharT, _Traits>&
1556 getline(basic_istream<_CharT, _Traits>& __is,
1557 basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
1559 #ifndef _LIBCPP_NO_EXCEPTIONS
1562 #endif // _LIBCPP_NO_EXCEPTIONS
1563 typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);
1567 ios_base::iostate __err = ios_base::goodbit;
1568 streamsize __extr = 0;
1571 typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
1572 if (_Traits::eq_int_type(__i, _Traits::eof()))
1574 __err |= ios_base::eofbit;
1578 _CharT __ch = _Traits::to_char_type(__i);
1579 if (_Traits::eq(__ch, __dlm))
1581 __str.push_back(__ch);
1582 if (__str.size() == __str.max_size())
1584 __err |= ios_base::failbit;
1589 __err |= ios_base::failbit;
1590 __is.setstate(__err);
1592 #ifndef _LIBCPP_NO_EXCEPTIONS
1596 __is.__set_badbit_and_consider_rethrow();
1598 #endif // _LIBCPP_NO_EXCEPTIONS
1602 template<class _CharT, class _Traits, class _Allocator>
1603 inline _LIBCPP_INLINE_VISIBILITY
1604 basic_istream<_CharT, _Traits>&
1605 getline(basic_istream<_CharT, _Traits>& __is,
1606 basic_string<_CharT, _Traits, _Allocator>& __str)
1608 return getline(__is, __str, __is.widen('\n'));
1611 #ifndef _LIBCPP_CXX03_LANG
1613 template<class _CharT, class _Traits, class _Allocator>
1614 inline _LIBCPP_INLINE_VISIBILITY
1615 basic_istream<_CharT, _Traits>&
1616 getline(basic_istream<_CharT, _Traits>&& __is,
1617 basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
1619 return getline(__is, __str, __dlm);
1622 template<class _CharT, class _Traits, class _Allocator>
1623 inline _LIBCPP_INLINE_VISIBILITY
1624 basic_istream<_CharT, _Traits>&
1625 getline(basic_istream<_CharT, _Traits>&& __is,
1626 basic_string<_CharT, _Traits, _Allocator>& __str)
1628 return getline(__is, __str, __is.widen('\n'));
1631 #endif // _LIBCPP_CXX03_LANG
1633 template <class _CharT, class _Traits, size_t _Size>
1634 basic_istream<_CharT, _Traits>&
1635 operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
1637 #ifndef _LIBCPP_NO_EXCEPTIONS
1640 #endif // _LIBCPP_NO_EXCEPTIONS
1641 typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
1644 basic_string<_CharT, _Traits> __str;
1645 const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
1647 ios_base::iostate __err = ios_base::goodbit;
1648 _CharT __zero = __ct.widen('0');
1649 _CharT __one = __ct.widen('1');
1652 typename _Traits::int_type __i = __is.rdbuf()->sgetc();
1653 if (_Traits::eq_int_type(__i, _Traits::eof()))
1655 __err |= ios_base::eofbit;
1658 _CharT __ch = _Traits::to_char_type(__i);
1659 if (!_Traits::eq(__ch, __zero) && !_Traits::eq(__ch, __one))
1661 __str.push_back(__ch);
1663 __is.rdbuf()->sbumpc();
1665 __x = bitset<_Size>(__str);
1667 __err |= ios_base::failbit;
1668 __is.setstate(__err);
1671 __is.setstate(ios_base::failbit);
1672 #ifndef _LIBCPP_NO_EXCEPTIONS
1676 __is.__set_badbit_and_consider_rethrow();
1678 #endif // _LIBCPP_NO_EXCEPTIONS
1682 #ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
1683 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
1684 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
1685 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
1688 _LIBCPP_END_NAMESPACE_STD
1692 #endif // _LIBCPP_ISTREAM