Chinaunix首页 | 论坛 | 博客
  • 博客访问: 468325
  • 博文数量: 107
  • 博客积分: 6073
  • 博客等级: 准将
  • 技术积分: 790
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-14 15:34
文章分类

全部博文(107)

文章存档

2010年(1)

2009年(106)

分类: C/C++

2009-10-20 09:01:05

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, char_traits
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)

阅读(1030) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~