Concepts
来自cppreference.com
< cpp
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
的概念是一个术语,用于描述一个命名的一组要求'一类。概念是一个更便捷的途径,同时指定什么样的属性,预计从类型,类型具有什么样的属性.
Original:
A concept is a term that describes a named set of requirements for a type. Concepts are a more convenient way to specify both what properties are expected from a type, and what properties a type has.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
有a proposal的概念转化为一个正式的规范,包括C + +11,这样编译器可以检查类型的要求“前”模板实例化,进而产生更合理的错误消息的情况下,类型不履行的模板的要求。由于种种原因后来放弃了这个建议。不过,也有非官方的计划,以增加将来的修订版的C + +语言的概念.
Original:
There was a proposal to include a formal specification of concepts into C++11 so that the compiler could check the type requirements before template instantiation and in turn could produce much more sensible error messages in case a type did not fulfill the template requirements. This proposal was later dropped for various reasons. However, there are unofficial plans to add concepts to a future revision of the C++ language.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
这里的“概念”有一点共同的上述建议。他们指的非正式命名的要求,在C + +03和C + +11定义不同类型的行为和预期的性能.
Original:
Here concepts have little in common with the abovementioned proposal. They refer to informal named requirements, used in C++03 and C++11 to define behavior and expected properties for various types.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Original: Basic The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 指定类型具有默认的构造函数 Original: specifies that type has default constructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| (C++11) |
指定该类型的移动构造函数 Original: specifies that type has move constructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| 指定该类型的拷贝构造函数 Original: specifies that type has copy constructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| (C++11) |
指定类型有移动赋值运算符 Original: specifies that type has move assignment operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| 指定该类型的拷贝赋值运算符 Original: specifies that type has copy assignment operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 类型有一个析构函数,清除所有的内存 Original: type has a destructor that clears all memory The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
Original: Layout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| Note, that the standard doesn't define named requirements or concepts with names specified in this subcategory. These are type categories defined by the core language. They are included here as concepts only for consistency. | |
| (C++11) |
类琐碎的复制,转让和析构函数 Original: class with trivial copy, assignment and destructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
类琐碎的构造函数,赋值和析构函数 Original: class with trivial constructors, assignment and destructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
非虚拟类只包含其他StandardLayout的成员,都具有相同的访问控制 Original: non-virtual class containing only other StandardLayout members, all with the same access control The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| POD(普通旧数据)结构,与Cstruct兼容 Original: POD (Plain Old Data) structure, compatible with C struct The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
Original: Library-wide The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 有一个工作 operator==是一个等价关系Original: has a working operator== that is an equivalence relationThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
operator<是一个严格弱序关系Original: operator< is a strict weak ordering relationThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| (C++11) |
可以调换不合格的非成员函数调用swap() Original: can be swapped with an unqualified non-member function call swap() The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
Iterator取消引用一个Swappable类型的 Original: The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
类似指针的类型支持空值 Original: pointer-like type supporting a null value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
(概念) |
| 类类型,它包含配置信息 Original: class type that contains allocation information The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 一个函数对象,可以调用与具体的参数和返回值转换成特定类型 Original: a function object that can be called with specific arguments and has return value convertible to specific type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 一个 Callable返回一个值转换为一个参数,而无需修改boolOriginal: a Callable that returns a value convertible to bool for one argument without modifying itThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 一个 Callable,返回一个值转换为bool两个参数,而无需修改Original: a Callable that returns a value convertible to bool for two arguments without modifying themThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
Original: Container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 数据结构元素的访问,允许使用迭代器 Original: data structure that allows element access using iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 使用双向迭代器的容器 Original: container using bidirectional iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| (C++11) |
容器使用的分配器 Original: container using an allocator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| 容器的元素以线性方式存放 Original: container with elements stored linearly The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 容器,其存储通过关联他们键的元素 Original: container that stores elements by associating them to keys The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 容器,用于存储元素的存储桶的关联键 Original: container that stores elements stored in buckets by associating them to keys The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
Original: Container element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| (C++11) |
元素可以是拷贝构造未初始化的存储 Original: element can be copy-constructed in uninitialized storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
元素可以移动,在未初始化的存储构建 Original: element can be move-constructed in uninitialized storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
可以构造未初始化的存储元素 Original: element can be constructed in uninitialized storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
Original: Iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 一般概念访问某些数据结构内的数据 Original: general concept to access data within some data structure The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 迭代器,它可用于读出的数据 Original: iterator that can be used to read data The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 迭代器,它可以用于将数据写入 Original: iterator that can be used to write data The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 迭代器,它可用于多次读取数据 Original: iterator that can be used to read data multiple times The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 迭代器,既可以是递增和递减 Original: iterator that can be both incremented and decremented The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 迭代器,它可以在固定的时间提前 Original: iterator that can be advanced in constant time The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
Original: Stream I/O functions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 流输入功能,不跳过空白字符和计算处理的字符 Original: a stream input function that doesn't skip whitespace and counts the processed characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 流输入功能,跳过开头的空白 Original: a stream input function that skips leading whitespace The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 的基本流输出功能 Original: a basic stream output function The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 流输出功能,设置failbit上已经存在的错误,并返回一个引用到流 Original: a stream output function that sets failbit on preexisting errors and returns a reference to the stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
Original: Random Number Generation The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| (C++11) |
消耗一个整数序列,产生一个32位的无符号值序列 Original: consumes a sequence of integers and produces a sequence of 32-bit unsigned values The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
返回均匀分布的随机无符号整数 Original: returns uniformly distributed random unsigned integers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
一个确定性 UniformRandomNumberGenerator,所定义的种子 Original: a deterministic UniformRandomNumberGenerator, defined by the seed The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
的输出转换的另一 RandomNumberEngine一个RandomNumberEngine Original: a RandomNumberEngine that transforms the output of another RandomNumberEngine The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
返回根据一个给定的数学概率密度函数的分布的随机数 Original: returns random numbers distributed according to a given mathematical probability density function The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
Original: Concurrency The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| (C++11) |
提供独家拥有的语义执行代理(即线程) Original: provides exclusive ownership semantics for execution agents (i.e. threads) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
增加了试图锁定收购 BasicLockable Original: adds attempted lock acquisition to BasicLockable The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
将定时锁获取 Lockable Original: adds timed lock acquisition to Lockable The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
一个 Lockable,防止数据争用和顺序一致的同步 Original: a Lockable that protects against data races and sequentially consistent synchronization The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
一个 TimedLockable,防止数据争用和顺序一致的同步 Original: a TimedLockable that protects against data races and sequentially consistent synchronization The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
Original: Other The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| (C++11) |
描述属性的类型 Original: describes a property of a type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
描述了一种在两种类型之间的关系 Original: describes a relationship between two types The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
修改一个属性的类型 Original: modifies a property of a type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
聚集体的持续时间的时间点,和一个函数来获取当前时间点 Original: aggregates a duration, a time point, and a function to get the current time point The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| (C++11) |
一个 Clock不会抛出异常 Original: a Clock that doesn't throw exceptions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) |
| 定义类型和字符类型的功能 Original: defines types and functions for a character type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 在流中的位置 Original: represents a position in a stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 表示一个流中的偏移量 Original: represents an offset in a stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| bitset的,整数或枚举 Original: bitset, integer, or enumeration The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (概念) | |
| 本节是不完整的 原因: Any other missing concept? |

