@@ -186,37 +186,31 @@ class basic_ostream<_CharT, _Traits>::sentry {
186
186
basic_ostream<_CharT, _Traits>& __os_;
187
187
188
188
public:
189
- explicit sentry (basic_ostream<_CharT, _Traits>& __os);
190
- ~sentry ();
191
- sentry (const sentry&) = delete ;
192
- sentry& operator =(const sentry&) = delete ;
193
-
194
- _LIBCPP_HIDE_FROM_ABI explicit operator bool () const { return __ok_; }
195
- };
196
-
197
- template <class _CharT , class _Traits >
198
- basic_ostream<_CharT, _Traits>::sentry::sentry (basic_ostream<_CharT, _Traits>& __os) : __ok_ (false ), __os_ (__os) {
199
- if (__os.good ()) {
200
- if (__os.tie ())
201
- __os.tie ()->flush ();
202
- __ok_ = true ;
189
+ _LIBCPP_HIDE_FROM_ABI explicit sentry (basic_ostream<_CharT, _Traits>& __os) : __ok_(false ), __os_(__os) {
190
+ if (__os.good ()) {
191
+ if (__os.tie ())
192
+ __os.tie ()->flush ();
193
+ __ok_ = true ;
194
+ }
203
195
}
204
- }
205
-
206
- template <class _CharT , class _Traits >
207
- basic_ostream<_CharT, _Traits>::sentry::~sentry () {
208
- if (__os_.rdbuf () && __os_.good () && (__os_.flags () & ios_base::unitbuf) && uncaught_exceptions () == 0 ) {
196
+ _LIBCPP_HIDE_FROM_ABI ~sentry () {
197
+ if (__os_.rdbuf () && __os_.good () && (__os_.flags () & ios_base::unitbuf) && uncaught_exceptions () == 0 ) {
209
198
# if _LIBCPP_HAS_EXCEPTIONS
210
- try {
199
+ try {
211
200
# endif // _LIBCPP_HAS_EXCEPTIONS
212
- if (__os_.rdbuf ()->pubsync () == -1 )
213
- __os_.setstate (ios_base::badbit);
201
+ if (__os_.rdbuf ()->pubsync () == -1 )
202
+ __os_.setstate (ios_base::badbit);
214
203
# if _LIBCPP_HAS_EXCEPTIONS
215
- } catch (...) {
216
- }
204
+ } catch (...) {
205
+ }
217
206
# endif // _LIBCPP_HAS_EXCEPTIONS
207
+ }
218
208
}
219
- }
209
+ _LIBCPP_HIDE_FROM_ABI sentry (const sentry&) = delete ;
210
+ _LIBCPP_HIDE_FROM_ABI sentry& operator =(const sentry&) = delete ;
211
+
212
+ _LIBCPP_HIDE_FROM_ABI explicit operator bool () const { return __ok_; }
213
+ };
220
214
221
215
template <class _CharT , class _Traits >
222
216
basic_ostream<_CharT, _Traits>::basic_ostream (basic_ostream&& __rhs) {
0 commit comments