Jump to content

Talk:Nullary constructor

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by 2a00:23c7:f18b:4801:4450:9d2:ade0:7169 (talk) at 03:37, 28 February 2024 (This misses a key "use": new section). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

nullary ≠ default

[edit]

In some languages, a nullary constructor is indeed the default. In others, there is no default constructor per se, but there still may be nullary constructors. Much this point was made earlier when it was proposed at “Default constructor” that it be merged with this article. Unfortunately, “Default constructor” presently draws upon a sloppy source for its discussion. That article needs at least enough work to explain why a default construct is a default constructor, as opposed mere to being a nullary constructor. —SlamDiego←T 10:58, 17 July 2009 (UTC)[reply]

This misses a key "use"

[edit]

AS pointed out, nullary and default are not quite the same, aside from default constructors another big use is two-phase construction which is used for serialisation. Splitting construction to a nullary constructor and a "Create" method.

I was hoping to see something about those considerations

2A00:23C7:F18B:4801:4450:9D2:ADE0:7169 (talk) 03:37, 28 February 2024 (UTC)[reply]