C++ 概念: DefaultConstructible

来自cppreference.com

指定该类型的一个实例是默认构造.
Original:
Specifies that an instance of the type can be default constructed.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 要求

该类型必须实现以下功能:1
Original:
The type must implement the following functions:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Type::Type

Type::Type();

默认构造函数: constructs an instance of a type with default contents.

The following expressions must have the specified effects:

表达
Original:
Expression
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Effects
Type a1;
a1默认初始化.
Original:
a1 is default-initialized.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Type a2{};
a2的值初始化.
Original:
a2 is value-initialized.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Type{}
Type()
一个临时对象类型Type值初始化.
Original:
a temporary object of type Type is value-initialized.
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.

(类模板) [edit]