1 2 Completion Checklist for the Standard C++ Library 3 Updated: 2003-04-25 4 5 Status Code Legend: 6 M - Missing 7 S - Present as stub. 8 X - Partially implemented, or buggy. 9 T - Implemented, pending test/inspection. 10 V - Verified to pass all available test suites. 11 Q - Qualified by inspection for non-testable correctness. 12 P - Portability verified. 13 C - Certified. 14 15 Lexical notes: 16 Only status codes appear in column 0. Notes relating to conformance 17 issues appear [in brackets]. 18 19 Note that this checklist does not (yet) include all emendations 20 recommended by the ISO Library Working Group: 21 http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-toc.html 22 23 Detailed explanation of status codes: 24 25 M - Missing: The name is not visible to programs that include 26 the specified header, either at compile or link stage. 27 28 S - Present as stub: A program can use the name, but no implementation 29 is provided. Programs that use the name link correctly, but 30 cannot usefully be run. 31 32 X - Partially implemented, or buggy: Some implementation has been 33 provided, but it is known or believed not to conform fully. 34 It may have an incorrect base class, wrong namespace, wrong 35 storage class, or simply not fully implement requirements. 36 However, it may be sufficiently usable to help test other 37 components. 38 39 T - Implemented, pending test/inspection: Implementation believed 40 to be complete, and informal testing suggests it is ready for 41 formal verification. 42 43 V - Verified, passes all test suites: Verified to satisfy all 44 generically testable conformance requirements. 45 46 Q - Qualified by inspection for non-testable correctness: 47 Inspected, "implementation-defined" documentation accepted, 48 local usability criteria satisfied, formally inspected for 49 other untestable conformance. (Untestable requirements 50 include exception-safety, thread-safety, worst-case 51 complexity, memory cleanliness, usefulness.) 52 53 P - Portability verified: Qualified on all primary target platforms. 54 55 C - Certified: Formally certified to have passed all tests, 56 inspections, qualifications; approved under "signing authority" 57 to be used to satisfy contractual guarantees. 58 59 ---------------------------------------------------------------------- 60 <algorithm> <iomanip> <list> <ostream> <streambuf> 61 <bitset> <ios> <locale> <queue> <string> 62 <complex> <iosfwd> <map> <set> <typeinfo> 63X <deque> <iostream> <memory> <sstream> <utility> 64 <exception> <istream> <new> <stack> <valarray> 65 <fstream> <iterator> <numeric> <stdexcept> <vector> 66 <functional> <limits> 67 68 [C header names must be in std:: to qualify. Related to shadow/ dir.] 69 <cassert> <ciso646> <csetjmp> <cstdio> <ctime> 70 <cctype> <climits> <csignal> <cstdlib> <cwchar> 71X <cerrno> <clocale> <cstdarg> <cstring> <cwctype> 72 <cfloat> <cmath> <cstddef> 73 74 Macro: 75X errno, declared or defined in <cerrno>. 76 77 Macro fn: 78X setjmp(jmp_buf), declared or defined in <csetjmp> 79X va_end(va_list), declared or defined in <cstdarg> 80 81 Types: 82X clock_t, div_t, FILE, fpos_t, lconv, ldiv_t, mbstate_t, 83X ptrdiff_t, sig_atomic_t, size_t, time_t, tm, va_list, 84X wctrans_t, wctype_t, and wint_t. 85 86 1 Which of the functions in the C++ Standard Library are not reentrant 87 subroutines is implementation-defined. 88 89 18.1 Types [lib.support.types] 90X <cstddef> 91X NULL 92X offsetof 93X ptrdiff_t 94X size_t 95 96 18.2 Implementation properties [lib.support.limits] 97 98 <limits>, <climits>, and <cfloat> 99 100 18.2.1 Numeric limits [lib.limits] 101 102X template<class T> class numeric_limits; 103 104T enum float_round_style; 105T enum float_denorm_style; 106 107T template<> class numeric_limits<bool>; 108 109T template<> class numeric_limits<char>; 110T template<> class numeric_limits<signed char>; 111T template<> class numeric_limits<unsigned char>; 112T template<> class numeric_limits<wchar_t>; 113 114T template<> class numeric_limits<short>; 115T template<> class numeric_limits<int>; 116T template<> class numeric_limits<long>; 117T template<> class numeric_limits<unsigned short>; 118T template<> class numeric_limits<unsigned int>; 119T template<> class numeric_limits<unsigned long>; 120 121X template<> class numeric_limits<float>; 122X template<> class numeric_limits<double>; 123X template<> class numeric_limits<long double>; 124 125 18.2.1.1 Template class numeric_limits [lib.numeric.limits] 126T template<class T> class numeric_limits { 127 public: 128T static const bool is_specialized = false; 129T static T min() throw(); 130T static T max() throw(); 131T static const int digits = 0; 132T static const int digits10 = 0; 133T static const bool is_signed = false; 134T static const bool is_integer = false; 135T static const bool is_exact = false; 136T static const int radix = 0; 137T static T epsilon() throw(); 138T static T round_error() throw(); 139 140T static const int min_exponent = 0; 141T static const int min_exponent10 = 0; 142T static const int max_exponent = 0; 143T static const int max_exponent10 = 0; 144 145T static const bool has_infinity = false; 146T static const bool has_quiet_NaN = false; 147T static const bool has_signaling_NaN = false; 148T static const float_denorm_style has_denorm = denorm_absent; 149T static const bool has_denorm_loss = false; 150T static T infinity() throw(); 151T static T quiet_NaN() throw(); 152T static T signaling_NaN() throw(); 153T static T denorm_min() throw(); 154 155T static const bool is_iec559 = false; 156T static const bool is_bounded = false; 157T static const bool is_modulo = false; 158 159T static const bool traps = false; 160T static const bool tinyness_before = false; 161T static const float_round_style round_style = round_toward_zero; 162 }; 163 164 18.2.1.3 Type float_round_style [lib.round.style] 165 166T enum float_round_style { 167T round_indeterminate = -1, 168T round_toward_zero = 0, 169T round_to_nearest = 1, 170T round_toward_infinity = 2, 171T round_toward_neg_infinity = 3 172 }; 173 174 18.2.1.4 Type float_denorm_style [lib.denorm.style] 175 176T enum float_denorm_style { 177T denorm_indeterminate = -1; 178T denorm_absent = 0; 179T denorm present = 1; 180 }; 181 182 18.2.1.5 numeric_limits specializations [lib.numeric.special] 183 184 [Note: see Note at 18.2.1. ] 185 186 18.2.2 C Library [lib.c.limits] 187 188 1 Header <climits> (Table 3): 189 CHAR_BIT INT_MAX LONG_MIN SCHAR_MIN UCHAR_MAX USHRT_MAX 190X CHAR_MAX INT_MIN MB_LEN_MAX SHRT_MAX UINT_MAX 191 CHAR_MIN LONG_MAX SCHAR_MAX SHRT_MIN ULONG_MAX 192 193 3 Header <cfloat> (Table 4): 194 195 DBL_DIG DBL_MIN_EXP FLT_MIN_10_EXP LDBL_MAX_10_EXP 196 DBL_EPSILON FLT_DIG FLT_MIN_EXP LDBL_MAX_EXP 197 DBL_MANT_DIG FLT_EPSILON FLT_RADIX LDBL_MIN 198X DBL_MAX FLT_MANT_DIG FLT_ROUNDS LDBL_MIN_10_EXP 199 DBL_MAX_10_EXP FLT_MAX LDBL_DIG LDBL_MIN_EXP 200 DBL_MAX_EXP FLT_MAX_10_EXP LDBL_EPSILON 201 DBL_MIN FLT_MAX_EXP LDBL_MANT_DIG 202 DBL_MIN_10_EXP FLT_MIN LDBL_MAX 203 204 205 1 Header <cstdlib> (partial), Table 5: 206X EXIT_FAILURE EXIT_SUCCESS 207 abort atexit exit 208 209S abort(void) 210S extern "C" int atexit(void (*f)(void)) 211S extern "C++" int atexit(void (*f)(void)) 212S exit(int status) 213 214 18.4 Dynamic memory management [lib.support.dynamic] 215 216 Header <new> synopsis 217 218T class bad_alloc; 219T struct nothrow_t {}; 220T extern const nothrow_t nothrow; 221T typedef void (*new_handler)(); 222T new_handler set_new_handler(new_handler new_p) throw(); 223 224T void* operator new(std::size_t size) throw(std::bad_alloc); 225T void* operator new(std::size_t size, const std::nothrow_t&) throw(); 226T void operator delete(void* ptr) throw(); 227T void operator delete(void* ptr, const std::nothrow_t&) throw(); 228T void* operator new[](std::size_t size) throw(std::bad_alloc); 229T void* operator new[](std::size_t size, const std::nothrow_t&) throw(); 230T void operator delete[](void* ptr) throw(); 231T void operator delete[](void* ptr, const std::nothrow_t&) throw(); 232T void* operator new (std::size_t size, void* ptr) throw(); 233T void* operator new[](std::size_t size, void* ptr) throw(); 234T void operator delete (void* ptr, void*) throw(); 235T void operator delete[](void* ptr, void*) throw(); 236 237 18.4.2.1 Class bad_alloc [lib.bad.alloc] 238 239T class bad_alloc : public exception { 240 public: 241T bad_alloc() throw(); 242T bad_alloc(const bad_alloc&) throw(); 243T bad_alloc& operator=(const bad_alloc&) throw(); 244T virtual ~bad_alloc() throw(); 245T virtual const char* what() const throw(); 246 247 248 249T new_handler set_new_handler(new_handler new_p) throw(); 250 251 252 Header <typeinfo> synopsis 253 254T class type_info; 255T class bad_cast; 256T class bad_typeid; 257 258 18.5.1 - Class type_info [lib.type.info] 259 260T class type_info { 261 public: 262T virtual ~type_info(); 263T bool operator==(const type_info& rhs) const; 264T bool operator!=(const type_info& rhs) const; 265T bool before(const type_info& rhs) const; 266T const char* name() const; 267 private: 268T type_info(const type_info& rhs); 269T type_info& operator=(const type_info& rhs); 270 }; 271 272 18.5.2 - Class bad_cast [lib.bad.cast] 273 274T bad_cast() throw(); 275T virtual const char* bad_cast::what() const throw(); 276 277 18.5.3 Class bad_typeid [lib.bad.typeid] 278 279T class bad_typeid : public exception { 280 public: 281T bad_typeid() throw(); 282T bad_typeid(const bad_typeid&) throw(); 283T bad_typeid& operator=(const bad_typeid&) throw(); 284T virtual ~bad_typeid() throw(); 285T virtual const char* what() const throw(); 286 }; 287 288 18.6 Exception handling [lib.support.exception] 289 290T Header <exception> synopsis 291 292T class exception; 293T class bad_exception; 294 295T typedef void (*unexpected_handler)(); 296T unexpected_handler set_unexpected(unexpected_handler f) throw(); 297T void unexpected(); 298T typedef void (*terminate_handler)(); 299T terminate_handler set_terminate(terminate_handler f) throw(); 300T void terminate(); 301T bool uncaught_exception(); 302 303 18.6.1 Class exception [lib.exception] 304 305T class exception { 306 public: 307T exception() throw(); 308T exception(const exception&) throw(); 309T exception& operator=(const exception&) throw(); 310T virtual ~exception() throw(); 311T virtual const char* what() const throw(); 312 }; 313 314 18.6.2.1 Class bad_exception [lib.bad.exception] 315T class bad_exception : public exception { 316 public: 317T bad_exception() throw(); 318T bad_exception(const bad_exception&) throw(); 319T bad_exception& operator=(const bad_exception&) throw(); 320T virtual ~bad_exception() throw(); 321T virtual const char* what() const throw(); 322 }; 323 324 18.7 Other runtime support [lib.support.runtime] 325 326 1 Headers <cstdarg> (variable arguments), <csetjmp> (nonlocal jumps), 327 <ctime> (system clock clock(), time()), <csignal> (signal handling), 328 and <cstdlib> (runtime environment getenv(), system()). 329 330 Table 6--Header <cstdarg> synopsis 331 Macros: va_arg va_end va_start 332X Type: va_list 333 334 Table 7--Header <csetjmp> synopsis 335 336 Macro: setjmp | 337X Type: jmp_buf 338 Function: longjmp 339 340 Table 8--Header <ctime> synopsis 341 342 Macros: CLOCKS_PER_SEC 343X Types: clock_t 344 Functions: clock 345 346 Table 9--Header <csignal> synopsis 347 348X Macros: SIGABRT SIGILL SIGSEGV SIG_DFL 349 SIG_IGN SIGFPE SIGINT SIGTERM SIG_ERR 350 Type: sig_atomic_t 351 Functions: raise signal 352 353 Table 10--Header <cstdlib> synopsis 354 355X Functions: getenv system 356 357 19.1 Exception classes [lib.std.exceptions] 358 359 Header <stdexcept> synopsis 360 361T class logic_error; 362T class domain_error; 363T class invalid_argument; 364T class length_error; 365T class out_of_range; 366T class runtime_error; 367T class range_error; 368T class overflow_error; 369T class underflow_error; 370 371 19.1.1 Class logic_error [lib.logic.error] 372T class logic_error : public exception { 373 public: 374T explicit logic_error(const string& what_arg); 375 }; 376 377 19.1.2 Class domain_error [lib.domain.error] 378 379T class domain_error : public logic_error { 380 public: 381T explicit domain_error(const string& what_arg); 382 }; 383 384 19.1.3 Class invalid_argument [lib.invalid.argument] 385 386T class invalid_argument : public logic_error { 387 public: 388T explicit invalid_argument(const string& what_arg); 389 }; 390 391 19.1.4 Class length_error [lib.length.error] 392 393T class length_error : public logic_error { 394 public: 395T explicit length_error(const string& what_arg); 396 }; 397 398 19.1.5 Class out_of_range [lib.out.of.range] 399 400T class out_of_range : public logic_error { 401 public: 402T explicit out_of_range(const string& what_arg); 403 }; 404 405 406 19.1.6 Class runtime_error [lib.runtime.error] 407 408T class runtime_error : public exception { 409 public: 410T explicit runtime_error(const string& what_arg); 411 }; 412 413 414 19.1.7 Class range_error [lib.range.error] 415 416T class range_error : public runtime_error { 417 public: 418T explicit range_error(const string& what_arg); 419 }; 420 421 19.1.8 Class overflow_error [lib.overflow.error] 422 423T class overflow_error : public runtime_error { 424 public: 425T explicit overflow_error(const string& what_arg); 426 }; 427 428 429 19.1.9 Class underflow_error [lib.underflow.error] 430 431T class underflow_error : public runtime_error { 432 public: 433T explicit underflow_error(const string& what_arg); 434 }; 435 436 437 19.2 Assertions [lib.assertions] 438 439 Table 2--Header <cassert> synopsis 440 441X Macro: assert 442 443 19.3 Error numbers [lib.errno] 444 445 Table 3--Header <cerrno> synopsis 446 447X |Macros: EDOM ERANGE errno | 448 449 450 20.2 Utility components [lib.utility] 451 452 Header <utility> synopsis 453 454 // _lib.operators_, operators: 455T namespace rel_ops { 456T template<class T> bool operator!=(const T&, const T&); 457T template<class T> bool operator> (const T&, const T&); 458T template<class T> bool operator<=(const T&, const T&); 459T template<class T> bool operator>=(const T&, const T&); 460 } 461 // _lib.pairs_, pairs: 462T template <class T1, class T2> struct pair; 463T template <class T1, class T2> 464 bool operator==(const pair<T1,T2>&, const pair<T1,T2>&); 465T template <class T1, class T2> 466 bool operator< (const pair<T1,T2>&, const pair<T1,T2>&); 467T template <class T1, class T2> 468 bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&); 469T template <class T1, class T2> 470 bool operator> (const pair<T1,T2>&, const pair<T1,T2>&); 471T template <class T1, class T2> 472 bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&); 473T template <class T1, class T2> 474 bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&); 475T template <class T1, class T2> pair<T1,T2> make_pair(const T1&, const T2&); 476 477 478 20.2.2 Pairs [lib.pairs] 479 480T template <class T1, class T2> 481 struct pair { 482T typedef T1 first_type; 483T typedef T2 second_type; 484 485T T1 first; 486T T2 second; 487T pair(); 488T pair(const T1& x, const T2& y); 489T template<class U, class V> pair(const pair<U, V> &p); 490 }; 491 492 20.3 Function objects [lib.function.objects] 493 494 Header <functional> synopsis 495 496 // _lib.base_, base: 497V template <class Arg, class Result> struct unary_function; 498V template <class Arg1, class Arg2, class Result> struct binary_function; 499 500 // _lib.arithmetic.operations_, arithmetic operations: 501V template <class T> struct plus; 502V template <class T> struct minus; 503V template <class T> struct multiplies; 504V template <class T> struct divides; 505V template <class T> struct modulus; 506V template <class T> struct negate; 507 // _lib.comparisons_, comparisons: 508V template <class T> struct equal_to; 509V template <class T> struct not_equal_to; 510V template <class T> struct greater; 511V template <class T> struct less; 512V template <class T> struct greater_equal; 513V template <class T> struct less_equal; 514 // _lib.logical.operations_, logical operations: 515V template <class T> struct logical_and; 516V template <class T> struct logical_or; 517V template <class T> struct logical_not; 518 // _lib.negators_, negators: 519 template <class Predicate> struct unary_negate; 520V template <class Predicate> 521 unary_negate<Predicate> not1(const Predicate&); 522V template <class Predicate> struct binary_negate; 523V template <class Predicate> 524 binary_negate<Predicate> not2(const Predicate&); 525 // _lib.binders_, binders: 526V template <class Operation> class binder1st; 527V template <class Operation, class T> 528 binder1st<Operation> bind1st(const Operation&, const T&); 529V template <class Operation> class binder2nd; 530V template <class Operation, class T> 531 binder2nd<Operation> bind2nd(const Operation&, const T&); 532 // _lib.function.pointer.adaptors_, adaptors: 533V template <class Arg, class Result> class pointer_to_unary_function; 534V template <class Arg, class Result> 535 pointer_to_unary_function<Arg,Result> ptr_fun(Result (*)(Arg)); 536V template <class Arg1, class Arg2, class Result> 537 class pointer_to_binary_function; 538V template <class Arg1, class Arg2, class Result> 539 pointer_to_binary_function<Arg1,Arg2,Result> 540 ptr_fun(Result (*)(Arg1,Arg2)); 541 542 // _lib.member.pointer.adaptors_, adaptors: 543V template<class S, class T> class mem_fun_t; 544V template<class S, class T, class A> class mem_fun1_t; 545V template<class S, class T> 546 mem_fun_t<S,T> mem_fun(S (T::*f)()); 547V template<class S, class T, class A> 548 mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)); 549V template<class S, class T> class mem_fun_ref_t; 550V template<class S, class T, class A> class mem_fun1_ref_t; 551V template<class S, class T> 552 mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); 553V template<class S, class T, class A> 554 mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A)); 555 556V template <class S, class T> class const_mem_fun_t; 557V template <class S, class T, class A> class const_mem_fun1_t; 558V template <class S, class T> 559 const_mem_fun_t<S,T> mem_fun(S (T::*f)() const); 560V template <class S, class T, class A> 561 const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const); 562V template <class S, class T> class const_mem_fun_ref_t; 563V template <class S, class T, class A> class const_mem_fun1_ref_t; 564V template <class S, class T> 565 const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); 566V template <class S, class T, class A> 567 const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); 568 } 569 570 20.3.1 Base [lib.base] 571 572V template <class Arg, class Result> 573 struct unary_function { 574V typedef Arg argument_type; 575V typedef Result result_type; 576 }; 577V template <class Arg1, class Arg2, class Result> 578 struct binary_function { 579V typedef Arg1 first_argument_type; 580V typedef Arg2 second_argument_type; 581V typedef Result result_type; 582 }; 583 584 20.3.2 Arithmetic operations [lib.arithmetic.operations] 585 586T template <class T> struct plus : binary_function<T,T,T> { 587V T operator()(const T& x, const T& y) const; 588 }; 589 590T template <class T> struct minus : binary_function<T,T,T> { 591V T operator()(const T& x, const T& y) const; 592 }; 593 594T template <class T> struct multiplies : binary_function<T,T,T> { 595V T operator()(const T& x, const T& y) const; 596 }; 597 598T template <class T> struct divides : binary_function<T,T,T> { 599V T operator()(const T& x, const T& y) const; 600 }; 601 602T template <class T> struct modulus : binary_function<T,T,T> { 603V T operator()(const T& x, const T& y) const; 604 }; 605 606T template <class T> struct negate : unary_function<T,T> { 607V T operator()(const T& x) const; 608 }; 609 610 20.3.3 Comparisons [lib.comparisons] 611 612T template <class T> struct equal_to : binary_function<T,T,bool> { 613V bool operator()(const T& x, const T& y) const; 614 }; 615 616T template <class T> struct not_equal_to : binary_function<T,T,bool> { 617V bool operator()(const T& x, const T& y) const; 618 }; 619 620T template <class T> struct greater : binary_function<T,T,bool> { 621V bool operator()(const T& x, const T& y) const; 622 }; 623 624T template <class T> struct less : binary_function<T,T,bool> { 625V bool operator()(const T& x, const T& y) const; 626 }; 627 628T template <class T> struct greater_equal : binary_function<T,T,bool> { 629V bool operator()(const T& x, const T& y) const; 630 }; 631 632T template <class T> struct less_equal : binary_function<T,T,bool> { 633V bool operator()(const T& x, const T& y) const; 634 }; 635 636 20.3.4 Logical operations [lib.logical.operations] 637 638T template <class T> struct logical_and : binary_function<T,T,bool> { 639V bool operator()(const T& x, const T& y) const; 640 }; 641 642T template <class T> struct logical_or : binary_function<T,T,bool> { 643V bool operator()(const T& x, const T& y) const; 644 }; 645 646T template <class T> struct logical_not : unary_function<T,bool> { 647V bool operator()(const T& x) const; 648 }; 649 650 20.3.5 Negators [lib.negators] 651 652T template <class Predicate> 653 class unary_negate 654 : public unary_function<typename Predicate::argument_type,bool> { 655 public: 656T explicit unary_negate(const Predicate& pred); 657V bool operator()(const typename Predicate::argument_type& x) const; 658 }; 659 660T template <class Predicate> 661 class binary_negate 662 : public binary_function<typename Predicate::first_argument_type, 663 typename Predicate::second_argument_type, bool> { 664 public: 665T explicit binary_negate(const Predicate& pred); 666V bool operator()(const typename Predicate::first_argument_type& x, 667 const typename Predicate::second_argument_type& y) const; 668 }; 669 670 671 20.3.6 Binders [lib.binders] 672 673 20.3.6.1 Template class binder1st [lib.binder.1st] 674T template <class Operation> 675 class binder1st 676 : public unary_function<typename Operation::second_argument_type, 677 typename Operation::result_type> { 678 protected: 679T Operation op; 680T typename Operation::first_argument_type value; 681 public: 682V binder1st(const Operation& x, 683 const typename Operation::first_argument_type& y); 684V typename Operation::result_type 685 operator()(const typename Operation::second_argument_type& x) const; 686 }; 687 688 20.3.6.2 bind1st [lib.bind.1st] 689 690V template <class Operation, class T> 691 binder1st<Operation> bind1st(const Operation& op, const T& x); 692 693 20.3.6.3 Template class binder2nd [lib.binder.2nd] 694T template <class Operation> 695 class binder2nd 696 : public unary_function<typename Operation::first_argument_type, 697 typename Operation::result_type> { 698 protected: 699T Operation op; 700T typename Operation::second_argument_type value; 701 public: 702V binder2nd(const Operation& x, 703 const typename Operation::second_argument_type& y); 704V typename Operation::result_type 705 operator()(const typename Operation::first_argument_type& x) const; 706 }; 707 708 20.3.6.4 bind2nd [lib.bind.2nd] 709 710T template <class Operation, class T> 711 binder2nd<Operation> bind2nd(const Operation& op, const T& x); 712 713 714 20.3.7 Adaptors for pointers to [lib.function.pointer.adaptors] 715 functions 716 717 1 To allow pointers to (unary and binary) functions to work with func- 718 tion adaptors the library provides: 719 720T template <class Arg, class Result> 721 class pointer_to_unary_function : public unary_function<Arg, Result> { 722 public: 723T explicit pointer_to_unary_function(Result (*f)(Arg)); 724V Result operator()(Arg x) const; 725 }; 726 727T template <class Arg, class Result> 728 pointer_to_unary_function<Arg, Result> ptr_fun(Result (*f)(Arg)); 729 730T template <class Arg1, class Arg2, class Result> 731 class pointer_to_binary_function : 732 public binary_function<Arg1,Arg2,Result> { 733 public: 734T explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2)); 735V Result operator()(Arg1 x, Arg2 y) const; 736 }; 737 738 739 20.3.8 Adaptors for pointers to [lib.member.pointer.adaptors] 740 members 741 742T template <class S, class T> class mem_fun_t 743 : public unary_function<T*, S> { 744 public: 745T explicit mem_fun_t(S (T::*p)()); 746V S operator()(T* p) const; 747 }; 748 749T template <class S, class T, class A> class mem_fun1_t 750 : public binary_function<T*, A, S> { 751 public: 752T explicit mem_fun1_t(S (T::*p)(A)); 753V S operator()(T* p, A x) const; 754 }; 755 756V template<class S, class T> mem_fun_t<S,T> 757 mem_fun(S (T::*f)()); 758V template<class S, class T, class A> mem_fun1_t<S,T,A> 759 mem_fun(S (T::*f)(A)); 760 761T template <class S, class T> class mem_fun_ref_t 762 : public unary_function<T, S> { 763 public: 764T explicit mem_fun_ref_t(S (T::*p)()); 765V S operator()(T& p) const; 766 }; 767 768T template <class S, class T, class A> class mem_fun1_ref_t 769 : public binary_function<T, A, S> { 770 public: 771T explicit mem_fun1_ref_t(S (T::*p)(A)); 772V S operator()(T& p, A x) const; 773 }; 774 775T template<class S, class T> mem_fun_ref_t<S,T> 776 mem_fun_ref(S (T::*f)()); 777 778T template<class S, class T, class A> mem_fun1_ref_t<S,T,A> 779 mem_fun_ref(S (T::*f)(A)); 780 781T template <class S, class T> class const_mem_fun_t 782 : public unary_function<T*, S> { 783 public: 784T explicit const_mem_fun_t(S (T::*p)() const); 785V S operator()(const T* p) const; 786 }; 787 788T template <class S, class T, class A> class const_mem_fun1_t 789 : public binary_function<T*, A, S> { 790 public: 791T explicit const mem_fun1_t(S (T::*p)(A) const); 792V S operator()(const T* p, A x) const; 793 }; 794 795V template<class S, class T> const_mem_fun_t<S,T> 796 mem_fun(S (T::*f)() const); 797V template<class S, class T, class A> const_mem_fun1_t<S,T,A> 798 mem_fun(S (T::*f)(A) const); 799 800T template <class S, class T> class const_mem_fun_ref_t 801 : public unary_function<T, S> { 802 public: 803T explicit const_mem_fun_ref_t(S (T::*p)() const); 804V S operator()(const T& p) const; 805 }; 806 807T template <class S, class T, class A> class const_mem_fun1_ref_t 808 : public binary_function<T, A, S> { 809 public: 810T explicit const_mem_fun1_ref_t(S (T::*p)(A) const); 811V S operator()(const T& p, A x) const; 812 }; 813 814T template<class S, class T> const_mem_fun_ref_t<S,T> 815 mem_fun_ref(S (T::*f)() const); 816 817T template<class S, class T, class A> const_mem_fun1_ref_t<S,T,A> 818 mem_fun_ref(S (T::*f)(A) const); 819 820 20.4 Memory [lib.memory] 821 822 Header <memory> synopsis 823 824 // _lib.default.allocator_, the default allocator: 825T template <class T> class allocator; 826T template <> class allocator<void>; 827T template <class T, class U> 828 bool operator==(const allocator<T>&, const allocator<U>&) throw(); 829T template <class T, class U> 830 bool operator!=(const allocator<T>&, const allocator<U>&) throw(); 831 // _lib.storage.iterator_, raw storage iterator: 832T template <class OutputIterator, class T> class raw_storage_iterator; 833 // _lib.temporary.buffer_, temporary buffers: 834T template <class T> 835 pair<T*,ptrdiff_t> get_temporary_buffer(ptrdiff_t n); 836T template <class T> 837 void return_temporary_buffer(T* p); 838 // _lib.specialized.algorithms_, specialized algorithms: 839T template <class InputIterator, class ForwardIterator> 840 ForwardIterator 841 uninitialized_copy(InputIterator first, InputIterator last, 842 ForwardIterator result); 843T template <class ForwardIterator, class T> 844 void uninitialized_fill(ForwardIterator first, ForwardIterator last, 845 const T& x); 846T template <class ForwardIterator, class Size, class T> 847 void uninitialized_fill_n(ForwardIterator first, Size n, const T& x); 848 // _lib.auto.ptr_, pointers: 849X template<class X> class auto_ptr; 850 } 851 852 20.4.1 The default allocator [lib.default.allocator] 853 854T template <class T> class allocator; 855 // specialize for void: 856T template <> class allocator<void> { 857 public: 858T typedef void* pointer; 859T typedef const void* const_pointer; 860 // reference-to-void members are impossible. 861T typedef void value_type; 862T template <class U> struct rebind { typedef allocator<U> other; }; 863 }; 864 865T template <class T> class allocator { 866 public: 867T typedef size_t size_type; 868T typedef ptrdiff_t difference_type; 869T typedef T* pointer; 870T typedef const T* const_pointer; 871T typedef T& reference; 872T typedef const T& const_reference; 873T typedef T value_type; 874T template <class U> struct rebind { typedef allocator<U> other; }; 875T allocator() throw(); 876T allocator(const allocator&) throw(); 877T template <class U> allocator(const allocator<U>&) throw(); 878T ~allocator() throw(); 879T pointer address(reference x) const; 880T const_pointer address(const_reference x) const; 881T pointer allocate( 882 size_type, allocator<void>::const_pointer hint = 0); 883T void deallocate(pointer p, size_type n); 884T size_type max_size() const throw(); 885T void construct(pointer p, const T& val); 886T void destroy(pointer p); 887 }; 888 889 20.4.1.2 allocator globals [lib.allocator.globals] 890 891T template <class T1, class T2> 892 bool operator==(const allocator<T1>&, const allocator<T2>&) throw(); 893T template <class T1, class T2> 894 bool operator!=(const allocator<T1>&, const allocator<T2>&) throw(); 895 896 20.4.2 Raw storage iterator [lib.storage.iterator] 897 898T template <class OutputIterator, class T> 899 class raw_storage_iterator 900 : public iterator<output_iterator_tag,void,void,void,void> { 901 public: 902T explicit raw_storage_iterator(OutputIterator x); 903T raw_storage_iterator<OutputIterator,T>& operator*(); 904T raw_storage_iterator<OutputIterator,T>& operator=(const T& element); 905T raw_storage_iterator<OutputIterator,T>& operator++(); 906T raw_storage_iterator<OutputIterator,T> operator++(int); 907 }; 908 909 20.4.3 Temporary buffers [lib.temporary.buffer] 910 911T template <class T> 912 pair<T*, ptrdiff_t> get_temporary_buffer(ptrdiff_t n); 913 914T template <class T> void return_temporary_buffer(T* p); 915 916 20.4.4 Specialized algorithms [lib.specialized.algorithms] 917 918 20.4.4.1 uninitialized_copy [lib.uninitialized.copy] 919 920V template <class InputIterator, class ForwardIterator> 921 ForwardIterator 922 uninitialized_copy(InputIterator first, InputIterator last, 923 ForwardIterator result); 924 925 20.4.4.2 uninitialized_fill [lib.uninitialized.fill] 926 927V template <class ForwardIterator, class T> 928 void uninitialized_fill(ForwardIterator first, ForwardIterator last, 929 const T& x); 930 931 20.4.4.3 uninitialized_fill_n [lib.uninitialized.fill.n] 932 933V template <class ForwardIterator, class Size, class T> 934 void uninitialized_fill_n(ForwardIterator first, Size n, const T& x); 935 936 20.4.5 Template class auto_ptr [lib.auto.ptr] 937 938X template<class X> class auto_ptr { 939 template <class Y> struct auto_ptr_ref {}; 940 public: 941T typedef X element_type; 942 // _lib.auto.ptr.cons_ construct/copy/destroy: 943T explicit auto_ptr(X* p =0) throw(); 944T auto_ptr(auto_ptr&) throw(); 945T template<class Y> auto_ptr(auto_ptr<Y>&) throw(); 946T auto_ptr& operator=(auto_ptr&) throw(); 947T template<class Y> auto_ptr& operator=(auto_ptr<Y>&) throw(); 948T ~auto_ptr() throw(); 949 // _lib.auto.ptr.members_ members: 950T X& operator*() const throw(); 951T X* operator->() const throw(); 952T X* get() const throw(); 953T X* release() throw(); 954T void reset(X* p =0) throw(); 955 956 // _lib.auto.ptr.conv_ conversions: 957X auto_ptr(auto_ptr_ref<X>) throw(); 958X template<class Y> operator auto_ptr_ref<Y>() throw(); 959X template<class Y> operator auto_ptr<Y>() throw(); 960 }; 961 962 20.4.6 C Library [lib.c.malloc] 963 964 Table 7--Header <cstdlib> synopsis 965 966X Functions: calloc malloc 967 free realloc 968 969 970 Table 8--Header <cstring> synopsis 971 972X Macro: NULL 973X Type: size_t 974X Functions: memchr memcmp 975X memcpy memmove memset 976 977 Table 9--Header <ctime> synopsis 978 979X Macros: NULL 980X Types: size_t clock_t time_t 981X Struct: tm 982 Functions: 983X asctime clock difftime localtime strftime 984X ctime gmtime mktime time 985 986 21.1.1 Character traits requirements [lib.char.traits.require] 987 988 2 The struct template 989T template<class charT> struct char_traits; 990 shall be provided in the header <string> as a basis for explicit spe- 991 cializations. 992 993 994 21.1.3.1 struct [lib.char.traits.specializations.char] 995 char_traits<char> 996 997T template<> 998 struct char_traits<char> { 999T typedef char char_type; 1000T typedef int int_type; 1001T typedef streamoff off_type; 1002T typedef streampos pos_type; 1003T typedef mbstate_t state_type; 1004 1005T static void assign(char_type& c1, const char_type& c2); 1006T static bool eq(const char_type& c1, const char_type& c2); 1007T static bool lt(const char_type& c1, const char_type& c2); 1008 1009T static int compare(const char_type* s1, const char_type* s2, size_t n); 1010T static size_t length(const char_type* s); 1011T static const char_type* find(const char_type* s, size_t n, 1012 const char_type& a); 1013T static char_type* move(char_type* s1, const char_type* s2, size_t n); 1014T static char_type* copy(char_type* s1, const char_type* s2, size_t n); 1015T static char_type* assign(char_type* s, size_t n, char_type a); 1016 1017T static int_type not_eof(const int_type& c); 1018T static char_type to_char_type(const int_type& c); 1019T static int_type to_int_type(const char_type& c); 1020T static bool eq_int_type(const int_type& c1, const int_type& c2); 1021T static int_type eof(); 1022 }; 1023 1024 21.1.3.2 struct [lib.char.traits.specializations.wchar.t] 1025 char_traits<wchar_t> 1026 1027V template<> 1028 struct char_traits<wchar_t> { 1029V typedef wchar_t char_type; 1030V typedef wint_t int_type; 1031V typedef streamoff off_type; 1032V typedef wstreampos pos_type; 1033V typedef mbstate_t state_type; 1034 1035V static void assign(char_type& c1, const char_type& c2); 1036V static bool eq(const char_type& c1, const char_type& c2); 1037V static bool lt(const char_type& c1, const char_type& c2); 1038 1039V static int compare(const char_type* s1, const char_type* s2, size_t n); 1040V static size_t length(const char_type* s); 1041V static const char_type* find(const char_type* s, size_t n, 1042 const char_type& a); 1043V static char_type* move(char_type* s1, const char_type* s2, size_t n); 1044V static char_type* copy(char_type* s1, const char_type* s2, size_t n); 1045V static char_type* assign(char_type* s, size_t n, char_type a); 1046 1047V static int_type not_eof(const int_type& c); 1048V static char_type to_char_type(const int_type& c); 1049V static int_type to_int_type(const char_type& c); 1050V static bool eq_int_type(const int_type& c1, const int_type& c2); 1051V static int_type eof(); 1052 }; 1053 1054 21.2 String classes [lib.string.classes] 1055 1056 // _lib.char.traits_, character traits: 1057V template<class charT> 1058 struct char_traits; 1059V template <> struct char_traits<char>; 1060V template <> struct char_traits<wchar_t>; 1061 1062 // _lib.basic.string_, basic_string: 1063V template<class charT, class traits = char_traits<charT>, 1064 class Allocator = allocator<charT> > 1065 class basic_string; 1066V template<class charT, class traits, class Allocator> 1067 basic_string<charT,traits,Allocator> 1068 operator+(const basic_string<charT,traits,Allocator>& lhs, 1069 const basic_string<charT,traits,Allocator>& rhs); 1070V template<class charT, class traits, class Allocator> 1071 basic_string<charT,traits,Allocator> 1072 operator+(const charT* lhs, 1073 const basic_string<charT,traits,Allocator>& rhs); 1074V template<class charT, class traits, class Allocator> 1075 basic_string<charT,traits,Allocator> 1076 operator+(charT lhs, const basic_string<charT,traits,Allocator>& rhs); 1077V template<class charT, class traits, class Allocator> 1078 basic_string<charT,traits,Allocator> 1079 operator+(const basic_string<charT,traits,Allocator>& lhs, 1080 const charT* rhs); 1081V template<class charT, class traits, class Allocator> 1082 basic_string<charT,traits,Allocator> 1083 operator+(const basic_string<charT,traits,Allocator>& lhs, charT rhs); 1084 1085V template<class charT, class traits, class Allocator> 1086 bool operator==(const basic_string<charT,traits,Allocator>& lhs, 1087 const basic_string<charT,traits,Allocator>& rhs); 1088V template<class charT, class traits, class Allocator> 1089 bool operator==(const charT* lhs, 1090 const basic_string<charT,traits,Allocator>& rhs); 1091V template<class charT, class traits, class Allocator> 1092 bool operator==(const basic_string<charT,traits,Allocator>& lhs, 1093 const charT* rhs); 1094V template<class charT, class traits, class Allocator> 1095 bool operator!=(const basic_string<charT,traits,Allocator>& lhs, 1096 const basic_string<charT,traits,Allocator>& rhs); 1097V template<class charT, class traits, class Allocator> 1098 bool operator!=(const charT* lhs, 1099 const basic_string<charT,traits,Allocator>& rhs); 1100V template<class charT, class traits, class Allocator> 1101 bool operator!=(const basic_string<charT,traits,Allocator>& lhs, 1102 const charT* rhs); 1103V template<class charT, class traits, class Allocator> 1104 bool operator< (const basic_string<charT,traits,Allocator>& lhs, 1105 const basic_string<charT,traits,Allocator>& rhs); 1106V template<class charT, class traits, class Allocator> 1107 bool operator< (const basic_string<charT,traits,Allocator>& lhs, 1108 const charT* rhs); 1109V template<class charT, class traits, class Allocator> 1110 bool operator< (const charT* lhs, 1111 const basic_string<charT,traits,Allocator>& rhs); 1112V template<class charT, class traits, class Allocator> 1113 bool operator> (const basic_string<charT,traits,Allocator>& lhs, 1114 const basic_string<charT,traits,Allocator>& rhs); 1115V template<class charT, class traits, class Allocator> 1116 bool operator> (const basic_string<charT,traits,Allocator>& lhs, 1117 const charT* rhs); 1118V template<class charT, class traits, class Allocator> 1119 bool operator> (const charT* lhs, 1120 const basic_string<charT,traits,Allocator>& rhs); 1121V template<class charT, class traits, class Allocator> 1122 bool operator<=(const basic_string<charT,traits,Allocator>& lhs, 1123 const basic_string<charT,traits,Allocator>& rhs); 1124V template<class charT, class traits, class Allocator> 1125 bool operator<=(const basic_string<charT,traits,Allocator>& lhs, 1126 const charT* rhs); 1127V template<class charT, class traits, class Allocator> 1128 bool operator<=(const charT* lhs, 1129 const basic_string<charT,traits,Allocator>& rhs); 1130V template<class charT, class traits, class Allocator> 1131 bool operator>=(const basic_string<charT,traits,Allocator>& lhs, 1132 const basic_string<charT,traits,Allocator>& rhs); 1133V template<class charT, class traits, class Allocator> 1134 bool operator>=(const basic_string<charT,traits,Allocator>& lhs, 1135 const charT* rhs); 1136V template<class charT, class traits, class Allocator> 1137 bool operator>=(const charT* lhs, 1138 const basic_string<charT,traits,Allocator>& rhs); 1139 1140 // _lib.string.special_: 1141V template<class charT, class traits, class Allocator> 1142 void swap(basic_string<charT,traits,Allocator>& lhs, 1143 basic_string<charT,traits,Allocator>& rhs); 1144V template<class charT, class traits, class Allocator> 1145 basic_istream<charT,traits>& 1146 operator>>(basic_istream<charT,traits>& is, 1147 basic_string<charT,traits,Allocator>& str); 1148T template<class charT, class traits, class Allocator> 1149 basic_ostream<charT, traits>& 1150 operator<<(basic_ostream<charT, traits>& os, 1151 const basic_string<charT,traits,Allocator>& str); 1152V template<class charT, class traits, class Allocator> 1153 basic_istream<charT,traits>& 1154 getline(basic_istream<charT,traits>& is, 1155 basic_string<charT,traits,Allocator>& str, 1156 charT delim); 1157V template<class charT, class traits, class Allocator> 1158 basic_istream<charT,traits>& 1159 getline(basic_istream<charT,traits>& is, 1160 basic_string<charT,traits,Allocator>& str); 1161V typedef basic_string<char> string; 1162T typedef basic_string<wchar_t> wstring; 1163 } 1164 1165 21.3 Template class basic_string [lib.basic.string] 1166 1167V namespace std { 1168 template<class charT, class traits = char_traits<charT>, 1169 class Allocator = allocator<charT> > 1170 class basic_string { 1171 public: 1172 // types: 1173 typedef traits traits_type; 1174 typedef typename traits::char_type value_type; 1175 typedef Allocator allocator_type; 1176 typedef typename Allocator::size_type size_type; 1177 typedef typename Allocator::difference_type difference_type; 1178 typedef typename Allocator::reference reference; 1179 typedef typename Allocator::const_reference const_reference; 1180 typedef typename Allocator::pointer pointer; 1181 typedef typename Allocator::const_pointer const_pointer; 1182 typedef implementation defined iterator; 1183 typedef implementation defined const_iterator; 1184 typedef std::reverse_iterator<iterator> reverse_iterator; 1185 typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 1186 static const size_type npos = -1; 1187 1188 // _lib.string.cons_ construct/copy/destroy: 1189V explicit basic_string(const Allocator& a = Allocator()); 1190V basic_string(const basic_string& str, size_type pos = 0, 1191 size_type n = npos, const Allocator& a = Allocator()); 1192V basic_string(const charT* s, 1193 size_type n, const Allocator& a = Allocator()); 1194V basic_string(const charT* s, const Allocator& a = Allocator()); 1195V basic_string(size_type n, charT c, const Allocator& a = Allocator()); 1196V template<class InputIterator> 1197 basic_string(InputIterator begin, InputIterator end, 1198 const Allocator& a = Allocator()); 1199V ~basic_string(); 1200V basic_string& operator=(const basic_string& str); 1201V basic_string& operator=(const charT* s); 1202V basic_string& operator=(charT c); 1203 // _lib.string.iterators_ iterators: 1204V iterator begin(); 1205V const_iterator begin() const; 1206V iterator end(); 1207V const_iterator end() const; 1208 1209V reverse_iterator rbegin(); 1210V const_reverse_iterator rbegin() const; 1211V reverse_iterator rend(); 1212V const_reverse_iterator rend() const; 1213 // _lib.string.capacity_ capacity: 1214V size_type size() const; 1215V size_type length() const; 1216V size_type max_size() const; 1217V void resize(size_type n, charT c); 1218V void resize(size_type n); 1219V size_type capacity() const; 1220V void reserve(size_type res_arg = 0); 1221V void clear(); 1222V bool empty() const; 1223 // _lib.string.access_ element access: 1224V const_reference operator[](size_type pos) const; 1225V reference operator[](size_type pos); 1226V const_reference at(size_type n) const; 1227V reference at(size_type n); 1228 // _lib.string.modifiers_ modifiers: 1229V basic_string& operator+=(const basic_string& str); 1230V basic_string& operator+=(const charT* s); 1231V basic_string& operator+=(charT c); 1232V basic_string& append(const basic_string& str); 1233V basic_string& append(const basic_string& str, size_type pos, 1234 size_type n); 1235V basic_string& append(const charT* s, size_type n); 1236V basic_string& append(const charT* s); 1237V basic_string& append(size_type n, charT c); 1238V template<class InputIterator> 1239 basic_string& append(InputIterator first, InputIterator last); 1240V void push_back(const charT); 1241 1242V basic_string& assign(const basic_string&); 1243V basic_string& assign(const basic_string& str, size_type pos, 1244 size_type n); 1245V basic_string& assign(const charT* s, size_type n); 1246V basic_string& assign(const charT* s); 1247V basic_string& assign(size_type n, charT c); 1248V template<class InputIterator> 1249 basic_string& assign(InputIterator first, InputIterator last); 1250V basic_string& insert(size_type pos1, const basic_string& str); 1251V basic_string& insert(size_type pos1, const basic_string& str, 1252 size_type pos2, size_type n); 1253V basic_string& insert(size_type pos, const charT* s, size_type n); 1254V basic_string& insert(size_type pos, const charT* s); 1255V basic_string& insert(size_type pos, size_type n, charT c); 1256V iterator insert(iterator p, charT c); 1257V void insert(iterator p, size_type n, charT c); 1258V template<class InputIterator> 1259 void insert(iterator p, InputIterator first, InputIterator last); 1260V basic_string& erase(size_type pos = 0, size_type n = npos); 1261V iterator erase(iterator position); 1262V iterator erase(iterator first, iterator last); 1263V basic_string& replace(size_type pos1, size_type n1, 1264 const basic_string& str); 1265V basic_string& replace(size_type pos1, size_type n1, 1266 const basic_string& str, 1267 size_type pos2, size_type n2); 1268V basic_string& replace(size_type pos, size_type n1, const charT* s, 1269 size_type n2); 1270V basic_string& replace(size_type pos, size_type n1, const charT* s); 1271V basic_string& replace(size_type pos, size_type n1, size_type n2, 1272 charT c); 1273V basic_string& replace(iterator i1, iterator i2, const basic_string& str); 1274V basic_string& replace(iterator i1, iterator i2, const charT* s, 1275 size_type n); 1276V basic_string& replace(iterator i1, iterator i2, const charT* s); 1277V basic_string& replace(iterator i1, iterator i2, 1278 size_type n, charT c); 1279V template<class InputIterator> 1280 basic_string& replace(iterator i1, iterator i2, 1281 InputIterator j1, InputIterator j2); 1282V size_type copy(charT* s, size_type n, size_type pos = 0) const; 1283V void swap(basic_string<charT,traits,Allocator>&); 1284 // _lib.string.ops_ string operations: 1285V const charT* c_str() const; // explicit 1286V const charT* data() const; 1287V allocator_type get_allocator() const; 1288V size_type find (const basic_string& str, size_type pos = 0) const; 1289V size_type find (const charT* s, size_type pos, size_type n) const; 1290V size_type find (const charT* s, size_type pos = 0) const; 1291V size_type find (charT c, size_type pos = 0) const; 1292V size_type rfind(const basic_string& str, size_type pos = npos) const; 1293V size_type rfind(const charT* s, size_type pos, size_type n) const; 1294V size_type rfind(const charT* s, size_type pos = npos) const; 1295V size_type rfind(charT c, size_type pos = npos) const; 1296 1297V size_type find_first_of(const basic_string& str, 1298 size_type pos = 0) const; 1299V size_type find_first_of(const charT* s, 1300 size_type pos, size_type n) const; 1301V size_type find_first_of(const charT* s, size_type pos = 0) const; 1302V size_type find_first_of(charT c, size_type pos = 0) const; 1303V size_type find_last_of (const basic_string& str, 1304 size_type pos = npos) const; 1305V size_type find_last_of (const charT* s, 1306 size_type pos, size_type n) const; 1307V size_type find_last_of (const charT* s, size_type pos = npos) const; 1308V size_type find_last_of (charT c, size_type pos = npos) const; 1309V size_type find_first_not_of(const basic_string& str, 1310 size_type pos = 0) const; 1311V size_type find_first_not_of(const charT* s, size_type pos, 1312 size_type n) const; 1313V size_type find_first_not_of(const charT* s, size_type pos = 0) const; 1314V size_type find_first_not_of(charT c, size_type pos = 0) const; 1315V size_type find_last_not_of (const basic_string& str, 1316 size_type pos = npos) const; 1317V size_type find_last_not_of (const charT* s, size_type pos, 1318 size_type n) const; 1319V size_type find_last_not_of (const charT* s, 1320 size_type pos = npos) const; 1321V size_type find_last_not_of (charT c, size_type pos = npos) const; 1322V basic_string substr(size_type pos = 0, size_type n = npos) const; 1323V int compare(const basic_string& str) const; 1324V int compare(size_type pos1, size_type n1, 1325 const basic_string& str) const; 1326V int compare(size_type pos1, size_type n1, 1327 const basic_string& str, 1328 size_type pos2, size_type n2) const; 1329V int compare(const charT* s) const; 1330V int compare(size_type pos1, size_type n1, 1331 const charT* s, size_type n2 = npos) const; 1332 }; 1333 } 1334 1335 21.4 Null-terminated sequence utilities [lib.c.strings] 1336 1337 Table 10--Header <cctype> synopsis 1338 1339 isalnum isdigit isprint isupper tolower 1340X isalpha isgraph ispunct isxdigit toupper 1341 iscntrl islower isspace 1342 1343 Table 11--Header <cwctype> synopsis 1344 1345X Macro: WEOF <cwctype> 1346X Types: wctrans_t wctype_t wint_t <cwctype> 1347 Functions: 1348X iswalnum iswctype iswlower iswspace towctrans wctrans 1349X iswalpha iswdigit iswprint iswupper towlower wctype 1350X iswcntrl iswgraph iswpunct iswxdigit towupper 1351 1352 Table 12--Header <cstring> synopsis 1353 1354X Macro: NULL <cstring> 1355X Type: size_t <cstring> 1356 Functions: 1357X memchr strcat strcspn strncpy strtok 1358X memcmp strchr strerror strpbrk strxfrm 1359X memcpy strcmp strlen strrchr 1360X memmove strcoll strncat strspn 1361X memset strcpy strncmp strstr 1362 1363 Table 13--Header <cwchar> synopsis 1364 Macros: NULL <cwchar> WCHAR_MAX WCHAR_MIN WEOF <cwchar> 1365 Types: mbstate_t wint_t <cwchar> size_t 1366 Functions: 1367X btowc getwchar ungetwc wcscpy wcsrtombs wmemchr 1368X fgetwc mbrlen vfwprintf wcscspn wcsspn wmemcmp 1369X fgetws mbrtowc vswprintf wcsftime wcsstr wmemcpy 1370X fputwc mbsinit vwprintf wcslen wcstod wmemmove 1371X fputws mbsrtowcs wcrtomb wcsncat wcstok wmemset 1372X fwide putwc wcscat wcsncmp wcstol wprintf 1373X fwprintf putwchar wcschr wcsncpy wcstoul wscanf 1374X fwscanf swprintf wcscmp wcspbrk wcsxfrm 1375X getwc swscanf wcscoll wcsrchr wctob 1376 1377 Table 14--Header <cstdlib> synopsis 1378 1379 Macros: MB_CUR_MAX 1380 Functions: 1381X atol mblen strtod wctomb 1382X atof mbstowcs strtol wcstombs 1383X atoi mbtowc strtoul 1384 1385X const char* strchr(const char* s, int c); 1386X char* strchr( char* s, int c); 1387 1388X const char* strpbrk(const char* s1, const char* s2); 1389X char* strpbrk( char* s1, const char* s2); 1390 1391X const char* strrchr(const char* s, int c); 1392X char* strrchr( char* s, int c); 1393 1394X const char* strstr(const char* s1, const char* s2); 1395X char* strstr( char* s1, const char* s2); 1396 1397X const void* memchr(const void* s, int c, size_t n); 1398X void* memchr( void* s, int c, size_t n); 1399 1400X const wchar_t* wcschr(const wchar_t* s, wchar_t c); 1401X wchar_t* wcschr( wchar_t* s, wchar_t c); 1402 1403X const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); 1404X wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2); 1405 1406X const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); 1407X wchar_t* wcsrchr( wchar_t* s, wchar_t c); 1408 1409X const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); 1410X wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2); 1411 1412X const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); 1413X wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n); 1414 1415 [for initial efforts on the above, see shadow/string.h] 1416 1417 22.1 Locales [lib.locales] 1418 1419 Header <locale> synopsis 1420 1421 // _lib.locale_, locale: 1422T class locale; 1423T template <class Facet> const Facet& use_facet(const locale&); 1424T template <class Facet> bool has_facet(const locale&) throw(); 1425 1426 // _lib.locale.convenience_, convenience interfaces: 1427T template <class charT> bool isspace (charT c, const locale& loc); 1428T template <class charT> bool isprint (charT c, const locale& loc); 1429T template <class charT> bool iscntrl (charT c, const locale& loc); 1430T template <class charT> bool isupper (charT c, const locale& loc); 1431T template <class charT> bool islower (charT c, const locale& loc); 1432T template <class charT> bool isalpha (charT c, const locale& loc); 1433T template <class charT> bool isdigit (charT c, const locale& loc); 1434T template <class charT> bool ispunct (charT c, const locale& loc); 1435T template <class charT> bool isxdigit(charT c, const locale& loc); 1436T template <class charT> bool isalnum (charT c, const locale& loc); 1437T template <class charT> bool isgraph (charT c, const locale& loc); 1438T template <class charT> charT toupper(charT c, const locale& loc); 1439T template <class charT> charT tolower(charT c, const locale& loc); 1440 // _lib.category.ctype_ and _lib.facet.ctype.special_, ctype: 1441 class ctype_base; 1442T template <class charT> class ctype; 1443T template <> class ctype<char>; // specialization 1444S template <class charT> class ctype_byname; 1445S template <> class ctype_byname<char>; // specialization 1446T class codecvt_base; 1447X template <class internT, class externT, class stateT> class codecvt; 1448S template <class internT, class externT, class stateT> class codecvt_byname; 1449 // _lib.category.numeric_ and _lib.facet.numpunct_, numeric: 1450X template <class charT, class InputIterator> class num_get; 1451X template <class charT, class OutputIterator> class num_put; 1452T template <class charT> class numpunct; 1453S template <class charT> class numpunct_byname; 1454 // _lib.category.collate_, collation: 1455T template <class charT> class collate; 1456S template <class charT> class collate_byname; 1457 // _lib.category.time_, date and time: 1458T class time_base; 1459S template <class charT, class InputIterator> class time_get; 1460S template <class charT, class InputIterator> class time_get_byname; 1461S template <class charT, class OutputIterator> class time_put; 1462S template <class charT, class OutputIterator> class time_put_byname; 1463 // _lib.category.monetary_, money: 1464T class money_base; 1465S template <class charT, class InputIterator> class money_get; 1466S template <class charT, class OutputIterator> class money_put; 1467S template <class charT, bool Intl> class moneypunct; 1468S template <class charT, bool Intl> class moneypunct_byname; 1469 // _lib.category.messages_, message retrieval: 1470T class messages_base; 1471S template <class charT> class messages; 1472S template <class charT> class messages_byname; 1473 1474 1475 22.1.1 Class locale [lib.locale] 1476 1477X class locale { 1478 public: 1479 // types: 1480T class facet; 1481T class id; 1482T typedef int category; 1483T static const category // values assigned here are for exposition only 1484T none = 0, 1485T collate = 0x010, ctype = 0x020, 1486T monetary = 0x040, numeric = 0x080, 1487T time = 0x100, messages = 0x200, 1488T all = collate | ctype | monetary | numeric | time | messages; 1489 // construct/copy/destroy: 1490T locale() throw() 1491T locale(const locale& other) throw() 1492X explicit locale(const char* std_name); 1493X locale(const locale& other, const char* std_name, category); 1494T template <class Facet> locale(const locale& other, Facet* f); 1495T locale(const locale& other, const locale& one, category); 1496T ~locale() throw(); // non-virtual 1497T const locale& operator=(const locale& other) throw(); 1498T template <class Facet> locale combine(const locale& other) const; 1499 // locale operations: 1500X basic_string<char> name() const; 1501T bool operator==(const locale& other) const; 1502T bool operator!=(const locale& other) const; 1503T template <class charT, class Traits, class Allocator> 1504 bool operator()(const basic_string<charT,Traits,Allocator>& s1, 1505 const basic_string<charT,Traits,Allocator>& s2) const; 1506 // global locale objects: 1507T static locale global(const locale&); 1508T static const locale& classic(); 1509 }; 1510 1511 22.1.1.1 locale types [lib.locale.types] 1512 1513 22.1.1.1.1 Type locale::category [lib.locale.category] 1514 1515T typedef int category; 1516 1517T none, collate, ctype, monetary, numeric, time, and messages 1518 1519 [required locale members] 1520T collate<char>, collate<wchar_t> 1521T ctype<char>, ctype<wchar_t> 1522T codecvt<char,char,mbstate_t>, 1523S codecvt<wchar_t,char,mbstate_t> 1524T moneypunct<char>, moneypunct<wchar_t> 1525T moneypunct<char,true>, moneypunct<wchar_t,true>, 1526S money_get<char>, money_get<wchar_t 1527S money_put<char>, money_put<wchar_t> 1528T numpunct<char>, numpunct<wchar_t>, 1529X num_get<char>, num_get<wchar_t> 1530X num_put<char>, num_put<wchar_t> 1531S time_get<char>, time_get<wchar_t>, 1532S time_put<char>, time_put<wchar_t> 1533S messages<char>, messages<wchar_t> 1534 1535 [required instantiations] 1536S collate_byname<char>, collate_byname<wchar_t> 1537S ctype_byname<char>, ctype_byname<wchar_t> 1538S codecvt_byname<char,char,mbstate_t>, 1539S codecvt_byname<wchar_t,char,mbstate_t> 1540S moneypunct_byname<char,International>, 1541S moneypunct_byname<wchar_t,International>, 1542S money_get<C,InputIterator>, 1543S money_put<C,OutputIterator> 1544S numpunct_byname<char>, numpunct_byname<wchar_t> 1545X num_get<C,InputIterator>, num_put<C,OutputIterator> 1546S time_get<char,InputIterator>, 1547S time_get_byname<char,InputIterator>, 1548S time_get<wchar_t,OutputIterator>, 1549S time_get_byname<wchar_t,OutputIterator>, 1550S time_put<char,OutputIterator>, 1551S time_put_byname<char,OutputIterator>, 1552S time_put<wchar_t,OutputIterator> 1553S time_put_byname<wchar_t,OutputIterator> 1554S messages_byname<char>, messages_byname<wchar_t> 1555 1556 1557 22.1.1.1.2 Class locale::facet [lib.locale.facet] 1558 1559T class locale::facet { 1560 protected: 1561T explicit facet(size_t refs = 0); 1562T virtual ~facet(); 1563 private: 1564T facet(const facet&); // not defined 1565T void operator=(const facet&); // not defined 1566 }; 1567 } 1568 1569 1570 22.1.1.1.3 Class locale::id [lib.locale.id] 1571 1572T class locale::id { 1573 public: 1574T id(); 1575 private: 1576T void operator=(const id&); // not defined 1577T id(const id&); // not defined 1578 }; 1579 } 1580 1581 1582 22.2.1 The ctype category [lib.category.ctype] 1583 1584T class ctype_base { 1585 public: 1586T enum mask { // numeric values are for exposition only. 1587T space=, print=, cntrl=, upper=, lower=, 1588T alpha=, digit=, punct=, xdigit=, 1589T alnum=, graph= 1590 }; 1591 }; 1592 1593 1594 22.2.1.1 Template class ctype [lib.locale.ctype] 1595 1596T template <class charT> 1597 class ctype : public locale::facet, public ctype_base { 1598 public: 1599T typedef charT char_type; 1600T explicit ctype(size_t refs = 0); 1601T bool is(mask m, charT c) const; 1602T const charT* is(const charT* low, const charT* high, mask* vec) const; 1603T const charT* scan_is(mask m, 1604 const charT* low, const charT* high) const; 1605T const charT* scan_not(mask m, 1606 const charT* low, const charT* high) const; 1607T charT toupper(charT c) const; 1608T const charT* toupper(charT* low, const charT* high) const; 1609T charT tolower(charT c) const; 1610T const charT* tolower(charT* low, const charT* high) const; 1611T charT widen(char c) const; 1612T const char* widen(const char* low, const char* high, charT* to) const; 1613T char narrow(charT c, char dfault) const; 1614T const charT* narrow(const charT* low, const charT*, char dfault, 1615 char* to) const; 1616T static locale::id id; 1617 1618 protected: 1619T ~ctype(); // virtual 1620T virtual bool do_is(mask m, charT c) const; 1621T virtual const charT* do_is(const charT* low, const charT* high, 1622 mask* vec) const; 1623T virtual const charT* do_scan_is(mask m, 1624 const charT* low, const charT* high) const; 1625T virtual const charT* do_scan_not(mask m, 1626 const charT* low, const charT* high) const; 1627T virtual charT do_toupper(charT) const; 1628T virtual const charT* do_toupper(charT* low, const charT* high) const; 1629T virtual charT do_tolower(charT) const; 1630T virtual const charT* do_tolower(charT* low, const charT* high) const; 1631T virtual charT do_widen(char) const; 1632T virtual const char* do_widen(const char* low, const char* high, 1633 charT* dest) const; 1634T virtual char do_narrow(charT, char dfault) const; 1635T virtual const charT* do_narrow(const charT* low, const charT* high, 1636 char dfault, char* dest) const; 1637 }; 1638 1639 1640 22.2.1.2 Template class ctype_byname [lib.locale.ctype.byname] 1641 1642X template <class charT> 1643 class ctype_byname : public ctype<charT> { 1644 public: 1645T typedef ctype<charT>::mask mask; 1646S explicit ctype_byname(const char*, size_t refs = 0); 1647 protected: 1648S ~ctype_byname(); // virtual 1649S virtual bool do_is(mask m, charT c) const; 1650S virtual const charT* do_is(const charT* low, const charT* high, 1651 mask* vec) const; 1652S virtual const char* do_scan_is(mask m, 1653 const charT* low, const charT* high) const; 1654S virtual const char* do_scan_not(mask m, 1655 const charT* low, const charT* high) const; 1656S virtual charT do_toupper(charT) const; 1657S virtual const charT* do_toupper(charT* low, const charT* high) const; 1658S virtual charT do_tolower(charT) const; 1659S virtual const charT* do_tolower(charT* low, const charT* high) const; 1660S virtual charT do_widen(char) const; 1661S virtual const char* do_widen(const char* low, const char* high, 1662 charT* dest) const; 1663S virtual char do_narrow(charT, char dfault) const; 1664S virtual const charT* do_narrow(const charT* low, const charT* high, 1665 char dfault, char* dest) const; 1666 }; 1667 1668 22.2.1.3 ctype specializations [lib.facet.ctype.special] 1669 1670T template <> class ctype<char> 1671 : public locale::facet, public ctype_base { 1672 public: 1673T typedef char char_type; 1674T explicit ctype(const mask* tab = 0, bool del = false, 1675 size_t refs = 0); 1676T bool is(mask m, char c) const; 1677T const char* is(const char* low, const char* high, mask* vec) const; 1678T const char* scan_is (mask m, 1679 const char* low, const char* high) const; 1680T const char* scan_not(mask m, 1681 const char* low, const char* high) const; 1682T char toupper(char c) const; 1683T const char* toupper(char* low, const char* high) const; 1684T char tolower(char c) const; 1685T const char* tolower(char* low, const char* high) const; 1686T char widen(char c) const; 1687T const char* widen(const char* low, const char* high, char* to) const; 1688T char narrow(char c, char dfault) const; 1689T const char* narrow(const char* low, const char* high, char dfault, 1690 char* to) const; 1691T static locale::id id; 1692T static const size_t table_size = IMPLEMENTATION_DEFINED; 1693 1694 protected: 1695T const mask* table() const throw(); 1696T static const mask* classic_table() throw(); 1697T ~ctype(); // virtual 1698T virtual char do_toupper(char c) const; 1699T virtual const char* do_toupper(char* low, const char* high) const; 1700T virtual char do_tolower(char c) const; 1701T virtual const char* do_tolower(char* low, const char* high) const; 1702 1703T virtual char do_widen(char c) const; 1704T virtual const char* do_widen(const char* low, 1705 const char* high, 1706 char* to) const; 1707T virtual char do_narrow(char c, char dfault) const; 1708T virtual const char* do_narrow(const char* low, 1709 const char* high, 1710 char dfault, char* to) const; 1711 }; 1712 1713 1714 22.2.1.4 Class [lib.locale.ctype.byname.special] 1715 ctype_byname<char> 1716 1717X template <> class ctype_byname<char> : public ctype<char> { 1718 public: 1719S explicit ctype_byname(const char*, size_t refs = 0); 1720 protected: 1721S ~ctype_byname(); // virtual 1722S virtual char do_toupper(char c) const; 1723S virtual const char* do_toupper(char* low, const char* high) const; 1724S virtual char do_tolower(char c) const; 1725S virtual const char* do_tolower(char* low, const char* high) const; 1726 1727S virtual char do_widen(char c) const; 1728S virtual const char* do_widen(char* low, 1729 const char* high, 1730 char* to) const; 1731S virtual char do_widen(char c) const; 1732S virtual const char* do_widen(char* low, const char* high) const; 1733 1734 }; 1735 1736 1737 1738 22.2.1.5 Template class codecvt [lib.locale.codecvt] 1739 1740T class codecvt_base { 1741 public: 1742T enum result { ok, partial, error, noconv }; 1743 }; 1744 1745T template <class internT, class externT, class stateT> 1746 class codecvt : public locale::facet, public codecvt_base { 1747 public: 1748T typedef internT intern_type; 1749T typedef externT extern_type; 1750T typedef stateT state_type; 1751T explicit codecvt(size_t refs = 0) 1752T result out(stateT& state, 1753 const internT* from, const internT* from_end, const internT*& from_next, 1754 externT* to, externT* to_limit, externT*& to_next) const; 1755T result unshift(stateT& state, 1756 externT* to, externT* to_limit, externT*& to_next) const; 1757T result in(stateT& state, 1758 const externT* from, const externT* from_end, const externT*& from_next, 1759 internT* to, internT* to_limit, internT*& to_next) const; 1760T int encoding() const throw(); 1761T bool always_noconv() const throw(); 1762T int length(const stateT&, const externT* from, const externT* end, 1763 size_t max) const; 1764T int max_length() const throw(); 1765T static locale::id id; 1766 1767 protected: 1768T ~codecvt(); // virtual 1769T virtual result do_out(stateT& state, 1770 const internT* from, const internT* from_end, const internT*& from_next, 1771 externT* to, externT* to_limit, externT*& to_next) const; 1772T virtual result do_in(stateT& state, 1773T const externT* from, const externT* from_end, const externT*& from_next, 1774 internT* to, internT* to_limit, internT*& to_next) const; 1775T virtual result do_unshift(stateT& state, 1776 externT* to, externT* to_limit, externT*& to_next) const; 1777T virtual int do_encoding() const throw(); 1778T virtual bool do_always_noconv() const throw(); 1779T virtual int do_length(const stateT&, const externT* from, 1780 const externT* end, size_t max) const; 1781T virtual int do_max_length() const throw(); 1782 }; 1783 } 1784 1785 1786 22.2.1.6 Template class [lib.locale.codecvt.byname] 1787 codecvt_byname 1788 1789X template <class internT, class externT, class stateT> 1790 class codecvt_byname : public codecvt<internT, externT, stateT> { 1791 public: 1792S explicit codecvt_byname(const char*, size_t refs = 0); 1793 protected: 1794S ~codecvt_byname(); // virtual 1795S virtual result do_out(stateT& state, 1796 const internT* from, const internT* from_end, const internT*& from_next, 1797 externT* to, externT* to_limit, externT*& to_next) const; 1798S virtual result do_in(stateT& state, 1799 const externT* from, const externT* from_end, const externT*& from_next, 1800 internT* to, internT* to_limit, internT*& to_next) const; 1801S virtual result do_unshift(stateT& state, 1802 externT* to, externT* to_limit, externT*& to_next) const; 1803S virtual int do_encoding() const throw(); 1804S virtual bool do_always_noconv() const throw(); 1805S virtual int do_length(const stateT&, const externT* from, 1806 const externT* end, size_t max) const; 1807S virtual result do_unshift(stateT& state, 1808 externT* to, externT* to_limit, externT*& to_next) const; 1809S virtual int do_max_length() const throw(); 1810 }; 1811 1812 1813 22.2.2.1 Template class num_get [lib.locale.num.get] 1814 1815X template <class charT, class InputIterator = istreambuf_iterator<charT> > 1816 class num_get : public locale::facet { 1817 public: 1818T typedef charT char_type; 1819T typedef InputIterator iter_type; 1820T explicit num_get(size_t refs = 0); 1821T iter_type get(iter_type in, iter_type end, ios_base&, 1822 ios_base::iostate& err, bool& v) const; 1823T iter_type get(iter_type in, iter_type end, ios_base& , 1824 ios_base::iostate& err, long& v) const; 1825T iter_type get(iter_type in, iter_type end, ios_base&, 1826 ios_base::iostate& err, unsigned short& v) const; 1827T iter_type get(iter_type in, iter_type end, ios_base&, 1828 ios_base::iostate& err, unsigned int& v) const; 1829T iter_type get(iter_type in, iter_type end, ios_base&, 1830 ios_base::iostate& err, unsigned long& v) const; 1831T iter_type get(iter_type in, iter_type end, ios_base&, 1832 ios_base::iostate& err, float& v) const; 1833T iter_type get(iter_type in, iter_type end, ios_base&, 1834 ios_base::iostate& err, double& v) const; 1835T iter_type get(iter_type in, iter_type end, ios_base&, 1836 ios_base::iostate& err, long double& v) const; 1837T iter_type get(iter_type in, iter_type end, ios_base&, 1838 ios_base::iostate& err, void*& v) const; 1839T static locale::id id; 1840 1841 protected: 1842T ~num_get(); // virtual 1843T virtual iter_type do_get(iter_type, iter_type, ios_base&, 1844 ios_base::iostate& err, bool& v) const; 1845S virtual iter_type do_get(iter_type, iter_type, ios_base&, 1846 ios_base::iostate& err, long& v) const; 1847S virtual iter_type do_get(iter_type, iter_type, ios_base&, 1848 ios_base::iostate& err, unsigned short& v) const; 1849S virtual iter_type do_get(iter_type, iter_type, ios_base&, 1850 ios_base::iostate& err, unsigned int& v) const; 1851S virtual iter_type do_get(iter_type, iter_type, ios_base&, 1852 ios_base::iostate& err, unsigned long& v) const; 1853S virtual iter_type do_get(iter_type, iter_type, ios_base&, 1854 ios_base::iostate& err, float& v) const; 1855S virtual iter_type do_get(iter_type, iter_type, ios_base&, 1856 ios_base::iostate& err, double& v) const; 1857S virtual iter_type do_get(iter_type, iter_type, ios_base&, 1858 ios_base::iostate& err, long double& v) const; 1859S virtual iter_type do_get(iter_type, iter_type, ios_base&, 1860 ios_base::iostate& err, void*& v) const; 1861 }; 1862 1863 1864 1865 22.2.2.2 Template class num_put [lib.locale.nm.put] 1866 1867X template <class charT, class OutputIterator = ostreambuf_iterator<charT> > 1868 class num_put : public locale::facet { 1869 public: 1870T typedef charT char_type; 1871T typedef OutputIterator iter_type; 1872T explicit num_put(size_t refs = 0); 1873T iter_type put(iter_type s, ios_base& f, char_type fill, bool v) const; 1874T iter_type put(iter_type s, ios_base& f, char_type fill, long v) const; 1875T iter_type put(iter_type s, ios_base& f, char_type fill, 1876 unsigned long v) const; 1877T iter_type put(iter_type s, ios_base& f, char_type fill, 1878 double v) const; 1879T iter_type put(iter_type s, ios_base& f, char_type fill, 1880 long double v) const; 1881T iter_type put(iter_type s, ios_base& f, char_type fill, 1882 const void* v) const; 1883T static locale::id id; 1884 protected: 1885T ~num_put(); // virtual 1886T virtual iter_type do_put(iter_type, ios_base&, char_type fill, 1887 bool v) const; 1888T virtual iter_type do_put(iter_type, ios_base&, char_type fill, 1889 long v) const; 1890T virtual iter_type do_put(iter_type, ios_base&, char_type fill, 1891 unsigned long) const; 1892S virtual iter_type do_put(iter_type, ios_base&, char_type fill, 1893 double v) const; 1894S virtual iter_type do_put(iter_type, ios_base&, char_type fill, 1895 long double v) const; 1896T virtual iter_type do_put(iter_type, ios_base&, char_type fill, 1897 const void* v) const; 1898 }; 1899 } 1900 1901 22.2.3.1 Template class numpunct [lib.locale.numpunct] 1902 1903T template <class charT> 1904 class numpunct : public locale::facet { 1905 public: 1906T typedef charT char_type; 1907T typedef basic_string<charT> string_type; 1908T explicit numpunct(size_t refs = 0); 1909T char_type decimal_point() const; 1910T char_type thousands_sep() const; 1911T string grouping() const; 1912T string_type truename() const; 1913T string_type falsename() const; 1914T static locale::id id; 1915 protected: 1916T ~numpunct(); // virtual 1917T virtual char_type do_decimal_point() const; 1918T virtual char_type do_thousands_sep() const; 1919T virtual string do_grouping() const; 1920T virtual string_type do_truename() const; // for bool 1921T virtual string_type do_falsename() const; // for bool 1922 }; 1923 } 1924 1925 1926 1927 22.2.3.2 Template class [lib.locale.numpunct.byname] 1928 numpunct_byname 1929 1930X template <class charT> 1931 class numpunct_byname : public numpunct<charT> { 1932 // this class is specialized for char and wchar_t. 1933 public: 1934T typedef charT char_type; 1935T typedef basic_string<charT> string_type; 1936S explicit numpunct_byname(const char*, size_t refs = 0); 1937 protected: 1938S ~numpunct_byname(); // virtual 1939S virtual char_type do_decimal_point() const; 1940S virtual char_type do_thousands_sep() const; 1941S virtual string do_grouping() const; 1942S virtual string_type do_truename() const; // for bool 1943S virtual string_type do_falsename() const; // for bool 1944 }; 1945 1946 1947 22.2.4.1 Template class collate [lib.locale.collate] 1948 1949T template <class charT> 1950 class collate : public locale::facet { 1951 public: 1952T typedef charT char_type; 1953T typedef basic_string<charT> string_type; 1954T explicit collate(size_t refs = 0); 1955T int compare(const charT* low1, const charT* high1, 1956 const charT* low2, const charT* high2) const; 1957T string_type transform(const charT* low, const charT* high) const; 1958T long hash(const charT* low, const charT* high) const; 1959T static locale::id id; 1960 protected: 1961T ~collate(); // virtual 1962T virtual int do_compare(const charT* low1, const charT* high1, 1963 const charT* low2, const charT* high2) const; 1964T virtual string_type do_transform 1965 (const charT* low, const charT* high) const; 1966T virtual long do_hash (const charT* low, const charT* high) const; 1967 }; 1968 1969 1970 22.2.4.2 Template class [lib.locale.collate.byname] 1971 collate_byname 1972 1973X template <class charT> 1974 class collate_byname : public collate<charT> { 1975 public: 1976T typedef basic_string<charT> string_type; 1977T explicit collate_byname(const char*, size_t refs = 0); 1978 protected: 1979S ~collate_byname(); // virtual 1980S virtual int do_compare(const charT* low1, const charT* high1, 1981 const charT* low2, const charT* high2) const; 1982S virtual string_type do_transform 1983 (const charT* low, const charT* high) const; 1984S virtual long do_hash (const charT* low, const charT* high) const; 1985 }; 1986 1987 1988 22.2.5.1 Template class time_get [lib.locale.time.get] 1989 1990T class time_base { 1991 public: 1992T enum dateorder { no_order, dmy, mdy, ymd, ydm }; 1993 }; 1994 1995 [Note: semantics of time_get members are implementation-defined. 1996 To complete implementation requires documenting behavior.] 1997 1998X template <class charT, class InputIterator = istreambuf_iterator<charT> > 1999 class time_get : public locale::facet, public time_base { 2000 public: 2001T typedef charT char_type; 2002T typedef InputIterator iter_type; 2003T explicit time_get(size_t refs = 0); 2004 2005T dateorder date_order() const { return do_date_order(); } 2006T iter_type get_time(iter_type s, iter_type end, ios_base& f, 2007 ios_base::iostate& err, tm* t) const; 2008T iter_type get_date(iter_type s, iter_type end, ios_base& f, 2009 ios_base::iostate& err, tm* t) const; 2010T iter_type get_weekday(iter_type s, iter_type end, ios_base& f, 2011 ios_base::iostate& err, tm* t) const; 2012T iter_type get_monthname(iter_type s, iter_type end, ios_base& f, 2013 ios_base::iostate& err, tm* t) const; 2014T iter_type get_year(iter_type s, iter_type end, ios_base& f, 2015 ios_base::iostate& err, tm* t) const; 2016T static locale::id id; 2017 protected: 2018 ~time_get(); // virtual 2019X virtual dateorder do_date_order() const; 2020S virtual iter_type do_get_time(iter_type s, iter_type end, ios_base&, 2021 ios_base::iostate& err, tm* t) const; 2022S virtual iter_type do_get_date(iter_type s, iter_type end, ios_base&, 2023 ios_base::iostate& err, tm* t) const; 2024S virtual iter_type do_get_weekday(iter_type s, iter_type end, ios_base&, 2025 ios_base::iostate& err, tm* t) const; 2026S virtual iter_type do_get_monthname(iter_type s, ios_base&, 2027 ios_base::iostate& err, tm* t) const; 2028S virtual iter_type do_get_year(iter_type s, iter_type end, ios_base&, 2029 ios_base::iostate& err, tm* t) const; 2030 }; 2031 2032 2033 2034 22.2.5.2 Template class [lib.locale.time.get.byname] 2035 time_get_byname 2036 2037X template <class charT, class InputIterator = istreambuf_iterator<charT> > 2038 class time_get_byname : public time_get<charT, InputIterator> { 2039 public: 2040T typedef time_base::dateorder dateorder; 2041T typedef InputIterator iter_type 2042 2043S explicit time_get_byname(const char*, size_t refs = 0); 2044 protected: 2045S ~time_get_byname(); // virtual 2046S virtual dateorder do_date_order() const; 2047S virtual iter_type do_get_time(iter_type s, iter_type end, ios_base&, 2048 ios_base::iostate& err, tm* t) const; 2049S virtual iter_type do_get_date(iter_type s, iter_type end, ios_base&, 2050 ios_base::iostate& err, tm* t) const; 2051T virtual iter_type do_get_weekday(iter_type s, iter_type end, ios_base&, 2052 ios_base::iostate& err, tm* t) const; 2053T virtual iter_type do_get_monthname(iter_type s, iter_type end, ios_base&, 2054 ios_base::iostate& err, tm* t) const; 2055S virtual iter_type do_get_year(iter_type s, iter_type end, ios_base&, 2056 ios_base::iostate& err, tm* t) const; 2057 }; 2058 } 2059 2060 22.2.5.3 Template class time_put [lib.locale.time.put] 2061 2062X template <class charT, class OutputIterator = ostreambuf_iterator<charT> > 2063 class time_put : public locale::facet { 2064 public: 2065T typedef charT char_type; 2066T typedef OutputIterator iter_type; 2067T explicit time_put(size_t refs = 0); 2068 // the following is implemented in terms of other member functions. 2069S iter_type put(iter_type s, ios_base& f, char_type fill, const tm* tmb, 2070 const charT* pattern, const charT* pat_end) const; 2071T iter_type put(iter_type s, ios_base& f, char_type fill, 2072 const tm* tmb, char format, char modifier = 0) const; 2073T static locale::id id; 2074 protected: 2075T ~time_put(); // virtual 2076S virtual iter_type do_put(iter_type s, ios_base&, char_type, const tm* t, 2077 char format, char modifier) const; 2078 }; 2079 2080 2081 2082 22.2.5.4 Template class [lib.locale.time.put.byname] 2083 time_put_byname 2084 2085T template <class charT, class OutputIterator = ostreambuf_iterator<charT> > 2086 class time_put_byname : public time_put<charT, OutputIterator> 2087 { 2088 public: 2089T typedef charT char_type; 2090T typedef OutputIterator iter_type; 2091 2092T explicit time_put_byname(const char*, size_t refs = 0); 2093 protected: 2094T ~time_put_byname(); // virtual 2095S virtual iter_type do_put(iter_type s, ios_base&, char_type, const tm* t, 2096 char format, char modifier) const; 2097 }; 2098 2099 2100 22.2.6.1 Template class money_get [lib.locale.money.get] 2101 2102X template <class charT, 2103 class InputIterator = istreambuf_iterator<charT> > 2104 class money_get : public locale::facet { 2105 public: 2106T typedef charT char_type; 2107T typedef InputIterator iter_type; 2108T typedef basic_string<charT> string_type; 2109T explicit money_get(size_t refs = 0); 2110T iter_type get(iter_type s, iter_type end, bool intl, 2111 ios_base& f, ios_base::iostate& err, 2112 long double& units) const; 2113T iter_type get(iter_type s, iter_type end, bool intl, 2114 ios_base& f, ios_base::iostate& err, 2115 string_type& digits) const; 2116T static locale::id id; 2117 protected: 2118T ~money_get(); // virtual 2119S virtual iter_type do_get(iter_type, iter_type, bool, ios_base&, 2120 ios_base::iostate& err, long double& units) const; 2121S virtual iter_type do_get(iter_type, iter_type, bool, ios_base&, 2122 ios_base::iostate& err, string_type& digits) const; 2123 }; 2124 2125 22.2.6.2 Template class money_put [lib.locale.money.put] 2126 2127X template <class charT, 2128 class OutputIterator = ostreambuf_iterator<charT> > 2129 class money_put : public locale::facet { 2130 public: 2131T typedef charT char_type; 2132T typedef OutputIterator iter_type; 2133T typedef basic_string<charT> string_type; 2134T explicit money_put(size_t refs = 0); 2135T iter_type put(iter_type s, bool intl, ios_base& f, 2136 char_type fill, long double units) const; 2137T iter_type put(iter_type s, bool intl, ios_base& f, 2138 char_type fill, const string_type& digits) const; 2139T static locale::id id; 2140 2141 protected: 2142T ~money_put(); // virtual 2143S virtual iter_type 2144 do_put(iter_type, bool, ios_base&, char_type fill, 2145 long double units) const; 2146S virtual iter_type 2147 do_put(iter_type, bool, ios_base&, char_type fill, 2148 const string_type& digits) const; 2149 }; 2150 2151 2152 22.2.6.3 Template class moneypunct [lib.locale.moneypunct] 2153 2154T class money_base { 2155 public: 2156T enum part { none, space, symbol, sign, value }; 2157T struct pattern { char field[4]; }; 2158 }; 2159 2160X template <class charT, bool International = false> 2161 class moneypunct : public locale::facet, public money_base { 2162 public: 2163T typedef charT char_type; 2164T typedef basic_string<charT> string_type; 2165T explicit moneypunct(size_t refs = 0); 2166T charT decimal_point() const; 2167T charT thousands_sep() const; 2168T string grouping() const; 2169T string_type curr_symbol() const; 2170T string_type positive_sign() const; 2171T string_type negative_sign() const; 2172T int frac_digits() const; 2173T pattern pos_format() const; 2174T pattern neg_format() const; 2175T static locale::id id; 2176T static const bool intl = International; 2177 protected: 2178T ~moneypunct(); // virtual 2179S virtual charT do_decimal_point() const; 2180S virtual charT do_thousands_sep() const; 2181S virtual string do_grouping() const; 2182S virtual string_type do_curr_symbol() const; 2183S virtual string_type do_positive_sign() const; 2184S virtual string_type do_negative_sign() const; 2185S virtual int do_frac_digits() const; 2186T virtual pattern do_pos_format() const; 2187T virtual pattern do_neg_format() const; 2188 }; 2189 } 2190 2191 22.2.6.4 Template class [lib.locale.moneypunct.byname] 2192 moneypunct_byname 2193 2194X template <class charT, bool Intl = false> 2195 class moneypunct_byname : public moneypunct<charT, Intl> { 2196 public: 2197T typedef money_base::pattern pattern; 2198T typedef basic_string<charT> string_type; 2199 2200T explicit moneypunct_byname(const char*, size_t refs = 0); 2201 protected: 2202T ~moneypunct_byname(); // virtual 2203S virtual charT do_decimal_point() const; 2204S virtual charT do_thousands_sep() const; 2205S virtual string do_grouping() const; 2206S virtual string_type do_curr_symbol() const; 2207S virtual string_type do_positive_sign() const; 2208S virtual string_type do_negative_sign() const; 2209S virtual int do_frac_digits() const; 2210S virtual pattern do_pos_format() const; 2211S virtual pattern do_neg_format() const; 2212 }; 2213 2214 22.2.7.1 Template class messages [lib.locale.messages] 2215 2216T class messages_base { 2217 public: 2218T typedef int catalog; 2219 }; 2220 2221X template <class charT> 2222 class messages : public locale::facet, public messages_base { 2223 public: 2224T typedef charT char_type; 2225T typedef basic_string<charT> string_type; 2226T explicit messages(size_t refs = 0); 2227T catalog open(const basic_string<char>& fn, const locale&) const; 2228T string_type get(catalog c, int set, int msgid, 2229 const string_type& dfault) const; 2230T void close(catalog c) const; 2231T static locale::id id; 2232 protected: 2233T ~messages(); // virtual 2234S virtual catalog do_open(const basic_string<char>&, const locale&) const; 2235S virtual string_type do_get(catalog, int set, int msgid, 2236 const string_type& dfault) const; 2237S virtual void do_close(catalog) const; 2238 }; 2239 2240 22.2.7.2 Template class [lib.locale.messages.byname] 2241 messages_byname 2242 2243 2244X template <class charT> 2245 class messages_byname : public messages<charT> { 2246 public: 2247T typedef messages_base::catalog catalog; 2248T typedef basic_string<charT> string_type; 2249 2250T explicit messages_byname(const char*, size_t refs = 0); 2251 protected: 2252T ~messages_byname(); // virtual 2253S virtual catalog do_open(const basic_string<char>&, const locale&) const; 2254S virtual string_type do_get(catalog, int set, int msgid, 2255 const string_type& dfault) const; 2256S virtual void do_close(catalog) const; 2257 }; 2258 2259 2260 22.3 C Library Locales [lib.c.locales] 2261 2262 2263 Table 13--Header <clocale> synopsis 2264 Macros: 2265X LC_ALL LC_COLLATE LC_CTYPE 2266X LC_MONETARY LC_NUMERIC LC_TIME 2267X NULL 2268X Struct: lconv 2269X Functions: localeconv setlocale 2270 2271 2272 23.2 Sequences [lib.sequences] 2273 2274 <deque>, <list>, <queue>, <stack>, and <vector>. 2275 2276 Header <deque> synopsis 2277 2278T template <class T, class Allocator = allocator<T> > class deque; 2279T template <class T, class Allocator> 2280 bool operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y); 2281T template <class T, class Allocator> 2282 bool operator< (const deque<T,Allocator>& x, const deque<T,Allocator>& y); 2283T template <class T, class Allocator> 2284 bool operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); 2285T template <class T, class Allocator> 2286 bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y); 2287T template <class T, class Allocator> 2288 bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); 2289T template <class T, class Allocator> 2290 bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); 2291T template <class T, class Allocator> 2292 void swap(deque<T,Allocator>& x, deque<T,Allocator>& y); 2293 } 2294 2295 Header <list> synopsis 2296 2297T template <class T, class Allocator = allocator<T> > class list; 2298T template <class T, class Allocator> 2299 bool operator==(const list<T,Allocator>& x, const list<T,Allocator>& y); 2300T template <class T, class Allocator> 2301 bool operator< (const list<T,Allocator>& x, const list<T,Allocator>& y); 2302T template <class T, class Allocator> 2303 bool operator!=(const list<T,Allocator>& x, const list<T,Allocator>& y); 2304T template <class T, class Allocator> 2305 bool operator> (const list<T,Allocator>& x, const list<T,Allocator>& y); 2306T template <class T, class Allocator> 2307 bool operator>=(const list<T,Allocator>& x, const list<T,Allocator>& y); 2308T template <class T, class Allocator> 2309 bool operator<=(const list<T,Allocator>& x, const list<T,Allocator>& y); 2310T template <class T, class Allocator> 2311 void swap(list<T,Allocator>& x, list<T,Allocator>& y); 2312 } 2313 2314 Header <queue> synopsis 2315 2316 namespace std { 2317T template <class T, class Container = deque<T> > class queue; 2318T template <class T, class Container> 2319 bool operator==(const queue<T, Container>& x, 2320 const queue<T, Container>& y); 2321T template <class T, class Container> 2322 bool operator< (const queue<T, Container>& x, 2323 const queue<T, Container>& y); 2324T template <class T, class Container> 2325 bool operator!=(const queue<T, Container>& x, 2326 const queue<T, Container>& y); 2327T template <class T, class Container> 2328 bool operator> (const queue<T, Container>& x, 2329 const queue<T, Container>& y); 2330T template <class T, class Container> 2331 bool operator>=(const queue<T, Container>& x, 2332 const queue<T, Container>& y); 2333T template <class T, class Container> 2334 bool operator<=(const queue<T, Container>& x, 2335 const queue<T, Container>& y); 2336T template <class T, class Container = vector<T>, 2337 class Compare = less<typename Container::value_type> > 2338T class priority_queue; 2339 } 2340 2341 Header <stack> synopsis 2342 2343 namespace std { 2344T template <class T, class Container = deque<T> > class stack; 2345T template <class T, class Container> 2346 bool operator==(const stack<T, Container>& x, 2347 const stack<T, Container>& y); 2348T template <class T, class Container> 2349 bool operator< (const stack<T, Container>& x, 2350 const stack<T, Container>& y); 2351T template <class T, class Container> 2352 bool operator!=(const stack<T, Container>& x, 2353 const stack<T, Container>& y); 2354T template <class T, class Container> 2355 bool operator> (const stack<T, Container>& x, 2356 const stack<T, Container>& y); 2357T template <class T, class Container> 2358 bool operator>=(const stack<T, Container>& x, 2359 const stack<T, Container>& y); 2360T template <class T, class Container> 2361 bool operator<=(const stack<T, Container>& x, 2362 const stack<T, Container>& y); 2363 } 2364 2365 Header <vector> synopsis 2366 2367T template <class T, class Allocator = allocator<T> > class vector; 2368 2369T template <class T, class Allocator> 2370 bool operator==(const vector<T,Allocator>& x, 2371 const vector<T,Allocator>& y); 2372T template <class T, class Allocator> 2373 bool operator< (const vector<T,Allocator>& x, 2374 const vector<T,Allocator>& y); 2375T template <class T, class Allocator> 2376 bool operator!=(const vector<T,Allocator>& x, 2377 const vector<T,Allocator>& y); 2378T template <class T, class Allocator> 2379 bool operator> (const vector<T,Allocator>& x, 2380 const vector<T,Allocator>& y); 2381T template <class T, class Allocator> 2382 bool operator>=(const vector<T,Allocator>& x, 2383 const vector<T,Allocator>& y); 2384T template <class T, class Allocator> 2385 bool operator<=(const vector<T,Allocator>& x, 2386 const vector<T,Allocator>& y); 2387T template <class T, class Allocator> 2388 void swap(vector<T,Allocator>& x, vector<T,Allocator>& y); 2389 2390T template <class Allocator> class vector<bool,Allocator>; 2391T template <class Allocator> 2392 bool operator==(const vector<bool,Allocator>& x, 2393 const vector<bool,Allocator>& y); 2394T template <class Allocator> 2395 bool operator< (const vector<bool,Allocator>& x, 2396 const vector<bool,Allocator>& y); 2397T template <class Allocator> 2398 bool operator!=(const vector<bool,Allocator>& x, 2399 const vector<bool,Allocator>& y); 2400T template <class Allocator> 2401 bool operator> (const vector<bool,Allocator>& x, 2402 const vector<bool,Allocator>& y); 2403T template <class Allocator> 2404 bool operator>=(const vector<bool,Allocator>& x, 2405 const vector<bool,Allocator>& y); 2406T template <class Allocator> 2407 bool operator<=(const vector<bool,Allocator>& x, 2408 const vector<bool,Allocator>& y); 2409T template <class Allocator> 2410 void swap(vector<bool,Allocator>& x, vector<bool,Allocator>& y); 2411 } 2412 2413 23.2.1 Template class deque [lib.deque] 2414 2415 template <class T, class Allocator = allocator<T> > 2416T class deque { 2417 public: 2418 // types: 2419T typedef typename Allocator::reference reference; 2420T typedef typename Allocator::const_reference const_reference; 2421T typedef implementation defined iterator; 2422T typedef implementation defined const_iterator; 2423T typedef implementation defined size_type; 2424T typedef implementation defined difference_type; 2425T typedef T value_type; 2426T typedef Allocator allocator_type; 2427T typedef typename Allocator::pointer pointer; 2428T typedef typename Allocator::const_pointer const_pointer; 2429T typedef std::reverse_iterator<iterator> reverse_iterator; 2430T typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 2431 // _lib.deque.cons_ construct/copy/destroy: 2432T explicit deque(const Allocator& = Allocator()); 2433T explicit deque(size_type n, const T& value = T(), 2434 const Allocator& = Allocator()); 2435T template <class InputIterator> 2436 deque(InputIterator first, InputIterator last, 2437 const Allocator& = Allocator()); 2438T deque(const deque<T,Allocator>& x); 2439T ~deque(); 2440T deque<T,Allocator>& operator=(const deque<T,Allocator>& x); 2441T template <class InputIterator> 2442 void assign(InputIterator first, InputIterator last); 2443T void assign(size_type n, const T& t); 2444T allocator_type get_allocator() const; 2445 // iterators: 2446T iterator begin(); 2447T const_iterator begin() const; 2448T iterator end(); 2449T const_iterator end() const; 2450T reverse_iterator rbegin(); 2451T const_reverse_iterator rbegin() const; 2452T reverse_iterator rend(); 2453T const_reverse_iterator rend() const; 2454 // _lib.deque.capacity_ capacity: 2455T size_type size() const; 2456T size_type max_size() const; 2457T void resize(size_type sz, T c = T()); 2458T bool empty() const; 2459 2460 // element access: 2461T reference operator[](size_type n); 2462T const_reference operator[](size_type n) const; 2463T reference at(size_type n); 2464T const_reference at(size_type n) const; 2465T reference front(); 2466T const_reference front() const; 2467T reference back(); 2468T const_reference back() const; 2469 // _lib.deque.modifiers_ modifiers: 2470T void push_front(const T& x); 2471T void push_back(const T& x); 2472T iterator insert(iterator position, const T& x); 2473T void insert(iterator position, size_type n, const T& x); 2474T template <class InputIterator> 2475 void insert (iterator position, 2476 InputIterator first, InputIterator last); 2477T void pop_front(); 2478T void pop_back(); 2479T iterator erase(iterator position); 2480T iterator erase(iterator first, iterator last); 2481T void swap(deque<T,Allocator>&); 2482T void clear(); 2483 }; 2484T template <class T, class Allocator> 2485 bool operator==(const deque<T,Allocator>& x, 2486 const deque<T,Allocator>& y); 2487T template <class T, class Allocator> 2488 bool operator< (const deque<T,Allocator>& x, 2489 const deque<T,Allocator>& y); 2490T template <class T, class Allocator> 2491 bool operator!=(const deque<T,Allocator>& x, 2492 const deque<T,Allocator>& y); 2493T template <class T, class Allocator> 2494 bool operator> (const deque<T,Allocator>& x, 2495 const deque<T,Allocator>& y); 2496T template <class T, class Allocator> 2497 bool operator>=(const deque<T,Allocator>& x, 2498 const deque<T,Allocator>& y); 2499T template <class T, class Allocator> 2500 bool operator<=(const deque<T,Allocator>& x, 2501 const deque<T,Allocator>& y); 2502 // specialized algorithms: 2503T template <class T, class Allocator> 2504 void swap(deque<T,Allocator>& x, deque<T,Allocator>& y); 2505 2506 2507 23.2.2 Template class list [lib.list] 2508 2509T template <class T, class Allocator = allocator<T> > 2510 class list { 2511 public: 2512 // types: 2513T typedef typename Allocator::reference reference; 2514T typedef typename Allocator::const_reference const_reference; 2515T typedef implementation defined iterator; 2516T typedef implementation defined const_iterator; 2517T typedef implementation defined size_type; 2518T typedef implementation defined difference_type; 2519T typedef T value_type; 2520T typedef Allocator allocator_type; 2521T typedef typename Allocator::pointer pointer; 2522T typedef typename Allocator::const_pointer const_pointer; 2523T typedef std::reverse_iterator<iterator> reverse_iterator; 2524T typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 2525 2526 // _lib.list.cons_ construct/copy/destroy: 2527T explicit list(const Allocator& = Allocator()); 2528T explicit list(size_type n, const T& value = T(), 2529 const Allocator& = Allocator()); 2530T template <class InputIterator> 2531 list(InputIterator first, InputIterator last, 2532 const Allocator& = Allocator()); 2533T list(const list<T,Allocator>& x); 2534T ~list(); 2535T list<T,Allocator>& operator=(const list<T,Allocator>& x); 2536T template <class InputIterator> 2537 void assign(InputIterator first, InputIterator last); 2538T void assign(size_type n, const T& t); 2539T allocator_type get_allocator() const; 2540 // iterators: 2541T iterator begin(); 2542T const_iterator begin() const; 2543T iterator end(); 2544T const_iterator end() const; 2545T reverse_iterator rbegin(); 2546T const_reverse_iterator rbegin() const; 2547T reverse_iterator rend(); 2548T const_reverse_iterator rend() const; 2549 // _lib.list.capacity_ capacity: 2550T bool empty() const; 2551T size_type size() const; 2552T size_type max_size() const; 2553T void resize(size_type sz, T c = T()); 2554 // element access: 2555T reference front(); 2556T const_reference front() const; 2557T reference back(); 2558T const_reference back() const; 2559 // _lib.list.modifiers_ modifiers: 2560T void push_front(const T& x); 2561T void pop_front(); 2562T void push_back(const T& x); 2563T void pop_back(); 2564T iterator insert(iterator position, const T& x); 2565T void insert(iterator position, size_type n, const T& x); 2566T template <class InputIterator> 2567 void insert(iterator position, InputIterator first, 2568 InputIterator last); 2569T iterator erase(iterator position); 2570T iterator erase(iterator position, iterator last); 2571T void swap(list<T,Allocator>&); 2572T void clear(); 2573 // _lib.list.ops_ list operations: 2574T void splice(iterator position, list<T,Allocator>& x); 2575T void splice(iterator position, list<T,Allocator>& x, iterator i); 2576T void splice(iterator position, list<T,Allocator>& x, iterator first, 2577 iterator last); 2578T void remove(const T& value); 2579T template <class Predicate> void remove_if(Predicate pred); 2580 2581T void unique(); 2582T template <class BinaryPredicate> 2583 void unique(BinaryPredicate binary_pred); 2584T void merge(list<T,Allocator>& x); 2585T template <class Compare> void merge(list<T,Allocator>& x, Compare comp); 2586 void sort(); 2587T template <class Compare> void sort(Compare comp); 2588 void reverse(); 2589 }; 2590T template <class T, class Allocator> 2591 bool operator==(const list<T,Allocator>& x, const list<T,Allocator>& y); 2592T template <class T, class Allocator> 2593 bool operator< (const list<T,Allocator>& x, const list<T,Allocator>& y); 2594T template <class T, class Allocator> 2595 bool operator!=(const list<T,Allocator>& x, const list<T,Allocator>& y); 2596T template <class T, class Allocator> 2597 bool operator> (const list<T,Allocator>& x, const list<T,Allocator>& y); 2598T template <class T, class Allocator> 2599 bool operator>=(const list<T,Allocator>& x, const list<T,Allocator>& y); 2600T template <class T, class Allocator> 2601 bool operator<=(const list<T,Allocator>& x, const list<T,Allocator>& y); 2602 // specialized algorithms: 2603T template <class T, class Allocator> 2604 void swap(list<T,Allocator>& x, list<T,Allocator>& y); 2605 2606 2607 23.2.3.1 Template class queue [lib.queue] 2608 2609T template <class T, class Container = deque<T> > 2610 class queue { 2611 public: 2612T typedef typename Container::value_type value_type; 2613T typedef typename Container::size_type size_type; 2614T typedef Container container_type; 2615 protected: 2616T Container c; 2617 public: 2618T explicit queue(const Container& = Container()); 2619 2620T bool empty() const { return c.empty(); } 2621T size_type size() const { return c.size(); } 2622T value_type& front() { return c.front(); } 2623T const value_type& front() const { return c.front(); } 2624T value_type& back() { return c.back(); } 2625T const value_type& back() const { return c.back(); } 2626T void push(const value_type& x) { c.push_back(x); } 2627T void pop() { c.pop_front(); } 2628 }; 2629 2630T template <class T, class Container> 2631 bool operator==(const queue<T, Container>& x, 2632 const queue<T, Container>& y); 2633T template <class T, class Container> 2634 bool operator< (const queue<T, Container>& x, 2635 const queue<T, Container>& y); 2636T template <class T, class Container> 2637 bool operator!=(const queue<T, Container>& x, 2638 const queue<T, Container>& y); 2639T template <class T, class Container> 2640 bool operator> (const queue<T, Container>& x, 2641 const queue<T, Container>& y); 2642T template <class T, class Container> 2643 bool operator>=(const queue<T, Container>& x, 2644 const queue<T, Container>& y); 2645T template <class T, class Container> 2646 bool operator<=(const queue<T, Container>& x, 2647 const queue<T, Container>& y); 2648 2649 23.2.3.2 Template class priority_queue [lib.priority.queue] 2650 2651T template <class T, class Container = vector<T>, 2652 class Compare = less<typename Container::value_type> > 2653 class priority_queue { 2654 public: 2655T typedef typename Container::value_type value_type; 2656T typedef typename Container::size_type size_type; 2657T typedef Container container_type; 2658 protected: 2659T Container c; 2660T Compare comp; 2661 public: 2662T explicit priority_queue(const Compare& x = Compare(), 2663 const Container& = Container()); 2664T template <class InputIterator> 2665 priority_queue(InputIterator first, InputIterator last, 2666 const Compare& x = Compare(), 2667 const Container& = Container()); 2668 2669T bool empty() const { return c.empty(); } 2670T size_type size() const { return c.size(); } 2671T const value_type& top() const { return c.front(); } 2672T void push(const value_type& x); 2673T void pop(); 2674 }; 2675 2676 23.2.3.3 Template class stack [lib.stack] 2677 2678T template <class T, class Container = deque<T> > 2679 class stack { 2680 public: 2681T typedef typename Container::value_type value_type; 2682T typedef typename Container::size_type size_type; 2683T typedef Container container_type; 2684 protected: 2685T Container c; 2686 public: 2687T explicit stack(const Container& = Container()); 2688 2689T bool empty() const { return c.empty(); } 2690T size_type size() const { return c.size(); } 2691T value_type& top() { return c.back(); } 2692T const value_type& top() const { return c.back(); } 2693T void push(const value_type& x) { c.push_back(x); } 2694T void pop() { c.pop_back(); } 2695 }; 2696T template <class T, class Container> 2697 bool operator==(const stack<T, Container>& x, 2698 const stack<T, Container>& y); 2699T template <class T, class Container> 2700 bool operator< (const stack<T, Container>& x, 2701 const stack<T, Container>& y); 2702T template <class T, class Container> 2703 bool operator!=(const stack<T, Container>& x, 2704 const stack<T, Container>& y); 2705T template <class T, class Container> 2706 bool operator> (const stack<T, Container>& x, 2707 const stack<T, Container>& y); 2708T template <class T, class Container> 2709 bool operator>=(const stack<T, Container>& x, 2710 const stack<T, Container>& y); 2711T template <class T, class Container> 2712 bool operator<=(const stack<T, Container>& x, 2713 const stack<T, Container>& y); 2714 2715 23.2.4 Template class vector [lib.vector] 2716 2717 template <class T, class Allocator = allocator<T> > 2718T class vector { 2719 public: 2720 // types: 2721T typedef typename Allocator::reference reference; 2722T typedef typename Allocator::const_reference const_reference; 2723T typedef implementation defined iterator; 2724T typedef implementation defined const_iterator; 2725T typedef implementation defined size_type; 2726T typedef implementation defined difference_type; 2727T typedef T value_type; 2728T typedef Allocator allocator_type; 2729T typedef typename Allocator::pointer pointer; 2730T typedef typename Allocator::const_pointer const_pointer 2731T typedef std::reverse_iterator<iterator> reverse_iterator; 2732T typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 2733 // _lib.vector.cons_ construct/copy/destroy: 2734T explicit vector(const Allocator& = Allocator()); 2735T explicit vector(size_type n, const T& value = T(), 2736 const Allocator& = Allocator()); 2737T template <class InputIterator> 2738 vector(InputIterator first, InputIterator last, 2739 const Allocator& = Allocator()); 2740T vector(const vector<T,Allocator>& x); 2741T ~vector(); 2742T vector<T,Allocator>& operator=(const vector<T,Allocator>& x); 2743T template <class InputIterator> 2744 void assign(InputIterator first, InputIterator last); 2745T void assign(size_type n, const T& u); 2746T allocator_type get_allocator() const; 2747 // iterators: 2748T iterator begin(); 2749T const_iterator begin() const; 2750T iterator end(); 2751T const_iterator end() const; 2752T reverse_iterator rbegin(); 2753T const_reverse_iterator rbegin() const; 2754T reverse_iterator rend(); 2755T const_reverse_iterator rend() const; 2756 // _lib.vector.capacity_ capacity: 2757T size_type size() const; 2758T size_type max_size() const; 2759T void resize(size_type sz, T c = T()); 2760T size_type capacity() const; 2761T bool empty() const; 2762T void reserve(size_type n); 2763 2764 // element access: 2765T reference operator[](size_type n); 2766T const_reference operator[](size_type n) const; 2767T const_reference at(size_type n) const; 2768T reference at(size_type n); 2769T reference front(); 2770T const_reference front() const; 2771T reference back(); 2772T const_reference back() const; 2773 // _lib.vector.modifiers_ modifiers: 2774T void push_back(const T& x); 2775T void pop_back(); 2776T iterator insert(iterator position, const T& x); 2777T void insert(iterator position, size_type n, const T& x); 2778T template <class InputIterator> 2779 void insert(iterator position, 2780 InputIterator first, InputIterator last); 2781T iterator erase(iterator position); 2782T iterator erase(iterator first, iterator last); 2783T void swap(vector<T,Allocator>&); 2784T void clear(); 2785 }; 2786 2787T template <class T, class Allocator> 2788 bool operator==(const vector<T,Allocator>& x, 2789 const vector<T,Allocator>& y); 2790T template <class T, class Allocator> 2791 bool operator< (const vector<T,Allocator>& x, 2792 const vector<T,Allocator>& y); 2793T template <class T, class Allocator> 2794 bool operator!=(const vector<T,Allocator>& x, 2795 const vector<T,Allocator>& y); 2796T template <class T, class Allocator> 2797 bool operator> (const vector<T,Allocator>& x, 2798 const vector<T,Allocator>& y); 2799T template <class T, class Allocator> 2800 bool operator>=(const vector<T,Allocator>& x, 2801 const vector<T,Allocator>& y); 2802T template <class T, class Allocator> 2803 bool operator<=(const vector<T,Allocator>& x, 2804 const vector<T,Allocator>& y); 2805 // specialized algorithms: 2806T template <class T, class Allocator> 2807 void swap(vector<T,Allocator>& x, vector<T,Allocator>& y); 2808 2809 2810 23.2.5 Class vector<bool> [lib.vector.bool] 2811 2812T template <class Allocator> class vector<bool, Allocator> { 2813 public: 2814 // types: 2815T typedef bool const_reference; 2816T typedef implementation defined iterator; 2817T typedef implementation defined const_iterator; 2818T typedef implementation defined size_type; 2819T typedef implementation defined difference_type; 2820T typedef bool value_type; 2821T typedef Allocator allocator_type; 2822T typedef implementation defined pointer; 2823T typedef implementation defined const_pointer 2824T typedef std::reverse_iterator<iterator> reverse_iterator; 2825T typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 2826 // bit reference: 2827T class reference { 2828 friend class vector; 2829T reference(); 2830 public: 2831T ~reference(); 2832T operator bool() const; 2833T reference& operator=(const bool x); 2834T reference& operator=(const reference& x); 2835T void flip(); // flips the bit 2836 }; 2837 2838 // construct/copy/destroy: 2839T explicit vector(const Allocator& = Allocator()); 2840T explicit vector(size_type n, const bool& value = bool(), 2841 const Allocator& = Allocator()); 2842T template <class InputIterator> 2843 vector(InputIterator first, InputIterator last, 2844 const Allocator& = Allocator()); 2845T vector(const vector<bool,Allocator>& x); 2846T ~vector(); 2847T vector<bool,Allocator>& operator=(const vector<bool,Allocator>& x); 2848T template <class InputIterator> 2849 void assign(InputIterator first, InputIterator last); 2850T void assign(size_type n, const T& t); 2851T allocator_type get_allocator() const; 2852 // iterators: 2853T iterator begin(); 2854T const_iterator begin() const; 2855T iterator end(); 2856T const_iterator end() const; 2857T reverse_iterator rbegin(); 2858T const_reverse_iterator rbegin() const; 2859T reverse_iterator rend(); 2860T const_reverse_iterator rend() const; 2861 // capacity: 2862T size_type size() const; 2863T size_type max_size() const; 2864T void resize(size_type sz, bool c = false); 2865T size_type capacity() const; 2866T bool empty() const; 2867T void reserve(size_type n); 2868 // element access: 2869T reference operator[](size_type n); 2870T const_reference operator[](size_type n) const; 2871T const_reference at(size_type n) const; 2872T reference at(size_type n); 2873T reference front(); 2874T const_reference front() const; 2875T reference back(); 2876T const_reference back() const; 2877 // modifiers: 2878T void push_back(const bool& x); 2879T void pop_back(); 2880T iterator insert(iterator position, const bool& x); 2881T void insert (iterator position, size_type n, const bool& x); 2882T template <class InputIterator> 2883 void insert(iterator position, 2884 InputIterator first, InputIterator last); 2885T iterator erase(iterator position); 2886T iterator erase(iterator first, iterator last); 2887T void swap(vector<bool,Allocator>&); 2888T static void swap(reference x, reference y); 2889T void flip(); // flips all bits 2890T void clear(); 2891 }; 2892 2893T template <class Allocator> 2894 bool operator==(const vector<bool,Allocator>& x, 2895 const vector<bool,Allocator>& y); 2896T template <class Allocator> 2897 bool operator< (const vector<bool,Allocator>& x, 2898 const vector<bool,Allocator>& y); 2899T template <class Allocator> 2900 bool operator!=(const vector<bool,Allocator>& x, 2901 const vector<bool,Allocator>& y); 2902T template <class Allocator> 2903 bool operator> (const vector<bool,Allocator>& x, 2904 const vector<bool,Allocator>& y); 2905T template <class Allocator> 2906 bool operator>=(const vector<bool,Allocator>& x, 2907 const vector<bool,Allocator>& y); 2908T template <class Allocator> 2909 bool operator<=(const vector<bool,Allocator>& x, 2910 const vector<bool,Allocator>& y); 2911 // specialized algorithms: 2912T template <class Allocator> 2913 void swap(vector<bool,Allocator>& x, vector<bool,Allocator>& y); 2914 2915 23.3 Associative containers [lib.associative] 2916 2917 <map> and <set>: 2918 2919 Header <map> synopsis 2920 2921 template <class Key, class T, class Compare = less<Key>, 2922 class Allocator = allocator<pair<const Key, T> > > 2923T class map; 2924 2925T template <class Key, class T, class Compare, class Allocator> 2926 bool operator==(const map<Key,T,Compare,Allocator>& x, 2927 const map<Key,T,Compare,Allocator>& y); 2928T template <class Key, class T, class Compare, class Allocator> 2929 bool operator< (const map<Key,T,Compare,Allocator>& x, 2930 const map<Key,T,Compare,Allocator>& y); 2931T template <class Key, class T, class Compare, class Allocator> 2932 bool operator!=(const map<Key,T,Compare,Allocator>& x, 2933 const map<Key,T,Compare,Allocator>& y); 2934T template <class Key, class T, class Compare, class Allocator> 2935 bool operator> (const map<Key,T,Compare,Allocator>& x, 2936 const map<Key,T,Compare,Allocator>& y); 2937T template <class Key, class T, class Compare, class Allocator> 2938 bool operator>=(const map<Key,T,Compare,Allocator>& x, 2939 const map<Key,T,Compare,Allocator>& y); 2940T template <class Key, class T, class Compare, class Allocator> 2941 bool operator<=(const map<Key,T,Compare,Allocator>& x, 2942 const map<Key,T,Compare,Allocator>& y); 2943T template <class Key, class T, class Compare, class Allocator> 2944 void swap(map<Key,T,Compare,Allocator>& x, 2945 map<Key,T,Compare,Allocator>& y); 2946T template <class Key, class T, class Compare = less<Key>, 2947 class Allocator = allocator<pair<const Key, T> > > 2948 class multimap; 2949T template <class Key, class T, class Compare, class Allocator> 2950 bool operator==(const multimap<Key,T,Compare,Allocator>& x, 2951 const multimap<Key,T,Compare,Allocator>& y); 2952T template <class Key, class T, class Compare, class Allocator> 2953 bool operator< (const multimap<Key,T,Compare,Allocator>& x, 2954 const multimap<Key,T,Compare,Allocator>& y); 2955T template <class Key, class T, class Compare, class Allocator> 2956 bool operator!=(const multimap<Key,T,Compare,Allocator>& x, 2957 const multimap<Key,T,Compare,Allocator>& y); 2958T template <class Key, class T, class Compare, class Allocator> 2959 bool operator> (const multimap<Key,T,Compare,Allocator>& x, 2960 const multimap<Key,T,Compare,Allocator>& y); 2961T template <class Key, class T, class Compare, class Allocator> 2962 bool operator>=(const multimap<Key,T,Compare,Allocator>& x, 2963 const multimap<Key,T,Compare,Allocator>& y); 2964T template <class Key, class T, class Compare, class Allocator> 2965 bool operator<=(const multimap<Key,T,Compare,Allocator>& x, 2966 const multimap<Key,T,Compare,Allocator>& y); 2967T template <class Key, class T, class Compare, class Allocator> 2968 void swap(multimap<Key,T,Compare,Allocator>& x, 2969 multimap<Key,T,Compare,Allocator>& y); 2970 } 2971 2972 Header <set> synopsis 2973 2974 template <class Key, class Compare = less<Key>, 2975 class Allocator = allocator<Key> > 2976T class set; 2977 2978T template <class Key, class Compare, class Allocator> 2979 bool operator==(const set<Key,Compare,Allocator>& x, 2980 const set<Key,Compare,Allocator>& y); 2981T template <class Key, class Compare, class Allocator> 2982 bool operator< (const set<Key,Compare,Allocator>& x, 2983 const set<Key,Compare,Allocator>& y); 2984T template <class Key, class Compare, class Allocator> 2985 bool operator!=(const set<Key,Compare,Allocator>& x, 2986 const set<Key,Compare,Allocator>& y); 2987T template <class Key, class Compare, class Allocator> 2988 bool operator> (const set<Key,Compare,Allocator>& x, 2989 const set<Key,Compare,Allocator>& y); 2990T template <class Key, class Compare, class Allocator> 2991 bool operator>=(const set<Key,Compare,Allocator>& x, 2992 const set<Key,Compare,Allocator>& y); 2993T template <class Key, class Compare, class Allocator> 2994 bool operator<=(const set<Key,Compare,Allocator>& x, 2995 const set<Key,Compare,Allocator>& y); 2996T template <class Key, class Compare, class Allocator> 2997 void swap(set<Key,Compare,Allocator>& x, 2998 set<Key,Compare,Allocator>& y); 2999T template <class Key, class Compare = less<Key>, 3000 class Allocator = allocator<Key> > 3001 class multiset; 3002T template <class Key, class Compare, class Allocator> 3003 bool operator==(const multiset<Key,Compare,Allocator>& x, 3004 const multiset<Key,Compare,Allocator>& y); 3005T template <class Key, class Compare, class Allocator> 3006 bool operator< (const multiset<Key,Compare,Allocator>& x, 3007 const multiset<Key,Compare,Allocator>& y); 3008T template <class Key, class Compare, class Allocator> 3009 bool operator!=(const multiset<Key,Compare,Allocator>& x, 3010 const multiset<Key,Compare,Allocator>& y); 3011T template <class Key, class Compare, class Allocator> 3012 bool operator> (const multiset<Key,Compare,Allocator>& x, 3013 const multiset<Key,Compare,Allocator>& y); 3014T template <class Key, class Compare, class Allocator> 3015 bool operator>=(const multiset<Key,Compare,Allocator>& x, 3016 const multiset<Key,Compare,Allocator>& y); 3017T template <class Key, class Compare, class Allocator> 3018 bool operator<=(const multiset<Key,Compare,Allocator>& x, 3019 const multiset<Key,Compare,Allocator>& y); 3020T template <class Key, class Compare, class Allocator> 3021 void swap(multiset<Key,Compare,Allocator>& x, 3022 multiset<Key,Compare,Allocator>& y); 3023 } 3024 3025 23.3.1 Template class map [lib.map] 3026 3027 template <class Key, class T, class Compare = less<Key>, 3028 class Allocator = allocator<pair<const Key, T> > > 3029T class map { 3030 public: 3031 // types: 3032T typedef Key key_type; 3033T typedef T mapped_type; 3034T typedef pair<const Key, T> value_type; 3035T typedef Compare key_compare; 3036T typedef Allocator allocator_type; 3037T typedef typename Allocator::reference reference; 3038T typedef typename Allocator::const_reference const_reference; 3039T typedef implementation defined iterator; 3040T typedef implementation defined const_iterator; 3041T typedef implementation defined size_type; 3042T typedef implementation defined difference_type; 3043T typedef typename Allocator::pointer pointer; 3044T typedef typename Allocator::const_pointer const_pointer; 3045T typedef std::reverse_iterator<iterator> reverse_iterator; 3046T typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 3047T class value_compare 3048 : public binary_function<value_type,value_type,bool> { 3049 friend class map; 3050 protected: 3051T Compare comp; 3052T value_compare(Compare c) : comp(c) {} 3053 public: 3054T bool operator()(const value_type& x, const value_type& y) const { 3055 return comp(x.first, y.first); 3056 } 3057 }; 3058 3059 // _lib.map.cons_ construct/copy/destroy: 3060T explicit map(const Compare& comp = Compare(), 3061 const Allocator& = Allocator()); 3062T template <class InputIterator> 3063 map(InputIterator first, InputIterator last, 3064 const Compare& comp = Compare(), const Allocator& = Allocator()); 3065T map(const map<Key,T,Compare,Allocator>& x); 3066T ~map(); 3067T map<Key,T,Compare,Allocator>& 3068 operator=(const map<Key,T,Compare,Allocator>& x); 3069 // iterators: 3070T iterator begin(); 3071T const_iterator begin() const; 3072T iterator end(); 3073T const_iterator end() const; 3074T reverse_iterator rbegin(); 3075T const_reverse_iterator rbegin() const; 3076T reverse_iterator rend(); 3077T const_reverse_iterator rend() const; 3078 // capacity: 3079T bool empty() const; 3080T size_type size() const; 3081T size_type max_size() const; 3082 // _lib.map.access_ element access: 3083T T& operator[](const key_type& x); 3084 // modifiers: 3085T pair<iterator, bool> insert(const value_type& x); 3086T iterator insert(iterator position, const value_type& x); 3087T template <class InputIterator> 3088 void insert(InputIterator first, InputIterator last); 3089T void erase(iterator position); 3090T size_type erase(const key_type& x); 3091T void erase(iterator first, iterator last); 3092T void swap(map<Key,T,Compare,Allocator>&); 3093T void clear(); 3094 // observers: 3095T key_compare key_comp() const; 3096T value_compare value_comp() const; 3097 // _lib.map.ops_ map operations: 3098T iterator find(const key_type& x); 3099T const_iterator find(const key_type& x) const; 3100T size_type count(const key_type& x) const; 3101T iterator lower_bound(const key_type& x); 3102T const_iterator lower_bound(const key_type& x) const; 3103T iterator upper_bound(const key_type& x); 3104T const_iterator upper_bound(const key_type& x) const; 3105T pair<iterator,iterator> 3106 equal_range(const key_type& x); 3107T pair<const_iterator,const_iterator> 3108 equal_range(const key_type& x) const; 3109 }; 3110 3111T template <class Key, class T, class Compare, class Allocator> 3112 bool operator==(const map<Key,T,Compare,Allocator>& x, 3113 const map<Key,T,Compare,Allocator>& y); 3114T template <class Key, class T, class Compare, class Allocator> 3115 bool operator< (const map<Key,T,Compare,Allocator>& x, 3116 const map<Key,T,Compare,Allocator>& y); 3117T template <class Key, class T, class Compare, class Allocator> 3118 bool operator!=(const map<Key,T,Compare,Allocator>& x, 3119 const map<Key,T,Compare,Allocator>& y); 3120T template <class Key, class T, class Compare, class Allocator> 3121 bool operator> (const map<Key,T,Compare,Allocator>& x, 3122 const map<Key,T,Compare,Allocator>& y); 3123T template <class Key, class T, class Compare, class Allocator> 3124 bool operator>=(const map<Key,T,Compare,Allocator>& x, 3125 const map<Key,T,Compare,Allocator>& y); 3126T template <class Key, class T, class Compare, class Allocator> 3127 bool operator<=(const map<Key,T,Compare,Allocator>& x, 3128 const map<Key,T,Compare,Allocator>& y); 3129 // specialized algorithms: 3130T template <class Key, class T, class Compare, class Allocator> 3131 void swap(map<Key,T,Compare,Allocator>& x, 3132 map<Key,T,Compare,Allocator>& y); 3133 3134 23.3.2 Template class multimap [lib.multimap] 3135 3136 template <class Key, class T, class Compare = less<Key>, 3137 class Allocator = allocator<pair<const Key, T> > > 3138T class multimap { 3139 public: 3140 // types: 3141T typedef Key key_type; 3142T typedef T mapped_type; 3143T typedef pair<const Key,T> value_type; 3144T typedef Compare key_compare; 3145T typedef Allocator allocator_type; 3146T typedef typename Allocator::reference reference; 3147T typedef typename Allocator::const_reference const_reference; 3148T typedef implementation defined iterator; 3149T typedef implementation defined const_iterator; 3150T typedef implementation defined size_type; 3151T typedef implementation defined difference_type 3152T typedef typename Allocator::pointer pointer; 3153T typedef typename Allocator::const_pointer const_pointer; 3154T typedef std::reverse_iterator<iterator> reverse_iterator; 3155T typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 3156T class value_compare 3157 : public binary_function<value_type,value_type,bool> { 3158 friend class multimap; 3159 protected: 3160T Compare comp; 3161T value_compare(Compare c) : comp(c) {} 3162 public: 3163T bool operator()(const value_type& x, const value_type& y) const { 3164 return comp(x.first, y.first); 3165 } 3166 }; 3167 // construct/copy/destroy: 3168T explicit multimap(const Compare& comp = Compare(), 3169 const Allocator& = Allocator()); 3170T template <class InputIterator> 3171 multimap(InputIterator first, InputIterator last, 3172 const Compare& comp = Compare(), 3173 const Allocator& = Allocator()); 3174T multimap(const multimap<Key,T,Compare,Allocator>& x); 3175T ~multimap(); 3176T multimap<Key,T,Compare,Allocator>& 3177 operator=(const multimap<Key,T,Compare,Allocator>& x); 3178T allocator_type get_allocator() const; 3179 3180 // iterators: 3181T iterator begin(); 3182T const_iterator begin() const; 3183T iterator end(); 3184T const_iterator end() const; 3185T reverse_iterator rbegin(); 3186T const_reverse_iterator rbegin() const; 3187T reverse_iterator rend(); 3188T const_reverse_iterator rend() const; 3189 // capacity: 3190T bool empty() const; 3191T size_type size() const; 3192T size_type max_size() const; 3193 // modifiers: 3194T iterator insert(const value_type& x); 3195T iterator insert(iterator position, const value_type& x); 3196T template <class InputIterator> 3197 void insert(InputIterator first, InputIterator last); 3198T void erase(iterator position); 3199T size_type erase(const key_type& x); 3200T void erase(iterator first, iterator last); 3201T void swap(multimap<Key,T,Compare,Allocator>&); 3202T void clear(); 3203 // observers: 3204T key_compare key_comp() const; 3205T value_compare value_comp() const; 3206 // map operations: 3207T iterator find(const key_type& x); 3208T const_iterator find(const key_type& x) const; 3209T size_type count(const key_type& x) const; 3210T iterator lower_bound(const key_type& x); 3211T const_iterator lower_bound(const key_type& x) const; 3212T iterator upper_bound(const key_type& x); 3213T const_iterator upper_bound(const key_type& x) const; 3214T pair<iterator,iterator> equal_range(const key_type& x); 3215T pair<const_iterator,const_iterator> equal_range(const key_type& x) const; 3216 }; 3217 3218T template <class Key, class T, class Compare, class Allocator> 3219 bool operator==(const multimap<Key,T,Compare,Allocator>& x, 3220 const multimap<Key,T,Compare,Allocator>& y); 3221T template <class Key, class T, class Compare, class Allocator> 3222 bool operator< (const multimap<Key,T,Compare,Allocator>& x, 3223 const multimap<Key,T,Compare,Allocator>& y); 3224T template <class Key, class T, class Compare, class Allocator> 3225 bool operator!=(const multimap<Key,T,Compare,Allocator>& x, 3226 const multimap<Key,T,Compare,Allocator>& y); 3227T template <class Key, class T, class Compare, class Allocator> 3228 bool operator> (const multimap<Key,T,Compare,Allocator>& x, 3229 const multimap<Key,T,Compare,Allocator>& y); 3230T template <class Key, class T, class Compare, class Allocator> 3231 bool operator>=(const multimap<Key,T,Compare,Allocator>& x, 3232 const multimap<Key,T,Compare,Allocator>& y); 3233T template <class Key, class T, class Compare, class Allocator> 3234 bool operator<=(const multimap<Key,T,Compare,Allocator>& x, 3235 const multimap<Key,T,Compare,Allocator>& y); 3236 // specialized algorithms: 3237T template <class Key, class T, class Compare, class Allocator> 3238 void swap(multimap<Key,T,Compare,Allocator>& x, 3239 multimap<Key,T,Compare,Allocator>& y); 3240 3241 3242 23.3.3 Template class set [lib.set] 3243 3244 template <class Key, class Compare = less<Key>, 3245 class Allocator = allocator<Key> > 3246T class set { 3247 public: 3248 // types: 3249T typedef Key key_type; 3250T typedef Key value_type; 3251T typedef Compare key_compare; 3252T typedef Compare value_compare; 3253T typedef Allocator allocator_type; 3254T typedef typename Allocator::reference reference; 3255T typedef typename Allocator::const_reference const_reference; 3256T typedef implementation defined iterator; 3257T typedef implementation defined const_iterator; 3258T typedef implementation defined size_type; 3259T typedef implementation defined difference_type; 3260T typedef typename Allocator::pointer pointer; 3261T typedef typename Allocator::const_pointer const_pointer; 3262T typedef std::reverse_iterator<iterator> reverse_iterator; 3263T typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 3264 // _lib.set.cons_ construct/copy/destroy: 3265T explicit set(const Compare& comp = Compare(), 3266 const Allocator& = Allocator()); 3267T template <class InputIterator> 3268 set(InputIterator first, InputIterator last, 3269 const Compare& comp = Compare(), const Allocator& = Allocator()); 3270T set(const set<Key,Compare,Allocator>& x); 3271T ~set(); 3272T set<Key,Compare,Allocator>& 3273 operator=(const set<Key,Compare,Allocator>& x); 3274T allocator_type get_allocator() const; 3275 // iterators: 3276T iterator begin(); 3277T const_iterator begin() const; 3278T iterator end(); 3279T const_iterator end() const; 3280T reverse_iterator rbegin(); 3281T const_reverse_iterator rbegin() const; 3282T reverse_iterator rend(); 3283T const_reverse_iterator rend() const; 3284 // capacity: 3285T bool empty() const; 3286T size_type size() const; 3287T size_type max_size() const; 3288 // modifiers: 3289T pair<iterator,bool> insert(const value_type& x); 3290T iterator insert(iterator position, const value_type& x); 3291T template <class InputIterator> 3292T void insert(InputIterator first, InputIterator last); 3293T void erase(iterator position); 3294T size_type erase(const key_type& x); 3295T void erase(iterator first, iterator last); 3296T void swap(set<Key,Compare,Allocator>&); 3297T void clear(); 3298 3299 // observers: 3300T key_compare key_comp() const; 3301T value_compare value_comp() const; 3302 // set operations: 3303T iterator find(const key_type& x) const; 3304T size_type count(const key_type& x) const; 3305T iterator lower_bound(const key_type& x) const; 3306T iterator upper_bound(const key_type& x) const; 3307T pair<iterator,iterator> equal_range(const key_type& x) const; 3308 }; 3309T template <class Key, class Compare, class Allocator> 3310 bool operator==(const set<Key,Compare,Allocator>& x, 3311 const set<Key,Compare,Allocator>& y); 3312T template <class Key, class Compare, class Allocator> 3313 bool operator< (const set<Key,Compare,Allocator>& x, 3314 const set<Key,Compare,Allocator>& y); 3315T template <class Key, class Compare, class Allocator> 3316 bool operator!=(const set<Key,Compare,Allocator>& x, 3317 const set<Key,Compare,Allocator>& y); 3318T template <class Key, class Compare, class Allocator> 3319 bool operator> (const set<Key,Compare,Allocator>& x, 3320 const set<Key,Compare,Allocator>& y); 3321T template <class Key, class Compare, class Allocator> 3322 bool operator>=(const set<Key,Compare,Allocator>& x, 3323 const set<Key,Compare,Allocator>& y); 3324T template <class Key, class Compare, class Allocator> 3325 bool operator<=(const set<Key,Compare,Allocator>& x, 3326 const set<Key,Compare,Allocator>& y); 3327 // specialized algorithms: 3328T template <class Key, class Compare, class Allocator> 3329 void swap(set<Key,Compare,Allocator>& x, 3330 set<Key,Compare,Allocator>& y); 3331 3332 23.3.4 Template class multiset [lib.multiset] 3333 3334 template <class Key, class Compare = less<Key>, 3335 class Allocator = allocator<Key> > 3336T class multiset { 3337 public: 3338 // types: 3339T typedef Key key_type; 3340T typedef Key value_type; 3341T typedef Compare key_compare; 3342T typedef Compare value_compare; 3343T typedef Allocator allocator_type; 3344T typedef typename Allocator::reference reference; 3345T typedef typename Allocator::const_reference const_reference; 3346T typedef implementation defined iterator; 3347T typedef implementation defined const_iterator; 3348T typedef implementation defined size_type; 3349T typedef implementation defined difference_type 3350T typedef typename Allocator::pointer pointer; 3351T typedef typename Allocator::const_pointer const_pointer; 3352T typedef std::reverse_iterator<iterator> reverse_iterator; 3353T typedef std::reverse_iterator<const_iterator> const_reverse_iterator; 3354 3355 // construct/copy/destroy: 3356T explicit multiset(const Compare& comp = Compare(), 3357 const Allocator& = Allocator()); 3358T template <class InputIterator> 3359 multiset(InputIterator first, InputIterator last, 3360 const Compare& comp = Compare(), 3361 const Allocator& = Allocator()); 3362T multiset(const multiset<Key,Compare,Allocator>& x); 3363T ~multiset(); 3364T multiset<Key,Compare,Allocator>& 3365 operator=(const multiset<Key,Compare,Allocator>& x); 3366T allocator_type get_allocator() const; 3367 // iterators: 3368T iterator begin(); 3369T const_iterator begin() const; 3370T iterator end(); 3371T const_iterator end() const; 3372T reverse_iterator rbegin(); 3373T const_reverse_iterator rbegin() const; 3374T reverse_iterator rend(); 3375T const_reverse_iterator rend() const; 3376 // capacity: 3377T bool empty() const; 3378T size_type size() const; 3379T size_type max_size() const; 3380 // modifiers: 3381T iterator insert(const value_type& x); 3382T iterator insert(iterator position, const value_type& x); 3383T template <class InputIterator> 3384 void insert(InputIterator first, InputIterator last); 3385T void erase(iterator position); 3386T size_type erase(const key_type& x); 3387T void erase(iterator first, iterator last); 3388T void swap(multiset<Key,Compare,Allocator>&); 3389T void clear(); 3390 // observers: 3391T key_compare key_comp() const; 3392T value_compare value_comp() const; 3393 // set operations: 3394T iterator find(const key_type& x) const; 3395T size_type count(const key_type& x) const; 3396T iterator lower_bound(const key_type& x) const; 3397T iterator upper_bound(const key_type& x) const; 3398T pair<iterator,iterator> equal_range(const key_type& x) const; 3399 }; 3400 3401T template <class Key, class Compare, class Allocator> 3402 bool operator==(const multiset<Key,Compare,Allocator>& x, 3403 const multiset<Key,Compare,Allocator>& y); 3404T template <class Key, class Compare, class Allocator> 3405 bool operator< (const multiset<Key,Compare,Allocator>& x, 3406 const multiset<Key,Compare,Allocator>& y); 3407T template <class Key, class Compare, class Allocator> 3408 bool operator!=(const multiset<Key,Compare,Allocator>& x, 3409 const multiset<Key,Compare,Allocator>& y); 3410T template <class Key, class Compare, class Allocator> 3411 bool operator> (const multiset<Key,Compare,Allocator>& x, 3412 const multiset<Key,Compare,Allocator>& y); 3413T template <class Key, class Compare, class Allocator> 3414 bool operator>=(const multiset<Key,Compare,Allocator>& x, 3415 const multiset<Key,Compare,Allocator>& y); 3416T template <class Key, class Compare, class Allocator> 3417 bool operator<=(const multiset<Key,Compare,Allocator>& x, 3418 const multiset<Key,Compare,Allocator>& y); 3419 // specialized algorithms: 3420T template <class Key, class Compare, class Allocator> 3421 void swap(multiset<Key,Compare,Allocator>& x, 3422 multiset<Key,Compare,Allocator>& y); 3423 3424 23.3.5 Template class bitset [lib.template.bitset] 3425 3426 Header <bitset> synopsis 3427 3428T template <size_t N> class bitset; 3429 // _lib.bitset.operators_ bitset operations: 3430T template <size_t N> 3431 bitset<N> operator&(const bitset<N>&, const bitset<N>&); 3432T template <size_t N> 3433 bitset<N> operator|(const bitset<N>&, const bitset<N>&); 3434T template <size_t N> 3435 bitset<N> operator^(const bitset<N>&, const bitset<N>&); 3436T template <class charT, class traits, size_t N> 3437 basic_istream<charT, traits>& 3438 operator>>(basic_istream<charT, traits>& is, bitset<N>& x); 3439T template <class charT, class traits, size_t N> 3440 basic_ostream<charT, traits>& 3441 operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x); 3442 3443T template<size_t N> class bitset { 3444 public: 3445 // bit reference: 3446T class reference { 3447 friend class bitset; 3448T reference(); 3449 public: 3450T ~reference(); 3451T reference& operator=(bool x); // for b[i] = x; 3452T reference& operator=(const reference&); // for b[i] = b[j]; 3453T bool operator~() const; // flips the bit 3454T operator bool() const; // for x = b[i]; 3455T reference& flip(); // for b[i].flip(); 3456 }; 3457 3458 // _lib.bitset.cons_ constructors: 3459T bitset(); 3460T bitset(unsigned long val); 3461T template<class charT, class traits, class Allocator> 3462 explicit bitset( 3463 const basic_string<charT,traits,Allocator>& str, 3464 typename basic_string<charT,traits,Allocator>::size_type pos = 0, 3465 typename basic_string<charT,traits,Allocator>::size_type n = 3466 basic_string<charT,traits,Allocator>::npos); 3467 // _lib.bitset.members_ bitset operations: 3468T bitset<N>& operator&=(const bitset<N>& rhs); 3469T bitset<N>& operator|=(const bitset<N>& rhs); 3470T bitset<N>& operator^=(const bitset<N>& rhs); 3471T bitset<N>& operator<<=(size_t pos); 3472T bitset<N>& operator>>=(size_t pos); 3473T bitset<N>& set(); 3474T bitset<N>& set(size_t pos, int val = true); 3475T bitset<N>& reset(); 3476T bitset<N>& reset(size_t pos); 3477T bitset<N> operator~() const; 3478T bitset<N>& flip(); 3479T bitset<N>& flip(size_t pos); 3480 // element access: 3481T reference operator[](size_t pos); // for b[i]; 3482T unsigned long to_ulong() const; 3483T template <class charT, class traits, class Allocator> 3484 basic_string<charT, traits, Allocator> to_string() const; 3485T size_t count() const; 3486T size_t size() const; 3487T bool operator==(const bitset<N>& rhs) const; 3488T bool operator!=(const bitset<N>& rhs) const; 3489T bool test(size_t pos) const; 3490T bool any() const; 3491T bool none() const; 3492T bitset<N> operator<<(size_t pos) const; 3493T bitset<N> operator>>(size_t pos) const; 3494 }; 3495 3496 3497 3498 3499 24.2 Header <iterator> synopsis [lib.iterator.synopsis] 3500 3501 // _lib.iterator.primitives_, primitives: 3502T template<class Iterator> struct iterator_traits; 3503T template<class T> struct iterator_traits<T*>; 3504 3505X template<class Category, class T, class Distance = ptrdiff_t, 3506 class Pointer = T*, class Reference = T&> struct iterator; 3507T struct input_iterator_tag {}; 3508T struct output_iterator_tag {}; 3509T struct forward_iterator_tag: public input_iterator_tag {}; 3510T struct bidirectional_iterator_tag: public forward_iterator_tag {}; 3511T struct random_access_iterator_tag: public bidirectional_iterator_tag {}; 3512 // _lib.iterator.operations_, iterator operations: 3513T template <class InputIterator, class Distance> 3514 void advance(InputIterator& i, Distance n); 3515T template <class InputIterator> 3516 typename iterator_traits<InputIterator>::difference_type 3517 distance(InputIterator first, InputIterator last); 3518 // _lib.predef.iterators_, predefined iterators: 3519X template <class Iterator> class reverse_iterator; 3520T template <class Iterator> 3521 bool operator==( 3522 const reverse_iterator<Iterator>& x, 3523 const reverse_iterator<Iterator>& y); 3524T template <class Iterator> 3525 bool operator<( 3526 const reverse_iterator<Iterator>& x, 3527 const reverse_iterator<Iterator>& y); 3528T template <class Iterator> 3529 bool operator!=( 3530 const reverse_iterator<Iterator>& x, 3531 const reverse_iterator<Iterator>& y); 3532T template <class Iterator> 3533 bool operator>( 3534 const reverse_iterator<Iterator>& x, 3535 const reverse_iterator<Iterator>& y); 3536T template <class Iterator> 3537 bool operator>=( 3538 const reverse_iterator<Iterator>& x, 3539 const reverse_iterator<Iterator>& y); 3540T template <class Iterator> 3541 bool operator<=( 3542 const reverse_iterator<Iterator>& x, 3543 const reverse_iterator<Iterator>& y); 3544T template <class Iterator> 3545 typename reverse_iterator<Iterator>::difference_type operator-( 3546 const reverse_iterator<Iterator>& x, 3547 const reverse_iterator<Iterator>& y); 3548T template <class Iterator> 3549 reverse_iterator<Iterator> 3550 operator+( 3551 typename reverse_iterator<Iterator>::difference_type n, 3552 const reverse_iterator<Iterator>& x); 3553 3554X template <class Container> class back_insert_iterator; 3555T template <class Container> 3556 back_insert_iterator<Container> back_inserter(Container& x); 3557X template <class Container> class front_insert_iterator; 3558T template <class Container> 3559 front_insert_iterator<Container> front_inserter(Container& x); 3560X template <class Container> class insert_iterator; 3561T template <class Container, class Iterator> 3562 insert_iterator<Container> inserter(Container& x, Iterator i); 3563 // _lib.stream.iterators_, stream iterators: 3564X template <class T, class charT = char, class traits = char_traits<charT>, 3565 class Distance = ptrdiff_t> 3566 class istream_iterator; 3567 template <class T, class charT, class traits, class Distance> 3568X bool operator==(const istream_iterator<T,charT,traits,Distance>& x, 3569 const istream_iterator<T,charT,traits,Distance>& y); 3570 template <class T, class charT, class traits, class Distance> 3571X bool operator!=(const istream_iterator<T,charT,traits,Distance>& x, 3572 const istream_iterator<T,charT,traits,Distance>& y); 3573X template <class T, class charT = char, class traits = char_traits<charT> > 3574 class ostream_iterator; 3575X template<class charT, class traits = char_traits<charT> > 3576 class istreambuf_iterator; 3577X template <class charT, class traits> 3578 bool operator==(const istreambuf_iterator<charT,traits>& a, 3579 const istreambuf_iterator<charT,traits>& b); 3580X template <class charT, class traits> 3581 bool operator!=(const istreambuf_iterator<charT,traits>& a, 3582 const istreambuf_iterator<charT,traits>& b); 3583T template <class charT, class traits = char_traits<charT> > 3584 class ostreambuf_iterator; 3585 3586 24.3 Iterator primitives [lib.iterator.primitives] 3587 3588T template<class Iterator> struct iterator_traits { 3589T typedef typename Iterator::difference_type difference_type; 3590T typedef typename Iterator::value_type value_type; 3591T typedef typename Iterator::pointer pointer; 3592T typedef typename Iterator::reference reference; 3593T typedef typename Iterator::iterator_category iterator_category; 3594 }; 3595 3596T template<class T> struct iterator_traits<T*> { 3597T typedef ptrdiff_t difference_type; 3598T typedef T value_type; 3599T typedef T* pointer; 3600T typedef T& reference; 3601T typedef random_access_iterator_tag iterator_category; 3602 }; 3603 3604T template<class T> struct iterator_traits<const T*> { 3605T typedef ptrdiff_t difference_type; 3606T typedef T value_type; 3607T typedef const T* pointer; 3608T typedef const T& reference; 3609T typedef random_access_iterator_tag iterator_category; 3610 }; 3611 3612 24.3.2 Basic iterator [lib.iterator.basic] 3613 3614 template<class Category, class T, class Distance = ptrdiff_t, 3615 class Pointer = T*, class Reference = T&> 3616X struct iterator { 3617T typedef T value_type; 3618T typedef Distance difference_type; 3619T typedef Pointer pointer; 3620T typedef Reference reference; 3621T typedef Category iterator_category; 3622 }; 3623 3624 24.3.3 Standard iterator tags [lib.std.iterator.tags] 3625 3626T struct input_iterator_tag {}; 3627T struct output_iterator_tag {}; 3628T struct forward_iterator_tag: public input_iterator_tag {}; 3629T struct bidirectional_iterator_tag: public forward_iterator_tag {}; 3630T struct random_access_iterator_tag: public bidirectional_iterator_tag {}; 3631 3632 3633 24.4.1 Reverse iterators [lib.reverse.iterators] 3634 3635 template <class Iterator> 3636X class reverse_iterator : public 3637 iterator<typename iterator_traits<Iterator>::iterator_category, 3638 typename iterator_traits<Iterator>::value_type, 3639 typename iterator_traits<Iterator>::difference_type, 3640 typename iterator_traits<Iterator>::pointer, 3641 typename iterator_traits<Iterator>::reference> { 3642 protected: 3643T Iterator current; 3644 public: 3645T typedef Iterator 3646 iterator_type; 3647T typedef typename iterator_traits<Iterator>::difference_type 3648 difference_type; 3649T typedef typename iterator_traits<Iterator>::reference 3650 reference; 3651T typedef typename iterator_traits<Iterator>::pointer 3652 pointer; 3653 3654T reverse_iterator(); 3655T explicit reverse_iterator(Iterator x); 3656T template <class U> reverse_iterator(const reverse_iterator<U>& u); 3657T Iterator base() const; // explicit 3658T reference operator*() const; 3659T pointer operator->() const; 3660T reverse_iterator& operator++(); 3661T reverse_iterator operator++(int); 3662T reverse_iterator& operator--(); 3663T reverse_iterator operator--(int); 3664 3665T reverse_iterator operator+ (difference_type n) const; 3666T reverse_iterator& operator+=(difference_type n); 3667T reverse_iterator operator- (difference_type n) const; 3668T reverse_iterator& operator-=(difference_type n); 3669T reference operator[](difference_type n) const; 3670 }; 3671T template <class Iterator> 3672 bool operator==( 3673 const reverse_iterator<Iterator>& x, 3674 const reverse_iterator<Iterator>& y); 3675T template <class Iterator> 3676 bool operator<( 3677 const reverse_iterator<Iterator>& x, 3678 const reverse_iterator<Iterator>& y); 3679T template <class Iterator> 3680 bool operator!=( 3681 const reverse_iterator<Iterator>& x, 3682 const reverse_iterator<Iterator>& y); 3683T template <class Iterator> 3684 bool operator>( 3685 const reverse_iterator<Iterator>& x, 3686 const reverse_iterator<Iterator>& y); 3687T template <class Iterator> 3688 bool operator>=( 3689 const reverse_iterator<Iterator>& x, 3690 const reverse_iterator<Iterator>& y); 3691T template <class Iterator> 3692 bool operator<=( 3693 const reverse_iterator<Iterator>& x, 3694 const reverse_iterator<Iterator>& y); 3695T template <class Iterator> 3696 typename reverse_iterator<Iterator>::difference_type operator-( 3697 const reverse_iterator<Iterator>& x, 3698 const reverse_iterator<Iterator>& y); 3699T template <class Iterator> 3700 reverse_iterator<Iterator> operator+( 3701 typename reverse_iterator<Iterator>::difference_type n, 3702 const reverse_iterator<Iterator>& x); 3703 3704 3705 24.4.2.1 Template class [lib.back.insert.iterator] 3706 back_insert_iterator 3707 3708 template <class Container> 3709X class back_insert_iterator : 3710 public iterator<output_iterator_tag,void,void,void,void> { 3711 protected: 3712T Container* container; 3713 public: 3714T typedef Container container_type; 3715T explicit back_insert_iterator(Container& x); 3716T back_insert_iterator<Container>& 3717 operator=(typename Container::const_reference value); 3718 3719T back_insert_iterator<Container>& operator*(); 3720T back_insert_iterator<Container>& operator++(); 3721T back_insert_iterator<Container> operator++(int); 3722 }; 3723T template <class Container> 3724 back_insert_iterator<Container> back_inserter(Container& x); 3725 3726 3727 3728 24.4.2.3 Template class [lib.front.insert.iterator] 3729 front_insert_iterator 3730 3731 template <class Container> 3732X class front_insert_iterator : 3733 public iterator<output_iterator_tag,void,void,void,void> { 3734 protected: 3735T Container* container; 3736 public: 3737T typedef Container container_type; 3738T explicit front_insert_iterator(Container& x); 3739T front_insert_iterator<Container>& 3740 operator=(typename Container::const_reference value); 3741T front_insert_iterator<Container>& operator*(); 3742T front_insert_iterator<Container>& operator++(); 3743T front_insert_iterator<Container> operator++(int); 3744 }; 3745T template <class Container> 3746 front_insert_iterator<Container> front_inserter(Container& x); 3747 3748 3749 24.4.2.5 Template class insert_iterator [lib.insert.iterator] 3750 3751 template <class Container> 3752X class insert_iterator : 3753 public iterator<output_iterator_tag,void,void,void,void> { 3754 protected: 3755T Container* container; 3756T typename Container::iterator iter; 3757 public: 3758T typedef Container container_type; 3759T insert_iterator(Container& x, typename Container::iterator i); 3760T insert_iterator<Container>& 3761 operator=(typename Container::const_reference value); 3762T insert_iterator<Container>& operator*(); 3763T insert_iterator<Container>& operator++(); 3764T insert_iterator<Container>& operator++(int); 3765 }; 3766T template <class Container, class Iterator> 3767 insert_iterator<Container> inserter(Container& x, Iterator i); 3768 3769 24.5.1 Template class istream_iterator [lib.istream.iterator] 3770 3771 template <class T, class charT = char, class traits = char_traits<charT>, 3772 class Distance = ptrdiff_t> 3773X class istream_iterator: 3774 public iterator<input_iterator_tag, T, Distance, const T*, const T&> { 3775 public: 3776T typedef charT char_type 3777T typedef traits traits_type; 3778T typedef basic_istream<charT,traits> istream_type; 3779T istream_iterator(); 3780T istream_iterator(istream_type& s); 3781T istream_iterator(const istream_iterator<T,charT,traits,Distance>& x); 3782T ~istream_iterator(); 3783 3784T const T& operator*() const; 3785T const T* operator->() const; 3786T istream_iterator<T,charT,traits,Distance>& operator++(); 3787T istream_iterator<T,charT,traits,Distance> operator++(int); 3788 }; 3789 3790T template <class T, class charT, class traits, class Distance> 3791 bool operator==(const istream_iterator<T,charT,traits,Distance>& x, 3792 const istream_iterator<T,charT,traits,Distance>& y); 3793T template <class T, class charT, class traits, class Distance> 3794 bool operator!=(const istream_iterator<T,charT,traits,Distance>& x, 3795 const istream_iterator<T,charT,traits,Distance>& y); 3796 3797 3798 24.5.2 Template class ostream_iterator [lib.ostream.iterator] 3799 3800 template <class T, class charT = char, class traits = char_traits<charT> > 3801X class ostream_iterator: 3802 public iterator<output_iterator_tag, void, void, void, void> { 3803 public: 3804T typedef charT char_type; 3805T typedef traits traits_type; 3806T typedef basic_ostream<charT,traits> ostream_type; 3807T ostream_iterator(ostream_type& s); 3808T ostream_iterator(ostream_type& s, const charT* delimiter); 3809T ostream_iterator(const ostream_iterator<T,charT,traits>& x); 3810T ~ostream_iterator(); 3811T ostream_iterator<T,charT,traits>& operator=(const T& value); 3812 3813T ostream_iterator<T,charT,traits>& operator*(); 3814T ostream_iterator<T,charT,traits>& operator++(); 3815T ostream_iterator<T,charT,traits>& operator++(int); 3816 }; 3817 3818 3819 24.5.3 Template class [lib.istreambuf.iterator] 3820 istreambuf_iterator 3821 3822 template<class charT, class traits = char_traits<charT> > 3823X class istreambuf_iterator 3824 : public iterator<input_iterator_tag, charT, 3825 typename traits::off_type, charT*, charT&> { 3826 public: 3827T typedef charT char_type; 3828T typedef traits traits_type; 3829T typedef typename traits::int_type int_type; 3830T typedef basic_streambuf<charT,traits> streambuf_type; 3831T typedef basic_istream<charT,traits> istream_type; 3832T class proxy; // exposition only 3833T istreambuf_iterator() throw(); 3834T istreambuf_iterator(istream_type& s) throw(); 3835T istreambuf_iterator(streambuf_type* s) throw(); 3836T istreambuf_iterator(const proxy& p) throw(); 3837T charT operator*() const; 3838T istreambuf_iterator<charT,traits>& operator++(); 3839T proxy operator++(int); 3840X bool equal(istreambuf_iterator& b); 3841 }; 3842 3843T template <class charT, class traits> 3844 bool operator==(const istreambuf_iterator<charT,traits>& a, 3845 const istreambuf_iterator<charT,traits>& b); 3846 3847T template <class charT, class traits> 3848 bool operator!=(const istreambuf_iterator<charT,traits>& a, 3849 const istreambuf_iterator<charT,traits>& b); 3850 3851 24.5.3.1 Template class [lib.istreambuf.iterator::proxy] 3852 istreambuf_iterator::proxy 3853 3854 template <class charT, class traits = char_traits<charT> > 3855T class istreambuf_iterator<charT, traits>::proxy 3856 { 3857T charT keep_; 3858T basic_streambuf<charT,traits>* sbuf_; 3859T proxy(charT c, 3860 basic_streambuf<charT,traits>* sbuf); 3861 : keep_(c), sbuf_(sbuf) {} 3862 public: 3863T charT operator*() { return keep_; } 3864 }; 3865 3866 3867 3868 24.5.4 Template class [lib.ostreambuf.iterator] 3869 ostreambuf_iterator 3870 3871 template <class charT, class traits = char_traits<charT> > 3872T class ostreambuf_iterator: 3873 public iterator<output_iterator_tag, void, void, void, void> { 3874 public: 3875T typedef charT char_type; 3876T typedef traits traits_type; 3877T typedef basic_streambuf<charT,traits> streambuf_type; 3878T typedef basic_ostream<charT,traits> ostream_type; 3879 public: 3880T ostreambuf_iterator(ostream_type& s) throw(); 3881T ostreambuf_iterator(streambuf_type* s) throw(); 3882T ostreambuf_iterator& operator=(charT c); 3883T ostreambuf_iterator& operator*(); 3884T ostreambuf_iterator& operator++(); 3885T ostreambuf_iterator& operator++(int); 3886T bool failed() const throw(); 3887 }; 3888 3889 3890 Header <algorithm> synopsis 3891 3892 3893 // _lib.alg.nonmodifying_, non-modifying sequence operations: 3894T template<class InputIterator, class Function> 3895 Function for_each(InputIterator first, InputIterator last, Function f); 3896T template<class InputIterator, class T> 3897 InputIterator find(InputIterator first, InputIterator last, 3898 const T& value); 3899T template<class InputIterator, class Predicate> 3900 InputIterator find_if(InputIterator first, InputIterator last, 3901 Predicate pred); 3902T template<class ForwardIterator1, class ForwardIterator2> 3903 ForwardIterator1 3904 find_end(ForwardIterator1 first1, ForwardIterator1 last1, 3905 ForwardIterator2 first2, ForwardIterator2 last2); 3906T template<class ForwardIterator1, class ForwardIterator2, 3907 class BinaryPredicate> 3908 ForwardIterator1 3909 find_end(ForwardIterator1 first1, ForwardIterator1 last1, 3910 ForwardIterator2 first2, ForwardIterator2 last2, 3911 BinaryPredicate pred); 3912T template<class ForwardIterator1, class ForwardIterator2> 3913 ForwardIterator1 3914 find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, 3915 ForwardIterator2 first2, ForwardIterator2 last2); 3916T template<class ForwardIterator1, class ForwardIterator2, 3917 class BinaryPredicate> 3918 ForwardIterator1 3919 find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, 3920 ForwardIterator2 first2, ForwardIterator2 last2, 3921 BinaryPredicate pred); 3922T template<class ForwardIterator> 3923 ForwardIterator adjacent_find(ForwardIterator first, 3924 ForwardIterator last); 3925T template<class ForwardIterator, class BinaryPredicate> 3926 ForwardIterator adjacent_find(ForwardIterator first, 3927 ForwardIterator last, BinaryPredicate pred); 3928T template<class InputIterator, class T> 3929 typename iterator_traits<InputIterator>::difference_type 3930 count(InputIterator first, InputIterator last, const T& value); 3931T template<class InputIterator, class Predicate> 3932 typename iterator_traits<InputIterator>::difference_type 3933 count_if(InputIterator first, InputIterator last, Predicate pred); 3934T template<class InputIterator1, class InputIterator2> 3935 pair<InputIterator1, InputIterator2> 3936 mismatch(InputIterator1 first1, InputIterator1 last1, 3937 InputIterator2 first2); 3938T template<class InputIterator1, class InputIterator2, class BinaryPredicate> 3939 pair<InputIterator1, InputIterator2> 3940 mismatch(InputIterator1 first1, InputIterator1 last1, 3941 InputIterator2 first2, BinaryPredicate pred); 3942 3943T template<class InputIterator1, class InputIterator2> 3944 bool equal(InputIterator1 first1, InputIterator1 last1, 3945 InputIterator2 first2); 3946T template<class InputIterator1, class InputIterator2, class BinaryPredicate> 3947 bool equal(InputIterator1 first1, InputIterator1 last1, 3948 InputIterator2 first2, BinaryPredicate pred); 3949T template<class ForwardIterator1, class ForwardIterator2> 3950 ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1, 3951 ForwardIterator2 first2, ForwardIterator2 last2); 3952T template<class ForwardIterator1, class ForwardIterator2, 3953 class BinaryPredicate> 3954 ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1, 3955 ForwardIterator2 first2, ForwardIterator2 last2, 3956 BinaryPredicate pred); 3957T template<class ForwardIterator, class Size, class T> 3958 ForwardIterator search_n(ForwardIterator first, ForwardIterator last, 3959 Size count, const T& value); 3960T template<class ForwardIterator, class Size, class T, class BinaryPredicate> 3961 ForwardIterator1 search_n(ForwardIterator first, ForwardIterator last, 3962 Size count, const T& value, 3963 BinaryPredicate pred); 3964 // _lib.alg.modifying.operations_, modifying sequence operations: 3965 // _lib.alg.copy_, copy: 3966T template<class InputIterator, class OutputIterator> 3967 OutputIterator copy(InputIterator first, InputIterator last, 3968 OutputIterator result); 3969T template<class BidirectionalIterator1, class BidirectionalIterator2> 3970 BidirectionalIterator2 3971 copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, 3972 BidirectionalIterator2 result); 3973 // _lib.alg.swap_, swap: 3974T template<class T> void swap(T& a, T& b); 3975T template<class ForwardIterator1, class ForwardIterator2> 3976 ForwardIterator2 swap_ranges(ForwardIterator1 first1, 3977 ForwardIterator1 last1, ForwardIterator2 first2); 3978T template<class ForwardIterator1, class ForwardIterator2> 3979 void iter_swap(ForwardIterator1 a, ForwardIterator2 b); 3980T template<class InputIterator, class OutputIterator, class UnaryOperation> 3981 OutputIterator transform(InputIterator first, InputIterator last, 3982 OutputIterator result, UnaryOperation op); 3983T template<class InputIterator1, class InputIterator2, class OutputIterator, 3984 class BinaryOperation> 3985 OutputIterator transform(InputIterator1 first1, InputIterator1 last1, 3986 InputIterator2 first2, OutputIterator result, 3987 BinaryOperation binary_op); 3988 3989T template<class ForwardIterator, class T> 3990 void replace(ForwardIterator first, ForwardIterator last, 3991 const T& old_value, const T& new_value); 3992T template<class ForwardIterator, class Predicate, class T> 3993 void replace_if(ForwardIterator first, ForwardIterator last, 3994 Predicate pred, const T& new_value); 3995T template<class InputIterator, class OutputIterator, class T> 3996 OutputIterator replace_copy(InputIterator first, InputIterator last, 3997 OutputIterator result, 3998 const T& old_value, const T& new_value); 3999T template<class Iterator, class OutputIterator, class Predicate, class T> 4000 OutputIterator replace_copy_if(Iterator first, Iterator last, 4001 OutputIterator result, 4002 Predicate pred, const T& new_value); 4003T template<class ForwardIterator, class T> 4004 void fill(ForwardIterator first, ForwardIterator last, const T& value); 4005T template<class OutputIterator, class Size, class T> 4006 void fill_n(OutputIterator first, Size n, const T& value); 4007T template<class ForwardIterator, class Generator> 4008 void generate(ForwardIterator first, ForwardIterator last, Generator gen); 4009T template<class OutputIterator, class Size, class Generator> 4010 void generate_n(OutputIterator first, Size n, Generator gen); 4011T template<class ForwardIterator, class T> 4012 ForwardIterator remove(ForwardIterator first, ForwardIterator last, 4013 const T& value); 4014T template<class ForwardIterator, class Predicate> 4015 ForwardIterator remove_if(ForwardIterator first, ForwardIterator last, 4016 Predicate pred); 4017T template<class InputIterator, class OutputIterator, class T> 4018 OutputIterator remove_copy(InputIterator first, InputIterator last, 4019 OutputIterator result, const T& value); 4020T template<class InputIterator, class OutputIterator, class Predicate> 4021 OutputIterator remove_copy_if(InputIterator first, InputIterator last, 4022 OutputIterator result, Predicate pred); 4023T template<class ForwardIterator> 4024 ForwardIterator unique(ForwardIterator first, ForwardIterator last); 4025T template<class ForwardIterator, class BinaryPredicate> 4026 ForwardIterator unique(ForwardIterator first, ForwardIterator last, 4027 BinaryPredicate pred); 4028T template<class InputIterator, class OutputIterator> 4029 OutputIterator unique_copy(InputIterator first, InputIterator last, 4030 OutputIterator result); 4031T template<class InputIterator, class OutputIterator, class BinaryPredicate> 4032 OutputIterator unique_copy(InputIterator first, InputIterator last, 4033 OutputIterator result, BinaryPredicate pred); 4034T template<class BidirectionalIterator> 4035 void reverse(BidirectionalIterator first, BidirectionalIterator last); 4036T template<class BidirectionalIterator, class OutputIterator> 4037 OutputIterator reverse_copy(BidirectionalIterator first, 4038 BidirectionalIterator last, 4039 OutputIterator result); 4040 4041T template<class ForwardIterator> 4042 void rotate(ForwardIterator first, ForwardIterator middle, 4043 ForwardIterator last); 4044T template<class ForwardIterator, class OutputIterator> 4045 OutputIterator rotate_copy(ForwardIterator first, ForwardIterator middle, 4046 ForwardIterator last, OutputIterator result); 4047T template<class RandomAccessIterator> 4048 void random_shuffle(RandomAccessIterator first, 4049 RandomAccessIterator last); 4050T template<class RandomAccessIterator, class RandomNumberGenerator> 4051 void random_shuffle(RandomAccessIterator first, 4052 RandomAccessIterator last, 4053 RandomNumberGenerator& rand); 4054 // _lib.alg.partitions_, partitions: 4055T template<class BidirectionalIterator, class Predicate> 4056 BidirectionalIterator partition(BidirectionalIterator first, 4057 BidirectionalIterator last, 4058 Predicate pred); 4059T template<class BidirectionalIterator, class Predicate> 4060 BidirectionalIterator stable_partition(BidirectionalIterator first, 4061 BidirectionalIterator last, 4062 Predicate pred); 4063 // _lib.alg.sorting_, sorting and related operations: 4064 // _lib.alg.sort_, sorting: 4065T template<class RandomAccessIterator> 4066 void sort(RandomAccessIterator first, RandomAccessIterator last); 4067T template<class RandomAccessIterator, class Compare> 4068 void sort(RandomAccessIterator first, RandomAccessIterator last, 4069 Compare comp); 4070T template<class RandomAccessIterator> 4071 void stable_sort(RandomAccessIterator first, RandomAccessIterator last); 4072T template<class RandomAccessIterator, class Compare> 4073 void stable_sort(RandomAccessIterator first, RandomAccessIterator last, 4074 Compare comp); 4075T template<class RandomAccessIterator> 4076 void partial_sort(RandomAccessIterator first, 4077 RandomAccessIterator middle, 4078 RandomAccessIterator last); 4079T template<class RandomAccessIterator, class Compare> 4080 void partial_sort(RandomAccessIterator first, 4081 RandomAccessIterator middle, 4082 RandomAccessIterator last, Compare comp); 4083T template<class InputIterator, class RandomAccessIterator> 4084 RandomAccessIterator 4085 partial_sort_copy(InputIterator first, InputIterator last, 4086 RandomAccessIterator result_first, 4087 RandomAccessIterator result_last); 4088T template<class InputIterator, class RandomAccessIterator, class Compare> 4089 RandomAccessIterator 4090 partial_sort_copy(InputIterator first, InputIterator last, 4091 RandomAccessIterator result_first, 4092 RandomAccessIterator result_last, 4093 Compare comp); 4094 4095T template<class RandomAccessIterator> 4096 void nth_element(RandomAccessIterator first, RandomAccessIterator nth, 4097 RandomAccessIterator last); 4098T template<class RandomAccessIterator, class Compare> 4099 void nth_element(RandomAccessIterator first, RandomAccessIterator nth, 4100 RandomAccessIterator last, Compare comp); 4101 // _lib.alg.binary.search_, binary search: 4102T template<class ForwardIterator, class T> 4103 ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, 4104 const T& value); 4105T template<class ForwardIterator, class T, class Compare> 4106 ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, 4107 const T& value, Compare comp); 4108T template<class ForwardIterator, class T> 4109 ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, 4110 const T& value); 4111T template<class ForwardIterator, class T, class Compare> 4112 ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, 4113 const T& value, Compare comp); 4114T template<class ForwardIterator, class T> 4115 pair<ForwardIterator, ForwardIterator> 4116 equal_range(ForwardIterator first, ForwardIterator last, 4117 const T& value); 4118T template<class ForwardIterator, class T, class Compare> 4119 pair<ForwardIterator, ForwardIterator> 4120 equal_range(ForwardIterator first, ForwardIterator last, 4121 const T& value, Compare comp); 4122T template<class ForwardIterator, class T> 4123 bool binary_search(ForwardIterator first, ForwardIterator last, 4124 const T& value); 4125T template<class ForwardIterator, class T, class Compare> 4126 bool binary_search(ForwardIterator first, ForwardIterator last, 4127 const T& value, Compare comp); 4128 // _lib.alg.merge_, merge: 4129T template<class InputIterator1, class InputIterator2, class OutputIterator> 4130 OutputIterator merge(InputIterator1 first1, InputIterator1 last1, 4131 InputIterator2 first2, InputIterator2 last2, 4132 OutputIterator result); 4133T template<class InputIterator1, class InputIterator2, class OutputIterator, 4134 class Compare> 4135 OutputIterator merge(InputIterator1 first1, InputIterator1 last1, 4136 InputIterator2 first2, InputIterator2 last2, 4137 OutputIterator result, Compare comp); 4138T template<class BidirectionalIterator> 4139 void inplace_merge(BidirectionalIterator first, 4140 BidirectionalIterator middle, 4141 BidirectionalIterator last); 4142T template<class BidirectionalIterator, class Compare> 4143 void inplace_merge(BidirectionalIterator first, 4144 BidirectionalIterator middle, 4145 BidirectionalIterator last, Compare comp); 4146 4147 // _lib.alg.set.operations_, set operations: 4148T template<class InputIterator1, class InputIterator2> 4149 bool includes(InputIterator1 first1, InputIterator1 last1, 4150 InputIterator2 first2, InputIterator2 last2); 4151T template<class InputIterator1, class InputIterator2, class Compare> 4152 bool includes(InputIterator1 first1, InputIterator1 last1, 4153 InputIterator2 first2, InputIterator2 last2, Compare comp); 4154T template<class InputIterator1, class InputIterator2, class OutputIterator> 4155 OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, 4156 InputIterator2 first2, InputIterator2 last2, 4157 OutputIterator result); 4158T template<class InputIterator1, class InputIterator2, class OutputIterator, 4159 class Compare> 4160 OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, 4161 InputIterator2 first2, InputIterator2 last2, 4162 OutputIterator result, Compare comp); 4163T template<class InputIterator1, class InputIterator2, class OutputIterator> 4164 OutputIterator set_intersection 4165 (InputIterator1 first1, InputIterator1 last1, 4166 InputIterator2 first2, InputIterator2 last2, 4167 OutputIterator result); 4168T template<class InputIterator1, class InputIterator2, class OutputIterator, 4169 class Compare> 4170 OutputIterator set_intersection 4171 (InputIterator1 first1, InputIterator1 last1, 4172 InputIterator2 first2, InputIterator2 last2, 4173 OutputIterator result, Compare comp); 4174T template<class InputIterator1, class InputIterator2, class OutputIterator> 4175 OutputIterator set_difference 4176 (InputIterator1 first1, InputIterator1 last1, 4177 InputIterator2 first2, InputIterator2 last2, 4178 OutputIterator result); 4179T template<class InputIterator1, class InputIterator2, class OutputIterator, 4180 class Compare> 4181 OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1, 4182 InputIterator2 first2, InputIterator2 last2, 4183 OutputIterator result, Compare comp); 4184T template<class InputIterator1, class InputIterator2, class OutputIterator> 4185 OutputIterator 4186 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, 4187 InputIterator2 first2, InputIterator2 last2, 4188 OutputIterator result); 4189T template<class InputIterator1, class InputIterator2, class OutputIterator, 4190 class Compare> 4191 OutputIterator 4192 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, 4193 InputIterator2 first2, InputIterator2 last2, 4194 OutputIterator result, Compare comp); 4195 // _lib.alg.heap.operations_, heap operations: 4196T template<class RandomAccessIterator> 4197 void push_heap(RandomAccessIterator first, RandomAccessIterator last); 4198T template<class RandomAccessIterator, class Compare> 4199 void push_heap(RandomAccessIterator first, RandomAccessIterator last, 4200 Compare comp); 4201 4202T template<class RandomAccessIterator> 4203 void pop_heap(RandomAccessIterator first, RandomAccessIterator last); 4204T template<class RandomAccessIterator, class Compare> 4205 void pop_heap(RandomAccessIterator first, RandomAccessIterator last, 4206 Compare comp); 4207T template<class RandomAccessIterator> 4208 void make_heap(RandomAccessIterator first, RandomAccessIterator last); 4209T template<class RandomAccessIterator, class Compare> 4210 void make_heap(RandomAccessIterator first, RandomAccessIterator last, 4211 Compare comp); 4212T template<class RandomAccessIterator> 4213 void sort_heap(RandomAccessIterator first, RandomAccessIterator last); 4214T template<class RandomAccessIterator, class Compare> 4215 void sort_heap(RandomAccessIterator first, RandomAccessIterator last, 4216 Compare comp); 4217 // _lib.alg.min.max_, minimum and maximum: 4218T template<class T> const T& min(const T& a, const T& b); 4219T template<class T, class Compare> 4220 const T& min(const T& a, const T& b, Compare comp); 4221T template<class T> const T& max(const T& a, const T& b); 4222T template<class T, class Compare> 4223 const T& max(const T& a, const T& b, Compare comp); 4224T template<class ForwardIterator> 4225 ForwardIterator min_element(ForwardIterator first, ForwardIterator last); 4226T template<class ForwardIterator, class Compare> 4227 ForwardIterator min_element(ForwardIterator first, ForwardIterator last, 4228 Compare comp); 4229T template<class ForwardIterator> 4230 ForwardIterator max_element(ForwardIterator first, ForwardIterator last); 4231T template<class ForwardIterator, class Compare> 4232 ForwardIterator max_element(ForwardIterator first, ForwardIterator last, 4233 Compare comp); 4234T template<class InputIterator1, class InputIterator2> 4235 bool lexicographical_compare 4236 (InputIterator1 first1, InputIterator1 last1, 4237 InputIterator2 first2, InputIterator2 last2); 4238T template<class InputIterator1, class InputIterator2, class Compare> 4239 bool lexicographical_compare 4240 (InputIterator1 first1, InputIterator1 last1, 4241 InputIterator2 first2, InputIterator2 last2, 4242 Compare comp); 4243 4244 // _lib.alg.permutation.generators_, permutations 4245T template<class BidirectionalIterator> 4246 bool next_permutation(BidirectionalIterator first, 4247 BidirectionalIterator last); 4248T template<class BidirectionalIterator, class Compare> 4249 bool next_permutation(BidirectionalIterator first, 4250 BidirectionalIterator last, Compare comp); 4251T template<class BidirectionalIterator> 4252 bool prev_permutation(BidirectionalIterator first, 4253 BidirectionalIterator last); 4254T template<class BidirectionalIterator, class Compare> 4255 bool prev_permutation(BidirectionalIterator first, 4256 BidirectionalIterator last, Compare comp); 4257 4258 4259 25.4 C library algorithms [lib.alg.c.library] 4260 4261 1 Header <cstdlib> (partial, Table 2): 4262 4263 Table 2--Header <cstdlib> synopsis 4264 4265 Functions: bsearch qsort 4266 4267 4268X extern "C" void *bsearch(const void *key, const void *base, 4269 size_t nmemb, size_t size, 4270 int (*compar)(const void *, const void *)); 4271X extern "C++" void *bsearch(const void *key, const void *base, 4272 size_t nmemb, size_t size, 4273 int (*compar)(const void *, const void *)); 4274 4275X extern "C" void qsort(void* base, size_t nmemb, size_t size, 4276 int (*compar)(const void*, const void*)); 4277X extern "C++" void qsort(void* base, size_t nmemb, size_t size, 4278 int (*compar)(const void*, const void*)); 4279 4280 4281 4282 26.2 Complex numbers [lib.complex.numbers] 4283 4284 4285 26.2.1 Header <complex> synopsis [lib.complex.synopsis] 4286 4287T template<class T> class complex; 4288T template<> class complex<float>; 4289T template<> class complex<double>; 4290T template<> class complex<long double>; 4291 // _lib.complex.ops_ operators: 4292T template<class T> 4293 complex<T> operator+(const complex<T>&, const complex<T>&); 4294T template<class T> complex<T> operator+(const complex<T>&, const T&); 4295T template<class T> complex<T> operator+(const T&, const complex<T>&); 4296T template<class T> complex<T> operator- 4297 (const complex<T>&, const complex<T>&); 4298T template<class T> complex<T> operator-(const complex<T>&, const T&); 4299T template<class T> complex<T> operator-(const T&, const complex<T>&); 4300T template<class T> complex<T> operator* 4301 (const complex<T>&, const complex<T>&); 4302T template<class T> complex<T> operator*(const complex<T>&, const T&); 4303T template<class T> complex<T> operator*(const T&, const complex<T>&); 4304T template<class T> complex<T> operator/ 4305 (const complex<T>&, const complex<T>&); 4306T template<class T> complex<T> operator/(const complex<T>&, const T&); 4307T template<class T> complex<T> operator/(const T&, const complex<T>&); 4308T template<class T> complex<T> operator+(const complex<T>&); 4309T template<class T> complex<T> operator-(const complex<T>&); 4310T template<class T> bool operator== 4311 (const complex<T>&, const complex<T>&); 4312T template<class T> bool operator==(const complex<T>&, const T&); 4313T template<class T> bool operator==(const T&, const complex<T>&); 4314T template<class T> bool operator!=(const complex<T>&, const complex<T>&); 4315T template<class T> bool operator!=(const complex<T>&, const T&); 4316T template<class T> bool operator!=(const T&, const complex<T>&); 4317T template<class T, class charT, class traits> 4318 basic_istream<charT, traits>& 4319 operator>>(basic_istream<charT, traits>&, complex<T>&); 4320 4321T template<class T, class charT, class traits> 4322 basic_ostream<charT, traits>& 4323 operator<<(basic_ostream<charT, traits>&, const complex<T>&); 4324 // _lib.complex.value.ops_ values: 4325T template<class T> T real(const complex<T>&); 4326T template<class T> T imag(const complex<T>&); 4327 4328T template<class T> T abs(const complex<T>&); 4329T template<class T> T arg(const complex<T>&); 4330T template<class T> T norm(const complex<T>&); 4331T template<class T> complex<T> conj(const complex<T>&); 4332T template<class T> complex<T> polar(const T&, const T&); 4333 // _lib.complex.transcendentals_ transcendentals: 4334T template<class T> complex<T> cos (const complex<T>&); 4335T template<class T> complex<T> cosh (const complex<T>&); 4336T template<class T> complex<T> exp (const complex<T>&); 4337T template<class T> complex<T> log (const complex<T>&); 4338T template<class T> complex<T> log10(const complex<T>&); 4339T template<class T> complex<T> pow(const complex<T>&, int); 4340T template<class T> complex<T> pow(const complex<T>&, const T&); 4341T template<class T> complex<T> pow(const complex<T>&, const complex<T>&); 4342T template<class T> complex<T> pow(const T&, const complex<T>&); 4343T template<class T> complex<T> sin (const complex<T>&); 4344T template<class T> complex<T> sinh (const complex<T>&); 4345T template<class T> complex<T> sqrt (const complex<T>&); 4346T template<class T> complex<T> tan (const complex<T>&); 4347T template<class T> complex<T> tanh (const complex<T>&); 4348 } 4349 4350 26.2.2 Template class complex [lib.complex] 4351 4352 template<class T> 4353T class complex { 4354 public: 4355T typedef T value_type; 4356 4357T complex(const T& re = T(), const T& im = T()); 4358T complex(const complex&); 4359T template<class X> complex(const complex<X>&); 4360 4361T T real() const; 4362T T imag() const; 4363 4364T complex<T>& operator= (const T&); 4365T complex<T>& operator+=(const T&); 4366T complex<T>& operator-=(const T&); 4367T complex<T>& operator*=(const T&); 4368T complex<T>& operator/=(const T&); 4369 4370T complex& operator=(const complex&); 4371T template<class X> complex<T>& operator= (const complex<X>&); 4372T template<class X> complex<T>& operator+=(const complex<X>&); 4373T template<class X> complex<T>& operator-=(const complex<X>&); 4374T template<class X> complex<T>& operator*=(const complex<X>&); 4375T template<class X> complex<T>& operator/=(const complex<X>&); 4376 }; 4377 4378T template<class T> complex<T> operator+ 4379 (const complex<T>&, const complex<T>&); 4380T template<class T> complex<T> operator+(const complex<T>&, const T&); 4381T template<class T> complex<T> operator+(const T&, const complex<T>&); 4382 4383T template<class T> complex<T> operator- 4384 (const complex<T>&, const complex<T>&); 4385T template<class T> complex<T> operator-(const complex<T>&, const T&); 4386T template<class T> complex<T> operator-(const T&, const complex<T>&); 4387 4388T template<class T> complex<T> operator* 4389 (const complex<T>&, const complex<T>&); 4390T template<class T> complex<T> operator*(const complex<T>&, const T&); 4391T template<class T> complex<T> operator*(const T&, const complex<T>&); 4392 4393T template<class T> complex<T> operator/ 4394 (const complex<T>&, const complex<T>&); 4395T template<class T> complex<T> operator/(const complex<T>&, const T&); 4396T template<class T> complex<T> operator/(const T&, const complex<T>&); 4397 4398T template<class T> complex<T> operator+(const complex<T>&); 4399T template<class T> complex<T> operator-(const complex<T>&); 4400 4401T template<class T> bool operator==(const complex<T>&, const complex<T>&); 4402T template<class T> bool operator==(const complex<T>&, const T&); 4403T template<class T> bool operator==(const T&, const complex<T>&); 4404 4405T template<class T> bool operator!=(const complex<T>&, const complex<T>&); 4406T template<class T> bool operator!=(const complex<T>&, const T&); 4407T template<class T> bool operator!=(const T&, const complex<T>&); 4408 4409T template<class T, class charT, class traits> 4410 basic_istream<charT, traits>& 4411 operator>>(basic_istream<charT, traits>&, complex<T>&); 4412 4413T template<class T, class charT, class traits> 4414 basic_ostream<charT, traits>& 4415 operator<<(basic_ostream<charT, traits>&, const complex<T>&); 4416 4417 4418 26.2.3 complex specializations [lib.complex.special] 4419 4420T template<> class complex<float> { 4421 public: 4422T typedef float value_type; 4423 4424T complex(float re = 0.0f, float im = 0.0f); 4425T explicit complex(const complex<double>&); 4426T explicit complex(const complex<long double>&); 4427T float real() const; 4428T float imag() const; 4429 4430T complex<float>& operator= (float); 4431T complex<float>& operator+=(float); 4432T complex<float>& operator-=(float); 4433T complex<float>& operator*=(float); 4434T complex<float>& operator/=(float); 4435 4436T complex<float>& operator=(const complex<float>&); 4437T template<class X> complex<float>& operator= (const complex<X>&); 4438T template<class X> complex<float>& operator+=(const complex<X>&); 4439T template<class X> complex<float>& operator-=(const complex<X>&); 4440T template<class X> complex<float>& operator*=(const complex<X>&); 4441T template<class X> complex<float>& operator/=(const complex<X>&); 4442 }; 4443T template<> class complex<double> { 4444 public: 4445T typedef double value_type; 4446 4447T complex(double re = 0.0, double im = 0.0); 4448T complex(const complex<float>&); 4449T explicit complex(const complex<long double>&); 4450T double real() const; 4451T double imag() const; 4452 4453T complex<double>& operator= (double); 4454T complex<double>& operator+=(double); 4455T complex<double>& operator-=(double); 4456T complex<double>& operator*=(double); 4457T complex<double>& operator/=(double); 4458 4459T complex<double>& operator=(const complex<double>&); 4460T template<class X> complex<double>& operator= (const complex<X>&); 4461T template<class X> complex<double>& operator+=(const complex<X>&); 4462T template<class X> complex<double>& operator-=(const complex<X>&); 4463T template<class X> complex<double>& operator*=(const complex<X>&); 4464T template<class X> complex<double>& operator/=(const complex<X>&); 4465 }; 4466 4467T template<> class complex<long double> { 4468 public: 4469T typedef long double value_type; 4470 4471T complex(long double re = 0.0L, long double im = 0.0L); 4472T complex(const complex<float>&); 4473T complex(const complex<double>&); 4474T long double real() const; 4475T long double imag() const; 4476 4477T complex<long double>& operator=(const complex<long double>&); 4478T complex<long double>& operator= (long double); 4479T complex<long double>& operator+=(long double); 4480T complex<long double>& operator-=(long double); 4481T complex<long double>& operator*=(long double); 4482T complex<long double>& operator/=(long double); 4483 4484T template<class X> complex<long double>& operator= (const complex<X>&); 4485T template<class X> complex<long double>& operator+=(const complex<X>&); 4486T template<class X> complex<long double>& operator-=(const complex<X>&); 4487T template<class X> complex<long double>& operator*=(const complex<X>&); 4488T template<class X> complex<long double>& operator/=(const complex<X>&); 4489 }; 4490 4491 26.3 Numeric arrays [lib.numarray] 4492 4493 26.3.1 Header <valarray> synopsis [lib.valarray.synopsis] 4494 4495T template<class T> class valarray; // An array of type T 4496T class slice; 4497T template<class T> class slice_array; 4498T class gslice; 4499T template<class T> class gslice_array; 4500T template<class T> class mask_array; // a masked array 4501T template<class T> class indirect_array; // an indirected array 4502 4503T template<class T> valarray<T> operator* 4504 (const valarray<T>&, const valarray<T>&); 4505T template<class T> valarray<T> operator* (const valarray<T>&, const T&); 4506T template<class T> valarray<T> operator* (const T&, const valarray<T>&); 4507T template<class T> valarray<T> operator/ 4508 (const valarray<T>&, const valarray<T>&); 4509T template<class T> valarray<T> operator/ (const valarray<T>&, const T&); 4510T template<class T> valarray<T> operator/ (const T&, const valarray<T>&); 4511T template<class T> valarray<T> operator% 4512 (const valarray<T>&, const valarray<T>&); 4513T template<class T> valarray<T> operator% (const valarray<T>&, const T&); 4514T template<class T> valarray<T> operator% (const T&, const valarray<T>&); 4515T template<class T> valarray<T> operator+ 4516 (const valarray<T>&, const valarray<T>&); 4517T template<class T> valarray<T> operator+ (const valarray<T>&, const T&); 4518T template<class T> valarray<T> operator+ (const T&, const valarray<T>&); 4519T template<class T> valarray<T> operator- 4520 (const valarray<T>&, const valarray<T>&); 4521T template<class T> valarray<T> operator- (const valarray<T>&, const T&); 4522T template<class T> valarray<T> operator- (const T&, const valarray<T>&); 4523T template<class T> valarray<T> operator^ 4524 (const valarray<T>&, const valarray<T>&); 4525T template<class T> valarray<T> operator^ (const valarray<T>&, const T&); 4526T template<class T> valarray<T> operator^ (const T&, const valarray<T>&); 4527T template<class T> valarray<T> operator& 4528 (const valarray<T>&, const valarray<T>&); 4529T template<class T> valarray<T> operator& (const valarray<T>&, const T&); 4530T template<class T> valarray<T> operator& (const T&, const valarray<T>&); 4531T template<class T> valarray<T> operator| 4532 (const valarray<T>&, const valarray<T>&); 4533T template<class T> valarray<T> operator| (const valarray<T>&, const T&); 4534T template<class T> valarray<T> operator| (const T&, const valarray<T>&); 4535T template<class T> valarray<T> operator<< 4536 (const valarray<T>&, const valarray<T>&); 4537T template<class T> valarray<T> operator<<(const valarray<T>&, const T&); 4538T template<class T> valarray<T> operator<<(const T&, const valarray<T>&); 4539T template<class T> valarray<T> operator>> 4540 (const valarray<T>&, const valarray<T>&); 4541T template<class T> valarray<T> operator>>(const valarray<T>&, const T&); 4542T template<class T> valarray<T> operator>>(const T&, const valarray<T>&); 4543T template<class T> valarray<bool> operator&& 4544 (const valarray<T>&, const valarray<T>&); 4545T template<class T> valarray<bool> operator&&(const valarray<T>&, const T&); 4546T template<class T> valarray<bool> operator&&(const T&, const valarray<T>&); 4547T template<class T> valarray<bool> operator|| 4548 (const valarray<T>&, const valarray<T>&); 4549T template<class T> valarray<bool> operator||(const valarray<T>&, const T&); 4550T template<class T> valarray<bool> operator||(const T&, const valarray<T>&); 4551 4552T template<class T> 4553 valarray<bool> operator==(const valarray<T>&, const valarray<T>&); 4554T template<class T> valarray<bool> operator==(const valarray<T>&, const T&); 4555T template<class T> valarray<bool> operator==(const T&, const valarray<T>&); 4556T template<class T> 4557 valarray<bool> operator!=(const valarray<T>&, const valarray<T>&); 4558T template<class T> valarray<bool> operator!=(const valarray<T>&, const T&); 4559T template<class T> valarray<bool> operator!=(const T&, const valarray<T>&); 4560T template<class T> 4561 valarray<bool> operator< (const valarray<T>&, const valarray<T>&); 4562T template<class T> valarray<bool> operator< (const valarray<T>&, const T&); 4563T template<class T> valarray<bool> operator< (const T&, const valarray<T>&); 4564T template<class T> 4565 valarray<bool> operator> (const valarray<T>&, const valarray<T>&); 4566T template<class T> valarray<bool> operator> (const valarray<T>&, const T&); 4567T template<class T> valarray<bool> operator> (const T&, const valarray<T>&); 4568T template<class T> 4569 valarray<bool> operator<=(const valarray<T>&, const valarray<T>&); 4570T template<class T> valarray<bool> operator<=(const valarray<T>&, const T&); 4571T template<class T> valarray<bool> operator<=(const T&, const valarray<T>&); 4572T template<class T> 4573 valarray<bool> operator>=(const valarray<T>&, const valarray<T>&); 4574T template<class T> valarray<bool> operator>=(const valarray<T>&, const T&); 4575T template<class T> valarray<bool> operator>=(const T&, const valarray<T>&); 4576T template<class T> valarray<T> abs (const valarray<T>&); 4577T template<class T> valarray<T> acos (const valarray<T>&); 4578T template<class T> valarray<T> asin (const valarray<T>&); 4579T template<class T> valarray<T> atan (const valarray<T>&); 4580T template<class T> valarray<T> atan2 4581 (const valarray<T>&, const valarray<T>&); 4582T template<class T> valarray<T> atan2(const valarray<T>&, const T&); 4583T template<class T> valarray<T> atan2(const T&, const valarray<T>&); 4584T template<class T> valarray<T> cos (const valarray<T>&); 4585T template<class T> valarray<T> cosh (const valarray<T>&); 4586T template<class T> valarray<T> exp (const valarray<T>&); 4587T template<class T> valarray<T> log (const valarray<T>&); 4588T template<class T> valarray<T> log10(const valarray<T>&); 4589T template<class T> valarray<T> pow(const valarray<T>&, const valarray<T>&); 4590T template<class T> valarray<T> pow(const valarray<T>&, const T&); 4591T template<class T> valarray<T> pow(const T&, const valarray<T>&); 4592T template<class T> valarray<T> sin (const valarray<T>&); 4593T template<class T> valarray<T> sinh (const valarray<T>&); 4594T template<class T> valarray<T> sqrt (const valarray<T>&); 4595T template<class T> valarray<T> tan (const valarray<T>&); 4596T template<class T> valarray<T> tanh (const valarray<T>&); 4597 } 4598 4599 4600 26.3.2 Template class valarray [lib.template.valarray] 4601 4602T template<class T> class valarray { 4603 public: 4604T typedef T value_type; 4605 4606 // _lib.valarray.cons_ construct/destroy: 4607T valarray(); 4608T explicit valarray(size_t); 4609T valarray(const T&, size_t); 4610T valarray(const T*, size_t); 4611T valarray(const valarray&); 4612T valarray(const slice_array<T>&); 4613T valarray(const gslice_array<T>&); 4614T valarray(const mask_array<T>&); 4615T valarray(const indirect_array<T>&); 4616T ~valarray(); 4617 4618 // _lib.valarray.assign_ assignment: 4619T valarray<T>& operator=(const valarray<T>&); 4620T valarray<T>& operator=(const T&); 4621T valarray<T>& operator=(const slice_array<T>&); 4622T valarray<T>& operator=(const gslice_array<T>&); 4623T valarray<T>& operator=(const mask_array<T>&); 4624T valarray<T>& operator=(const indirect_array<T>&); 4625 // _lib.valarray.access_ element access: 4626T T operator[](size_t) const; 4627T T& operator[](size_t); 4628 // _lib.valarray.sub_ subset operations: 4629T valarray<T> operator[](slice) const; 4630T slice_array<T> operator[](slice); 4631T valarray<T> operator[](const gslice&) const; 4632T gslice_array<T> operator[](const gslice&); 4633T valarray<T> operator[](const valarray<bool>&) const; 4634T mask_array<T> operator[](const valarray<bool>&); 4635T valarray<T> operator[](const valarray<size_t>&) const; 4636T indirect_array<T> operator[](const valarray<size_t>&); 4637 // _lib.valarray.unary_ unary operators: 4638T valarray<T> operator+() const; 4639T valarray<T> operator-() const; 4640T valarray<T> operator~() const; 4641T valarray<T> operator!() const; 4642 // _lib.valarray.cassign_ computed assignment: 4643T valarray<T>& operator*= (const T&); 4644T valarray<T>& operator/= (const T&); 4645T valarray<T>& operator%= (const T&); 4646T valarray<T>& operator+= (const T&); 4647T valarray<T>& operator-= (const T&); 4648T valarray<T>& operator^= (const T&); 4649T valarray<T>& operator&= (const T&); 4650T valarray<T>& operator|= (const T&); 4651T valarray<T>& operator<<=(const T&); 4652T valarray<T>& operator>>=(const T&); 4653T valarray<T>& operator*= (const valarray<T>&); 4654T valarray<T>& operator/= (const valarray<T>&); 4655T valarray<T>& operator%= (const valarray<T>&); 4656T valarray<T>& operator+= (const valarray<T>&); 4657T valarray<T>& operator-= (const valarray<T>&); 4658T valarray<T>& operator^= (const valarray<T>&); 4659T valarray<T>& operator|= (const valarray<T>&); 4660T valarray<T>& operator&= (const valarray<T>&); 4661T valarray<T>& operator<<=(const valarray<T>&); 4662T valarray<T>& operator>>=(const valarray<T>&); 4663 // _lib.valarray.members_ member functions: 4664T size_t size() const; 4665T T sum() const; 4666T T min() const; 4667T T max() const; 4668 4669T valarray<T> shift (int) const; 4670T valarray<T> cshift(int) const; 4671T valarray<T> apply(T func(T)) const; 4672T valarray<T> apply(T func(const T&)) const; 4673T void resize(size_t sz, T c = T()); 4674 }; 4675 } 4676 4677 4678 4679 26.3.4 Class slice [lib.class.slice] 4680 4681T class slice { 4682 public: 4683T slice(); 4684T slice(size_t, size_t, size_t); 4685 4686T size_t start() const; 4687T size_t size() const; 4688T size_t stride() const; 4689 }; 4690 } 4691 4692 4693 4694 26.3.5 Template class slice_array [lib.template.slice.array] 4695 4696T template <class T> class slice_array { 4697 public: 4698T typedef T value_type; 4699 4700T void operator= (const valarray<T>&) const; 4701T void operator*= (const valarray<T>&) const; 4702T void operator/= (const valarray<T>&) const; 4703T void operator%= (const valarray<T>&) const; 4704T void operator+= (const valarray<T>&) const; 4705T void operator-= (const valarray<T>&) const; 4706T void operator^= (const valarray<T>&) const; 4707T void operator&= (const valarray<T>&) const; 4708T void operator|= (const valarray<T>&) const; 4709T void operator<<=(const valarray<T>&) const; 4710T void operator>>=(const valarray<T>&) const; 4711T void operator=(const T&); 4712T ~slice_array(); 4713 private: 4714T slice_array(); 4715T slice_array(const slice_array&); 4716T slice_array& operator=(const slice_array&); 4717 }; 4718 } 4719 4720 4721 4722 26.3.6 The gslice class [lib.class.gslice] 4723 4724T class gslice { 4725 public: 4726T gslice(); 4727T gslice(size_t s, const valarray<size_t>& l, const valarray<size_t>& d); 4728 4729T size_t start() const; 4730T valarray<size_t> size() const; 4731T valarray<size_t> stride() const; 4732 }; 4733 4734 4735 26.3.7 Template class gslice_array [lib.template.gslice.array] 4736 4737T template <class T> class gslice_array { 4738 public: 4739T typedef T value_type; 4740 4741T void operator= (const valarray<T>&) const; 4742T void operator*= (const valarray<T>&) const; 4743T void operator/= (const valarray<T>&) const; 4744T void operator%= (const valarray<T>&) const; 4745T void operator+= (const valarray<T>&) const; 4746T void operator-= (const valarray<T>&) const; 4747T void operator^= (const valarray<T>&) const; 4748T void operator&= (const valarray<T>&) const; 4749T void operator|= (const valarray<T>&) const; 4750T void operator<<=(const valarray<T>&) const; 4751T void operator>>=(const valarray<T>&) const; 4752T void operator=(const T&); 4753T ~gslice_array(); 4754 private: 4755T gslice_array(); 4756T gslice_array(const gslice_array&); 4757T gslice_array& operator=(const gslice_array&); 4758 }; 4759 4760 4761 26.3.8 Template class mask_array [lib.template.mask.array] 4762 4763T template <class T> class mask_array { 4764 public: 4765T typedef T value_type; 4766 4767T void operator= (const valarray<T>&) const; 4768T void operator*= (const valarray<T>&) const; 4769T void operator/= (const valarray<T>&) const; 4770T void operator%= (const valarray<T>&) const; 4771T void operator+= (const valarray<T>&) const; 4772T void operator-= (const valarray<T>&) const; 4773T void operator^= (const valarray<T>&) const; 4774T void operator&= (const valarray<T>&) const; 4775T void operator|= (const valarray<T>&) const; 4776T void operator<<=(const valarray<T>&) const; 4777T void operator>>=(const valarray<T>&) const; 4778T void operator=(const T&); 4779T ~mask_array(); 4780 private: 4781T mask_array(); 4782T mask_array(const mask_array&); 4783T mask_array& operator=(const mask_array&); 4784 // remainder implementation defined 4785 }; 4786 4787 4788 26.3.9 Template class [lib.template.indirect.array] 4789 indirect_array 4790 4791T template <class T> class indirect_array { 4792 public: 4793T typedef T value_type; 4794 4795T void operator= (const valarray<T>&) const; 4796T void operator*= (const valarray<T>&) const; 4797T void operator/= (const valarray<T>&) const; 4798T void operator%= (const valarray<T>&) const; 4799T void operator+= (const valarray<T>&) const; 4800T void operator-= (const valarray<T>&) const; 4801T void operator^= (const valarray<T>&) const; 4802T void operator&= (const valarray<T>&) const; 4803T void operator|= (const valarray<T>&) const; 4804T void operator<<=(const valarray<T>&) const; 4805T void operator>>=(const valarray<T>&) const; 4806T void operator=(const T&); 4807T ~indirect_array(); 4808 private: 4809T indirect_array(); 4810T indirect_array(const indirect_array&); 4811T indirect_array& operator=(const indirect_array&); 4812 // remainder implementation defined 4813 }; 4814 4815 26.4 Generalized numeric operations [lib.numeric.ops] 4816 4817 Header <numeric> synopsis 4818 4819T template <class InputIterator, class T> 4820 T accumulate(InputIterator first, InputIterator last, T init); 4821 4822T template <class InputIterator, class T, class BinaryOperation> 4823 T accumulate(InputIterator first, InputIterator last, T init, 4824 BinaryOperation binary_op); 4825 4826T template <class InputIterator1, class InputIterator2, class T> 4827 T inner_product(InputIterator1 first1, InputIterator1 last1, 4828 InputIterator2 first2, T init); 4829 4830T template <class InputIterator1, class InputIterator2, class T, 4831 class BinaryOperation1, class BinaryOperation2> 4832 T inner_product(InputIterator1 first1, InputIterator1 last1, 4833 InputIterator2 first2, T init, 4834 BinaryOperation1 binary_op1, 4835 BinaryOperation2 binary_op2); 4836 4837T template <class InputIterator, class OutputIterator> 4838 OutputIterator partial_sum(InputIterator first, 4839 InputIterator last, 4840 OutputIterator result); 4841 4842T template <class InputIterator, class OutputIterator, 4843 class BinaryOperation> 4844 OutputIterator partial_sum(InputIterator first, 4845 InputIterator last, 4846 OutputIterator result, 4847 BinaryOperation binary_op); 4848 4849T template <class InputIterator, class OutputIterator> 4850 OutputIterator adjacent_difference(InputIterator first, 4851 InputIterator last, 4852 OutputIterator result); 4853 4854T template <class InputIterator, class OutputIterator, 4855 class BinaryOperation> 4856 OutputIterator adjacent_difference(InputIterator first, 4857 InputIterator last, 4858 OutputIterator result, 4859 BinaryOperation binary_op); 4860 4861 4862 26.5 C Library [lib.c.math] 4863 4864 Table 2--Header <cmath> synopsis 4865X Macro: HUGE_VAL 4866 Functions: 4867X acos cos fmod modf tan 4868X asin cosh frexp pow tanh 4869X atan exp ldexp sin 4870X atan2 fabs log sinh 4871X ceil floor log10 sqrt 4872 4873 Table 3--Header <cstdlib> synopsis 4874X Macros: RAND_MAX 4875X Types: div_t ldiv_t 4876 Functions: 4877X abs labs srand 4878X div ldiv rand 4879 4880X long abs(long); // labs() 4881X ldiv_t div(long, long); // ldiv() 4882 4883X float abs (float); 4884X float acos (float); 4885X float asin (float); 4886X float atan (float); 4887X float atan2(float, float); 4888X float ceil (float); 4889X float cos (float); 4890X float cosh (float); 4891X float exp (float); 4892X float fabs (float); 4893X float floor(float); 4894X float fmod (float, float); 4895X float frexp(float, int*); 4896X float ldexp(float, int); 4897X float log (float); 4898X float log10(float); 4899X float modf (float, float*); 4900X float pow (float, float); 4901X float pow (float, int); 4902X float sin (float); 4903X float sinh (float); 4904X float sqrt (float); 4905X float tan (float); 4906X float tanh (float); 4907 4908X double abs(double); // fabs() 4909X double pow(double, int); 4910 4911X long double abs (long double); 4912X long double acos (long double); 4913X long double asin (long double); 4914X long double atan (long double); 4915X long double atan2(long double, long double); 4916X long double ceil (long double); 4917X long double cos (long double); 4918X long double cosh (long double); 4919X long double exp (long double); 4920X long double fabs (long double); 4921X long double floor(long double); 4922X long double fmod (long double, long double); 4923X long double frexp(long double, int*); 4924X long double ldexp(long double, int); 4925X long double log (long double); 4926X long double log10(long double); 4927X long double modf (long double, long double*); 4928X long double pow (long double, long double); 4929X long double pow (long double, int); 4930X long double sin (long double); 4931X long double sinh (long double); 4932X long double sqrt (long double); 4933X long double tan (long double); 4934X long double tanh (long double); 4935 4936 Header <iosfwd> synopsis 4937 4938X template<class charT> class char_traits; 4939X template<> class char_traits<char>; 4940X template<> class char_traits<wchar_t>; 4941X template<class T> class allocator; 4942X template <class charT, class traits = char_traits<charT> > 4943 class basic_ios; 4944 4945X template <class charT, class traits = char_traits<charT> > 4946 class basic_streambuf; 4947 4948X template <class charT, class traits = char_traits<charT> > 4949 class basic_istream; 4950 4951X template <class charT, class traits = char_traits<charT> > 4952 class basic_ostream; 4953 4954X template <class charT, class traits = char_traits<charT> > 4955 class basic_iostream; 4956 4957X template <class charT, class traits = char_traits<charT>, 4958 class Allocator = allocator<charT> > 4959 class basic_stringbuf; 4960 4961X template <class charT, class traits = char_traits<charT>, 4962 class Allocator = allocator<charT> > 4963 class basic_istringstream; 4964 4965X template <class charT, class traits = char_traits<charT>, 4966 class Allocator = allocator<charT> > 4967 class basic_ostringstream; 4968 4969X template <class charT, class traits = char_traits<charT>, 4970 class Allocator = allocator<charT> > 4971 class basic_stringstream; 4972 4973X template <class charT, class traits = char_traits<charT> > 4974 class basic_filebuf; 4975 4976X template <class charT, class traits = char_traits<charT> > 4977 class basic_ifstream; 4978 4979X template <class charT, class traits = char_traits<charT> > 4980 class basic_ofstream; 4981 4982X template <class charT, class traits = char_traits<charT> > 4983 class basic_fstream; 4984X template <class charT, class traits = char_traits<charT> > 4985 class istreambuf_iterator; 4986 4987X template <class charT, class traits = char_traits<charT> > 4988 class ostreambuf_iterator; 4989X typedef basic_ios<char> ios; 4990X typedef basic_ios<wchar_t> wios; 4991X typedef basic_streambuf<char> streambuf; 4992X typedef basic_istream<char> istream; 4993X typedef basic_ostream<char> ostream; 4994X typedef basic_iostream<char> iostream; 4995X typedef basic_stringbuf<char> stringbuf; 4996X typedef basic_istringstream<char> istringstream; 4997X typedef basic_ostringstream<char> ostringstream; 4998X typedef basic_stringstream<char> stringstream; 4999X typedef basic_filebuf<char> filebuf; 5000X typedef basic_ifstream<char> ifstream; 5001X typedef basic_ofstream<char> ofstream; 5002X typedef basic_fstream<char> fstream; 5003X typedef basic_streambuf<wchar_t> wstreambuf; 5004X typedef basic_istream<wchar_t> wistream; 5005X typedef basic_ostream<wchar_t> wostream; 5006X typedef basic_iostream<wchar_t> wiostream; 5007X typedef basic_stringbuf<wchar_t> wstringbuf; 5008X typedef basic_istringstream<wchar_t> wistringstream; 5009X typedef basic_ostringstream<wchar_t> wostringstream; 5010X typedef basic_stringstream<wchar_t> wstringstream; 5011 5012X typedef basic_filebuf<wchar_t> wfilebuf; 5013X typedef basic_ifstream<wchar_t> wifstream; 5014X typedef basic_ofstream<wchar_t> wofstream; 5015X typedef basic_fstream<wchar_t> wfstream; 5016X template <class state> class fpos; 5017X typedef fpos<char_traits<char>::state_type> streampos; 5018X typedef fpos<char_traits<wchar_t>::state_type> wstreampos; 5019 5020 27.3 Standard iostream objects [lib.iostream.objects] 5021 5022 Header <iostream> synopsis 5023 5024T [must also include <istream> and <ostream>] 5025T extern istream cin; 5026T extern ostream cout; 5027T extern ostream cerr; 5028T extern ostream clog; 5029 5030T extern wistream wcin; 5031T extern wostream wcout; 5032T extern wostream wcerr; 5033T extern wostream wclog; 5034 5035 27.4 Iostreams base classes [lib.iostreams.base] 5036 5037 Header <ios> synopsis 5038 5039 #include <iosfwd> 5040 5041T typedef OFF_T streamoff; 5042T typedef SZ_T streamsize; 5043T template <class stateT> class fpos; 5044 5045 class ios_base; 5046 template <class charT, class traits = char_traits<charT> > 5047 class basic_ios; 5048 // _lib.std.ios.manip_, manipulators: 5049T ios_base& boolalpha (ios_base& str); 5050T ios_base& noboolalpha(ios_base& str); 5051T ios_base& showbase (ios_base& str); 5052T ios_base& noshowbase (ios_base& str); 5053T ios_base& showpoint (ios_base& str); 5054T ios_base& noshowpoint(ios_base& str); 5055T ios_base& showpos (ios_base& str); 5056T ios_base& noshowpos (ios_base& str); 5057T ios_base& skipws (ios_base& str); 5058T ios_base& noskipws (ios_base& str); 5059T ios_base& nouppercase(ios_base& str); 5060T ios_base& uppercase (ios_base& str); 5061M ios_base& unitbuf (ios_base& str); 5062M ios_base& nounitbuf (ios_base& str); 5063 // _lib.adjustfield.manip_ adjustfield: 5064T ios_base& internal (ios_base& str); 5065T ios_base& left (ios_base& str); 5066T ios_base& right (ios_base& str); 5067 // _lib.basefield.manip_ basefield: 5068T ios_base& dec (ios_base& str); 5069T ios_base& hex (ios_base& str); 5070T ios_base& oct (ios_base& str); 5071 5072 // _lib.floatfield.manip_ floatfield: 5073T ios_base& fixed (ios_base& str); 5074T ios_base& scientific (ios_base& str); 5075 5076 5077 27.4.2 Class ios_base [lib.ios.base] 5078 5079T class ios_base { 5080 public: 5081 class failure; 5082T typedef T1 fmtflags; 5083T static const fmtflags boolalpha; 5084T static const fmtflags dec; 5085T static const fmtflags fixed; 5086T static const fmtflags hex; 5087T static const fmtflags internal; 5088T static const fmtflags left; 5089T static const fmtflags oct; 5090T static const fmtflags right; 5091T static const fmtflags scientific; 5092T static const fmtflags showbase; 5093T static const fmtflags showpoint; 5094T static const fmtflags showpos; 5095T static const fmtflags skipws; 5096X static const fmtflags unitbuf; 5097T static const fmtflags uppercase; 5098T static const fmtflags adjustfield; 5099T static const fmtflags basefield; 5100T static const fmtflags floatfield; 5101 5102 typedef T2 iostate; 5103T static const iostate badbit; 5104T static const iostate eofbit; 5105T static const iostate failbit; 5106T static const iostate goodbit; 5107T typedef T3 openmode; 5108T static const openmode app; 5109T static const openmode ate; 5110T static const openmode binary; 5111T static const openmode in; 5112T static const openmode out; 5113T static const openmode trunc; 5114T typedef T4 seekdir; 5115T static const seekdir beg; 5116T static const seekdir cur; 5117T static const seekdir end; 5118T class Init; 5119 // _lib.fmtflags.state_ fmtflags state: 5120T fmtflags flags() const; 5121T fmtflags flags(fmtflags fmtfl); 5122T fmtflags setf(fmtflags fmtfl); 5123T fmtflags setf(fmtflags fmtfl, fmtflags mask); 5124T void unsetf(fmtflags mask); 5125T streamsize precision() const; 5126T streamsize precision(streamsize prec); 5127T streamsize width() const; 5128T streamsize width(streamsize wide); 5129 // _lib.ios.base.locales_ locales: 5130T locale imbue(const locale& loc); 5131T locale getloc() const; 5132 // _lib.ios.base.storage_ storage: 5133T static int xalloc(); 5134T long& iword(int index); 5135T void*& pword(int index); 5136 // destructor 5137T virtual ~ios_base(); 5138 // _lib.ios.base.callback_ callbacks; 5139T enum event { erase_event, imbue_event, copyfmt_event }; 5140T typedef void (*event_callback)(event, ios_base&, int index); 5141T void register_callback(event_call_back fn, int index); 5142T static bool sync_with_stdio(bool sync = true); 5143 protected: 5144T ios_base(); 5145 }; 5146 5147 27.4.2.1.1 Class ios_base::failure [lib.ios::failure] 5148 5149T class ios_base::failure : public exception { 5150 public: 5151T explicit failure(const string& msg); 5152T virtual ~failure(); 5153T virtual const char* what() const throw(); 5154 }; 5155 5156 5157 27.4.2.1.6 Class ios_base::Init [lib.ios::Init] 5158 5159T class ios_base::Init { 5160 public: 5161T Init(); 5162T ~Init(); 5163 }; 5164 5165 5166 27.4.3 Template class fpos [lib.fpos] 5167 5168X template <class stateT> class fpos { 5169 public: 5170 // _lib.fpos.members_ Members 5171T stateT state() const; 5172T void state(stateT); 5173 private; 5174T stateT st; // exposition only 5175 }; 5176 5177 5178 27.4.5 Template class basic_ios [lib.ios] 5179 5180 template <class charT, class traits = char_traits<charT> > 5181X class basic_ios : public ios_base { 5182 public: 5183 5184 // Types: 5185T typedef charT char_type; 5186T typedef typename traits::int_type int_type; 5187T typedef typename traits::pos_type pos_type; 5188T typedef typename traits::off_type off_type; 5189T typedef traits traits_type; 5190T operator void*() const 5191T bool operator!() const 5192T iostate rdstate() const; 5193T void clear(iostate state = goodbit); 5194T void setstate(iostate state); 5195T bool good() const; 5196T bool eof() const; 5197T bool fail() const; 5198T bool bad() const; 5199T iostate exceptions() const; 5200T void exceptions(iostate except); 5201 // _lib.basic.ios.cons_ Constructor/destructor: 5202T explicit basic_ios(basic_streambuf<charT,traits>* sb); 5203T virtual ~basic_ios(); 5204 // _lib.basic.ios.members_ Members: 5205T basic_ostream<charT,traits>* tie() const; 5206T basic_ostream<charT,traits>* tie(basic_ostream<charT,traits>* tiestr); 5207T basic_streambuf<charT,traits>* rdbuf() const; 5208T basic_streambuf<charT,traits>* rdbuf(basic_streambuf<charT,traits>* sb); 5209X basic_ios& copyfmt(const basic_ios& rhs); 5210T char_type fill() const; 5211T char_type fill(char_type ch); 5212 // _lib.ios.base.locales_ locales: 5213T locale imbue(const locale& loc); 5214X char narrow(char_type c, char dfault) const; 5215X char_type widen(char c) const; 5216 protected: 5217 basic_ios(); 5218T void init(basic_streambuf<charT,traits>* sb); 5219 private: 5220T basic_ios(const basic_ios& ); // not defined 5221T basic_ios& operator=(const basic_ios&); // not defined 5222 }; 5223 5224 5225 27.5 Stream buffers [lib.stream.buffers] 5226 5227 Header <streambuf> synopsis 5228 5229X template <class charT, class traits = char_traits<charT> > 5230 class basic_streambuf; 5231T typedef basic_streambuf<char> streambuf; 5232T typedef basic_streambuf<wchar_t> wstreambuf; 5233 5234 27.5.2 Template class [lib.streambuf] 5235 basic_streambuf<charT,traits> 5236 5237 template <class charT, class traits = char_traits<charT> > 5238X class basic_streambuf { 5239 public: 5240 5241 // Types: 5242T typedef charT char_type; 5243T typedef typename traits::int_type int_type; 5244T typedef typename traits::pos_type pos_type; 5245T typedef typename traits::off_type off_type; 5246T typedef traits traits_type; 5247T virtual ~basic_streambuf(); 5248 // _lib.streambuf.locales_ locales: 5249T locale pubimbue(const locale &loc); 5250T locale getloc() const; 5251 // _lib.streambuf.buffer_ buffer and positioning: 5252T basic_streambuf<char_type,traits>* 5253 pubsetbuf(char_type* s, streamsize n); 5254T pos_type pubseekoff(off_type off, ios_base::seekdir way, 5255 ios_base::openmode which = 5256 ios_base::in | ios_base::out); 5257T pos_type pubseekpos(pos_type sp, 5258 ios_base::openmode which = 5259 ios_base::in | ios_base::out); 5260T int pubsync(); 5261 5262 // Get and put areas: 5263 // _lib.streambuf.pub.get_ Get area: 5264T streamsize in_avail(); 5265T int_type snextc(); 5266T int_type sbumpc(); 5267T int_type sgetc(); 5268T streamsize sgetn(char_type* s, streamsize n); 5269 // _lib.streambuf.pub.pback_ Putback: 5270X int_type sputbackc(char_type c); 5271X int_type sungetc(); 5272 // _lib.streambuf.pub.put_ Put area: 5273T int_type sputc(char_type c); 5274X streamsize sputn(const char_type* s, streamsize n); 5275 protected: 5276T basic_streambuf(); 5277 // _lib.streambuf.get.area_ Get area: 5278T char_type* eback() const; 5279T char_type* gptr() const; 5280T char_type* egptr() const; 5281T void gbump(int n); 5282T void setg(char_type* gbeg, char_type* gnext, char_type* gend); 5283 // _lib.streambuf.put.area_ Put area: 5284T char_type* pbase() const; 5285T char_type* pptr() const; 5286T char_type* epptr() const; 5287T void pbump(int n); 5288T void setp(char_type* pbeg, char_type* pend); 5289 // _lib.streambuf.virtuals_ virtual functions: 5290 // _lib.streambuf.virt.locales_ Locales: 5291T virtual void imbue(const locale &loc); 5292 // _lib.streambuf.virt.buffer_ Buffer management and positioning: 5293T virtual basic_streambuf<char_type,traits>* 5294 setbuf(char_type* s, streamsize n); 5295T virtual pos_type seekoff(off_type off, ios_base::seekdir way, 5296 ios_base::openmode which = ios_base::in | ios_base::out); 5297T virtual pos_type seekpos(pos_type sp, 5298 ios_base::openmode which = ios_base::in | ios_base::out); 5299T virtual int sync(); 5300 // _lib.streambuf.virt.get_ Get area: 5301T virtual int showmanyc(); 5302T virtual streamsize xsgetn(char_type* s, streamsize n); 5303T virtual int_type underflow(); 5304T virtual int_type uflow(); 5305 // _lib.streambuf.virt.pback_ Putback: 5306T virtual int_type pbackfail(int_type c = traits::eof()); 5307 // _lib.streambuf.virt.put_ Put area: 5308X virtual streamsize xsputn(const char_type* s, streamsize n); 5309T virtual int_type overflow (int_type c = traits::eof()); 5310 }; 5311 5312 27.6 Formatting and manipulators [lib.iostream.format] 5313 5314 Header <istream> synopsis 5315 5316T template <class charT, class traits = char_traits<charT> > 5317 class basic_istream; 5318T typedef basic_istream<char> istream; 5319T typedef basic_istream<wchar_t> wistream; 5320 5321T template <class charT, class traits = char_traits<charT> > 5322 class basic_iostream; 5323T typedef basic_iostream<char> iostream; 5324T typedef basic_iostream<wchar_t> wiostream; 5325 5326X template <class charT, class traits> 5327 basic_istream<charT,traits>& ws(basic_istream<charT,traits>& is); 5328 5329 Header <ostream> synopsis 5330 5331X template <class charT, class traits = char_traits<charT> > 5332 class basic_ostream; 5333T typedef basic_ostream<char> ostream; 5334T typedef basic_ostream<wchar_t> wostream; 5335 5336T template <class charT, class traits> 5337 basic_ostream<charT,traits>& endl(basic_ostream<charT,traits>& os); 5338T template <class charT, class traits> 5339 basic_ostream<charT,traits>& ends(basic_ostream<charT,traits>& os); 5340T template <class charT, class traits> 5341 basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os); 5342 5343 Header <iomanip> synopsis 5344 5345 // Types T1, T2, ... are unspecified implementation types 5346T T1 resetiosflags(ios_base::fmtflags mask); 5347T T2 setiosflags (ios_base::fmtflags mask); 5348T T3 setbase(int base); 5349T template<charT> T4 setfill(charT c); 5350T T5 setprecision(int n); 5351T T6 setw(int n); 5352 5353 5354 27.6.1.1 Template class basic_istream [lib.istream] 5355 5356 template <class charT, class traits = char_traits<charT> > 5357T class basic_istream : virtual public basic_ios<charT,traits> { 5358 public: 5359 // Types (inherited from basic_ios (_lib.ios_)): 5360T typedef charT char_type; 5361T typedef typename traits::int_type int_type; 5362T typedef typename traits::pos_type pos_type; 5363T typedef typename traits::off_type off_type; 5364T typedef traits traits_type; 5365 // _lib.istream.cons_ Constructor/destructor: 5366T explicit basic_istream(basic_streambuf<charT,traits>* sb); 5367T virtual ~basic_istream(); 5368 // _lib.istream::sentry_ Prefix/suffix: 5369T class sentry; 5370 5371 // _lib.istream.formatted_ Formatted input: 5372T basic_istream<charT,traits>& operator>> 5373 (basic_istream<charT,traits>& (*pf)(basic_istream<charT,traits>&)) 5374T basic_istream<charT,traits>& operator>> 5375 (basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&)) 5376T basic_istream<charT,traits>& operator>> 5377 (ios_base& (*pf)(ios_base&)) 5378S basic_istream<charT,traits>& operator>>(bool& n); 5379S basic_istream<charT,traits>& operator>>(short& n); 5380S basic_istream<charT,traits>& operator>>(unsigned short& n); 5381S basic_istream<charT,traits>& operator>>(int& n); 5382S basic_istream<charT,traits>& operator>>(unsigned int& n); 5383S basic_istream<charT,traits>& operator>>(long& n); 5384S basic_istream<charT,traits>& operator>>(unsigned long& n); 5385S basic_istream<charT,traits>& operator>>(float& f); 5386S basic_istream<charT,traits>& operator>>(double& f); 5387S basic_istream<charT,traits>& operator>>(long double& f); 5388S basic_istream<charT,traits>& operator>>(void*& p); 5389S basic_istream<charT,traits>& operator>> 5390 (basic_streambuf<char_type,traits>* sb); 5391 // _lib.istream.unformatted_ Unformatted input: 5392T streamsize gcount() const; 5393S int_type get(); 5394S basic_istream<charT,traits>& get(char_type& c); 5395S basic_istream<charT,traits>& get(char_type* s, streamsize n); 5396S basic_istream<charT,traits>& get(char_type* s, streamsize n, 5397 char_type delim); 5398S basic_istream<charT,traits>& get(basic_streambuf<char_type,traits>& sb); 5399S basic_istream<charT,traits>& get(basic_streambuf<char_type,traits>& sb, 5400 char_type delim); 5401S basic_istream<charT,traits>& getline(char_type* s, streamsize n); 5402S basic_istream<charT,traits>& getline(char_type* s, streamsize n, 5403 char_type delim); 5404S basic_istream<charT,traits>& ignore 5405 (streamsize n = 1, int_type delim = traits::eof()); 5406S int_type peek(); 5407S basic_istream<charT,traits>& read (char_type* s, streamsize n); 5408S streamsize readsome(char_type* s, streamsize n); 5409S basic_istream<charT,traits>& putback(char_type c); 5410S basic_istream<charT,traits>& unget(); 5411S int sync(); 5412 5413S pos_type tellg(); 5414S basic_istream<charT,traits>& seekg(pos_type); 5415S basic_istream<charT,traits>& seekg(off_type, ios_base::seekdir); 5416 }; 5417 5418 // _lib.istream::extractors_ character extraction templates: 5419S template<class charT, class traits> 5420 basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>&, 5421 charT&); 5422S template<class traits> 5423 basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, 5424 unsigned char&); 5425S template<class traits> 5426 basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, 5427 signed char&); 5428 5429S template<class charT, class traits> 5430 basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>&, 5431 charT*); 5432S template<class traits> 5433 basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, 5434 unsigned char*); 5435S template<class traits> 5436 basic_istream<char,traits>& operator>>(basic_istream<char,traits>&, 5437 signed char*); 5438 5439 27.6.1.1.2 Class basic_istream::sentry [lib.istream::sentry] 5440 5441 5442 template <class charT,class traits = char_traits<charT> > 5443S class basic_istream<charT,traits>::sentry { 5444 typedef traits traits_type; 5445S bool ok_; // exposition only 5446 public: 5447S explicit sentry(basic_istream<charT,traits>& is, bool noskipws = false); 5448S ~sentry(); 5449S operator bool() const { return ok_; } 5450 private: 5451T sentry(const sentry&); // not defined 5452T sentry& operator=(const sentry&); // not defined 5453 }; 5454 5455 5456 27.6.1.5 Template class basic_iostream [lib.iostreamclass] 5457 5458 template <class charT, class traits = char_traits<charT> > 5459T class basic_iostream : 5460 public basic_istream<charT,traits>, 5461 public basic_ostream<charT,traits> { 5462 public: 5463 // constructor/destructor 5464T explicit basic_iostream(basic_streambuf<charT,traits>* sb); 5465T virtual ~basic_iostream(); 5466 }; 5467 5468 5469 27.6.2.1 Template class basic_ostream [lib.ostream] 5470 5471 template <class charT, class traits = char_traits<charT> > 5472X class basic_ostream : virtual public basic_ios<charT,traits> { 5473 public: 5474 // Types (inherited from basic_ios (_lib.ios_)): 5475T typedef charT char_type; 5476T typedef typename traits::int_type int_type; 5477T typedef typename traits::pos_type pos_type; 5478T typedef typename traits::off_type off_type; 5479T typedef traits traits_type; 5480 // _lib.ostream.cons_ Constructor/destructor: 5481T explicit basic_ostream(basic_streambuf<char_type,traits>* sb); 5482T virtual ~basic_ostream(); 5483 // _lib.ostream::sentry_ Prefix/suffix: 5484T class sentry; 5485 // _lib.ostream.formatted_ Formatted output: 5486T basic_ostream<charT,traits>& operator<< 5487 (basic_ostream<charT,traits>& (*pf)(basic_ostream<charT,traits>&)); 5488T basic_ostream<charT,traits>& operator<< 5489 (basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&)); 5490T basic_ostream<charT,traits>& operator<< 5491 (ios_base& (*pf)(ios_base&)); 5492T basic_ostream<charT,traits>& operator<<(bool n); 5493T basic_ostream<charT,traits>& operator<<(short n); 5494T basic_ostream<charT,traits>& operator<<(unsigned short n); 5495T basic_ostream<charT,traits>& operator<<(int n); 5496T basic_ostream<charT,traits>& operator<<(unsigned int n); 5497T basic_ostream<charT,traits>& operator<<(long n); 5498T basic_ostream<charT,traits>& operator<<(unsigned long n); 5499S basic_ostream<charT,traits>& operator<<(float f); 5500S basic_ostream<charT,traits>& operator<<(double f); 5501S basic_ostream<charT,traits>& operator<<(long double f); 5502T basic_ostream<charT,traits>& operator<<(const void* p); 5503X basic_ostream<charT,traits>& operator<< 5504 (basic_streambuf<char_type,traits>* sb); 5505 // _lib.ostream.unformatted_ Unformatted output: 5506T basic_ostream<charT,traits>& put(char_type c); 5507T basic_ostream<charT,traits>& write(const char_type* s, streamsize n); 5508X basic_ostream<charT,traits>& flush(); 5509 5510 // _lib.ostream.seeks_ seeks: 5511S pos_type tellp(); 5512S basic_ostream<charT,traits>& seekp(pos_type); 5513S basic_ostream<charT,traits>& seekp(off_type, ios_base::seekdir); 5514 }; 5515 // _lib.ostream.inserters.character_ character inserters 5516X template<class charT, class traits> 5517 basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, 5518 charT); 5519X template<class charT, class traits> 5520 basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, 5521 char); 5522 // specialization 5523X template<class traits> 5524 basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, 5525 char); 5526 // signed and unsigned 5527X template<class traits> 5528 basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, 5529 signed char); 5530X template<class traits> 5531 basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, 5532 unsigned char) 5533X template<class charT, class traits> 5534 basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, 5535 const charT*); 5536X template<class charT, class traits> 5537 basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, 5538 const char*); 5539 // partial specializationss 5540X template<class traits> 5541 basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, 5542 const char*); 5543 // signed and unsigned 5544X template<class traits> 5545 basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, 5546 const signed char*); 5547X template<class traits> 5548 basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>&, 5549 const unsigned char*); 5550 5551 5552 27.6.2.3 Class basic_ostream::sentry [lib.ostream::sentry] 5553 5554 template <class charT,class traits = char_traits<charT> > 5555X class basic_ostream<charT,traits>::sentry { 5556 bool ok_; // exposition only 5557 public: 5558X explicit sentry(basic_ostream<charT,traits>& os); 5559X ~sentry(); 5560X operator bool() const { return ok_; } 5561 private 5562X sentry(const sentry&); // not defined 5563X sentry& operator=(const sentry&); // not defined 5564 }; 5565 5566 27.7 String-based streams [lib.string.streams] 5567 5568 Header <sstream> synopsis 5569 5570X template <class charT, class traits = char_traits<charT>, 5571 class Allocator = allocator<charT> > 5572 class basic_stringbuf; 5573 5574T typedef basic_stringbuf<char> stringbuf; 5575T typedef basic_stringbuf<wchar_t> wstringbuf; 5576 5577 template <class charT, class traits = char_traits<charT>, 5578 class Allocator = allocator<charT> > 5579X class basic_istringstream; 5580 5581T typedef basic_istringstream<char> istringstream; 5582T typedef basic_istringstream<wchar_t> wistringstream; 5583 5584 template <class charT, class traits = char_traits<charT>, 5585 class Allocator = allocator<charT> > 5586X class basic_ostringstream; 5587T typedef basic_ostringstream<char> ostringstream; 5588T typedef basic_ostringstream<wchar_t> wostringstream; 5589 5590 template <class charT, class traits = char_traits<charT>, 5591 class Allocator = allocator<charT> > 5592X class basic_stringstream; 5593T typedef basic_stringstream<char> stringstream; 5594T typedef basic_stringstream<wchar_t> wstringstream; 5595 5596 27.7.1 Template class basic_stringbuf [lib.stringbuf] 5597 5598 template <class charT, class traits = char_traits<charT>, 5599 class Allocator = allocator<charT> > 5600X class basic_stringbuf : public basic_streambuf<charT,traits> { 5601 public: 5602T typedef charT char_type; 5603T typedef typename traits::int_type int_type; 5604T typedef typename traits::pos_type pos_type; 5605T typedef typename traits::off_type off_type; 5606T typedef traits traits_type; 5607 // _lib.stringbuf.cons_ Constructors: 5608S explicit basic_stringbuf(ios_base::openmode which 5609 = ios_base::in | ios_base::out); 5610S explicit basic_stringbuf 5611 (const basic_string<charT,traits,Allocator>& str, 5612 ios_base::openmode which = ios_base::in | ios_base::out); 5613 // _lib.stringbuf.members_ Get and set: 5614S basic_string<charT,traits,Allocator> str() const; 5615S void str(const basic_string<charT,traits,Allocator>& s); 5616 5617 protected: 5618 // _lib.stringbuf.virtuals_ Overridden virtual functions: 5619S virtual int_type underflow(); 5620S virtual int_type pbackfail(int_type c = traits::eof()); 5621S virtual int_type overflow (int_type c = traits::eof()); 5622S virtual basic_streambuf<charT,traits>* setbuf(charT*, streamsize); 5623 5624S virtual pos_type seekoff(off_type off, ios_base::seekdir way, 5625 ios_base::openmode which 5626 = ios_base::in | ios_base::out); 5627S virtual pos_type seekpos(pos_type sp, 5628 ios_base::openmode which 5629 = ios_base::in | ios_base::out); 5630 }; 5631 5632 5633 27.7.2 Template class basic_istringstream [lib.istringstream] 5634 5635 template <class charT, class traits = char_traits<charT>, 5636 class Allocator = allocator<charT> > 5637X class basic_istringstream : public basic_istream<charT,traits> { 5638 public: 5639T typedef charT char_type; 5640T typedef typename traits::int_type int_type; 5641T typedef typename traits::pos_type pos_type; 5642T typedef typename traits::off_type off_type; 5643T typedef traits traits_type; 5644 // _lib.istringstream.cons_ Constructors: 5645S explicit basic_istringstream(ios_base::openmode which = ios_base::in); 5646S explicit basic_istringstream( 5647 const basic_string<charT,traits,Allocator>& str, 5648 ios_base::openmode which = ios_base::in); 5649 5650 // _lib.istringstream.members_ Members: 5651S basic_stringbuf<charT,traits,Allocator>* rdbuf() const; 5652S basic_string<charT,traits,Allocator> str() const; 5653S void str(const basic_string<charT,traits,Allocator>& s); 5654 private: 5655 // basic_stringbuf<charT,traits,Allocator> sb; exposition only 5656 }; 5657 5658 27.7.3 Class basic_ostringstream [lib.ostringstream] 5659 5660 template <class charT, class traits = char_traits<charT>, 5661 class Allocator = allocator<charT> > 5662X class basic_ostringstream : public basic_ostream<charT,traits> { 5663 public: 5664 5665 // Types: 5666T typedef charT char_type; 5667T typedef typename traits::int_type int_type; 5668T typedef typename traits::pos_type pos_type; 5669T typedef typename traits::off_type off_type; 5670 // _lib.ostringstream.cons_ Constructors/destructor: 5671S explicit basic_ostringstream(ios_base::openmode which = ios_base::out); 5672S explicit basic_ostringstream( 5673 const basic_string<charT,traits,Allocator>& str, 5674 ios_base::openmode which = ios_base::out); 5675 // _lib.ostringstream.members_ Members: 5676S basic_stringbuf<charT,traits,Allocator>* rdbuf() const; 5677S basic_string<charT,traits,Allocator> str() const; 5678S void str(const basic_string<charT,traits,Allocator>& s); 5679 }; 5680 5681 5682 27.7.4 Template class basic_stringstream [lib.stringstream] 5683 5684 template <class charT, class traits = char_traits<charT>, 5685 class Allocator = allocator<charT> > 5686X class basic_stringstream 5687 : public basic_iostream<charT,traits> { 5688 public: 5689 // Types 5690T typedef charT char_type; 5691T typedef typename traits::int_type int_type; 5692T typedef typename traits::pos_type pos_type; 5693T typedef typename traits::off_type off_type; 5694 // constructors/destructors 5695S explicit basic_stringstream( 5696 ios_base::openmode which = ios_base::out|ios_base::in); 5697S explicit basic_stringstream( 5698 const basic_string<charT,traits,Allocator>& str, 5699 ios_base::openmode which = ios_base::out|ios_base::in); 5700 // Members: 5701S basic_stringbuf<charT,traits,Allocator>* rdbuf() const; 5702S basic_string<charT,traits,Allocator> str() const; 5703S void str(const basic_string<charT,traits,Allocator>& str); 5704 }; 5705 5706 5707 5708 27.8.1 File streams [lib.fstreams] 5709 5710 5711 Header <fstream> synopsis 5712 5713X template <class charT, class traits = char_traits<charT> > 5714 class basic_filebuf; 5715T typedef basic_filebuf<char> filebuf; 5716T typedef basic_filebuf<wchar_t> wfilebuf; 5717 5718X template <class charT, class traits = char_traits<charT> > 5719 class basic_ifstream; 5720T typedef basic_ifstream<char> ifstream; 5721T typedef basic_ifstream<wchar_t> wifstream; 5722 5723X template <class charT, class traits = char_traits<charT> > 5724 class basic_ofstream; 5725T typedef basic_ofstream<char> ofstream; 5726T typedef basic_ofstream<wchar_t> wofstream; 5727 5728X template <class charT, class traits = char_traits<charT> > 5729 class basic_fstream; 5730T typedef basic_fstream<char> fstream; 5731T typedef basic_fstream<wchar_t> wfstream; 5732 5733 27.8.1.1 Template class basic_filebuf [lib.filebuf] 5734 5735 template <class charT, class traits = char_traits<charT> > 5736X class basic_filebuf : public basic_streambuf<charT,traits> { 5737 public: 5738T typedef charT char_type; 5739T typedef typename traits::int_type int_type; 5740T typedef typename traits::pos_type pos_type; 5741T typedef typename traits::off_type off_type; 5742T typedef traits traits_type; 5743 // _lib.filebuf.cons_ Constructors/destructor: 5744X basic_filebuf(); 5745X virtual ~basic_filebuf(); 5746 // _lib.filebuf.members_ Members: 5747T bool is_open() const; 5748X basic_filebuf<charT,traits>* open 5749 (const char* s, ios_base::openmode mode); 5750X basic_filebuf<charT,traits>* close(); 5751 protected: 5752 // _lib.filebuf.virtuals_ Overridden virtual functions: 5753X virtual streamsize showmanyc(); 5754X virtual int_type underflow(); 5755X virtual int_type uflow(); 5756X virtual int_type pbackfail(int_type c = traits::eof()); 5757X virtual int_type overflow (int_type c = traits::eof()); 5758S virtual basic_streambuf<charT,traits>* 5759 setbuf(char_type* s, streamsize n); 5760S virtual pos_type seekoff(off_type off, ios_base::seekdir way, 5761 ios_base::openmode which 5762 = ios_base::in | ios_base::out); 5763S virtual pos_type seekpos(pos_type sp, ios_base::openmode which 5764 = ios_base::in | ios_base::out); 5765S virtual int sync(); 5766S virtual void imbue(const locale& loc); 5767 }; 5768 5769 5770 5771 27.8.1.5 Template class basic_ifstream [lib.ifstream] 5772 5773 template <class charT, class traits = char_traits<charT> > 5774X class basic_ifstream : public basic_istream<charT,traits> { 5775 public: 5776T typedef charT char_type; 5777T typedef typename traits::int_type int_type; 5778T typedef typename traits::pos_type pos_type; 5779T typedef typename traits::off_type off_type; 5780T typedef traits traits_type; 5781 // _lib.ifstream.cons_ Constructors: 5782S basic_ifstream(); 5783S explicit basic_ifstream(const char* s, 5784 ios_base::openmode mode = ios_base::in); 5785 // _lib.ifstream.members_ Members: 5786S basic_filebuf<charT,traits>* rdbuf() const; 5787S bool is_open(); 5788S void open(const char* s, ios_base::openmode mode = ios_base::in); 5789S void close(); 5790 }; 5791 5792 5793 27.8.1.8 Template class basic_ofstream [lib.ofstream] 5794 5795 template <class charT, class traits = char_traits<charT> > 5796X class basic_ofstream : public basic_ostream<charT,traits> { 5797 public: 5798T typedef charT char_type; 5799T typedef typename traits::int_type int_type; 5800T typedef typename traits::pos_type pos_type; 5801T typedef typename traits::off_type off_type; 5802T typedef traits traits_type; 5803 // _lib.ofstream.cons_ Constructors: 5804X basic_ofstream(); 5805X explicit basic_ofstream(const char* s, 5806 ios_base::openmode mode 5807 = ios_base::out); 5808 // _lib.ofstream.members_ Members: 5809X basic_filebuf<charT,traits>* rdbuf() const; 5810T bool is_open(); 5811X void open(const char* s, ios_base::openmode mode = ios_base::out); 5812X void close(); 5813 }; 5814 5815 5816 27.8.1.11 Template class basic_fstream [lib.fstream] 5817 5818 template <class charT, class traits=char_traits<charT> > 5819X class basic_fstream 5820 : public basic_iostream<charT,traits> { 5821 public: 5822T typedef charT char_type; 5823T typedef typename traits::int_type int_type; 5824T typedef typename traits::pos_type pos_type; 5825T typedef typename traits::off_type off_type; 5826T typedef traits traits_type; 5827 // constructors/destructor 5828S basic_fstream(); 5829S explicit basic_fstream( 5830 const char* s, 5831 ios_base::openmode mode = ios_base::in|ios_base::out); 5832 5833 // Members: 5834S basic_filebuf<charT,traits>* rdbuf() const; 5835S bool is_open(); 5836S void open( 5837 const char* s, 5838 ios_base::openmode mode = ios_base::in|ios_base::out); 5839S void close(); 5840 }; 5841 5842 5843 5844 27.8.2 C Library files [lib.c.files] 5845 5846 5847 Table 13--Header <cstdio> synopsis 5848 Macros: 5849X BUFSIZ L_tmpnam SEEK_SET TMP_MAX 5850X EOF NULL <cstdio> stderr _IOFBF 5851X FILENAME_MAX SEEK_CUR stdin _IOLBF 5852X FOPEN_MAX SEEK_END stdout _IONBF 5853 5854X Types: FILE fpos_t size_t <cstdio> 5855 Functions: 5856X clearerr fgets fscanf gets rewind 5857X fclose fopen fseek perror scanf tmpnam 5858X feof fprintf fsetpos printf setbuf ungetc 5859X ferror fputc ftell putc setvbuf vprintf 5860X fflush fputs fwrite puts sprintf vfprintf 5861X fgetc fread getc remove sscanf vsprintf 5862X fgetpos freopen getchar putchar rename tmpfile 5863 5864 5865 5866 5867 1.5 Standard C library headers [depr.c.headers] 5868 5869X <assert.h> <iso646.h> <setjmp.h> <stdio.h> <wchar.h> 5870 <ctype.h> <limits.h> <signal.h> <stdlib.h> <wctype.h> 5871 <errno.h> <locale.h> <stdarg.h> <string.h> 5872 <float.h> <math.h> <stddef.h> <time.h> 5873 5874 1.6 Old iostreams members [depr.ios.members] 5875 5876 [Note: these should be #ifdef'd to permit diagnostics if used.] 5877 namespace std { 5878 class ios_base { 5879 public: 5880T typedef T1 io_state; 5881T typedef T2 open_mode; 5882T typedef T3 seek_dir; 5883T typedef OFF_T streamoff; 5884T typedef OFF_T streampos; 5885 // remainder unchanged 5886 }; 5887 } 5888 5889 [Note: these should be #ifdef'd to permit diagnostics if used.] 5890 namespace std { 5891 template<class charT, class traits = char_traits<charT> > 5892 class basic_streambuf { 5893 public: 5894T void stossc(); 5895 // remainder unchanged 5896 }; 5897 } 5898 5899 8 An implementation may provide the following member functions that 5900 overload signatures specified in clause _lib.iostreams_: 5901 5902 [Note: the following overloads should be #ifdef'd to permit 5903 diagnostics to be emitted, by default, if used.] 5904 5905 template<class charT, class Traits> class basic_ios { 5906 public: 5907M void clear(io_state state); 5908M void setstate(io_state state); 5909 // remainder unchanged 5910 }; 5911 class ios_base { 5912 public: 5913M void exceptions(io_state); 5914 // remainder unchanged 5915 }; 5916 template<class charT, class traits = char_traits<charT> > 5917 class basic_streambuf { 5918 public: 5919M pos_type pubseekoff(off_type off, ios_base::seek_dir way, 5920 ios_base::open_mode which = ios_base::in | ios_base::out); 5921M pos_type pubseekpos(pos_type sp, 5922 ios_base::open_mode which = ios_base::in | ios_base::out); 5923 // remainder unchanged 5924 }; 5925 template <class charT, class traits = char_traits<charT> > 5926 class basic_filebuf : public basic_streambuf<charT,traits> { 5927 public: 5928M basic_filebuf<charT,traits>* open 5929 (const char* s, ios_base::open_mode mode); 5930 // remainder unchanged 5931 }; 5932 template <class charT, class traits = char_traits<charT> > 5933 class basic_ifstream : public basic_istream<charT,traits> { 5934 public: 5935M void open(const char* s, ios_base::open_mode mode = in); 5936 // remainder unchanged 5937 }; 5938 template <class charT, class traits = char_traits<charT> > 5939 class basic_ofstream : public basic_ostream<charT,traits> { 5940 public: 5941M void open(const char* s, ios_base::open_mode mode = out | trunc); 5942 // remainder unchanged 5943 }; 5944 } 5945 5946 5947 5948 1.7.1 Class strstreambuf [depr.strstreambuf] 5949 5950 [Note: It should be possible to adopt these components with only 5951 minor changes from the 2.8 version of the library.] 5952 5953M class strstreambuf : public basic_streambuf<char> { 5954 public: 5955M explicit strstreambuf(streamsize alsize_arg = 0); 5956M strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*)); 5957M strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = 0); 5958M strstreambuf(const char* gnext_arg, streamsize n); 5959M strstreambuf(signed char* gnext_arg, streamsize n, 5960 signed char* pbeg_arg = 0); 5961M strstreambuf(const signed char* gnext_arg, streamsize n); 5962M strstreambuf(unsigned char* gnext_arg, streamsize n, 5963 unsigned char* pbeg_arg = 0); 5964M strstreambuf(const unsigned char* gnext_arg, streamsize n); 5965M virtual ~strstreambuf(); 5966M void freeze(bool freezefl = true); 5967M char* str(); 5968M int pcount(); 5969 protected: 5970M virtual int_type overflow (int_type c = EOF); 5971M virtual int_type pbackfail(int_type c = EOF); 5972M virtual int_type underflow(); 5973M virtual pos_type seekoff(off_type off, ios_base::seekdir way, 5974 ios_base::openmode which 5975 = ios_base::in | ios_base::out); 5976M virtual pos_type seekpos(pos_type sp, ios_base::openmode which 5977 = ios_base::in | ios_base::out); 5978M virtual streambuf<char>* setbuf(char* s, streamsize n); 5979 } 5980 5981 1.7.4 Class strstream [depr.strstream] 5982 5983M class strstream 5984 : public basic_iostream<char> { 5985 public: 5986 // Types 5987M typedef char char_type; 5988M typedef typename char_traits<char>::int_type int_type 5989M typedef typename char_traits<char>::pos_type pos_type; 5990M typedef typename char_traits<char>::off_type off_type; 5991 // consturctors/destructor 5992M strstream(); 5993M strstream(char* s, int n, 5994 ios_base::openmode mode = ios_base::in|ios_base::out); 5995M virtual ~strstream(); 5996 // Members: 5997M strstreambuf* rdbuf() const; 5998M void freeze(bool freezefl = true); 5999M int pcount() const; 6000M char* str(); 6001 }; 6002 6003