Talk:Nullary constructor

Latest comment: 8 months ago by 2A00:23C7:F18B:4801:4450:9D2:ADE0:7169 in topic This misses a key "use"

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