A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../string/../named_req/DefaultConstructible.html below:

C++ named requirements: DefaultConstructible - cppreference.com

Specifies that an instance of the type can be default constructed.

[edit] Requirements

The type T satisfies DefaultConstructible if all following statements and expressions are valid and have their specified effects:

[edit] Notes

For objects of non-aggregate class type, a public default constructor must be defined (either user-defined or implicitly defined) to satisfy DefaultConstructible.

Non-const objects of non-class object type are always DefaultConstructible.

Const non-class types are not DefaultConstructible.

Const aggregate types are not DefaultConstructible if any of their members is an object of non-class type.

Non-object types (function types, reference types, and the (possibly cv-qualified) type void) as well as the const non-object types are never DefaultConstructible.

[edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior LWG 724 C++98 the requirements of DefaultConstructible were missing added LWG 2170 C++98 initialzing an object of a DefaultConstructible type with an
empty initializer could only result in value-initialization can also lead to
aggregate-initialization [edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4