On 06/03/2015 03:47 AM, Andrei Alexandrescu wrote:
On 6/2/15 5:53 PM, Timon Gehr wrote:
Indeed, but I think this facility is undocumented. Maybe it should be
exposed via the standard library?
A good idea, please bugzilla so we don't forget. -- Andrei
On 2 June 2015 at 05:00, deadalnix via Digitalmars-d
digitalmars-d@puremagic.com wrote:
After discussion at DConf, it ends up that union have some lack of
specification, and some nonsensical behavior right now. Here are some points
discussed and possible solutions :
1/ .init for unions is not
On Monday, 1 June 2015 at 22:45:55 UTC, Walter Bright wrote:
On 6/1/2015 2:17 PM, CraigDillabaugh wrote:
Not sure. Walter?
I think it's fine.
So are you saying you think don't think they are mangled the
same way, but that you don't want to bother arguing.
Hah, I should have said that fine
On Tuesday, 2 June 2015 at 05:07:43 UTC, Andrei Alexandrescu
wrote:
On 6/1/15 9:46 PM, deadalnix wrote:
No, I asked you what is the rationale used to get types with
postblit/destructor in unions (right now, the spec says no). I
asked
about the rationale for introduction of element with
On 6/2/15 3:43 AM, Timon Gehr wrote:
On 06/02/2015 01:55 AM, Andrei Alexandrescu wrote:
On 6/1/15 2:40 PM, Steven Schveighoffer wrote:
So what happens on destruction?
Nothing happens.
What about postblit?
Nothing happens.
Andrei
Is there an official way to invoke them manually?
On 6/2/15 4:14 PM, Timon Gehr wrote:
On 06/03/2015 01:07 AM, Andrei Alexandrescu wrote:
On 6/2/15 3:42 PM, Steven Schveighoffer wrote:
On 6/2/15 6:14 PM, Andrei Alexandrescu wrote:
On 6/2/15 2:57 PM, Timon Gehr wrote:
OK. What about copying in instead of out?
If the appropriate type has
On 06/03/2015 02:51 AM, Andrei Alexandrescu wrote:
On 6/2/15 4:14 PM, Timon Gehr wrote:
On 06/03/2015 01:07 AM, Andrei Alexandrescu wrote:
On 6/2/15 3:42 PM, Steven Schveighoffer wrote:
On 6/2/15 6:14 PM, Andrei Alexandrescu wrote:
On 6/2/15 2:57 PM, Timon Gehr wrote:
OK. What about copying
On 6/2/15 8:53 PM, Timon Gehr wrote:
On 06/03/2015 02:51 AM, Andrei Alexandrescu wrote:
Oh, I only now understood the question. Yes, it's possible to only call
postblit if defined:
static if (hasElaborateCopyConstructor!T)
tvar.__postblit();
The sad part is, I knew this :(
Indeed,
On 3 June 2015 at 08:50, Andrei Alexandrescu via Digitalmars-d
digitalmars-d@puremagic.com wrote:
On 6/2/15 1:48 AM, Manu via Digitalmars-d wrote:
On 2 June 2015 at 05:00, deadalnix via Digitalmars-d
digitalmars-d@puremagic.com wrote:
After discussion at DConf, it ends up that union have
On 06/02/2015 09:48 PM, Andrei Alexandrescu wrote:
On 6/2/15 3:43 AM, Timon Gehr wrote:
On 06/02/2015 01:55 AM, Andrei Alexandrescu wrote:
On 6/1/15 2:40 PM, Steven Schveighoffer wrote:
So what happens on destruction?
Nothing happens.
What about postblit?
Nothing happens.
Andrei
Is
On 6/2/15 2:57 PM, Timon Gehr wrote:
OK. What about copying in instead of out?
If the appropriate type has already been constructed, assignment
suffices. Otherwise, emplace(target, source) is needed. -- Andrei
On 6/2/15 6:14 PM, Andrei Alexandrescu wrote:
On 6/2/15 2:57 PM, Timon Gehr wrote:
OK. What about copying in instead of out?
If the appropriate type has already been constructed, assignment
suffices. Otherwise, emplace(target, source) is needed. -- Andrei
My concern is if you copy the
On 6/2/15 1:48 AM, Manu via Digitalmars-d wrote:
On 2 June 2015 at 05:00, deadalnix via Digitalmars-d
digitalmars-d@puremagic.com wrote:
After discussion at DConf, it ends up that union have some lack of
specification, and some nonsensical behavior right now. Here are some points
discussed and
On 6/2/15 3:42 PM, Steven Schveighoffer wrote:
On 6/2/15 6:14 PM, Andrei Alexandrescu wrote:
On 6/2/15 2:57 PM, Timon Gehr wrote:
OK. What about copying in instead of out?
If the appropriate type has already been constructed, assignment
suffices. Otherwise, emplace(target, source) is needed.
On 6/2/15 6:50 PM, Andrei Alexandrescu wrote:
On 6/2/15 1:48 AM, Manu via Digitalmars-d wrote:
On 2 June 2015 at 05:00, deadalnix via Digitalmars-d
digitalmars-d@puremagic.com wrote:
After discussion at DConf, it ends up that union have some lack of
specification, and some nonsensical behavior
On 06/03/2015 01:07 AM, Andrei Alexandrescu wrote:
On 6/2/15 3:42 PM, Steven Schveighoffer wrote:
On 6/2/15 6:14 PM, Andrei Alexandrescu wrote:
On 6/2/15 2:57 PM, Timon Gehr wrote:
OK. What about copying in instead of out?
If the appropriate type has already been constructed, assignment
On 6/2/15 5:53 PM, Timon Gehr wrote:
Indeed, but I think this facility is undocumented. Maybe it should be
exposed via the standard library?
A good idea, please bugzilla so we don't forget. -- Andrei
On 06/02/2015 01:55 AM, Andrei Alexandrescu wrote:
On 6/1/15 2:40 PM, Steven Schveighoffer wrote:
So what happens on destruction?
Nothing happens.
What about postblit?
Nothing happens.
Andrei
Is there an official way to invoke them manually?
On 6/2/2015 1:34 AM, wobbles wrote:
On Monday, 1 June 2015 at 22:45:55 UTC, Walter Bright wrote:
On 6/1/2015 2:17 PM, CraigDillabaugh wrote:
Not sure. Walter?
I think it's fine.
So are you saying you think don't think they are mangled the
same way, but that you don't want to bother
After discussion at DConf, it ends up that union have some lack
of specification, and some nonsensical behavior right now. Here
are some points discussed and possible solutions :
1/ .init for unions is not defined. I propose to define it as the
.init of the first field + padding with 0s if
On 6/1/15 12:00 PM, deadalnix wrote:
1/ .init for unions is not defined. I propose to define it as the .init
of the first field + padding with 0s if the union is larger than its
first member. It seems to be what is generated right now.
Fine.
2/ Default constructor takes one argument per
On 6/1/2015 12:43 PM, Andrei Alexandrescu wrote:
On 6/1/15 12:00 PM, deadalnix wrote:
1/ .init for unions is not defined. I propose to define it as the .init
of the first field + padding with 0s if the union is larger than its
first member. It seems to be what is generated right now.
Fine.
On Monday, 1 June 2015 at 21:02:30 UTC, Walter Bright wrote:
On 6/1/2015 12:43 PM, Andrei Alexandrescu wrote:
On 6/1/15 12:00 PM, deadalnix wrote:
1/ .init for unions is not defined. I propose to define it as
the .init
of the first field + padding with 0s if the union is larger
than its
On 6/1/15 5:36 PM, Andrei Alexandrescu wrote:
On 6/1/15 2:22 PM, Steven Schveighoffer wrote:
I would make it clear here what you mean. I can't tell what the rule
is (there may be 2 rules, or 1, but I can't tell), and whether Andrei
agrees we should do it or not.
Unions should accept all
On Monday, 1 June 2015 at 21:32:32 UTC, Andrei Alexandrescu wrote:
On 6/1/15 2:02 PM, Walter Bright wrote:
3/ union and @safe is currently undefined. I proposed to
make everything
involving unions @system, and we will figure it out from
there.
No.
What should we do here then? -- Andrei
On 6/1/15 5:02 PM, Walter Bright wrote:
On 6/1/2015 12:43 PM, Andrei Alexandrescu wrote:
On 6/1/15 12:00 PM, deadalnix wrote:
1/ .init for unions is not defined. I propose to define it as the .init
of the first field + padding with 0s if the union is larger than its
first member. It seems to
On 6/1/15 2:02 PM, Walter Bright wrote:
3/ union and @safe is currently undefined. I proposed to make everything
involving unions @system, and we will figure it out from there.
No.
What should we do here then? -- Andrei
On 6/1/15 2:02 PM, Walter Bright wrote:
For non-native speakers, the use of fine is often confusing. Fine in
American english means you're wrong, but I won't argue the point. It
does not signify endorsement.
Thanks for the lesson. Indeed I did mean it as yes. -- Andrei
On 6/1/15 2:22 PM, Steven Schveighoffer wrote:
I would make it clear here what you mean. I can't tell what the rule
is (there may be 2 rules, or 1, but I can't tell), and whether Andrei
agrees we should do it or not.
Unions should accept all types, including those with @disabled or
elaborated
On 6/1/2015 2:32 PM, Andrei Alexandrescu wrote:
On 6/1/15 2:02 PM, Walter Bright wrote:
3/ union and @safe is currently undefined. I proposed to make everything
involving unions @system, and we will figure it out from there.
No.
What should we do here then? -- Andrei
There's nothing
On Monday, 1 June 2015 at 19:43:33 UTC, Andrei Alexandrescu wrote:
Do not define constructors. They ostensibly imply commitment to
remembering to call the appropriate destructor. A union can
only be default constructed (with its init value as described)
and has no destructor.
This is
On 6/1/2015 2:17 PM, CraigDillabaugh wrote:
Not sure. Walter?
I think it's fine.
So are you saying you think don't think they are mangled the
same way, but that you don't want to bother arguing.
Hah, I should have said that fine has the meaning reversed when it is used as
a single word
On 6/1/15 2:40 PM, Steven Schveighoffer via Digitalmars-d wrote:
On 6/1/15 5:36 PM, Andrei Alexandrescu wrote:
On 6/1/15 2:22 PM, Steven Schveighoffer wrote:
I would make it clear here what you mean. I can't tell what the rule
is (there may be 2 rules, or 1, but I can't tell), and whether
On 6/1/15 2:40 PM, Steven Schveighoffer wrote:
So what happens on destruction?
Nothing happens.
What about postblit?
Nothing happens.
Andrei
On 6/1/15 3:44 PM, Walter Bright wrote:
On 6/1/2015 2:32 PM, Andrei Alexandrescu wrote:
On 6/1/15 2:02 PM, Walter Bright wrote:
3/ union and @safe is currently undefined. I proposed to make
everything
involving unions @system, and we will figure it out from there.
No.
What should we do
On 6/1/15 3:43 PM, deadalnix wrote:
On Monday, 1 June 2015 at 19:43:33 UTC, Andrei Alexandrescu wrote:
Do not define constructors. They ostensibly imply commitment to
remembering to call the appropriate destructor. A union can only be
default constructed (with its init value as described) and
On 6/1/15 7:18 PM, deadalnix wrote:
On Tuesday, 2 June 2015 at 00:11:09 UTC, Andrei Alexandrescu wrote:
On 6/1/15 3:43 PM, deadalnix wrote:
On Monday, 1 June 2015 at 19:43:33 UTC, Andrei Alexandrescu wrote:
Do not define constructors. They ostensibly imply commitment to
remembering to call
On Tuesday, 2 June 2015 at 00:11:09 UTC, Andrei Alexandrescu
wrote:
On 6/1/15 3:43 PM, deadalnix wrote:
On Monday, 1 June 2015 at 19:43:33 UTC, Andrei Alexandrescu
wrote:
Do not define constructors. They ostensibly imply commitment
to
remembering to call the appropriate destructor. A union can
On Tuesday, 2 June 2015 at 02:32:55 UTC, Andrei Alexandrescu
wrote:
On 6/1/15 7:18 PM, deadalnix wrote:
On Tuesday, 2 June 2015 at 00:11:09 UTC, Andrei Alexandrescu
wrote:
On 6/1/15 3:43 PM, deadalnix wrote:
On Monday, 1 June 2015 at 19:43:33 UTC, Andrei Alexandrescu
wrote:
Do not define
On 6/1/15 9:46 PM, deadalnix wrote:
No, I asked you what is the rationale used to get types with
postblit/destructor in unions (right now, the spec says no). I asked
about the rationale for introduction of element with destructor/copy
constructor in C++, but it turns out that the link provided
40 matches
Mail list logo