visibility-decoration.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@114671 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant 2010-09-23 17:31:07 +00:00
parent 28c97e6ee1
commit 8d7a9557b7
7 changed files with 127 additions and 48 deletions

View File

@ -182,7 +182,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// basic_stringbuf // basic_stringbuf
template <class _CharT, class _Traits, class _Allocator> template <class _CharT, class _Traits, class _Allocator>
class basic_stringbuf class _LIBCPP_VISIBLE basic_stringbuf
: public basic_streambuf<_CharT, _Traits> : public basic_streambuf<_CharT, _Traits>
{ {
public: public:
@ -525,7 +525,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
// basic_istringstream // basic_istringstream
template <class _CharT, class _Traits, class _Allocator> template <class _CharT, class _Traits, class _Allocator>
class basic_istringstream class _LIBCPP_VISIBLE basic_istringstream
: public basic_istream<_CharT, _Traits> : public basic_istream<_CharT, _Traits>
{ {
public: public:
@ -644,7 +644,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
// basic_ostringstream // basic_ostringstream
template <class _CharT, class _Traits, class _Allocator> template <class _CharT, class _Traits, class _Allocator>
class basic_ostringstream class _LIBCPP_VISIBLE basic_ostringstream
: public basic_ostream<_CharT, _Traits> : public basic_ostream<_CharT, _Traits>
{ {
public: public:
@ -763,7 +763,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
// basic_stringstream // basic_stringstream
template <class _CharT, class _Traits, class _Allocator> template <class _CharT, class _Traits, class _Allocator>
class basic_stringstream class _LIBCPP_VISIBLE basic_stringstream
: public basic_iostream<_CharT, _Traits> : public basic_iostream<_CharT, _Traits>
{ {
public: public:

View File

@ -92,7 +92,7 @@ bool
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y); operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
template <class _Tp, class _Container = deque<_Tp> > template <class _Tp, class _Container = deque<_Tp> >
class stack class _LIBCPP_VISIBLE stack
{ {
public: public:
typedef _Container container_type; typedef _Container container_type;
@ -105,56 +105,76 @@ protected:
container_type c; container_type c;
public: public:
_LIBCPP_INLINE_VISIBILITY
stack() : c() {} stack() : c() {}
_LIBCPP_INLINE_VISIBILITY
explicit stack(const container_type& __c) : c(__c) {} explicit stack(const container_type& __c) : c(__c) {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
explicit stack(container_type&& __c) : c(_STD::move(__c)) {} explicit stack(container_type&& __c) : c(_STD::move(__c)) {}
_LIBCPP_INLINE_VISIBILITY
stack(stack&& __s) : c(_STD::move(__s.c)) {} stack(stack&& __s) : c(_STD::move(__s.c)) {}
_LIBCPP_INLINE_VISIBILITY
stack& operator=(stack&& __s) {c = _STD::move(__s.c); return *this;} stack& operator=(stack&& __s) {c = _STD::move(__s.c); return *this;}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Alloc> template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit stack(const _Alloc& __a, explicit stack(const _Alloc& __a,
typename enable_if<uses_allocator<container_type, typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0) _Alloc>::value>::type* = 0)
: c(__a) {} : c(__a) {}
template <class _Alloc> template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
stack(const container_type& __c, const _Alloc& __a, stack(const container_type& __c, const _Alloc& __a,
typename enable_if<uses_allocator<container_type, typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0) _Alloc>::value>::type* = 0)
: c(__c, __a) {} : c(__c, __a) {}
template <class _Alloc> template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
stack(const stack& __s, const _Alloc& __a, stack(const stack& __s, const _Alloc& __a,
typename enable_if<uses_allocator<container_type, typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0) _Alloc>::value>::type* = 0)
: c(__s.c, __a) {} : c(__s.c, __a) {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Alloc> template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
stack(container_type&& __c, const _Alloc& __a, stack(container_type&& __c, const _Alloc& __a,
typename enable_if<uses_allocator<container_type, typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0) _Alloc>::value>::type* = 0)
: c(_STD::move(__c), __a) {} : c(_STD::move(__c), __a) {}
template <class _Alloc> template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
stack(stack&& __s, const _Alloc& __a, stack(stack&& __s, const _Alloc& __a,
typename enable_if<uses_allocator<container_type, typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0) _Alloc>::value>::type* = 0)
: c(_STD::move(__s.c), __a) {} : c(_STD::move(__s.c), __a) {}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
bool empty() const {return c.empty();} bool empty() const {return c.empty();}
_LIBCPP_INLINE_VISIBILITY
size_type size() const {return c.size();} size_type size() const {return c.size();}
_LIBCPP_INLINE_VISIBILITY
reference top() {return c.back();} reference top() {return c.back();}
_LIBCPP_INLINE_VISIBILITY
const_reference top() const {return c.back();} const_reference top() const {return c.back();}
_LIBCPP_INLINE_VISIBILITY
void push(const value_type& __v) {c.push_back(__v);} void push(const value_type& __v) {c.push_back(__v);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
void push(value_type&& __v) {c.push_back(_STD::move(__v));} void push(value_type&& __v) {c.push_back(_STD::move(__v));}
#ifndef _LIBCPP_HAS_NO_VARIADICS #ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args> void emplace(_Args&&... __args) template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
void emplace(_Args&&... __args)
{c.emplace_back(_STD::forward<_Args>(__args)...);} {c.emplace_back(_STD::forward<_Args>(__args)...);}
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
void pop() {c.pop_back();} void pop() {c.pop_back();}
_LIBCPP_INLINE_VISIBILITY
void swap(stack& __s) void swap(stack& __s)
{ {
using _STD::swap; using _STD::swap;
@ -173,7 +193,7 @@ public:
}; };
template <class _Tp, class _Container> template <class _Tp, class _Container>
inline inline _LIBCPP_INLINE_VISIBILITY
bool bool
operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
{ {
@ -181,7 +201,7 @@ operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
} }
template <class _Tp, class _Container> template <class _Tp, class _Container>
inline inline _LIBCPP_INLINE_VISIBILITY
bool bool
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
{ {
@ -189,7 +209,7 @@ operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
} }
template <class _Tp, class _Container> template <class _Tp, class _Container>
inline inline _LIBCPP_INLINE_VISIBILITY
bool bool
operator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) operator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
{ {
@ -197,7 +217,7 @@ operator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
} }
template <class _Tp, class _Container> template <class _Tp, class _Container>
inline inline _LIBCPP_INLINE_VISIBILITY
bool bool
operator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) operator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
{ {
@ -205,7 +225,7 @@ operator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
} }
template <class _Tp, class _Container> template <class _Tp, class _Container>
inline inline _LIBCPP_INLINE_VISIBILITY
bool bool
operator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) operator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
{ {
@ -213,7 +233,7 @@ operator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
} }
template <class _Tp, class _Container> template <class _Tp, class _Container>
inline inline _LIBCPP_INLINE_VISIBILITY
bool bool
operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
{ {
@ -221,7 +241,7 @@ operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
} }
template <class _Tp, class _Container> template <class _Tp, class _Container>
inline inline _LIBCPP_INLINE_VISIBILITY
void void
swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y) swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
{ {
@ -229,7 +249,7 @@ swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
} }
template <class _Tp, class _Container, class _Alloc> template <class _Tp, class _Container, class _Alloc>
struct uses_allocator<stack<_Tp, _Container>, _Alloc> struct _LIBCPP_VISIBLE uses_allocator<stack<_Tp, _Container>, _Alloc>
: public uses_allocator<_Container, _Alloc> : public uses_allocator<_Container, _Alloc>
{ {
}; };

View File

@ -117,7 +117,7 @@ protected:
_LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits> template <class _CharT, class _Traits>
class basic_streambuf class _LIBCPP_VISIBLE basic_streambuf
{ {
public: public:
// types: // types:

View File

@ -442,7 +442,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// fpos // fpos
template <class _StateT> template <class _StateT>
class fpos class _LIBCPP_VISIBLE fpos
{ {
private: private:
_StateT __st_; _StateT __st_;
@ -628,7 +628,7 @@ struct _LIBCPP_VISIBLE char_traits<char>
// char_traits<wchar_t> // char_traits<wchar_t>
template <> template <>
struct char_traits<wchar_t> struct _LIBCPP_VISIBLE char_traits<wchar_t>
{ {
typedef wchar_t char_type; typedef wchar_t char_type;
typedef wint_t int_type; typedef wint_t int_type;
@ -665,7 +665,7 @@ struct char_traits<wchar_t>
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
template <> template <>
struct char_traits<char16_t> struct _LIBCPP_VISIBLE char_traits<char16_t>
{ {
typedef char16_t char_type; typedef char16_t char_type;
typedef uint_least16_t int_type; typedef uint_least16_t int_type;
@ -771,7 +771,7 @@ char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a)
} }
template <> template <>
struct char_traits<char32_t> struct _LIBCPP_VISIBLE char_traits<char32_t>
{ {
typedef char32_t char_type; typedef char32_t char_type;
typedef uint_least32_t int_type; typedef uint_least32_t int_type;
@ -1058,6 +1058,7 @@ public:
#endif #endif
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const_pointer __s) {return assign(__s);} _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const_pointer __s) {return assign(__s);}
basic_string& operator=(value_type __c); basic_string& operator=(value_type __c);
_LIBCPP_INLINE_VISIBILITY
basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());} basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
#ifndef _LIBCPP_DEBUG #ifndef _LIBCPP_DEBUG
@ -1092,6 +1093,7 @@ public:
_LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());} _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
void reserve(size_type res_arg = 0); void reserve(size_type res_arg = 0);
_LIBCPP_INLINE_VISIBILITY
void shrink_to_fit() {reserve();} void shrink_to_fit() {reserve();}
void clear(); void clear();
_LIBCPP_INLINE_VISIBILITY bool empty() const {return size() == 0;} _LIBCPP_INLINE_VISIBILITY bool empty() const {return size() == 0;}
@ -1127,6 +1129,7 @@ public:
basic_string& basic_string&
>::type >::type
append(_ForwardIterator __first, _ForwardIterator __last); append(_ForwardIterator __first, _ForwardIterator __last);
_LIBCPP_INLINE_VISIBILITY
basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());} basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
void push_back(value_type __c); void push_back(value_type __c);
@ -1156,6 +1159,7 @@ public:
basic_string& basic_string&
>::type >::type
assign(_ForwardIterator __first, _ForwardIterator __last); assign(_ForwardIterator __first, _ForwardIterator __last);
_LIBCPP_INLINE_VISIBILITY
basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());} basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
basic_string& insert(size_type __pos1, const basic_string& __str); basic_string& insert(size_type __pos1, const basic_string& __str);
@ -1180,6 +1184,7 @@ public:
iterator iterator
>::type >::type
insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last); insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __pos, initializer_list<value_type> __il) iterator insert(const_iterator __pos, initializer_list<value_type> __il)
{return insert(__pos, __il.begin(), __il.end());} {return insert(__pos, __il.begin(), __il.end());}
@ -1203,6 +1208,7 @@ public:
basic_string& basic_string&
>::type >::type
replace(iterator __i1, iterator __i2, _InputIterator __j1, _InputIterator __j2); replace(iterator __i1, iterator __i2, _InputIterator __j1, _InputIterator __j2);
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(iterator __i1, iterator __i2, initializer_list<value_type> __il) basic_string& replace(iterator __i1, iterator __i2, initializer_list<value_type> __il)
{return replace(__i1, __i2, __il.begin(), __il.end());} {return replace(__i1, __i2, __il.begin(), __il.end());}
@ -3551,7 +3557,7 @@ template<class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>::npos; basic_string<_CharT, _Traits, _Allocator>::npos;
template<class _CharT, class _Traits, class _Allocator> template<class _CharT, class _Traits, class _Allocator>
struct hash<basic_string<_CharT, _Traits, _Allocator> > struct _LIBCPP_VISIBLE hash<basic_string<_CharT, _Traits, _Allocator> >
: public unary_function<basic_string<_CharT, _Traits, _Allocator>, size_t> : public unary_function<basic_string<_CharT, _Traits, _Allocator>, size_t>
{ {
size_t size_t

View File

@ -135,7 +135,7 @@ private:
_LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_NAMESPACE_STD
class strstreambuf class _LIBCPP_VISIBLE strstreambuf
: public streambuf : public streambuf
{ {
public: public:
@ -187,20 +187,25 @@ private:
void __init(char* __gnext, streamsize __n, char* __pbeg); void __init(char* __gnext, streamsize __n, char* __pbeg);
}; };
class istrstream class _LIBCPP_VISIBLE istrstream
: public istream : public istream
{ {
public: public:
_LIBCPP_INLINE_VISIBILITY
explicit istrstream(const char* __s) explicit istrstream(const char* __s)
: istream(&__sb_), __sb_(__s, 0) {} : istream(&__sb_), __sb_(__s, 0) {}
_LIBCPP_INLINE_VISIBILITY
explicit istrstream(char* __s) explicit istrstream(char* __s)
: istream(&__sb_), __sb_(__s, 0) {} : istream(&__sb_), __sb_(__s, 0) {}
_LIBCPP_INLINE_VISIBILITY
istrstream(const char* __s, streamsize __n) istrstream(const char* __s, streamsize __n)
: istream(&__sb_), __sb_(__s, __n) {} : istream(&__sb_), __sb_(__s, __n) {}
_LIBCPP_INLINE_VISIBILITY
istrstream(char* __s, streamsize __n) istrstream(char* __s, streamsize __n)
: istream(&__sb_), __sb_(__s, __n) {} : istream(&__sb_), __sb_(__s, __n) {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
istrstream(istrstream&& __rhs) istrstream(istrstream&& __rhs)
: istream(_STD::move(__rhs)), : istream(_STD::move(__rhs)),
__sb_(_STD::move(__rhs.__sb_)) __sb_(_STD::move(__rhs.__sb_))
@ -208,6 +213,7 @@ public:
istream::set_rdbuf(&__sb_); istream::set_rdbuf(&__sb_);
} }
_LIBCPP_INLINE_VISIBILITY
istrstream& operator=(istrstream&& __rhs) istrstream& operator=(istrstream&& __rhs)
{ {
istream::operator=(_STD::move(__rhs)); istream::operator=(_STD::move(__rhs));
@ -218,31 +224,37 @@ public:
virtual ~istrstream(); virtual ~istrstream();
_LIBCPP_INLINE_VISIBILITY
void swap(istrstream& __rhs) void swap(istrstream& __rhs)
{ {
istream::swap(__rhs); istream::swap(__rhs);
__sb_.swap(__rhs.__sb_); __sb_.swap(__rhs.__sb_);
} }
_LIBCPP_INLINE_VISIBILITY
strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);} strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);}
_LIBCPP_INLINE_VISIBILITY
char *str() {return __sb_.str();} char *str() {return __sb_.str();}
private: private:
strstreambuf __sb_; strstreambuf __sb_;
}; };
class ostrstream class _LIBCPP_VISIBLE ostrstream
: public ostream : public ostream
{ {
public: public:
_LIBCPP_INLINE_VISIBILITY
ostrstream() ostrstream()
: ostream(&__sb_) {} : ostream(&__sb_) {}
_LIBCPP_INLINE_VISIBILITY
ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out) ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out)
: ostream(&__sb_), : ostream(&__sb_),
__sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0)) __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
{} {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
ostrstream(ostrstream&& __rhs) ostrstream(ostrstream&& __rhs)
: ostream(_STD::move(__rhs)), : ostream(_STD::move(__rhs)),
__sb_(_STD::move(__rhs.__sb_)) __sb_(_STD::move(__rhs.__sb_))
@ -250,6 +262,7 @@ public:
ostream::set_rdbuf(&__sb_); ostream::set_rdbuf(&__sb_);
} }
_LIBCPP_INLINE_VISIBILITY
ostrstream& operator=(ostrstream&& __rhs) ostrstream& operator=(ostrstream&& __rhs)
{ {
ostream::operator=(_STD::move(__rhs)); ostream::operator=(_STD::move(__rhs));
@ -260,22 +273,27 @@ public:
virtual ~ostrstream(); virtual ~ostrstream();
_LIBCPP_INLINE_VISIBILITY
void swap(ostrstream& __rhs) void swap(ostrstream& __rhs)
{ {
ostream::swap(__rhs); ostream::swap(__rhs);
__sb_.swap(__rhs.__sb_); __sb_.swap(__rhs.__sb_);
} }
_LIBCPP_INLINE_VISIBILITY
strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);} strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);}
_LIBCPP_INLINE_VISIBILITY
void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);} void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);}
_LIBCPP_INLINE_VISIBILITY
char* str() {return __sb_.str();} char* str() {return __sb_.str();}
_LIBCPP_INLINE_VISIBILITY
int pcount() const {return __sb_.pcount();} int pcount() const {return __sb_.pcount();}
private: private:
strstreambuf __sb_; // exposition only strstreambuf __sb_; // exposition only
}; };
class strstream class _LIBCPP_VISIBLE strstream
: public iostream : public iostream
{ {
public: public:
@ -286,14 +304,17 @@ public:
typedef char_traits<char>::off_type off_type; typedef char_traits<char>::off_type off_type;
// constructors/destructor // constructors/destructor
_LIBCPP_INLINE_VISIBILITY
strstream() strstream()
: iostream(&__sb_) {} : iostream(&__sb_) {}
_LIBCPP_INLINE_VISIBILITY
strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out) strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out)
: iostream(&__sb_), : iostream(&__sb_),
__sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0)) __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
{} {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
strstream(strstream&& __rhs) strstream(strstream&& __rhs)
: iostream(_STD::move(__rhs)), : iostream(_STD::move(__rhs)),
__sb_(_STD::move(__rhs.__sb_)) __sb_(_STD::move(__rhs.__sb_))
@ -301,6 +322,7 @@ public:
iostream::set_rdbuf(&__sb_); iostream::set_rdbuf(&__sb_);
} }
_LIBCPP_INLINE_VISIBILITY
strstream& operator=(strstream&& __rhs) strstream& operator=(strstream&& __rhs)
{ {
iostream::operator=(_STD::move(__rhs)); iostream::operator=(_STD::move(__rhs));
@ -311,6 +333,7 @@ public:
virtual ~strstream(); virtual ~strstream();
_LIBCPP_INLINE_VISIBILITY
void swap(strstream& __rhs) void swap(strstream& __rhs)
{ {
iostream::swap(__rhs); iostream::swap(__rhs);
@ -318,9 +341,13 @@ public:
} }
// Members: // Members:
_LIBCPP_INLINE_VISIBILITY
strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);} strstreambuf* rdbuf() const {return const_cast<strstreambuf*>(&__sb_);}
_LIBCPP_INLINE_VISIBILITY
void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);} void freeze(bool __freezefl = true) {__sb_.freeze(__freezefl);}
_LIBCPP_INLINE_VISIBILITY
int pcount() const {return __sb_.pcount();} int pcount() const {return __sb_.pcount();}
_LIBCPP_INLINE_VISIBILITY
char* str() {return __sb_.str();} char* str() {return __sb_.str();}
private: private:

View File

@ -229,12 +229,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// is_error_code_enum // is_error_code_enum
template <class _Tp> struct is_error_code_enum template <class _Tp>
struct _LIBCPP_VISIBLE is_error_code_enum
: public false_type {}; : public false_type {};
// is_error_condition_enum // is_error_condition_enum
template <class _Tp> struct is_error_condition_enum template <class _Tp>
struct _LIBCPP_VISIBLE is_error_condition_enum
: public false_type {}; : public false_type {};
// Some error codes are not present on all platforms, so we provide equivalents // Some error codes are not present on all platforms, so we provide equivalents
@ -342,15 +344,19 @@ enum _ {
_ __v_; _ __v_;
_LIBCPP_ALWAYS_INLINE
errc(_ __v) : __v_(__v) {} errc(_ __v) : __v_(__v) {}
_LIBCPP_ALWAYS_INLINE
operator int() const {return __v_;} operator int() const {return __v_;}
}; };
template <> struct is_error_condition_enum<errc> template <>
struct _LIBCPP_VISIBLE is_error_condition_enum<errc>
: true_type { }; : true_type { };
template <> struct is_error_condition_enum<errc::_> template <>
struct _LIBCPP_VISIBLE is_error_condition_enum<errc::_>
: true_type { }; : true_type { };
class error_condition; class error_condition;
@ -360,7 +366,7 @@ class error_code;
class __do_message; class __do_message;
class error_category class _LIBCPP_VISIBLE error_category
{ {
public: public:
virtual ~error_category(); virtual ~error_category();
@ -399,7 +405,7 @@ public:
const error_category& generic_category(); const error_category& generic_category();
const error_category& system_category(); const error_category& system_category();
class error_condition class _LIBCPP_VISIBLE error_condition
{ {
int __val_; int __val_;
const error_category* __cat_; const error_category* __cat_;
@ -469,7 +475,7 @@ operator<(const error_condition& __x, const error_condition& __y)
// error_code // error_code
class error_code class _LIBCPP_VISIBLE error_code
{ {
int __val_; int __val_;
const error_category* __cat_; const error_category* __cat_;
@ -588,9 +594,10 @@ bool
operator!=(const error_condition& __x, const error_condition& __y) {return !(__x == __y);} operator!=(const error_condition& __x, const error_condition& __y) {return !(__x == __y);}
template <> template <>
struct hash<error_code> struct _LIBCPP_VISIBLE hash<error_code>
: public unary_function<error_code, size_t> : public unary_function<error_code, size_t>
{ {
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const error_code& __ec) const size_t operator()(const error_code& __ec) const
{ {
return static_cast<size_t>(__ec.value()); return static_cast<size_t>(__ec.value());
@ -599,7 +606,7 @@ struct hash<error_code>
// system_error // system_error
class system_error class _LIBCPP_VISIBLE system_error
: public runtime_error : public runtime_error
{ {
error_code __ec_; error_code __ec_;

View File

@ -118,8 +118,11 @@ public:
__thread_specific_ptr(); __thread_specific_ptr();
~__thread_specific_ptr(); ~__thread_specific_ptr();
_LIBCPP_INLINE_VISIBILITY
pointer get() const {return static_cast<_Tp*>(pthread_getspecific(__key_));} pointer get() const {return static_cast<_Tp*>(pthread_getspecific(__key_));}
_LIBCPP_INLINE_VISIBILITY
pointer operator*() const {return *get();} pointer operator*() const {return *get();}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {return get();} pointer operator->() const {return get();}
pointer release(); pointer release();
void reset(pointer __p = nullptr); void reset(pointer __p = nullptr);
@ -175,7 +178,7 @@ __thread_id get_id();
} // this_thread } // this_thread
class __thread_id class _LIBCPP_VISIBLE __thread_id
{ {
// FIXME: pthread_t is a pointer on Darwin but a long on Linux. // FIXME: pthread_t is a pointer on Darwin but a long on Linux.
// NULL is the no-thread value on Darwin. Someone needs to check // NULL is the no-thread value on Darwin. Someone needs to check
@ -183,40 +186,50 @@ class __thread_id
pthread_t __id_; pthread_t __id_;
public: public:
_LIBCPP_INLINE_VISIBILITY
__thread_id() : __id_(0) {} __thread_id() : __id_(0) {}
friend bool operator==(__thread_id __x, __thread_id __y) friend _LIBCPP_INLINE_VISIBILITY
bool operator==(__thread_id __x, __thread_id __y)
{return __x.__id_ == __y.__id_;} {return __x.__id_ == __y.__id_;}
friend bool operator!=(__thread_id __x, __thread_id __y) friend _LIBCPP_INLINE_VISIBILITY
bool operator!=(__thread_id __x, __thread_id __y)
{return !(__x == __y);} {return !(__x == __y);}
friend bool operator< (__thread_id __x, __thread_id __y) friend _LIBCPP_INLINE_VISIBILITY
bool operator< (__thread_id __x, __thread_id __y)
{return __x.__id_ < __y.__id_;} {return __x.__id_ < __y.__id_;}
friend bool operator<=(__thread_id __x, __thread_id __y) friend _LIBCPP_INLINE_VISIBILITY
bool operator<=(__thread_id __x, __thread_id __y)
{return !(__y < __x);} {return !(__y < __x);}
friend bool operator> (__thread_id __x, __thread_id __y) friend _LIBCPP_INLINE_VISIBILITY
bool operator> (__thread_id __x, __thread_id __y)
{return __y < __x ;} {return __y < __x ;}
friend bool operator>=(__thread_id __x, __thread_id __y) friend _LIBCPP_INLINE_VISIBILITY
bool operator>=(__thread_id __x, __thread_id __y)
{return !(__x < __y);} {return !(__x < __y);}
template<class _CharT, class _Traits> template<class _CharT, class _Traits>
friend friend
_LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id) operator<<(basic_ostream<_CharT, _Traits>& __os, __thread_id __id)
{return __os << __id.__id_;} {return __os << __id.__id_;}
private: private:
_LIBCPP_INLINE_VISIBILITY
__thread_id(pthread_t __id) : __id_(__id) {} __thread_id(pthread_t __id) : __id_(__id) {}
friend __thread_id this_thread::get_id(); friend __thread_id this_thread::get_id();
friend class thread; friend class _LIBCPP_VISIBLE thread;
}; };
template<class _Tp> struct hash; template<class _Tp> struct hash;
template<> template<>
struct hash<__thread_id> struct _LIBCPP_VISIBLE hash<__thread_id>
: public unary_function<__thread_id, size_t> : public unary_function<__thread_id, size_t>
{ {
_LIBCPP_INLINE_VISIBILITY
size_t operator()(__thread_id __v) const size_t operator()(__thread_id __v) const
{ {
const size_t* const __p = reinterpret_cast<const size_t*>(&__v); const size_t* const __p = reinterpret_cast<const size_t*>(&__v);
@ -227,7 +240,7 @@ struct hash<__thread_id>
namespace this_thread namespace this_thread
{ {
inline inline _LIBCPP_INLINE_VISIBILITY
__thread_id __thread_id
get_id() get_id()
{ {
@ -236,7 +249,7 @@ get_id()
} // this_thread } // this_thread
class thread class _LIBCPP_VISIBLE thread
{ {
pthread_t __t_; pthread_t __t_;
@ -251,6 +264,7 @@ public:
typedef __thread_id id; typedef __thread_id id;
typedef pthread_t native_handle_type; typedef pthread_t native_handle_type;
_LIBCPP_INLINE_VISIBILITY
thread() : __t_(0) {} thread() : __t_(0) {}
#ifndef _LIBCPP_HAS_NO_VARIADICS #ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _F, class ..._Args, template <class _F, class ..._Args,
@ -266,16 +280,21 @@ public:
~thread(); ~thread();
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
thread(thread&& __t) : __t_(__t.__t_) {__t.__t_ = 0;} thread(thread&& __t) : __t_(__t.__t_) {__t.__t_ = 0;}
thread& operator=(thread&& __t); thread& operator=(thread&& __t);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
void swap(thread& __t) {_STD::swap(__t_, __t.__t_);} void swap(thread& __t) {_STD::swap(__t_, __t.__t_);}
_LIBCPP_INLINE_VISIBILITY
bool joinable() const {return __t_ != 0;} bool joinable() const {return __t_ != 0;}
void join(); void join();
void detach(); void detach();
_LIBCPP_INLINE_VISIBILITY
id get_id() const {return __t_;} id get_id() const {return __t_;}
_LIBCPP_INLINE_VISIBILITY
native_handle_type native_handle() {return __t_;} native_handle_type native_handle() {return __t_;}
static unsigned hardware_concurrency(); static unsigned hardware_concurrency();
@ -345,7 +364,7 @@ thread::thread(_F __f)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
inline inline _LIBCPP_INLINE_VISIBILITY
thread& thread&
thread::operator=(thread&& __t) thread::operator=(thread&& __t)
{ {
@ -358,7 +377,7 @@ thread::operator=(thread&& __t)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
inline inline _LIBCPP_INLINE_VISIBILITY
void swap(thread& __x, thread& __y) {__x.swap(__y);} void swap(thread& __x, thread& __y) {__x.swap(__y);}
namespace this_thread namespace this_thread
@ -390,7 +409,7 @@ sleep_until(const chrono::time_point<_Clock, _Duration>& __t)
} }
template <class _Duration> template <class _Duration>
inline inline _LIBCPP_INLINE_VISIBILITY
void void
sleep_until(const chrono::time_point<chrono::monotonic_clock, _Duration>& __t) sleep_until(const chrono::time_point<chrono::monotonic_clock, _Duration>& __t)
{ {
@ -398,7 +417,7 @@ sleep_until(const chrono::time_point<chrono::monotonic_clock, _Duration>& __t)
sleep_for(__t - monotonic_clock::now()); sleep_for(__t - monotonic_clock::now());
} }
inline inline _LIBCPP_INLINE_VISIBILITY
void yield() {sched_yield();} void yield() {sched_yield();}
} // this_thread } // this_thread