Source: https://timsong-cpp.github.io/cppwp/n3337/depr
List of Tables [tab] List of Figures [fig] 1 General [intro] 2 Lexical conventions [lex] 3 Basic concepts [basic] 4 Standard conversions [conv] 5 Expressions [expr] 6 Statements [stmt.stmt] 7 Declarations [dcl.dcl] 8 Declarators [dcl.decl] 9 Classes [class] 10 Derived classes [class.derived] 11 Member access control [class.access] 12 Special member functions [special] 13 Overloading [over] 14 Templates [temp] 15 Exception handling [except] 16 Preprocessing directives [cpp] 17 Library introduction [library] 18 Language support library [language.support] 19 Diagnostics library [diagnostics] 20 General utilities library [utilities] 21 Strings library [strings] 22 Localization library [localization] 23 Containers library [containers] 24 Iterators library [iterators] 25 Algorithms library [algorithms] 26 Numerics library [numerics] 27 Input/output library [input.output] 28 Regular expressions library [re] 29 Atomic operations library [atomics] 30 Thread support library [thread] Annex A (informative) Grammar summary [gram] Annex B (informative) Implementation quantities [implimits] Annex C (informative) Compatibility [diff] Annex D (normative) Compatibility features [depr] D.1 Increment operator with bool operand [depr.incr.bool] D.2 register keyword [depr.register] D.3 Implicit declaration of copy functions [depr.impldec] D.4 Dynamic exception specifications [depr.except.spec] D.5 C standard library headers [depr.c.headers] D.6 Old iostreams members [depr.ios.members] D.7 char* streams [depr.str.strstreams] D.8 Function objects [depr.function.objects] D.9 Binders [depr.lib.binders] D.10 auto_ptr [depr.auto.ptr] D.11 Violating exception-specifications [exception.unexpected] Annex E (normative) Universal character names for identifier characters [charname] Index [generalindex] Index of library names [libraryindex] Index of implementation-defined behavior [impldefindex]
bool
++
register
<assert.h>
<inttypes.h>
<signal.h>
<stdio.h>
<wchar.h>
<complex.h>
<iso646.h>
<stdalign.h>
<stdlib.h>
<wctype.h>
<ctype.h>
<limits.h>
<stdarg.h>
<string.h>
<errno.h>
<locale.h>
<stdbool.h>
<tgmath.h>
<fenv.h>
<math.h>
<stddef.h>
<time.h>
<float.h>
<setjmp.h>
<stdint.h>
<uchar.h>
name.h
cname
std
<cstdlib>
namespace std { class ios_base { public: typedef T1 io_state; typedef T2 open_mode; typedef T3 seek_dir; typedef implementation-defined streamoff; typedef implementation-defined streampos; // remainder unchanged }; }
io_state
T1
iostate
open_mode
T2
openmode
seek_dir
T3
seekdir
streamoff
streampos
sbumpc()
namespace std { template<class charT, class traits = char_traits<charT> > class basic_streambuf { public: void stossc(); // remainder unchanged }; }
namespace std { template<class charT, class traits> class basic_ios { public: void clear(io_state state); void setstate(io_state state); void exceptions(io_state); // remainder unchanged }; class ios_base { public: // remainder unchanged }; template<class charT, class traits = char_traits<charT> > class basic_streambuf { public: pos_type pubseekoff(off_type off, ios_base::seek_dir way, ios_base::open_mode which = ios_base::in | ios_base::out); pos_type pubseekpos(pos_type sp, ios_base::open_mode which); // remainder unchanged }; template <class charT, class traits = char_traits<charT> > class basic_filebuf : public basic_streambuf<charT,traits> { public: basic_filebuf<charT,traits>* open (const char* s, ios_base::open_mode mode); // remainder unchanged }; template <class charT, class traits = char_traits<charT> > class basic_ifstream : public basic_istream<charT,traits> { public: void open(const char* s, ios_base::open_mode mode); // remainder unchanged }; template <class charT, class traits = char_traits<charT> > class basic_ofstream : public basic_ostream<charT,traits> { public: void open(const char* s, ios_base::open_mode mode); // remainder unchanged }; }
<strstream>
namespace std { class strstreambuf : public basic_streambuf<char> { public: explicit strstreambuf(streamsize alsize_arg = 0); strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*)); strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = 0); strstreambuf(const char* gnext_arg, streamsize n); strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = 0); strstreambuf(const signed char* gnext_arg, streamsize n); strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = 0); strstreambuf(const unsigned char* gnext_arg, streamsize n); virtual ~strstreambuf(); void freeze(bool freezefl = true); char* str(); int pcount(); protected: virtual int_type overflow (int_type c = EOF); virtual int_type pbackfail(int_type c = EOF); virtual int_type underflow(); virtual pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode which = ios_base::in | ios_base::out); virtual pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out); virtual streambuf* setbuf(char* s, streamsize n); private: typedef T1 strstate; // exposition only static const strstate allocated; // exposition only static const strstate constant; // exposition only static const strstate dynamic; // exposition only static const strstate frozen; // exposition only strstate strmode; // exposition only streamsize alsize; // exposition only void* (*palloc)(size_t); // exposition only void (*pfree)(void*); // exposition only }; }
strstreambuf
seeklow
seekhigh
gnext
gbeg
pend
gend
explicit strstreambuf(streamsize alsize_arg = 0);
streambuf()
strstreambuf(streamsize)
strmode
dynamic
alsize
alsize_arg
palloc
pfree
strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*));
strstreambuf(void* (*)(size_t), void (*)(void*))
palloc_arg
pfree_arg
strstreambuf(char* gnext_arg, streamsize n, char *pbeg_arg = 0); strstreambuf(signed char* gnext_arg, streamsize n, signed char *pbeg_arg = 0); strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char *pbeg_arg = 0);
strstreambuf(charT*, streamsize, charT*)
gnext_arg
N
If n > 0, N is n.
n > 0
n
If n == 0, N is std::strlen(gnext_arg).
n == 0
std::strlen(gnext_arg)
If n < 0, N is INT_MAX.[cpp11 1]
n < 0
INT_MAX
pbeg_arg
setg(gnext_arg, gnext_arg, gnext_arg + N);
setg(gnext_arg, gnext_arg, pbeg_arg); setp(pbeg_arg, pbeg_arg + N); strstreambuf(const char* gnext_arg, streamsize n); strstreambuf(const signed char* gnext_arg, streamsize n); strstreambuf(const unsigned char* gnext_arg, streamsize n);
strstreambuf((char*)gnext_arg,n)
constant
virtual ~strstreambuf();
strmode & allocated != 0
strmode & frozen == 0
The function signature strlen(const char*) is declared in <cstring>. ([c.strings]). The macro INT_MAX is defined in <climits> ([support.limits]).
strlen(const char*)
<cstring>
<climits>
void freeze(bool freezefl = true);
If freezefl is true, the function sets frozen in strmode.
freezefl
true
frozen
Otherwise, it clears frozen in strmode.
char* str();
freeze()
int pcount() const;
pnext
pbeg
int_type overflow(int_type c = EOF);
c
If c != EOF and if either the output sequence has a write position available or the function makes a write position available (as described below), assigns c to *pnext++.
c != EOF
*pnext++
Returns (unsigned char)c.
(unsigned char)c
If c == EOF, there is no character to append.
c == EOF
Returns a value other than EOF.
EOF
(*palloc)(n)
new charT[n]
allocated
p
(*pfree)(p)
delete[]p
strmode & dynamic == 0
strmode & frozen != 0
int_type pbackfail(int_type c = EOF);
If c != EOF, if the input sequence has a putback position available, and if (char)c == gnext[-1], assigns gnext - 1 to gnext.
(char)c == gnext[-1]
gnext - 1
Returns c.
If c != EOF, if the input sequence has a putback position available, and if strmode & constant is zero, assigns c to *--gnext.
*--gnext
If c == EOF and if the input sequence has a putback position available, assigns gnext - 1 to gnext.
int_type underflow();
If the input sequence has a read position available, the function signals success by returning (unsigned char)*gnext.
(unsigned char)*gnext
Otherwise, if the current write next pointer pnext is not a null pointer and is greater than the current read end pointer gend, makes a read position available by assigning to gend a value greater than gnext and no greater than pnext.
Returns (unsigned char*)gnext.
(unsigned char*)gnext
pos_type seekoff(off_type off, seekdir way, openmode which = in | out);
seekoff
(which & ios::in) != 0
(which & ios::out) != 0
(which & (ios::in |
ios::out)) == (ios::in | ios::out)) and way == either ios::beg or ios::end
ios::out)) == (ios::in |
ios::out))
way ==
ios::beg
ios::end
newoff
way == ios::beg
way == ios::cur
xnext - xbeg
way == ios::end
seekhigh - xbeg
(newoff + off) <
(seeklow - xbeg), or (seekhigh - xbeg) < (newoff + off)
(seeklow - xbeg)
(seekhigh - xbeg) <
(newoff + off)
xbeg
off
xnext
pos_type(newoff), constructed from the resultant offset newoff (of type off_type), that stores the resultant stream position, if possible. If the positioning operation fails, or if the constructed object cannot represent the resultant stream position, the return value is pos_type(off_type(-1)).
pos_type(newoff)
off_type
pos_type(off_type(-1))
pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out);
sp
If (which & ios::in) != 0, positions the input sequence.
If (which & ios::out) != 0, positions the output sequence.
If the function positions neither sequence, the positioning operation fails.
For a sequence to be positioned, if its next pointer is a null pointer, the positioning operation fails. Otherwise, the function determines newoff from sp.offset():
sp.offset()
If newoff is an invalid stream position, has a negative value, or has a value greater than (seekhigh - seeklow), the positioning operation fails
Otherwise, the function adds newoff to the beginning pointer xbeg and stores the result in the next pointer xnext.
streambuf<char>* setbuf(char* s, streamsize n);
setbuf(0, 0)
namespace std { class istrstream : public basic_istream<char> { public: explicit istrstream(const char* s); explicit istrstream(char* s); istrstream(const char* s, streamsize n); istrstream(char* s, streamsize n); virtual ~istrstream(); strstreambuf* rdbuf() const; char *str(); private: strstreambuf sb; // exposition only }; }
istrstream
sb, the strstreambuf object.
sb
explicit istrstream(const char* s); explicit istrstream(char* s);
istream(&sb)
strstreambuf(s,0))
s
istrstream(const char* s, streamsize n);
strstreambuf(s,n))
strstreambuf* rdbuf() const;
const_cast<strstreambuf*>(&sb).
const_cast<strstreambuf*>(&sb)
rdbuf()->str().
rdbuf()->str()
namespace std { class ostrstream : public basic_ostream<char> { public: ostrstream(); ostrstream(char* s, int n, ios_base::openmode mode = ios_base::out); virtual ~ostrstream(); strstreambuf* rdbuf() const; void freeze(bool freezefl = true); char* str(); int pcount() const; private: strstreambuf sb; // exposition only }; }
ostrstream
ostrstream();
ostream(&sb)
strstreambuf())
ostrstream(char* s, int n, ios_base::openmode mode = ios_base::out);
If (mode & app) == 0, then s shall designate the first element of an array of n elements.
(mode & app) == 0
The constructor is strstreambuf(s, n, s).
strstreambuf(s, n, s)
If (mode & app) != 0, then s shall designate the first element of an array of n elements that contains an ntbs whose first element is designated by s. The constructor is strstreambuf(s, n, s + std::strlen(s)).
(mode & app) != 0
strstreambuf(s, n, s + std::strlen(s))
(strstreambuf*)&sb .
(strstreambuf*)&sb
rdbuf()->freeze(freezefl)
rdbuf()->pcount().
rdbuf()->pcount()
namespace std { class strstream : public basic_iostream<char> { public: // Types typedef char char_type; typedef typename char_traits<char>::int_type int_type; typedef typename char_traits<char>::pos_type pos_type; typedef typename char_traits<char>::off_type off_type; // constructors/destructor strstream(); strstream(char* s, int n, ios_base::openmode mode = ios_base::in|ios_base::out); virtual ~strstream(); // Members: strstreambuf* rdbuf() const; void freeze(bool freezefl = true); int pcount() const; char* str(); private: strstreambuf sb; // exposition only }; }
strstream
strstreambuf.
strstream();
iostream(&sb)
strstream(char* s, int n, ios_base::openmode mode = ios_base::in|ios_base::out);
If (mode & app) == 0, then s shall designate the first element of an array of n elements. The constructor is strstreambuf(s,n,s).
strstreambuf(s,n,s)
If (mode & app) != 0, then s shall designate the first element of an array of n elements that contains an ntbs whose first element is designated by s. The constructor is strstreambuf(s,n,s + std::strlen(s)).
strstreambuf(s,n,s + std::strlen(s))
virtual ~strstream()
&sb.
&sb
unary_function
binary_function
namespace std { template <class Arg, class Result> struct unary_function { typedef Arg argument_type; typedef Result result_type; }; }
namespace std { template <class Arg1, class Arg2, class Result> struct binary_function { typedef Arg1 first_argument_type; typedef Arg2 second_argument_type; typedef Result result_type; }; }
bind
template <class Arg, class Result> class pointer_to_unary_function : public unary_function<Arg, Result> { public: explicit pointer_to_unary_function(Result (*f)(Arg)); Result operator()(Arg x) const; };
operator()
f(x)
template <class Arg, class Result> pointer_to_unary_function<Arg, Result> ptr_fun(Result (*f)(Arg));
pointer_to_unary_function<Arg, Result>(f).
pointer_to_unary_function<Arg, Result>(f)
template <class Arg1, class Arg2, class Result> class pointer_to_binary_function : public binary_function<Arg1,Arg2,Result> { public: explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2)); Result operator()(Arg1 x, Arg2 y) const; };
f(x,y)
template <class Arg1, class Arg2, class Result> pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1, Arg2));
pointer_to_binary_function<Arg1,Arg2,Result>(f).
pointer_to_binary_function<Arg1,Arg2,Result>(f)
int compare(const char*, const char*); replace_if(v.begin(), v.end(), not1(bind2nd(ptr_fun(compare), "abc")), "def");
abc
def
v
template <class S, class T> class mem_fun_t : public unary_function<T*, S> { public: explicit mem_fun_t(S (T::*p)()); S operator()(T* p) const; };
mem_fun_t
template <class S, class T, class A> class mem_fun1_t : public binary_function<T*, A, S> { public: explicit mem_fun1_t(S (T::*p)(A)); S operator()(T* p, A x) const; };
mem_fun1_t
template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)()); template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A));
mem_fun(&X::f)
X::f
X
f
template <class S, class T> class mem_fun_ref_t : public unary_function<T, S> { public: explicit mem_fun_ref_t(S (T::*p)()); S operator()(T& p) const; };
mem_fun_ref_t
template <class S, class T, class A> class mem_fun1_ref_t : public binary_function<T, A, S> { public: explicit mem_fun1_ref_t(S (T::*p)(A)); S operator()(T& p, A x) const; };
mem_fun1_ref_t
template<class S, class T> mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A));
mem_fun_ref(&X::f)
template <class S, class T> class const_mem_fun_t : public unary_function<const T*, S> { public: explicit const_mem_fun_t(S (T::*p)() const); S operator()(const T* p) const; };
const_mem_fun_t
template <class S, class T, class A> class const_mem_fun1_t : public binary_function<const T*, A, S> { public: explicit const_mem_fun1_t(S (T::*p)(A) const); S operator()(const T* p, A x) const; };
const_mem_fun1_t
template<class S, class T> const_mem_fun_t<S,T> mem_fun(S (T::*f)() const); template<class S, class T, class A> const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const);
template <class S, class T> class const_mem_fun_ref_t : public unary_function<T, S> { public: explicit const_mem_fun_ref_t(S (T::*p)() const); S operator()(const T& p) const; };
const_mem_fun_ref_t
template <class S, class T, class A> class const_mem_fun1_ref_t : public binary_function<T, A, S> { public: explicit const_mem_fun1_ref_t(S (T::*p)(A) const); S operator()(const T& p, A x) const; };
const_mem_fun1_ref_t
template<class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); template<class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const);
binder1st
bind1st
binder2nd
bind2nd
template <class Fn> class binder1st : public unary_function<typename Fn::second_argument_type, typename Fn::result_type> { protected: Fn op; typename Fn::first_argument_type value; public: binder1st(const Fn& x, const typename Fn::first_argument_type& y); typename Fn::result_type operator()(const typename Fn::second_argument_type& x) const; typename Fn::result_type operator()(typename Fn::second_argument_type& x) const; };
op
x
value
y
(value,x)
template <class Fn, class T> binder1st<Fn> bind1st(const Fn& fn, const T& x);
binder1st<Fn>(fn, typename Fn::first_argument_type(x)).
binder1st<Fn>(fn, typename Fn::first_argument_type(x))
template <class Fn> class binder2nd : public unary_function<typename Fn::first_argument_type, typename Fn::result_type> { protected: Fn op; typename Fn::second_argument_type value; public: binder2nd(const Fn& x, const typename Fn::second_argument_type& y); typename Fn::result_type operator()(const typename Fn::first_argument_type& x) const; typename Fn::result_type operator()(typename Fn::first_argument_type& x) const; };
(x,value)
template <class Fn, class T> binder2nd<Fn> bind2nd(const Fn& op, const T& x);
binder2nd<Fn>(op, typename Fn::second_argument_type(x)).
binder2nd<Fn>(op, typename Fn::second_argument_type(x))
find_if(v.begin(), v.end(), bind2nd(greater<int>(), 5));
finds the first integer in vector v greater than 5;
find_if(v.begin(), v.end(), bind1st(greater<int>(), 5));
auto_ptr
unique_ptr
new
auto_ptr_ref
namespace std { template <class Y> struct auto_ptr_ref; // exposition only template <class X> class auto_ptr { public: typedef X element_type; // [auto.ptr.cons] construct/copy/destroy: explicit auto_ptr(X* p =0) throw(); auto_ptr(auto_ptr&) throw(); template<class Y> auto_ptr(auto_ptr<Y>&) throw(); auto_ptr& operator=(auto_ptr&) throw(); template<class Y> auto_ptr& operator=(auto_ptr<Y>&) throw(); auto_ptr& operator=(auto_ptr_ref<X> r) throw(); ~auto_ptr() throw(); // [auto.ptr.members] members: X& operator*() const throw(); X* operator->() const throw(); X* get() const throw(); X* release() throw(); void reset(X* p =0) throw(); // [auto.ptr.conv] conversions: auto_ptr(auto_ptr_ref<X>) throw(); template<class Y> operator auto_ptr_ref<Y>() throw(); template<class Y> operator auto_ptr<Y>() throw(); }; template <> class auto_ptr<void> { public: typedef void element_type; }; }
MoveConstructible
MoveAssignable
CopyConstructible
CopyAssignable
explicit auto_ptr(X* p =0) throw();
*this holds the pointer p.
*this
auto_ptr(auto_ptr& a) throw();
a.release()
*this holds the pointer returned from a.release().
template<class Y> auto_ptr(auto_ptr<Y>& a) throw();
Y* can be implicitly converted to X*.
Y*
X*
auto_ptr& operator=(auto_ptr& a) throw();
delete get()
reset(a.release()).
reset(a.release())
*this.
template<class Y> auto_ptr& operator=(auto_ptr<Y>& a) throw();
Y* can be implicitly converted to X*. The expression delete get() is well formed.
~auto_ptr() throw();
delete get().
X& operator*() const throw();
get() != 0
*get()
X* operator->() const throw();
get()
X* get() const throw();
X* release() throw();
*this holds the null pointer.
void reset(X* p=0) throw();
get() != p
auto_ptr(auto_ptr_ref<X> r) throw();
p.release()
r
*this holds the pointer returned from release().
release()
template<class Y> operator auto_ptr_ref<Y>() throw();
auto_ptr_ref<Y>
template<class Y> operator auto_ptr<Y>() throw();
auto_ptr<Y>
auto_ptr& operator=(auto_ptr_ref<X> r) throw()
reset(p.release())
auto_ptr p
typedef void (*unexpected_handler)();
unexpected()
unexpected_handler
std::terminate()
unexpected_handler set_unexpected(unexpected_handler f) noexcept;
unexpected_handler get_unexpected() noexcept;
noreturn void unexpected();
Source: https://timsong-cpp.github.io/cppwp/n4140/depr
List of Tables [tab] List of Figures [fig] 1 General [intro] 2 Lexical conventions [lex] 3 Basic concepts [basic] 4 Standard conversions [conv] 5 Expressions [expr] 6 Statements [stmt.stmt] 7 Declarations [dcl.dcl] 8 Declarators [dcl.decl] 9 Classes [class] 10 Derived classes [class.derived] 11 Member access control [class.access] 12 Special member functions [special] 13 Overloading [over] 14 Templates [temp] 15 Exception handling [except] 16 Preprocessing directives [cpp] 17 Library introduction [library] 18 Language support library [language.support] 19 Diagnostics library [diagnostics] 20 General utilities library [utilities] 21 Strings library [strings] 22 Localization library [localization] 23 Containers library [containers] 24 Iterators library [iterators] 25 Algorithms library [algorithms] 26 Numerics library [numerics] 27 Input/output library [input.output] 28 Regular expressions library [re] 29 Atomic operations library [atomics] 30 Thread support library [thread] Annex A (informative) Grammar summary [gram] Annex B (informative) Implementation quantities [implimits] Annex C (informative) Compatibility [diff] Annex D (normative) Compatibility features [depr] D.1 Increment operator with bool operand [depr.incr.bool] D.2 register keyword [depr.register] D.3 Implicit declaration of copy functions [depr.impldec] D.4 Dynamic exception specifications [depr.except.spec] D.5 C standard library headers [depr.c.headers] D.6 Old iostreams members [depr.ios.members] D.7 char* streams [depr.str.strstreams] D.8 Function objects [depr.function.objects] D.9 Binders [depr.lib.binders] D.10 auto_ptr [depr.auto.ptr] D.11 Violating exception-specifications [exception.unexpected] D.12 Random shuffle [depr.alg.random.shuffle] Annex E (normative) Universal character names for identifier characters [charname] Index [generalindex] Index of library names [libraryindex] Index of implementation-defined behavior [impldefindex]
deprecated
strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = 0); strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = 0); strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = 0);
If n < 0, N is INT_MAX.[cpp14 1]
(newoff + off) < (seeklow - xbeg)
(seekhigh - xbeg) < (newoff + off)
xbeg + newoff + off
namespace std { class istrstream : public basic_istream<char> { public: explicit istrstream(const char* s); explicit istrstream(char* s); istrstream(const char* s, streamsize n); istrstream(char* s, streamsize n); virtual ~istrstream(); strstreambuf* rdbuf() const; char* str(); private: strstreambuf sb; // exposition only }; }
virtual ~strstream();
random_shuffle
template<class RandomAccessIterator> void random_shuffle(RandomAccessIterator first, RandomAccessIterator last); template<class RandomAccessIterator, class RandomNumberGenerator> void random_shuffle(RandomAccessIterator first, RandomAccessIterator last, RandomNumberGenerator&& rng);
[first,last)
RandomAccessIterator shall satisfy the requirements of ValueSwappable ([swappable.requirements]). The random number generating function object rng shall have a return type that is convertible to iterator_traits<RandomAccessIterator>::difference_type, and the call rng(n) shall return a randomly chosen value in the interval [0,n), for n > 0 of type iterator_traits<RandomAccessIterator>::difference_type.
RandomAccessIterator
ValueSwappable
rng
iterator_traits<RandomAccessIterator>::difference_type
rng(n)
[0,n)
(last - first) - 1
The underlying source of random numbers for the first form of the function is implementation-defined. An implementation may use the rand function from the standard C library.
rand
In the second form of the function, the function object rng shall serve as the implementation's source of randomness.
Source: https://timsong-cpp.github.io/cppwp/n4659/depr
List of Tables [tab] List of Figures [fig] 1 Scope [intro.scope] 2 Normative references [intro.refs] 3 Terms and definitions [intro.defs] 4 General principles [intro] 5 Lexical conventions [lex] 6 Basic concepts [basic] 7 Standard conversions [conv] 8 Expressions [expr] 9 Statements [stmt.stmt] 10 Declarations [dcl.dcl] 11 Declarators [dcl.decl] 12 Classes [class] 13 Derived classes [class.derived] 14 Member access control [class.access] 15 Special member functions [special] 16 Overloading [over] 17 Templates [temp] 18 Exception handling [except] 19 Preprocessing directives [cpp] 20 Library introduction [library] 21 Language support library [language.support] 22 Diagnostics library [diagnostics] 23 General utilities library [utilities] 24 Strings library [strings] 25 Localization library [localization] 26 Containers library [containers] 27 Iterators library [iterators] 28 Algorithms library [algorithms] 29 Numerics library [numerics] 30 Input/output library [input.output] 31 Regular expressions library [re] 32 Atomic operations library [atomics] 33 Thread support library [thread] Annex A (informative) Grammar summary [gram] Annex B (informative) Implementation quantities [implimits] Annex C (informative) Compatibility [diff] Annex D (normative) Compatibility features [depr] D.1 Redeclaration of static constexpr data members [depr.static_constexpr] D.2 Implicit declaration of copy functions [depr.impldec] D.3 Deprecated exception specifications [depr.except.spec] D.4 C++standard library headers [depr.cpp.headers] D.5 C standard library headers [depr.c.headers] D.6 char* streams [depr.str.strstreams] D.7 uncaught_exception [depr.uncaught] D.8 Old adaptable function bindings [depr.func.adaptor.binding] D.9 The default allocator [depr.default.allocator] D.10 Raw storage iterator [depr.storage.iterator] D.11 Temporary buffers [depr.temporary.buffer] D.12 Deprecated type traits [depr.meta.types] D.13 Deprecated iterator primitives [depr.iterator.primitives] D.14 Deprecated shared_ptr observers [depr.util.smartptr.shared.obs] D.15 Deprecated standard code conversion facets [depr.locale.stdcvt] D.16 Deprecated convenience conversion interfaces [depr.conversions] Index [generalindex] Index of library names [libraryindex] Index of implementation-defined behavior [impldefindex]
constexpr
struct A { static constexpr int n = 5; // definition (declaration in C++ 2014) }; constexpr int A::n; // redundant declaration (definition in C++ 2014)
throw()
<ccomplex>
<cstdalign>
<cstdbool>
<ctgmath>
#include <complex>
<complex>
#define __alignas_is_defined 1
alignas
See also: ISO C 7.15.
#define __bool_true_false_are_defined 1
false
See also: ISO C 7.18.
#include <complex> #include <cmath>
<cmath>
std::byte
namespace std { class strstreambuf : public basic_streambuf<char> { public: explicit strstreambuf(streamsize alsize_arg = 0); strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*)); strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = 0); strstreambuf(const char* gnext_arg, streamsize n); strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = 0); strstreambuf(const signed char* gnext_arg, streamsize n); strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = 0); strstreambuf(const unsigned char* gnext_arg, streamsize n); virtual ~strstreambuf(); void freeze(bool freezefl = true); char* str(); int pcount(); protected: int_type overflow (int_type c = EOF) override; int_type pbackfail(int_type c = EOF) override; int_type underflow() override; pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode which = ios_base::in | ios_base::out) override; pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out) override; streambuf* setbuf(char* s, streamsize n) override; private: using strstate = T1; // exposition only static const strstate allocated; // exposition only static const strstate constant; // exposition only static const strstate dynamic; // exposition only static const strstate frozen; // exposition only strstate strmode; // exposition only streamsize alsize; // exposition only void* (*palloc)(size_t); // exposition only void (*pfree)(void*); // exposition only }; }
If n == 0, N is std::strlen(gnext_arg).
std::strlen(gnext_arg)
If n < 0, N is INT_MAX.[cpp17 1]
setg(gnext_arg, gnext_arg, pbeg_arg); setp(pbeg_arg, pbeg_arg + N);
strstreambuf(const char* gnext_arg, streamsize n); strstreambuf(const signed char* gnext_arg, streamsize n); strstreambuf(const unsigned char* gnext_arg, streamsize n);
(strmode & allocated) != 0
(strmode & frozen) == 0
strmode & dynamic
pnext - pbeg
int_type overflow(int_type c = EOF) override;
(strmode & dynamic) == 0
(strmode & frozen) != 0
int_type pbackfail(int_type c = EOF) override;
strmode & constant
int_type underflow() override;
If the input sequence has a read position available, the function signals success by returning (unsigned char)*gnext.
(unsigned char)*gnext
Returns (unsigned char)*gnext.
pos_type seekoff(off_type off, seekdir way, openmode which = in | out) override;
(which & ios::in) != 0
(which & ios::out) != 0
(which & (ios::in |
ios::out)) == (ios::in | ios::out)) and way == either ios::beg or ios::end
ios::out)) == (ios::in |
ios::out))
ios::beg
ios::end
way == ios::beg
way == ios::cur
way == ios::end
pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out) override;
If (which & ios::in) != 0, positions the input sequence.
If (which & ios::out) != 0, positions the output sequence.
seekhigh - seeklow
streambuf<char>* setbuf(char* s, streamsize n) override;
strstreambuf(s,0)
istrstream(const char* s, streamsize n); istrstream(char* s, streamsize n);
strstreambuf(s,n)
strstreambuf()
If (mode & app) != 0, then s shall designate the first element of an array of n elements that contains an ntbs whose first element is designated by s. The constructor is strstreambuf(s, n, s + std::strlen(s)).[cpp17 3]
strstreambuf(s, n, s + std::strlen(s))
(strstreambuf*)&sb.
namespace std { class strstream : public basic_iostream<char> { public: // Types using char_type = char; using int_type = char_traits<char>::int_type; using pos_type = char_traits<char>::pos_type; using off_type = char_traits<char>::off_type; // constructors/destructor strstream(); strstream(char* s, int n, ios_base::openmode mode = ios_base::in|ios_base::out); virtual ~strstream(); // Members: strstreambuf* rdbuf() const; void freeze(bool freezefl = true); int pcount() const; char* str(); private: strstreambuf sb; // exposition only }; }
If (mode & app) != 0, then s shall designate the first element of an array of n elements that contains an ntbs whose first element is designated by s. The constructor is strstreambuf(s,n,s + std::strlen(s)).
strstreambuf(s,n,s + std::strlen(s))
<exception>
namespace std { bool uncaught_exception() noexcept; }
bool uncaught_exception() noexcept;
uncaught_exceptions() > 0
result_type
T
if T is a pointer to function type, result_type shall be a synonym for the return type of T;
if T is a pointer to member function, result_type shall be a synonym for the return type of T;
if T is a class type and the qualified-id T::result_type is valid and denotes a type ([temp.deduct]), then result_type shall be a synonym for T::result_type;
T::result_type
otherwise result_type shall not be defined.
argument_type and result_type for function objects that take one argument and first_argument_type, second_argument_type, and result_type for function objects that take two arguments.
argument_type
first_argument_type
second_argument_type
namespace std { template<class T> struct owner_less<shared_ptr<T>> { using result_type = bool; using first_argument_type = shared_ptr<T>; using second_argument_type = shared_ptr<T>; }; template<class T> struct owner_less<weak_ptr<T>> { using result_type = bool; using first_argument_type = weak_ptr<T>; using second_argument_type = weak_ptr<T>; }; template <class T> class reference_wrapper { public : using result_type = see below; // not always defined using argument_type = see below; // not always defined using first_argument_type = see below; // not always defined using second_argument_type = see below; // not always defined }; template <class T> struct plus { using first_argument_type = T; using second_argument_type = T; using result_type = T; }; template <class T> struct minus { using first_argument_type = T; using second_argument_type = T; using result_type = T; }; template <class T> struct multiplies { using first_argument_type = T; using second_argument_type = T; using result_type = T; }; template <class T> struct divides { using first_argument_type = T; using second_argument_type = T; using result_type = T; }; template <class T> struct modulus { using first_argument_type = T; using second_argument_type = T; using result_type = T; }; template <class T> struct negate { using argument_type = T; using result_type = T; }; template <class T> struct equal_to { using first_argument_type = T; using second_argument_type = T; using result_type = bool; }; template <class T> struct not_equal_to { using first_argument_type = T; using second_argument_type = T; using result_type = bool; }; template <class T> struct greater { using first_argument_type = T; using second_argument_type = T; using result_type = bool; }; template <class T> struct less { using first_argument_type = T; using second_argument_type = T; using result_type = bool; }; template <class T> struct greater_equal { using first_argument_type = T; using second_argument_type = T; using result_type = bool; }; template <class T> struct less_equal { using first_argument_type = T; using second_argument_type = T; using result_type = bool; }; template <class T> struct logical_and { using first_argument_type = T; using second_argument_type = T; using result_type = bool; }; template <class T> struct logical_or { using first_argument_type = T; using second_argument_type = T; using result_type = bool; }; template <class T> struct logical_not { using argument_type = T; using result_type = bool; }; template <class T> struct bit_and { using first_argument_type = T; using second_argument_type = T; using result_type = T; }; template <class T> struct bit_or { using first_argument_type = T; using second_argument_type = T; using result_type = T; }; template <class T> struct bit_xor { using first_argument_type = T; using second_argument_type = T; using result_type = T; }; template <class T> struct bit_not { using argument_type = T; using result_type = T; }; template<class R, class T1> class function<R(T1)> { public: using argument_type = T1; }; template<class R, class T1, class T2> class function<R(T1, T2)> { public: using first_argument_type = T1; using second_argument_type = T2; }; }
reference_wrapper<T>
a function type or a pointer to function type taking one argument of type T1
a pointer to member function R T0::f() cv (where cv represents the member function's cv-qualifiers); the type T1 is cv T0*
R T0::f()
T0*
a class type where the qualified-id T::argument_type is valid and denotes a type ([temp.deduct]); the type T1 is T::argument_type.
T::argument_type
a function type or a pointer to function type taking two arguments of types T1 and T2
a pointer to member function R T0::f(T2) cv (where cv represents the member function's cv-qualifiers); the type T1 is cv T0*
R T0::f(T2)
a class type where the qualified-ids T::first_argument_type and T::second_argument_type are both valid and both denote types ([temp.deduct]); the type T1 is T::first_argument_type and the type T2 is T::second_argument_type.
T::first_argument_type
T::second_argument_type
hash<Key>
hash
size_t
Key
g
bind(f, bound_args...)
bind<R>(f, bound_args...)
R
mem_fn(pm)
pm
T*
Ret
namespace std { template <class Key, class T, class Compare, class Allocator> class map<Key, T, Compare, Allocator>::value_compare { public: using result_type = bool; using first_argument_type = value_type; using second_argument_type = value_type; }; template <class Key, class T, class Compare, class Allocator> class multimap<Key, T, Compare, Allocator>::value_compare { public: using result_type = bool; using first_argument_type = value_type; using second_argument_type = value_type; }; }
<functional>
namespace std { template <class Predicate> class unary_negate; template <class Predicate> constexpr unary_negate<Predicate> not1(const Predicate&); template <class Predicate> class binary_negate; template <class Predicate> constexpr binary_negate<Predicate> not2(const Predicate&); }
not1
not2
template <class Predicate> class unary_negate { public: constexpr explicit unary_negate(const Predicate& pred); constexpr bool operator()(const typename Predicate::argument_type& x) const; using argument_type = typename Predicate::argument_type; using result_type = bool; };
constexpr bool operator()(const typename Predicate::argument_type& x) const;
!pred(x)
template <class Predicate> constexpr unary_negate<Predicate> not1(const Predicate& pred);
unary_negate<Predicate>(pred)
template <class Predicate> class binary_negate { public: constexpr explicit binary_negate(const Predicate& pred); constexpr bool operator()(const typename Predicate::first_argument_type& x, const typename Predicate::second_argument_type& y) const; using first_argument_type = typename Predicate::first_argument_type; using second_argument_type = typename Predicate::second_argument_type; using result_type = bool; };
constexpr bool operator()(const typename Predicate::first_argument_type& x, const typename Predicate::second_argument_type& y) const;
!pred(x,y)
template <class Predicate> constexpr binary_negate<Predicate> not2(const Predicate& pred);
binary_negate<Predicate>(pred)
namespace std { // specialize for void: template <> class allocator<void> { public: using value_type = void; using pointer = void*; using const_pointer = const void*; // reference-to-void members are impossible. template <class U> struct rebind { using other = allocator<U>; }; }; template <class T> class allocator { public: using size_type = size_t; using difference_type = ptrdiff_t; using pointer = T*; using const_pointer = const T*; using reference = T using const_reference = const T template <class U> struct rebind { using other = allocator<U>; }; T* address(T& x) const noexcept; const T* address(const T& x) const noexcept; T* allocate(size_t n, const void* hint); template<class U, class... Args> void construct(U* p, Args&... args); template <class U> void destroy(U* p); size_t max_size() const noexcept; }; }
T* address(T& x) const noexcept; const T* address(const T& x) const noexcept;
addressof(x)
T* allocate(size_t n, const void* hint);
* sizeof(T), aligned appropriately for objects of type T. It is implementation-defined whether over-aligned types are supported ([basic.align]).
* sizeof(T)
::operator new(std::size_t)
bad_alloc if the storage cannot be obtained.
bad_alloc
template <class U, class... Args> void construct(U* p, Args&&... args);
::new((void *)p) U(std::forward<Args>(args)...);
template <class U> void destroy(U* p);
p->~U()
size_t max_size() const noexcept;
allocate(N, 0)
<memory>
namespace std { template <class OutputIterator, class T> class raw_storage_iterator { public: using iterator_category = output_iterator_tag; using value_type = void; using difference_type = void; using pointer = void; using reference = void; explicit raw_storage_iterator(OutputIterator x); raw_storage_iterator& operator*(); raw_storage_iterator& operator=(const T& element); raw_storage_iterator& operator=(T&& element); raw_storage_iterator& operator++(); raw_storage_iterator operator++(int); OutputIterator base() const; }; }
raw_storage_iterator
OutputIterator
operator*
operator&
explicit raw_storage_iterator(OutputIterator x);
raw_storage_iterator& operator*();
raw_storage_iterator& operator=(const T& element);
T shall be CopyConstructible.
element
raw_storage_iterator& operator=(T&& element);
T shall be MoveConstructible.
std::move(element)
raw_storage_iterator& operator++();
raw_storage_iterator operator++(int);
OutputIterator base() const;
namespace std { template <class T> pair<T*, ptrdiff_t> get_temporary_buffer(ptrdiff_t n) noexcept; template <class T> void return_temporary_buffer(T* p); }
template <class T> pair<T*, ptrdiff_t> get_temporary_buffer(ptrdiff_t n) noexcept;
get_temporary_buffer
N != n
N == 0
n <= 0
P
P.first
P.second == 0
P.second
sizeof(T)
template <class T> void return_temporary_buffer(T* p);
p shall be a pointer value returned by an earlier call to get_temporary_buffer that has not been invalidated by an intervening call to return_temporary_buffer(T*).
return_temporary_buffer(T*)
<type_traits>
namespace std { template <class T> struct is_literal_type; template <class T> constexpr bool is_literal_type_v = is_literal_type<T>::value; template <class> struct result_of; // not defined template <class Fn, class... ArgTypes> struct result_of<Fn(ArgTypes...)>; template <class T> using result_of_t = typename result_of<T>::type; }
is_literal_type
remove_all_extents_t<T>
void
result_of<Fn(ArgTypes...)>
Fn
ArgTypes
is_literal_type<T>
UnaryTypeTrait
true_type
false_type
TransformationTrait
type
invoke_result<Fn, ArgTypes...>::type
invoke_result_t<Fn, ArgTypes...>
is_literal_type_v
<iterator>
namespace std { template<class Category, class T, class Distance = ptrdiff_t, class Pointer = T*, class Reference = T&> struct iterator { using iterator_category = Category; using value_type = T; using difference_type = Distance; using pointer = Pointer; using reference = Reference; }; }
iterator
double
class MyIterator : public iterator<bidirectional_iterator_tag, double, long, T*, T&> { // code implementing ++, etc. };
namespace std { template<class T> class shared_ptr { public: bool unique() const noexcept; }; }
bool unique() const noexcept;
use_count() == 1
<codecvt>
namespace std { enum codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 }; template <class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0> class codecvt_utf8 : public codecvt<Elem, char, mbstate_t> { public: explicit codecvt_utf8(size_t refs = 0); ~codecvt_utf8(); }; template <class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0> class codecvt_utf16 : public codecvt<Elem, char, mbstate_t> { public: explicit codecvt_utf16(size_t refs = 0); ~codecvt_utf16(); }; template <class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0> class codecvt_utf8_utf16 : public codecvt<Elem, char, mbstate_t> { public: explicit codecvt_utf8_utf16(size_t refs = 0); ~codecvt_utf8_utf16(); }; }
codecvt_utf8
codecvt_utf16
codecvt_utf8_utf16
Elem is the wide-character type, such as wchar_t, char16_t, or char32_t.
Elem
wchar_t
char16_t
char32_t
Maxcode is the largest wide-character code that the facet will read or write without reporting a conversion error.
Maxcode
If (Mode & consume_header), the facet shall consume an initial header sequence, if present, when reading a multibyte sequence to determine the endianness of the subsequent multibyte sequence to be read.
(Mode & consume_header)
If (Mode & generate_header), the facet shall generate an initial header sequence when writing a multibyte sequence to advertise the endianness of the subsequent multibyte sequence to be written.
(Mode & generate_header)
If (Mode & little_endian), the facet shall generate a multibyte sequence in little-endian order, as opposed to the default big-endian order.
(Mode & little_endian)
The facet shall convert between UTF-8 multibyte sequences and UCS2 or UCS4 (depending on the size of Elem) within the program.
Endianness shall not affect how multibyte sequences are read or written.
The multibyte sequences may be written as either a text or a binary file.
The facet shall convert between UTF-16 multibyte sequences and UCS2 or UCS4 (depending on the size of Elem) within the program.
Multibyte sequences shall be read or written according to the Mode flag, as set out above.
Mode
The multibyte sequences may be written only as a binary file. Attempting to write to a text file produces undefined behavior.
The facet shall convert between UTF-8 multibyte sequences and UTF-16 (one or two 16-bit codes) within the program.
See also: ISO/IEC 10646-1:1993.
<locale>
namespace std { template <class Codecvt, class Elem = wchar_t, class Wide_alloc = allocator<Elem>, class Byte_alloc = allocator<char>> class wstring_convert; template <class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>> class wbuffer_convert; }
wstring_convert
codecvt
cout
wstring_convert<std::codecvt_utf8<wchar_t>> myconv; std::string mbstring = myconv.to_bytes(L"Hello\n"); std::cout << mbstring;
namespace std { template <class Codecvt, class Elem = wchar_t, class Wide_alloc = allocator<Elem>, class Byte_alloc = allocator<char>> class wstring_convert { public: using byte_string = basic_string<char, char_traits<char>, Byte_alloc>; using wide_string = basic_string<Elem, char_traits<Elem>, Wide_alloc>; using state_type = typename Codecvt::state_type; using int_type = typename wide_string::traits_type::int_type; explicit wstring_convert(Codecvt* pcvt = new Codecvt); wstring_convert(Codecvt* pcvt, state_type state); explicit wstring_convert(const byte_string& byte_err, const wide_string& wide_err = wide_string()); ~wstring_convert(); wstring_convert(const wstring_convert&) = delete; wstring_convert& operator=(const wstring_convert&) = delete; wide_string from_bytes(char byte); wide_string from_bytes(const char* ptr); wide_string from_bytes(const byte_string& str); wide_string from_bytes(const char* first, const char* last); byte_string to_bytes(Elem wchar); byte_string to_bytes(const Elem* wptr); byte_string to_bytes(const wide_string& wstr); byte_string to_bytes(const Elem* first, const Elem* last); size_t converted() const noexcept; state_type state() const; private: byte_string byte_err_string; // exposition only wide_string wide_err_string; // exposition only Codecvt* cvtptr; // exposition only state_type cvtstate; // exposition only size_t cvtcount; // exposition only }; }
basic_string<Elem, char_traits<Elem>, Wide_alloc>
basic_string<char, char_traits<char>, Byte_alloc>
wide_string
byte_string
Codecvt
codecvt<Elem, char, mbstate_t>
byte_err_string — a byte string to display on errors
byte_err_string
wide_err_string — a wide string to display on errors
wide_err_string
cvtptr — a pointer to the allocated conversion object (which is freed when the wstring_convert object is destroyed)
cvtptr
cvtstate — a conversion state object
cvtstate
cvtcount — a conversion count
cvtcount
using byte_string = basic_string<char, char_traits<char>, Byte_alloc>;
size_t converted() const noexcept;
wide_string from_bytes(char byte); wide_string from_bytes(const char* ptr); wide_string from_bytes(const byte_string& str); wide_string from_bytes(const char* first, const char* last);
byte
ptr
str
[first, last)
If the cvtstate object was not constructed with an explicit value, it shall be set to its default value (the initial conversion state) before the conversion begins. Otherwise it shall be left unchanged.
The number of input elements successfully converted shall be stored in cvtcount.
range_error
using int_type = typename wide_string::traits_type::int_type;
wide_string::traits_type::int_type
state_type state() const;
using state_type = typename Codecvt::state_type;
Codecvt::state_type
byte_string to_bytes(Elem wchar); byte_string to_bytes(const Elem* wptr); byte_string to_bytes(const wide_string& wstr); byte_string to_bytes(const Elem* first, const Elem* last);
wchar
wptr
wstr
using wide_string = basic_string<Elem, char_traits<Elem>, Wide_alloc>;
explicit wstring_convert(Codecvt* pcvt = new Codecvt); wstring_convert(Codecvt* pcvt, state_type state); explicit wstring_convert(const byte_string& byte_err, const wide_string& wide_err = wide_string());
pcvt != nullptr
pcvt
state
from_bytes
to_bytes
new Codecvt
state_type()
byte_err
wide_err
~wstring_convert();
wbuffer_convert
namespace std { template <class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>> class wbuffer_convert : public basic_streambuf<Elem, Tr> { public: using state_type = typename Codecvt::state_type; explicit wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt, state_type state = state_type()); ~wbuffer_convert(); wbuffer_convert(const wbuffer_convert&) = delete; wbuffer_convert& operator=(const wbuffer_convert&) = delete; streambuf* rdbuf() const; streambuf* rdbuf(streambuf* bytebuf); state_type state() const; private: streambuf* bufptr; // exposition only Codecvt* cvtptr; // exposition only state_type cvtstate; // exposition only }; }
Tr
streambuf
bufptr — a pointer to its underlying byte stream buffer
bufptr
cvtptr — a pointer to the allocated conversion object (which is freed when the wbuffer_convert object is destroyed)
streambuf* rdbuf() const;
streambuf* rdbuf(streambuf* bytebuf);
bytebuf
explicit wbuffer_convert( streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt, state_type state = state_type());
pcvt != nullptr.
~wbuffer_convert();
Source: https://timsong-cpp.github.io/cppwp/n4868/depr
1 Scope [intro.scope] 2 Normative references [intro.refs] 3 Terms and definitions [intro.defs] 4 General principles [intro] 5 Lexical conventions [lex] 6 Basics [basic] 7 Expressions [expr] 8 Statements [stmt.stmt] 9 Declarations [dcl.dcl] 10 Modules [module] 11 Classes [class] 12 Overloading [over] 13 Templates [temp] 14 Exception handling [except] 15 Preprocessing directives [cpp] 16 Library introduction [library] 17 Language support library [support] 18 Concepts library [concepts] 19 Diagnostics library [diagnostics] 20 General utilities library [utilities] 21 Strings library [strings] 22 Containers library [containers] 23 Iterators library [iterators] 24 Ranges library [ranges] 25 Algorithms library [algorithms] 26 Numerics library [numerics] 27 Time library [time] 28 Localization library [localization] 29 Input/output library [input.output] 30 Regular expressions library [re] 31 Atomic operations library [atomics] 32 Thread support library [thread] Annex A (informative) Grammar summary [gram] Annex B (normative) Implementation quantities [implimits] Annex C (informative) Compatibility [diff] Annex D (normative) Compatibility features [depr] D.1 General [depr.general] D.2 Arithmetic conversion on enumerations [depr.arith.conv.enum] D.3 Implicit capture of *this by reference [depr.capture.this] D.4 Comma operator in subscript expressions [depr.comma.subscript] D.5 Array comparisons [depr.array.comp] D.6 Deprecated volatile types [depr.volatile.type] D.7 Redeclaration of static constexpr data members [depr.static.constexpr] D.8 Non-local use of TU-local entities [depr.local] D.9 Implicit declaration of copy functions [depr.impldec] D.10 C headers [depr.c.headers] D.11 Requires paragraph [depr.res.on.required] D.12 Relational operators [depr.relops] D.13 char* streams [depr.str.strstreams] D.14 Deprecated type traits [depr.meta.types] D.15 Tuple [depr.tuple] D.16 Variant [depr.variant] D.17 Deprecated iterator class template [depr.iterator] D.18 Deprecated move_iterator access [depr.move.iter.elem] D.19 Deprecated shared_ptr atomic access [depr.util.smartptr.shared.atomic] D.20 Deprecated basic_string capacity [depr.string.capacity] D.21 Deprecated standard code conversion facets [depr.locale.stdcvt] D.22 Deprecated convenience conversion interfaces [depr.conversions] D.23 Deprecated locale category facets [depr.locale.category] D.24 Deprecated filesystem path factory functions [depr.fs.path.factory] D.25 Deprecated atomic operations [depr.atomics] Index [generalindex] Index of grammar productions [grammarindex] Index of library headers [headerindex] Index of library names [libraryindex] Index of library concepts [conceptindex] Index of implementation-defined behavior [impldefindex]
NoteThree-way comparisons ([expr.spaceship]) between such operands are ill-formed.
enum E1 { e }; enum E2 { f }; bool b = e <= 3.7; // deprecated int k = f - e; // deprecated auto cmp = e <=> f; // error
= ([expr.prim.lambda.capture]) may implicitly capture *this by reference.
=
struct X { int x; void foo(int n) { auto f = [=]() { x = n; }; // deprecated: x means this->x, not a copy thereof auto g = [=, this]() { x = n; }; // recommended replacement } };
NoteA parenthesized comma expression is not deprecated.
void f(int *a, int b, int c) { a[b,c]; // deprecated a[(b,c)]; // OK }
int arr1[5]; int arr2[5]; bool same = arr1 == arr2; // deprecated, same as &arr1[0] == &arr2[0], // does not compare array contents auto cmp = arr1 <=> arr2; // error
--
volatile int velociraptor; ++velociraptor; // deprecated
int neck, tail; volatile int brachiosaur; brachiosaur = neck; // OK tail = brachiosaur; // OK tail = brachiosaur = neck; // deprecated brachiosaur += neck; // deprecated brachiosaur = brachiosaur + neck; // OK
volatile struct amber jurassic(); // deprecated void trex(volatile short left_arm, volatile short right_arm); // deprecated void fly(volatile struct pterosaur* pteranodon); // OK
struct linhenykus { short forelimb; }; void park(linhenykus alvarezsauroid) { volatile auto [what_is_this] = alvarezsauroid; // deprecated // ... }
NoteSuch a declaration in an importable module unit is ill-formed.
namespace { struct A { void f() {} }; } A h(); // deprecated: not internal linkage inline void g() {A().f();} // deprecated: inline and not internal linkage
Noteand, and_eq, bitand, bitor, compl, not_eq, not, or, or_eq, xor, and xor_eq are keywords in C++ ([lex.key]).
and
and_eq
bitand
bitor
compl
not_eq
not
or
or_eq
xor
xor_eq
See also: ISO C 7.15
See also: ISO C 7.18
#include <cmath> #include <complex>
<name.h>
<cname>
namespace std::rel_ops { template<class T> bool operator!=(const T&, const T&); template<class T> bool operator> (const T&, const T&); template<class T> bool operator<=(const T&, const T&); template<class T> bool operator>=(const T&, const T&); }
operator!=
operator==
>
<=
>=
operator<
template<class T> bool operator!=(const T& x, const T& y);
!(x == y)
template<class T> bool operator>(const T& x, const T& y);
y < x
template<class T> bool operator<=(const T& x, const T& y);
!(y < x)
template<class T> bool operator>=(const T& x, const T& y);
!(x < y)
namespace std { class strstreambuf; class istrstream; class ostrstream; class strstream; }
namespace std { class strstreambuf : public basic_streambuf<char> { public: strstreambuf() : strstreambuf(0) {} explicit strstreambuf(streamsize alsize_arg); strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*)); strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = nullptr); strstreambuf(const char* gnext_arg, streamsize n); strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = nullptr); strstreambuf(const signed char* gnext_arg, streamsize n); strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = nullptr); strstreambuf(const unsigned char* gnext_arg, streamsize n); virtual ~strstreambuf(); void freeze(bool freezefl = true); char* str(); int pcount(); protected: int_type overflow (int_type c = EOF) override; int_type pbackfail(int_type c = EOF) override; int_type underflow() override; pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode which = ios_base::in | ios_base::out) override; pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out) override; streambuf* setbuf(char* s, streamsize n) override; private: using strstate = T1; // exposition only static const strstate allocated; // exposition only static const strstate constant; // exposition only static const strstate dynamic; // exposition only static const strstate frozen; // exposition only strstate strmode; // exposition only streamsize alsize; // exposition only void* (*palloc)(size_t); // exposition only void (*pfree)(void*); // exposition only }; }
explicit strstreambuf(streamsize alsize_arg);
strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = nullptr); strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = nullptr); strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = nullptr);
If n < 0, N is INT_MAX.[cpp20 1]
(which & (ios::in | ios::out)) ==
(ios::in | ios::out)
strstreambuf(s, 0)
strstreambuf(s, n)
If (mode & app) != 0, then s shall designate the first element of an array of n elements that contains an ntbs whose first element is designated by s. The constructor is strstreambuf(s, n, s + std::strlen(s)).[cpp20 2]
namespace std { class strstream : public basic_iostream<char> { public: // types using char_type = char; using int_type = char_traits<char>::int_type; using pos_type = char_traits<char>::pos_type; using off_type = char_traits<char>::off_type; // constructors/destructor strstream(); strstream(char* s, int n, ios_base::openmode mode = ios_base::in|ios_base::out); virtual ~strstream(); // members strstreambuf* rdbuf() const; void freeze(bool freezefl = true); int pcount() const; char* str(); private: strstreambuf sb; // exposition only }; }
namespace std { template<class T> struct is_pod; template<class T> inline constexpr bool is_pod_v = is_pod<T>::value; }
🔗template<class T> struct is_pod;
template<class T> struct is_pod;
is_pod<T>
namespace std { template<class T> class tuple_size<volatile T>; template<class T> class tuple_size<const volatile T>; template<size_t I, class T> class tuple_element<I, volatile T>; template<size_t I, class T> class tuple_element<I, const volatile T>; }
🔗template<class T> class tuple_size<volatile T>; template<class T> class tuple_size<const volatile T>;
template<class T> class tuple_size<volatile T>; template<class T> class tuple_size<const volatile T>;
TS
tuple_size<T>
TS::value
integral_constant<size_t, TS::value>
🔗template<size_t I, class T> class tuple_element<I, volatile T>; template<size_t I, class T> class tuple_element<I, const volatile T>;
template<size_t I, class T> class tuple_element<I, volatile T>; template<size_t I, class T> class tuple_element<I, const volatile T>;
TE
tuple_element_t<I, T>
for the first specialization, add_volatile_t<TE>, and
add_volatile_t<TE>
for the second specialization, add_cv_t<TE>.
add_cv_t<TE>
namespace std { template<class T> struct variant_size<volatile T>; template<class T> struct variant_size<const volatile T>; template<size_t I, class T> struct variant_alternative<I, volatile T>; template<size_t I, class T> struct variant_alternative<I, const volatile T>; }
🔗template<class T> class variant_size<volatile T>; template<class T> class variant_size<const volatile T>;
template<class T> class variant_size<volatile T>; template<class T> class variant_size<const volatile T>;
VS
variant_size<T>
integral_constant<size_t, VS::value>
🔗template<size_t I, class T> class variant_alternative<I, volatile T>; template<size_t I, class T> class variant_alternative<I, const volatile T>;
template<size_t I, class T> class variant_alternative<I, volatile T>; template<size_t I, class T> class variant_alternative<I, const volatile T>;
VA
variant_alternative<I, T>
for the first specialization, add_volatile_t<VA::type>, and
add_volatile_t<VA::type>
for the second specialization, add_cv_t<VA::type>.
add_cv_t<VA::type>
namespace std { template<class Iterator> class move_iterator { public: constexpr pointer operator->() const; }; }
constexpr pointer operator->() const;
current
namespace std { template<class T> bool atomic_is_lock_free(const shared_ptr<T>* p); template<class T> shared_ptr<T> atomic_load(const shared_ptr<T>* p); template<class T> shared_ptr<T> atomic_load_explicit(const shared_ptr<T>* p, memory_order mo); template<class T> void atomic_store(shared_ptr<T>* p, shared_ptr<T> r); template<class T> void atomic_store_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo); template<class T> shared_ptr<T> atomic_exchange(shared_ptr<T>* p, shared_ptr<T> r); template<class T> shared_ptr<T> atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo); template<class T> bool atomic_compare_exchange_weak(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w); template<class T> bool atomic_compare_exchange_strong(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w); template<class T> bool atomic_compare_exchange_weak_explicit( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w, memory_order success, memory_order failure); template<class T> bool atomic_compare_exchange_strong_explicit( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w, memory_order success, memory_order failure); }
shared_ptr
memory_order
template<class T> bool atomic_is_lock_free(const shared_ptr<T>* p);
*p
template<class T> shared_ptr<T> atomic_load(const shared_ptr<T>* p);
atomic_load_explicit(p, memory_order::seq_cst)
template<class T> shared_ptr<T> atomic_load_explicit(const shared_ptr<T>* p, memory_order mo);
mo
memory_order::release
memory_order::acq_rel
template<class T> void atomic_store(shared_ptr<T>* p, shared_ptr<T> r);
atomic_store_explicit(p, r, memory_order::seq_cst)
template<class T> void atomic_store_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo);
memory_order::acquire
p->swap(r)
template<class T> shared_ptr<T> atomic_exchange(shared_ptr<T>* p, shared_ptr<T> r);
atomic_exchange_explicit(p, r, memory_order::seq_cst)
template<class T> shared_ptr<T> atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo);
template<class T> bool atomic_compare_exchange_weak(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
atomic_compare_exchange_weak_explicit(p, v, w, memory_order::seq_cst, memory_order::seq_cst)
template<class T> bool atomic_compare_exchange_strong(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
atomic_compare_exchange_strong_explicit(p, v, w, memory_order::seq_cst, memory_order::seq_cst)
template<class T> bool atomic_compare_exchange_weak_explicit( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w, memory_order success, memory_order failure); template<class T> bool atomic_compare_exchange_strong_explicit( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w, memory_order success, memory_order failure);
bool atomic_compare_exchange_weak_explicit( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w, memory_order success, memory_order failure); template<class T>
failure
*v
w
success
namespace std { template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>> class basic_string { public: void reserve(); }; }
void reserve();
capacity()
size()
NoteThis is a non-binding shrink to fit request.
namespace std { enum codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 }; template<class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0> class codecvt_utf8 : public codecvt<Elem, char, mbstate_t> { public: explicit codecvt_utf8(size_t refs = 0); ~codecvt_utf8(); }; template<class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0> class codecvt_utf16 : public codecvt<Elem, char, mbstate_t> { public: explicit codecvt_utf16(size_t refs = 0); ~codecvt_utf16(); }; template<class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0> class codecvt_utf8_utf16 : public codecvt<Elem, char, mbstate_t> { public: explicit codecvt_utf8_utf16(size_t refs = 0); ~codecvt_utf8_utf16(); }; }
The facet shall convert between UTF-8 multibyte sequences and UCS-2 or UTF-32 (depending on the size of Elem) within the program.
The facet shall convert between UTF-16 multibyte sequences and UCS-2 or UTF-32 (depending on the size of Elem) within the program.
namespace std { template<class Codecvt, class Elem = wchar_t, class WideAlloc = allocator<Elem>, class ByteAlloc = allocator<char>> class wstring_convert; template<class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>> class wbuffer_convert; }
namespace std { template<class Codecvt, class Elem = wchar_t, class WideAlloc = allocator<Elem>, class ByteAlloc = allocator<char>> class wstring_convert { public: using byte_string = basic_string<char, char_traits<char>, ByteAlloc>; using wide_string = basic_string<Elem, char_traits<Elem>, WideAlloc>; using state_type = typename Codecvt::state_type; using int_type = typename wide_string::traits_type::int_type; wstring_convert() : wstring_convert(new Codecvt) {} explicit wstring_convert(Codecvt* pcvt); wstring_convert(Codecvt* pcvt, state_type state); explicit wstring_convert(const byte_string& byte_err, const wide_string& wide_err = wide_string()); ~wstring_convert(); wstring_convert(const wstring_convert&) = delete; wstring_convert& operator=(const wstring_convert&) = delete; wide_string from_bytes(char byte); wide_string from_bytes(const char* ptr); wide_string from_bytes(const byte_string& str); wide_string from_bytes(const char* first, const char* last); byte_string to_bytes(Elem wchar); byte_string to_bytes(const Elem* wptr); byte_string to_bytes(const wide_string& wstr); byte_string to_bytes(const Elem* first, const Elem* last); size_t converted() const noexcept; state_type state() const; private: byte_string byte_err_string; // exposition only wide_string wide_err_string; // exposition only Codecvt* cvtptr; // exposition only state_type cvtstate; // exposition only size_t cvtcount; // exposition only }; }
basic_string<Elem, char_traits<Elem>, WideAlloc>
basic_string<char, char_traits<char>, ByteAlloc>
using byte_string = basic_string<char, char_traits<char>, ByteAlloc>;
first, last
using wide_string = basic_string<Elem, char_traits<Elem>, WideAlloc>;
explicit wstring_convert(Codecvt* pcvt); wstring_convert(Codecvt* pcvt, state_type state); explicit wstring_convert(const byte_string& byte_err, const wide_string& wide_err = wide_string());
namespace std { template<class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>> class wbuffer_convert : public basic_streambuf<Elem, Tr> { public: using state_type = typename Codecvt::state_type; wbuffer_convert() : wbuffer_convert(nullptr) {} explicit wbuffer_convert(streambuf* bytebuf, Codecvt* pcvt = new Codecvt, state_type state = state_type()); ~wbuffer_convert(); wbuffer_convert(const wbuffer_convert&) = delete; wbuffer_convert& operator=(const wbuffer_convert&) = delete; streambuf* rdbuf() const; streambuf* rdbuf(streambuf* bytebuf); state_type state() const; private: streambuf* bufptr; // exposition only Codecvt* cvtptr; // exposition only state_type cvtstate; // exposition only }; }
explicit wbuffer_convert( streambuf* bytebuf, Codecvt* pcvt = new Codecvt, state_type state = state_type());
ctype
codecvt<char16_t, char, mbstate_t> codecvt<char32_t, char, mbstate_t>
codecvt_byname<char16_t, char, mbstate_t> codecvt_byname<char32_t, char, mbstate_t>
codecvt<char16_t, char, mbstate_t>
codecvt<char32_t, char, mbstate_t>
template<class Source> path u8path(const Source& source); template<class InputIterator> path u8path(InputIterator first, InputIterator last);
source
Source
InputIterator
char
char8_t
If value_type is char and the current native narrow encoding ([fs.path.type.cvt]) is UTF-8, return path(source) or path(first, last); otherwise,
value_type
path(source)
path(first, last)
if value_type is wchar_t and the native wide encoding is UTF-16, or if value_type is char16_t or char32_t, convert source or [first, last) to a temporary, tmp, of type string_type and return path(tmp); otherwise,
tmp
string_type
path(tmp)
convert source or [first, last) to a temporary, tmp, of type u32string and return path(tmp).
u32string
namespace fs = std::filesystem; std::string utf8_string = read_utf8_data(); fs::create_directory(fs::u8path(utf8_string));
For POSIX-based operating systems with the native narrow encoding set to UTF-8, no encoding or type conversion occurs.
For POSIX-based operating systems with the native narrow encoding not set to UTF-8, a conversion to UTF-32 occurs, followed by a conversion to the current native narrow encoding. Some Unicode characters may have no native character set representation.
NoteThe example above is representative of a historical use of filesystem::u8path. To indicate a UTF-8 encoding, passing a std::u8string to path's constructor is preferred as it is consistent with path's handling of other encodings.
filesystem::u8path
std::u8string
path
namespace std { template<class T> void atomic_init(volatile atomic<T>*, typename atomic<T>::value_type) noexcept; template<class T> void atomic_init(atomic<T>*, typename atomic<T>::value_type) noexcept; #define ATOMIC_VAR_INIT(value) see below #define ATOMIC_FLAG_INIT see below }
atomic<T>::is_always_lock_free
void store(T desired, memory_order order = memory_order::seq_cst) volatile noexcept; T operator=(T desired) volatile noexcept; T load(memory_order order = memory_order::seq_cst) const volatile noexcept; operator T() const volatile noexcept; T exchange(T desired, memory_order order = memory_order::seq_cst) volatile noexcept; bool compare_exchange_weak(T& expected, T desired, memory_order success, memory_order failure) volatile noexcept; bool compare_exchange_strong(T& expected, T desired, memory_order success, memory_order failure) volatile noexcept; bool compare_exchange_weak(T& expected, T desired, memory_order order = memory_order::seq_cst) volatile noexcept; bool compare_exchange_strong(T& expected, T desired, memory_order order = memory_order::seq_cst) volatile noexcept; T fetch_key(T operand, memory_order order = memory_order::seq_cst) volatile noexcept; T operator op=(T operand) volatile noexcept; T* fetch_key(ptrdiff_t operand, memory_order order = memory_order::seq_cst) volatile noexcept;
template<class T> void atomic_init(volatile atomic<T>* object, typename atomic<T>::value_type desired) noexcept; template<class T> void atomic_init(atomic<T>* object, typename atomic<T>::value_type desired) noexcept;
void atomic_init(volatile atomic<T>* object, typename atomic<T>::value_type desired) noexcept; template<class T>
atomic_store_explicit(object, desired, memory_order::relaxed);
#define ATOMIC_VAR_INIT(value) see below
see below
NoteThis operation might need to initialize locks. Concurrent access to the variable being initialized, even via an atomic operation, constitutes a data race.
atomic<int> v = ATOMIC_VAR_INIT(5);
#define ATOMIC_FLAG_INIT see below
ATOMIC_FLAG_INIT
atomic_flag
atomic_flag guard = ATOMIC_FLAG_INIT;
Source: https://timsong-cpp.github.io/cppwp/n4950/depr
1 Scope [intro.scope] 2 Normative references [intro.refs] 3 Terms and definitions [intro.defs] 4 General principles [intro] 5 Lexical conventions [lex] 6 Basics [basic] 7 Expressions [expr] 8 Statements [stmt.stmt] 9 Declarations [dcl.dcl] 10 Modules [module] 11 Classes [class] 12 Overloading [over] 13 Templates [temp] 14 Exception handling [except] 15 Preprocessing directives [cpp] 16 Library introduction [library] 17 Language support library [support] 18 Concepts library [concepts] 19 Diagnostics library [diagnostics] 20 Memory management library [mem] 21 Metaprogramming library [meta] 22 General utilities library [utilities] 23 Strings library [strings] 24 Containers library [containers] 25 Iterators library [iterators] 26 Ranges library [ranges] 27 Algorithms library [algorithms] 28 Numerics library [numerics] 29 Time library [time] 30 Localization library [localization] 31 Input/output library [input.output] 32 Regular expressions library [re] 33 Concurrency support library [thread] Annex A (informative) Grammar summary [gram] Annex B (normative) Implementation quantities [implimits] Annex C (informative) Compatibility [diff] Annex D (normative) Compatibility features [depr] D.1 General [depr.general] D.2 Arithmetic conversion on enumerations [depr.arith.conv.enum] D.3 Implicit capture of *this by reference [depr.capture.this] D.4 Array comparisons [depr.array.comp] D.5 Deprecated volatile types [depr.volatile.type] D.6 Redeclaration of static constexpr data members [depr.static.constexpr] D.7 Non-local use of TU-local entities [depr.local] D.8 Implicit declaration of copy functions [depr.impldec] D.9 Literal operator function declarations using an identifier [depr.lit] D.10 template keyword before qualified names [depr.template.template] D.11 Requires paragraph [depr.res.on.required] D.12 has_denorm members in numeric_limits [depr.numeric.limits.has.denorm] D.13 Deprecated C macros [depr.c.macros] D.14 Relational operators [depr.relops] D.15 char* streams [depr.str.strstreams] D.16 Deprecated error numbers [depr.cerrno] D.17 The default allocator [depr.default.allocator] D.18 Deprecated polymorphic_allocator member function [depr.mem.poly.allocator.mem] D.19 Deprecated type traits [depr.meta.types] D.20 Tuple [depr.tuple] D.21 Variant [depr.variant] D.22 Deprecated iterator class template [depr.iterator] D.23 Deprecated move_iterator access [depr.move.iter.elem] D.24 Deprecated shared_ptr atomic access [depr.util.smartptr.shared.atomic] D.25 Deprecated basic_string capacity [depr.string.capacity] D.26 Deprecated standard code conversion facets [depr.locale.stdcvt] D.27 Deprecated convenience conversion interfaces [depr.conversions] D.28 Deprecated locale category facets [depr.locale.category] D.29 Deprecated filesystem path factory functions [depr.fs.path.factory] D.30 Deprecated atomic operations [depr.atomics] Annex E (informative) Conformance with UAX #31 [uaxid] Bibliography [bibliography] Index [generalindex] Index of grammar productions [grammarindex] Index of library headers [headerindex] Index of library names [libraryindex] Index of library concepts [conceptindex] Index of implementation-defined behavior [impldefindex]
int neck, tail; volatile int brachiosaur; brachiosaur = neck; // OK tail = brachiosaur; // OK tail = brachiosaur = neck; // deprecated brachiosaur += neck; // OK
operator string-literal identifier
template
namespace std { enum float_denorm_style { denorm_indeterminate = -1, denorm_absent = 0, denorm_present = 1 }; }
static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false;
has_denorm
has_denorm_loss
numeric_limits
numeric_limits<bool>
If n < 0, N is INT_MAX.[cpp23 1]
If (mode & app) != 0, then s shall designate the first element of an array of n elements that contains an ntbs whose first element is designated by s. The constructor is strstreambuf(s, n, s + std::strlen(s)).[cpp23 2]
#define ENODATA see below #define ENOSR see below #define ENOSTR see below #define ETIME see below
enum errc
no_message_available, // ENODATA no_stream_resources, // ENOSR not_a_stream, // ENOSTR stream_timeout, // ETIME
namespace std { template<class T> class allocator { public: using is_always_equal = true_type; }; }
namespace std::pmr { template<class Tp = byte> class polymorphic_allocator { public: template <class T> void destroy(T* p); }; }
template<class T> void destroy(T* p);
p->~T()
namespace std { template<class T> struct is_pod; template<class T> constexpr bool is_pod_v = is_pod<T>::value; template<size_t Len, size_t Align = default-alignment> // see below struct aligned_storage; template<size_t Len, size_t Align = default-alignment> // see below using aligned_storage_t = typename aligned_storage<Len, Align>::type; template<size_t Len, class... Types> struct aligned_union; template<size_t Len, class... Types> using aligned_union_t = typename aligned_union<Len, Types...>::type; }
template<size_t Len, size_t Align = default-alignment> struct aligned_storage;
default-alignment
Len
Align
alignof(T)
aligned_storage<Len, Align>::type
std::byte[Len]
alignas(Align)
aligned_storage
template<size_t Len, size_t Alignment> struct aligned_storage { typedef struct { alignas(Alignment) unsigned char __data[Len]; } type; };
template<size_t Len, class... Types> struct aligned_union;
Types
alignment_value
namespace std { template<class T> struct tuple_size<volatile T>; template<class T> struct tuple_size<const volatile T>; template<size_t I, class T> struct tuple_element<I, volatile T>; template<size_t I, class T> struct tuple_element<I, const volatile T>; }
🔗template<class T> struct tuple_size<volatile T>; template<class T> struct tuple_size<const volatile T>;
template<class T> struct tuple_size<volatile T>; template<class T> struct tuple_size<const volatile T>;
🔗template<size_t I, class T> struct tuple_element<I, volatile T>; template<size_t I, class T> struct tuple_element<I, const volatile T>;
template<size_t I, class T> struct tuple_element<I, volatile T>; template<size_t I, class T> struct tuple_element<I, const volatile T>;
🔗template<class T> struct variant_size<volatile T>; template<class T> struct variant_size<const volatile T>;
template<class T> struct variant_size<volatile T>; template<class T> struct variant_size<const volatile T>;
🔗template<size_t I, class T> struct variant_alternative<I, volatile T>; template<size_t I, class T> struct variant_alternative<I, const volatile T>;
template<size_t I, class T> struct variant_alternative<I, volatile T>; template<size_t I, class T> struct variant_alternative<I, const volatile T>;
UCS-2 is the same encoding as UTF-16, except that it encodes scalar values in the range U+0000–U+ffff (Basic Multilingual Plane) only.
The facet shall convert between UTF-8 multibyte sequences and UCS-2 or UTF-32 (depending on the size of Elem).
The facet shall convert between UTF-16 multibyte sequences and UCS-2 or UTF-32 (depending on the size of Elem).
namespace std { template<class T> void atomic_init(volatile atomic<T>*, typename atomic<T>::value_type) noexcept; template<class T> void atomic_init(atomic<T>*, typename atomic<T>::value_type) noexcept; #define ATOMIC_VAR_INIT(value) see below }
atomic
NoteThis operation possibly needs to initialize locks. Concurrent access to the variable being initialized, even via an atomic operation, constitutes a data race.