@@ -184,19 +184,26 @@ public:
184
184
typedef typename traits_type::off_type off_type;
185
185
186
186
// 27.7.1.1.1 Constructor/destructor:
187
- explicit basic_istream (basic_streambuf<char_type, traits_type>* __sb);
187
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
188
+ explicit basic_istream (basic_streambuf<char_type, traits_type>* __sb) : __gc_(0 )
189
+ { this ->init (__sb); }
188
190
virtual ~basic_istream ();
189
191
protected:
190
192
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
191
- _LIBCPP_INLINE_VISIBILITY
193
+ inline _LIBCPP_INLINE_VISIBILITY
192
194
basic_istream (basic_istream&& __rhs);
193
195
#endif
194
196
// 27.7.1.1.2 Assign/swap:
195
197
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
196
- _LIBCPP_INLINE_VISIBILITY
198
+ inline _LIBCPP_INLINE_VISIBILITY
197
199
basic_istream& operator =(basic_istream&& __rhs);
198
200
#endif
199
- void swap (basic_istream& __rhs);
201
+
202
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
203
+ void swap (basic_istream& __rhs) {
204
+ _VSTD::swap (__gc_, __rhs.__gc_ );
205
+ basic_ios<char_type, traits_type>::swap (__rhs);
206
+ }
200
207
201
208
#if _LIBCPP_STD_VER > 11
202
209
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
@@ -213,10 +220,19 @@ public:
213
220
class _LIBCPP_TYPE_VIS_ONLY sentry;
214
221
215
222
// 27.7.1.2 Formatted input:
216
- basic_istream& operator >>(basic_istream& (*__pf)(basic_istream&));
223
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
224
+ basic_istream& operator >>(basic_istream& (*__pf)(basic_istream&))
225
+ { return __pf (*this ); }
226
+
227
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
217
228
basic_istream& operator >>(basic_ios<char_type, traits_type>&
218
- (*__pf)(basic_ios<char_type, traits_type>&));
219
- basic_istream& operator >>(ios_base& (*__pf)(ios_base&));
229
+ (*__pf)(basic_ios<char_type, traits_type>&))
230
+ { __pf (*this ); return *this ; }
231
+
232
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
233
+ basic_istream& operator >>(ios_base& (*__pf)(ios_base&))
234
+ { __pf (*this ); return *this ; }
235
+
220
236
basic_istream& operator >>(basic_streambuf<char_type, traits_type>* __sb);
221
237
basic_istream& operator >>(bool & __n);
222
238
basic_istream& operator >>(short & __n);
@@ -236,13 +252,31 @@ public:
236
252
_LIBCPP_INLINE_VISIBILITY
237
253
streamsize gcount () const {return __gc_;}
238
254
int_type get ();
239
- basic_istream& get (char_type& __c);
240
- basic_istream& get (char_type* __s, streamsize __n);
255
+
256
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
257
+ basic_istream& get (char_type& __c) {
258
+ int_type __ch = get ();
259
+ if (__ch != traits_type::eof ())
260
+ __c = traits_type::to_char_type (__ch);
261
+ return *this ;
262
+ }
263
+
264
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
265
+ basic_istream& get (char_type* __s, streamsize __n)
266
+ { return get (__s, __n, this ->widen (' \n ' )); }
267
+
241
268
basic_istream& get (char_type* __s, streamsize __n, char_type __dlm);
242
- basic_istream& get (basic_streambuf<char_type, traits_type>& __sb);
269
+
270
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
271
+ basic_istream& get (basic_streambuf<char_type, traits_type>& __sb)
272
+ { return get (__sb, this ->widen (' \n ' )); }
273
+
243
274
basic_istream& get (basic_streambuf<char_type, traits_type>& __sb, char_type __dlm);
244
275
245
- basic_istream& getline (char_type* __s, streamsize __n);
276
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
277
+ basic_istream& getline (char_type* __s, streamsize __n)
278
+ { return getline (__s, __n, this ->widen (' \n ' )); }
279
+
246
280
basic_istream& getline (char_type* __s, streamsize __n, char_type __dlm);
247
281
248
282
basic_istream& ignore (streamsize __n = 1 , int_type __dlm = traits_type::eof());
@@ -303,18 +337,9 @@ basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& _
303
337
__is.setstate (ios_base::failbit);
304
338
}
305
339
306
- template <class _CharT , class _Traits >
307
- inline _LIBCPP_INLINE_VISIBILITY
308
- basic_istream<_CharT, _Traits>::basic_istream(basic_streambuf<char_type, traits_type>* __sb)
309
- : __gc_(0 )
310
- {
311
- this ->init (__sb);
312
- }
313
-
314
340
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
315
341
316
342
template <class _CharT , class _Traits >
317
- inline _LIBCPP_INLINE_VISIBILITY
318
343
basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
319
344
: __gc_(__rhs.__gc_)
320
345
{
@@ -323,7 +348,6 @@ basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
323
348
}
324
349
325
350
template <class _CharT , class _Traits >
326
- inline _LIBCPP_INLINE_VISIBILITY
327
351
basic_istream<_CharT, _Traits>&
328
352
basic_istream<_CharT, _Traits>::operator =(basic_istream&& __rhs)
329
353
{
@@ -338,15 +362,6 @@ basic_istream<_CharT, _Traits>::~basic_istream()
338
362
{
339
363
}
340
364
341
- template <class _CharT , class _Traits >
342
- inline _LIBCPP_INLINE_VISIBILITY
343
- void
344
- basic_istream<_CharT, _Traits>::swap(basic_istream& __rhs)
345
- {
346
- _VSTD::swap (__gc_, __rhs.__gc_ );
347
- basic_ios<char_type, traits_type>::swap (__rhs);
348
- }
349
-
350
365
template <class _CharT , class _Traits >
351
366
basic_istream<_CharT, _Traits>&
352
367
basic_istream<_CharT, _Traits>::operator >>(unsigned short & __n)
@@ -724,33 +739,6 @@ basic_istream<_CharT, _Traits>::operator>>(int& __n)
724
739
return *this ;
725
740
}
726
741
727
- template <class _CharT , class _Traits >
728
- inline _LIBCPP_INLINE_VISIBILITY
729
- basic_istream<_CharT, _Traits>&
730
- basic_istream<_CharT, _Traits>::operator >>(basic_istream& (*__pf)(basic_istream&))
731
- {
732
- return __pf (*this );
733
- }
734
-
735
- template <class _CharT , class _Traits >
736
- inline _LIBCPP_INLINE_VISIBILITY
737
- basic_istream<_CharT, _Traits>&
738
- basic_istream<_CharT, _Traits>::operator >>(basic_ios<char_type, traits_type>&
739
- (*__pf)(basic_ios<char_type, traits_type>&))
740
- {
741
- __pf (*this );
742
- return *this ;
743
- }
744
-
745
- template <class _CharT , class _Traits >
746
- inline _LIBCPP_INLINE_VISIBILITY
747
- basic_istream<_CharT, _Traits>&
748
- basic_istream<_CharT, _Traits>::operator >>(ios_base& (*__pf)(ios_base&))
749
- {
750
- __pf (*this );
751
- return *this ;
752
- }
753
-
754
742
template <class _CharT , class _Traits >
755
743
basic_istream<_CharT, _Traits>&
756
744
operator >>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
@@ -946,17 +934,6 @@ basic_istream<_CharT, _Traits>::get()
946
934
return __r;
947
935
}
948
936
949
- template <class _CharT , class _Traits >
950
- inline _LIBCPP_INLINE_VISIBILITY
951
- basic_istream<_CharT, _Traits>&
952
- basic_istream<_CharT, _Traits>::get (char_type& __c)
953
- {
954
- int_type __ch = get ();
955
- if (__ch != traits_type::eof ())
956
- __c = traits_type::to_char_type (__ch);
957
- return *this ;
958
- }
959
-
960
937
template <class _CharT , class _Traits >
961
938
basic_istream<_CharT, _Traits>&
962
939
basic_istream<_CharT, _Traits>::get (char_type* __s, streamsize __n, char_type __dlm)
@@ -1005,14 +982,6 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
1005
982
return *this ;
1006
983
}
1007
984
1008
- template <class _CharT , class _Traits >
1009
- inline _LIBCPP_INLINE_VISIBILITY
1010
- basic_istream<_CharT, _Traits>&
1011
- basic_istream<_CharT, _Traits>::get (char_type* __s, streamsize __n)
1012
- {
1013
- return get (__s, __n, this ->widen (' \n ' ));
1014
- }
1015
-
1016
985
template <class _CharT , class _Traits >
1017
986
basic_istream<_CharT, _Traits>&
1018
987
basic_istream<_CharT, _Traits>::get (basic_streambuf<char_type, traits_type>& __sb,
@@ -1067,14 +1036,6 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
1067
1036
return *this ;
1068
1037
}
1069
1038
1070
- template <class _CharT , class _Traits >
1071
- inline _LIBCPP_INLINE_VISIBILITY
1072
- basic_istream<_CharT, _Traits>&
1073
- basic_istream<_CharT, _Traits>::get (basic_streambuf<char_type, traits_type>& __sb)
1074
- {
1075
- return get (__sb, this ->widen (' \n ' ));
1076
- }
1077
-
1078
1039
template <class _CharT , class _Traits >
1079
1040
basic_istream<_CharT, _Traits>&
1080
1041
basic_istream<_CharT, _Traits>::getline (char_type* __s, streamsize __n, char_type __dlm)
@@ -1128,14 +1089,6 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
1128
1089
return *this ;
1129
1090
}
1130
1091
1131
- template <class _CharT , class _Traits >
1132
- inline _LIBCPP_INLINE_VISIBILITY
1133
- basic_istream<_CharT, _Traits>&
1134
- basic_istream<_CharT, _Traits>::getline (char_type* __s, streamsize __n)
1135
- {
1136
- return getline (__s, __n, this ->widen (' \n ' ));
1137
- }
1138
-
1139
1092
template <class _CharT , class _Traits >
1140
1093
basic_istream<_CharT, _Traits>&
1141
1094
basic_istream<_CharT, _Traits>::ignore (streamsize __n, int_type __dlm)
@@ -1503,41 +1456,38 @@ public:
1503
1456
typedef typename traits_type::off_type off_type;
1504
1457
1505
1458
// constructor/destructor
1506
- explicit basic_iostream (basic_streambuf<char_type, traits_type>* __sb);
1459
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
1460
+ explicit basic_iostream (basic_streambuf<char_type, traits_type>* __sb)
1461
+ : basic_istream<_CharT, _Traits>(__sb)
1462
+ {}
1463
+
1507
1464
virtual ~basic_iostream ();
1508
1465
protected:
1509
1466
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1510
- _LIBCPP_INLINE_VISIBILITY
1467
+ inline _LIBCPP_INLINE_VISIBILITY
1511
1468
basic_iostream (basic_iostream&& __rhs);
1512
1469
#endif
1513
1470
1514
1471
// assign/swap
1515
1472
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1516
- _LIBCPP_INLINE_VISIBILITY
1473
+ inline _LIBCPP_INLINE_VISIBILITY
1517
1474
basic_iostream& operator =(basic_iostream&& __rhs);
1518
1475
#endif
1519
- void swap (basic_iostream& __rhs);
1476
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
1477
+ void swap (basic_iostream& __rhs)
1478
+ { basic_istream<char_type, traits_type>::swap (__rhs); }
1520
1479
public:
1521
1480
};
1522
1481
1523
- template <class _CharT , class _Traits >
1524
- inline _LIBCPP_INLINE_VISIBILITY
1525
- basic_iostream<_CharT, _Traits>::basic_iostream (basic_streambuf<char_type, traits_type>* __sb)
1526
- : basic_istream<_CharT, _Traits>(__sb)
1527
- {
1528
- }
1529
-
1530
1482
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1531
1483
1532
1484
template <class _CharT , class _Traits >
1533
- inline _LIBCPP_INLINE_VISIBILITY
1534
1485
basic_iostream<_CharT, _Traits>::basic_iostream (basic_iostream&& __rhs)
1535
1486
: basic_istream<_CharT, _Traits>(_VSTD::move (__rhs))
1536
1487
{
1537
1488
}
1538
1489
1539
1490
template <class _CharT , class _Traits >
1540
- inline _LIBCPP_INLINE_VISIBILITY
1541
1491
basic_iostream<_CharT, _Traits>&
1542
1492
basic_iostream<_CharT, _Traits>::operator =(basic_iostream&& __rhs)
1543
1493
{
@@ -1552,14 +1502,6 @@ basic_iostream<_CharT, _Traits>::~basic_iostream()
1552
1502
{
1553
1503
}
1554
1504
1555
- template <class _CharT , class _Traits >
1556
- inline _LIBCPP_INLINE_VISIBILITY
1557
- void
1558
- basic_iostream<_CharT, _Traits>::swap (basic_iostream& __rhs)
1559
- {
1560
- basic_istream<char_type, traits_type>::swap (__rhs);
1561
- }
1562
-
1563
1505
template <class _CharT , class _Traits , class _Allocator >
1564
1506
basic_istream<_CharT, _Traits>&
1565
1507
operator >>(basic_istream<_CharT, _Traits>& __is,
0 commit comments