The Wayback Machine - https://web.archive.org/web/20130313172537/http://zh.cppreference.com:80/w/cpp/utility

Utility library

来自cppreference.com
< cpp

 
 
实用工具库
类型的支持 (basic types, RTTI, type traits)
动态内存管理
错误处理
程序实用工具
可变参数函数
日期和时间
函数对象
initializer_list(C++11)
bitset
hash(C++11)
关系运算符
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
双和元组
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
掉期,远期和移动
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
C + +包含了多种实用程序库提供的功能从数位部分功能的应用。这些库可以大致分为两类:一
Original:
C++ includes a variety of utility libraries that provide functionality ranging from 数位 to 部分功能的应用. These libraries can be broadly divided into two groups:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • 语言支持库
    Original:
    language support libraries, and
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 通用库.
    Original:
    general-purpose libraries.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

目录

[编辑] 语言支持

语言支持库提供的类和函数语言特性,并支持通用的语言用法的密切互动与.
Original:
Language support libraries provide classes and functions that interact closely with language features and support common language idioms.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 类型的支持

基本类型(如std::size_tstd::nullptr_t),RTTI(例如std::type_info),类型特征(例如std::is_integralstd::rank
Original:
Basic types (e.g. std::size_t, std::nullptr_t), RTTI (e.g. std::type_info), type traits (e.g. std::is_integral, std::rank)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 动态内存管理

智能指针(如std::shared_ptr),分配器(例如std::allocator),C-风格的内存管理(例如std::malloc
Original:
Smart pointers (e.g. std::shared_ptr), allocators (e.g. std::allocator), C-style memory management (e.g. std::malloc)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 错误处理

异常(例如std::exceptionstd::logic_error),断言(例如assert
Original:
Exceptions (e.g. std::exception, std::logic_error), assertions (e.g. assert)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 初始化列表

允许使用的初始化列表中的语法初始化非纯老的数据类型
Original:
allows the use of 初始化列表中的语法 to initialize non plain-old-data types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]

[编辑] 可变参数函数

支持为任意数量的参数(通过例如va_startva_argva_end)的函数
Original:
Support for functions that take an arbitrary number of parameters (via e.g. va_start, va_arg, va_end)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


[编辑] 通用的工具

[编辑] 程序实用工具

终端(例如std::abortstd::atexit),环境(例如std::system),信号(例如std::raise)的
Original:
Termination (e.g. std::abort, std::atexit), environment (e.g. std::system), signals (e.g. std::raise)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 日期和时间

时间跟踪(如std::chrono::time_pointstd::chrono::duration),C-风格的日期和时间(如:std::timestd::clock
Original:
Time tracking (e.g. std::chrono::time_point, std::chrono::duration), C-style date and time (e.g. std::time, std::clock)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 比特集“

实现固定长度的位阵列
Original:
implements constant length bit array
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]

[编辑] 函数对象

部分功能的应用程序(如std::bind),通用功能(例如std::function),预定义的仿函数(如std::plusstd::equal_to
Original:
Partial function application (e.g. std::bind), generic functions (e.g. std::function), predefined functors (e.g. std::plus, std::equal_to)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 双和元组

实现二进制元组,即一对值
Original:
implements binary tuple, i.e. a pair of values
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
实现固定大小的容器,该容器保持可能的不同类型的元素
Original:
implements fixed size container, which holds elements of possibly different types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
使用的标签类型选择正确的重载函数,分段建设
Original:
tag type used to select correct function overload for piecewise construction
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
piecewise_construct_t类型的对象使用,以消除歧义分段施工的功能
Original:
an object of type piecewise_construct_t used to disambiguate functions for piecewise construction
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(不变) [edit]

[编辑] 掉期,远期和移动

掉期两个对象的值
Original:
swaps the values of two objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
(C++11)
转发函数的参数
Original:
forwards a function argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
(C++11)
获得一个右值引用
Original:
obtains an rvalue reference
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
获得一个右值引用的举动构造方法不抛出
Original:
obtains an rvalue reference if the move constructor does not throw
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]
(C++11)
在未经评估的情况下获得了表达式的类型
Original:
obtains the type of expression in unevaluated context
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数模板) [edit]

[编辑] 关系运算符

Defined in namespace std::rel_ops
automatically generates comparison operators based on user-defined operator== and operator<
(函数模板) [edit]

[编辑] 哈希支持

(C++11)
hash function object
(类模板) [edit]