Share via


Standard library changes in C++0x

C++0x will be released in the near future. Do you know the changes of standard library? Here is a list of changes that I've collected (minor behavior changes and changes related to concepts are not included).

1. New stuff

system_error:
    new header
array, vector, deque, list, string, map, set, unordered_map, unordered_set:
    new member function: cbegin, cend, crbegin, crend
vector, deque, string:
    new member function: shrink_to_fit
map, unordered_map:
    new member function: at
type_traits:
    new traits:
        is_lvalue_reference, is_rvalue_reference
        has_trivial_default_constructor, has_trivial_copy_constructor, has_nothrow_default_constructor, has_nothrow_copy_constructor
string:
    new type: u16string, u32string
    new function:
        stoi, stol, stoul, stoll, stoull, stof, stod, stold
        to_string, to_wstring
algorithm:
    new function:
        all_of, any_of, none_of, find_if_not, copy_if, partition_copy, is_partitioned, partition_point
        minmax_element
        is_heap_until, is_heap
        is_sorted_until, is_sorted
        next,prev
        min,max,minmax
        copy_n
random:
    new class: seed_seq and many new distributions
    new function: generate_canonical
    new type:
        ranlux24_base, ranlux48_base, ranlux24, ranlux48, knuth_b
        default_random_engine
    For classes linear_congruential, subtract_with_carry, mersenne_twister, discard_block, xor_combine:
        add ctor which accepts seed_seq, member function "seed" and the corresponding _engine class
memory:
    new class: default_delete,unique_ptr
    new function: allocate_shared,make_shared
functional:
    new functor: bit_and, bit_or, bit_xor
numeric:
    new function: iota
iomanip:
    new function:
        get_money, put_money
        get_time, put_time
ios:
    new function: defaultfloat
iosfwd:
    new type: char_traits<char16_t>, char_traits<char32_t>
limits:
    new member function: max_digits10, lowest

2. From tr1

array
unordered_map
unordered_set
regex
random
type_traits
tuple
functional
utility
    get
ios
    hexfloat

3. Other

set, map, unordered_map, unordered_set:
    member function "erase" will have return value (compatible with sequential container)
string:
    pop_back, front, back (compatible with vector)
bitset:
    ctor: unsigned long -> unsigned long long
fstream:
    ctor/open accept string & wstring as the type of filename (C++03 only supports raw string pointer)

Comments