nullptr pointer literal
Материал из cppreference.com
|
|
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. |
Содержание |
[править] Синтаксис
nullptr
|
(начиная с C++11) | ||||||||
[править] Объяснение
Ключевое слово
от nullptr обозначает нулевой указатель буквально. Это неопределенное prvalue типа std::nullptr_t. Там существуют <div class="t-tr-text">неявные преобразованияOriginal:
implicit conversions
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
nullptr на нулевое значение указателя любого типа указатель и указатель на любой тип элемента. Похожие преобразования существуют для любого значения типа std::nullptr_t, а также для NULL макро, нулевого указателя постоянная.Original:
The keyword
nullptr denotes the null pointer literal. It is an unspecified prvalue of type std::nullptr_t. There exist неявные преобразования</div> from
Original:
implicit conversions
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
nullptr to null pointer value of any pointer type and any pointer to member type. Similar conversions exist for any value of type std::nullptr_t as well as for the macro NULL, the 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.
You can help to correct and verify the translation. Click here for instructions.
[править] Пример
Демонстрирует Nullptr позволяет пересылку через шаблон функции .
Original:
Demonstrates how nullptr allows forwarding via a template function.
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.
Вывод:
Function g called Function g called Function g called
[править] Ключевые слова
[править] См. также
| определяется реализацией нулевого указателя постоянно 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) |
тип нулевого указателя буквальном 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. (определение типа) |