DIP53 and DIP49 (ver2) - New definitions for qualified constructors and postblits

Kenji Hara k.hara.pg at gmail.com
Wed Dec 18 17:27:37 PST 2013


2013/12/19 Joseph Rushton Wakeling <joseph.wakeling at webdrake.net>

> And you have this(...) const (aka "unique"), which can be used to
> construct both immutable and mutable instances.
>
> It seems to me that this is a very natural relation to the existing
> interpretation of mutable, immutable and const variables by the language,
> and e.g. the way that immutable, mutable and const function parameters are
> addressed.
>

That's right. When 'const' constructor/postblit is called, the constructing
object qualifier is either mutable or immutable, even if it is not visible
inside const constructor/postblit.

----

I tweaked the descriptions in DIPs, about Const Constructor/Postblit
concept.

- I mostly removed words "unique constructor" and "unique postblit",
because they would just increase reader's confusion.
  DIPs can describe intrinsic concepts without these words.

- I added following sections in DIPs:

  Why 'const' postblit will called to copy arbitrary qualified object?

http://wiki.dlang.org/DIP49#Why_.27const.27_postblit_will_called_to_copy_arbitrary_qualified_object.3F

  Why 'const' constructor will be called to create arbitrary qualified
object?

http://wiki.dlang.org/DIP53#Why_.27const.27_constructor_will_be_called_to_create_arbitrary_qualified_object.3F

  There's no violation against the widely known "const method" concept.

Kenji Hara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131219/a01587dc/attachment.html>


More information about the Digitalmars-d mailing list