Type support (basic types, RTTI, type traits)
Материал из 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. |
[править] Основные типы
[править] Основные типы, определенные в языке
[править] Среди основных типов и макросов
| Определено в файле <cstddef>
| |
| беззнаковое целое число типа возвращаемого sizeof оператора Original: unsigned integer type returned by the sizeof operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (определение типа) | |
| целое число типа возвращается при вычитании двух указателей Original: signed integer type returned when subtracting two pointers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (определение типа) | |
| (C++11) |
тип нулевого указателя буквальном nullptr Original: the type of the null pointer literal nullptr The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (определение типа) |
| определяется реализацией нулевого указателя постоянно Original: implementation-defined null pointer constant The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (константа-макрос) | |
| (C++11) |
POD типа с требованием выравнивания так велика, как любой другой тип скаляра Original: POD type with alignment requirement as great as any other scalar type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (определение типа) |
| байтовое смещение от начала стандартной верстки типа указанного члена Original: byte offset from the beginning of a standard-layout type to specified member The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция-макрос) | |
| Определено в файле <cstdbool>
| |
| __bool_true_false_are_defined (C++11) |
C совместимость макросов постоянной, расширяется до целочисленной константы 1 Original: C compatibility macro constant, expands to integer constant 1 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (константа-макрос) |
| Определено в файле <cstdalign>
| |
| __alignas_is_defined (C++11) |
C совместимость макросов постоянной, расширяется до целочисленной константы 1 Original: C compatibility macro constant, expands to integer constant 1 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (константа-макрос) |
[править] Исправлены типы целых ширину (начиная с C++11)
[править] numeric_limits
| Определено в файле <limits>
| |
| предоставляет интерфейс для запроса свойства всех основных числовых типов . Original: provides an interface to query properties of all fundamental numeric types. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
[править] С числовым ограничивает интерфейс
[править] Время идентификации типа
| содержит информацию о некоторых типов, порожденных implementation. Это класс, возвращается TypeId оператора Original: contains some type's information, generated by the implementation. This is the class, returned by the TypeId operator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (класс) | |
| (C++11) |
обертка type_info объект, который может быть использован в качестве индекса в ассоциативном и неупорядоченные ассоциативных контейнеров Original: wrapper around a type_info object, that can be used as index in associative and unordered associative containers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (класс) |
| Исключение, которое возникает, если аргумент в TypeId выражение является недействительным Original: exception that is thrown if an argument in a TypeId выражение is null The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (класс) | |
| Исключение, которое выдается на некорректное выражение dynamic_cast, т.е. приведение ссылочного типа не удается Original: exception that is thrown by an invalid dynamic_cast expression, i.e. a cast of reference type fails The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (класс) | |
[править] Тип черты NJ
Тип черты определяет время компиляции шаблона-интерфейс для запроса или изменения свойств типа.
Original:
Type traits defines an compile-time template-based interface to query or modify the properties of 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.
[править] Тип свойства
| Определено в файле <type_traits>
| |
Original: Primary type categories The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| (C++11) |
проверяет, является ли тип void Original: checks if a type is void 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: checks if a type is integral 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: checks if a type is floating-point 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: checks if a type is an array 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: checks if a type is an enumeration 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: checks if a type is an union 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) |
checks if a type is a class type (but not union type) (шаблон класса) |
| (C++11) |
проверяет, является ли тип является функцией типа Original: checks if a type is a function 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: checks if a type is a pointer 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: checks if a type is lvalue reference The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
| (C++11) |
проверяет, является ли тип RValue ссылкой Original: checks if a type is rvalue reference 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: checks if a type is a pointer to a non-static member object 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: checks if a type is a pointer to a non-static member function The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
Original: Composite type categories 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: checks if a type is fundamental 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: checks if a type is arithmetic 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: checks if a type is scalar 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: checks if a type is object 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: checks if a type is compound 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) |
проверяет, является ли тип либо именующее ссылкой или' RValue ссылки Original: checks if a type is either lvalue reference or rvalue reference The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
| (C++11) |
checks if a type is a pointer to a non-static member function or object (шаблон класса) |
Original: Type properties 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: checks if a type is const-qualified 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: checks if a type is volatile-qualified 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: checks if a type is trivial The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
| (C++11) |
checks if a type is trivially copyable (шаблон класса) |
| (C++11) |
проверяет, является ли тип нормативно-макета типа Original: checks if a type is standard-layout 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) |
проверяет, является ли тип обычный старый данных (POD) типа Original: checks if a type is plain-old data (POD) 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) |
checks if a type is literal type (шаблон класса) |
| (C++11) |
checks if a type is class (but not union) type and has no data (шаблон класса) |
| (C++11) |
проверяет, является ли тип полиморфного типа класса Original: checks if a type is polymorphic class 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: checks if a type is abstract class 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: checks if a type is signed arithmetic 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: checks if a type is unsigned arithmetic type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
Original: Supported operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| (C++11) (C++11) (C++11) |
проверяет, является ли тип имеет конструктор для конкретных аргументов Original: checks if a type has a constructor for specific arguments The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
| проверяет, является ли тип имеет конструктор по умолчанию Original: checks if a type has a 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) (C++11) (C++11) |
проверяет, является ли тип имеет конструктор копирования Original: checks if a type has a 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) (C++11) (C++11) |
проверяет, является ли тип имеет ход конструктора Original: checks if a type has a move 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) (C++11) (C++11) |
проверяет, является ли тип имеет оператор присваивания для конкретного аргумента Original: checks if a type has a assignment operator for a specific argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
| (C++11) (C++11) (C++11) |
проверяет, является ли тип имеет копирования оператора присваивания Original: checks if a type has a 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. (шаблон класса) |
| (C++11) (C++11) (C++11) |
проверяет, является ли тип имеет оператор ход назначения Original: checks if a type has a 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. (шаблон класса) |
| (C++11) (C++11) (C++11) |
проверяет, является ли тип имеет не удалил деструктор Original: checks if a type has a non-deleted 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: checks if a type has a virtual destructor The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
Original: Property queries 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: obtains the type's alignment requirements 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: obtains the number of dimensions of an array 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: obtains the size of an array type along a specified dimension The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
Original: Type relationships 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: checks if two types are the same The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
| (C++11) |
checks if a type is derived from the other type (шаблон класса) |
| (C++11) |
проверяет, является ли тип может быть преобразован в другой тип Original: checks if a type can be converted to the other type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
[править] Тип модификаций
Шаблоны типа модификации создания новых определений типа с применением модификаций от параметра шаблона. В результате типа могут быть доступны через
type член ЬурейеЕ.Original:
Type modification templates create new type definitions by applying modifications on a template parameter. The resulting type can then be accessed through
type member typedef.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.
| Определено в файле <type_traits>
| |
Original: Const-volatility specifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| (C++11) (C++11) (C++11) |
удаляет const и / или volatile спецификаторы от данного типа Original: removes const or/and volatile specifiers from the given 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) (C++11) (C++11) |
adds const or/and volatile specifiers to the given type (шаблон класса) |
Original: References 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: removes reference from the given 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) (C++11) |
именующее добавляет' или' RValue ссылка на данный тип Original: adds lvalue or rvalue reference to the given type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
Original: Pointers 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: removes pointer from the given 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: adds pointer to the given type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
Original: Sign modifiers 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: makes the given integral type signed 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: makes the given integral type unsigned The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
Original: Arrays 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: removes one extent from the given array 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) |
removes all extents from the given array type (шаблон класса) |
[править] Разное преобразований
| Определено в файле <type_traits>
| |
| (C++11) |
определяет тип подходит для использования в качестве неинициализированные для хранения типов заданного размера Original: defines the type suitable for use as uninitialized storage for types of given size 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: defines the type suitable for use as uninitialized storage for all given 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: applies type transformations as when passing a function argument by 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) |
скрывает перегруженную функцию или специализацию класса, основываясь на логическом значении, известном в момент компиляции (шаблон класса) |
| (C++11) |
выбирает один из двух типов в зависимости от логической константы времени компиляции (шаблон класса) |
| (C++11) |
deduces the result type of a mixed-mode arithmetic expression (шаблон класса) |
| (C++11) |
получает основной целочисленный тип для данного типа перечисления Original: obtains the underlying integer type for a given enumeration 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: deduces the return type of a function call expression The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
[править] Вспомогательные классы
| Определено в файле <type_traits>
| |
| (C++11) |
константой времени компиляции указанного типа с указанным значением Original: compile-time constant of specified type with specified value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
Два специализации std::integral_constant для типа bool предоставляются
Original:
Two specializations of std::integral_constant for the type bool are provided:
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.
| Определено в файле <type_traits>
| |
| Type
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
true_type
|
std::integral_constant<bool, true> |
false_type
|
std::integral_constant<bool, false> |