I expect nothing, my only intention was to show you, that this
cannot work. But that it works with an explicit cast is very
impressive. I thought the alias this does it automatically.
I'm learning too. ;)
On Thursday, 20 September 2012 at 15:04:48 UTC, Namespace wrote:
On Thursday, 20 September 2012 at 14:15:23 UTC, monarch_dodra
wrote:
On Thursday, 20 September 2012 at 14:09:29 UTC, Namespace
wrote:
http://dpaste.dzfl.pl/edit/361a54eb
With
[code]
@disable this(this);
[/code]
this don't work (
On Thursday, 20 September 2012 at 14:15:23 UTC, monarch_dodra
wrote:
On Thursday, 20 September 2012 at 14:09:29 UTC, Namespace wrote:
http://dpaste.dzfl.pl/edit/361a54eb
With
[code]
@disable this(this);
[/code]
this don't work (as expected). But with the copy ctor but
without ".get" you earn a
On Thursday, 20 September 2012 at 14:09:29 UTC, Namespace wrote:
http://dpaste.dzfl.pl/edit/361a54eb
With
[code]
@disable this(this);
[/code]
this don't work (as expected). But with the copy ctor but
without ".get" you earn a segmentation fault (as you can see).
So you can disable the copy cto
On Thursday, 20 September 2012 at 14:02:01 UTC, monarch_dodra
wrote:
On Thursday, 20 September 2012 at 12:32:03 UTC, Namespace wrote:
So I should disable the copy ctor (@disable this(this)) and
drop move, right?
Yes, but at that point, what you have is scoped!T
re-implemented :/
As you can Se
On Thursday, 20 September 2012 at 12:32:03 UTC, Namespace wrote:
So I should disable the copy ctor (@disable this(this)) and
drop move, right?
Yes, but at that point, what you have is scoped!T re-implemented
:/
As you can See if I pass a OnStack to function/class i'm using
.get all the Time.
So I should disable the copy ctor (@disable this(this)) and drop
move, right?
As you can See if I pass a OnStack to function/class i'm using
.get all the Time. The only other method IMO would be to pass it
as OnStack by value and Store it in the other class also as
OnStack, right?
@bearophiol
Am Thu, 20 Sep 2012 12:06:28 +0200
schrieb "monarch_dodra" :
> On Thursday, 20 September 2012 at 08:10:36 UTC, Namespace wrote:
> > You're right.
> > This is my next try: http://dpaste.dzfl.pl/02b32d33
> > Do you have anything else to say? :)
>
> I think it looks good, but I'm unsure about "move"
Am Thu, 20 Sep 2012 10:11:37 +0200
schrieb "Namespace" :
> You're right.
> This is my next try: http://dpaste.dzfl.pl/02b32d33
> Do you have anything else to say? :)
I think it shouldn't be possible to copy an OnStack struct. The
destructor is run for every copy, but the constructor was run only
On Thursday, 20 September 2012 at 08:10:36 UTC, Namespace wrote:
You're right.
This is my next try: http://dpaste.dzfl.pl/02b32d33
Do you have anything else to say? :)
I think it looks good, but I'm unsure about "move", or allowing
pass by value:
Classes can't be memcopied the way structs ca
On Wednesday, 19 September 2012 at 21:36:56 UTC, Namespace wrote:
I count it to destroy it if it isn't used anymore.
What I'm saying though is that when your "stacked_obj" goes out
of scope, it gets destroyed, 100% of the time. The "chunk"
disappears, along with any object inside it. When that
I count it to destroy it if it isn't used anymore.
I can remove this behaviour but IMO with this you haven't
unnecessary use of stack memory. Am I wrong?
Furthermore, if I copy the stack object e.g. if I pass it as
value parameter to another function/class, I can store it as long
as it's needed
On Wednesday, 19 September 2012 at 19:24:34 UTC, Namespace wrote:
Result:
http://dpaste.dzfl.pl/24988d8f
I like it, but how can something placed on the stack be reference
counted? The "chunk" is also placed on the stack, so it doesn't
really make sense to me: When the object goes out of scope
Result:
http://dpaste.dzfl.pl/24988d8f
On Wednesday, 19 September 2012 at 17:08:28 UTC, monarch_dodra
wrote:
On Wednesday, 19 September 2012 at 14:16:31 UTC, Namespace
wrote:
Thanks, I will use __traits(classInstanceSize, A);
But it does not work either.
This is because classes are already pointers. when you write
"&a", you are ge
On Wednesday, 19 September 2012 at 14:16:31 UTC, Namespace wrote:
Thanks, I will use __traits(classInstanceSize, A);
But it does not work either.
This is because classes are already pointers. when you write
"&a", you are getting the address of pointer itself. So when you
memcopy, don't use "&
Thanks, I will use __traits(classInstanceSize, A);
But it does not work either.
On Wed, 19 Sep 2012 15:45:21 +0200, Namespace
wrote:
On Wednesday, 19 September 2012 at 13:32:42 UTC, Namespace wrote:
Is that possible?
I can initialize an object with scope or, in feature, with scoped,
directly on the stack but is it also possible to move an existing
object from the he
On Wednesday, 19 September 2012 at 13:32:42 UTC, Namespace wrote:
Is that possible?
I can initialize an object with scope or, in feature, with
scoped, directly on the stack but is it also possible to move
an existing object from the heap to the stack?
I tried this:
http://dpaste.dzfl.pl/2955f
Is that possible?
I can initialize an object with scope or, in feature, with
scoped, directly on the stack but is it also possible to move an
existing object from the heap to the stack?
20 matches
Mail list logo