Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Objects/Constructors/KeepingDefaultConstructor

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

The compiler provides a do-nothing implementation of the "default constructor" (one that has no parameters), if the programmer hasn't manually provided a custom implementation for it. But traditionally, if the programmer writes any other constructor (having some other overloaded signature of parameters), then this built-in default constructor was not provided by the compiler. If you do write some other constructor, but you still also want the compiler to provide its built-in default constructor, request it with CRType() = default;. Additional information about keeping the default constructor