79806283

Date: 2025-11-01 00:22:56
Score: 0.5
Natty:
Report link

The provided answers are wrong. Construction is not always required.

C++11, 3.8 Lifetime

The lifetime of an object of type T begins when:

— storage with the proper alignment and size for type T is obtained, and

— if the object has non-trivial initialization, its initialization is complete.

Notes:

`malloc()` guarantees the first condition (by the C standard).

the "non-trivial initialization" condition was later modified in cpp14 and cpp17, but the modification still preserves the fact there are "trivially" (before cpp17) or "vacously" (from cpp17) initializable objects that do not require the ctor call to start their lifetime.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Sgg8