aboutsummaryrefslogtreecommitdiff
path: root/system/include/libcxx/ostream
diff options
context:
space:
mode:
Diffstat (limited to 'system/include/libcxx/ostream')
-rw-r--r--system/include/libcxx/ostream25
1 files changed, 17 insertions, 8 deletions
diff --git a/system/include/libcxx/ostream b/system/include/libcxx/ostream
index eac9c8f0..041314ac 100644
--- a/system/include/libcxx/ostream
+++ b/system/include/libcxx/ostream
@@ -32,6 +32,7 @@ public:
virtual ~basic_ostream();
// 27.7.2.3 Assign/swap
+ basic_ostream& operator=(const basic_ostream& rhs) = delete; // C++14
basic_ostream& operator=(basic_ostream&& rhs);
void swap(basic_ostream& rhs);
@@ -140,7 +141,7 @@ template <class charT, class traits, class T>
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS basic_ostream
+class _LIBCPP_TYPE_VIS_ONLY basic_ostream
: virtual public basic_ios<_CharT, _Traits>
{
public:
@@ -161,6 +162,9 @@ protected:
#endif
// 27.7.2.3 Assign/swap
+#if _LIBCPP_STD_VER > 11
+ basic_ostream& operator=(const basic_ostream&) = delete;
+#endif
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
basic_ostream& operator=(basic_ostream&& __rhs);
@@ -169,7 +173,7 @@ protected:
public:
// 27.7.2.4 Prefix/suffix:
- class _LIBCPP_TYPE_VIS sentry;
+ class _LIBCPP_TYPE_VIS_ONLY sentry;
// 27.7.2.6 Formatted output:
basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));
@@ -207,7 +211,7 @@ protected:
};
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS basic_ostream<_CharT, _Traits>::sentry
+class _LIBCPP_TYPE_VIS_ONLY basic_ostream<_CharT, _Traits>::sentry
{
bool __ok_;
basic_ostream<_CharT, _Traits>& __os_;
@@ -1155,7 +1159,8 @@ inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
{
- if (!this->fail())
+ sentry __s(*this);
+ if (__s)
{
if (this->rdbuf()->pubseekpos(__pos, ios_base::out) == pos_type(-1))
this->setstate(ios_base::failbit);
@@ -1168,8 +1173,12 @@ inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
{
- if (!this->fail())
- this->rdbuf()->pubseekoff(__off, __dir, ios_base::out);
+ sentry __s(*this);
+ if (__s)
+ {
+ if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::out) == pos_type(-1))
+ this->setstate(ios_base::failbit);
+ }
return *this;
}
@@ -1278,8 +1287,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
}
-_LIBCPP_EXTERN_TEMPLATE(class basic_ostream<char>)
-_LIBCPP_EXTERN_TEMPLATE(class basic_ostream<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ostream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ostream<wchar_t>)
_LIBCPP_END_NAMESPACE_STD