On Wed, 11 Apr 2012 13:07:54 -0400, Johannes Pfau
wrote:
Am Tue, 10 Apr 2012 20:28:28 +0200
schrieb Marco Leise :
Am Tue, 10 Apr 2012 07:35:31 -0400
schrieb "Steven Schveighoffer" :
> Destructors are strictly for cleaning up resources that *AREN'T*
> allocated by the GC. For example anyth
On Wed, Apr 11, 2012 at 07:07:54PM +0200, Johannes Pfau wrote:
> Am Tue, 10 Apr 2012 20:28:28 +0200
> schrieb Marco Leise :
>
> > Am Tue, 10 Apr 2012 07:35:31 -0400
> > schrieb "Steven Schveighoffer" :
> >
> > > Destructors are strictly for cleaning up resources that *AREN'T*
> > > allocated by t
Am Tue, 10 Apr 2012 20:28:28 +0200
schrieb Marco Leise :
> Am Tue, 10 Apr 2012 07:35:31 -0400
> schrieb "Steven Schveighoffer" :
>
> > Destructors are strictly for cleaning up resources that *AREN'T*
> > allocated by the GC. For example anything created with C's malloc,
> > or an open file descr
On Tuesday, 10 April 2012 at 18:28:39 UTC, Marco Leise wrote:
Am Tue, 10 Apr 2012 07:35:31 -0400
schrieb "Steven Schveighoffer" :
Destructors are strictly for cleaning up resources that
*AREN'T* allocated by the GC. For example anything created
with C's malloc, or an open file descriptor, e
Am Tue, 10 Apr 2012 07:35:31 -0400
schrieb "Steven Schveighoffer" :
> Destructors are strictly for cleaning up resources that *AREN'T* allocated
> by the GC. For example anything created with C's malloc, or an open file
> descriptor, etc.
This I think is a very good advice to beginners. Shor
class Deck {
Card popBack() {
auto card = cards.popBack(); // get last card. cards.length
Note that popBack() is void:
http://dlang.org/phobos/std_array.html#popBack
use
auto card = cards.back();
cards.popBack();
Thanks, works fine now.
On Tue, 10 Apr 2012 13:58:44 +0200, CrudOMatic
wrote:
Sorry, but a small issue.
the line: auto card = cards.popBack();
throws the errors:
error: variable xxx.card voids have no value
error: expression popBack(this.cards) is void and has no value
I tried reserving the space, I even tried c
Sorry, but a small issue.
the line: auto card = cards.popBack();
throws the errors:
error: variable xxx.card voids have no value
error: expression popBack(this.cards) is void and has no value
I tried reserving the space, I even tried cards = new
Card[no_cards];
On Tue, 10 Apr 2012 03:41:28 -0400, CrudOMatic
wrote:
The D documentation is a little lacking in a lot of areas. I'm needing
to know an exact way of making arrays of objects.
For example:
/* Deck class */
// Will be adjusted with the proper cards for each game type
class D
Thanks much.
On Tue, 10 Apr 2012 12:01:10 +0200, CrudOMatic
wrote:
Awesome. One last question, does popFront() have the same effect of
decreasing length - or should I avoid popFront()?
popFront will also reduce the length, but it will slice away the first
item. Read the article I linked earlier.
This
On Tuesday, 10 April 2012 at 09:52:45 UTC, simendsjo wrote:
On Tue, 10 Apr 2012 11:27:19 +0200, CrudOMatic
wrote:
h... so no need for a generic object reference counter.
Nice. I was trying to approach it from a literal sense (e.g.
card moves from deck to player's hand) - when you do the
p
On Tue, 10 Apr 2012 11:27:19 +0200, CrudOMatic
wrote:
h... so no need for a generic object reference counter. Nice. I was
trying to approach it from a literal sense (e.g. card moves from deck to
player's hand) - when you do the popBack() is that object returned and
deleted from the ori
On Tuesday, 10 April 2012 at 09:15:13 UTC, simendsjo wrote:
On Tue, 10 Apr 2012 10:53:58 +0200, CrudOMatic
wrote:
On Tuesday, 10 April 2012 at 08:05:33 UTC, simendsjo wrote:
On Tue, 10 Apr 2012 09:41:28 +0200, CrudOMatic
wrote:
The D documentation is a little lacking in a lot of areas.
I
On Tue, 10 Apr 2012 10:53:58 +0200, CrudOMatic
wrote:
On Tuesday, 10 April 2012 at 08:05:33 UTC, simendsjo wrote:
On Tue, 10 Apr 2012 09:41:28 +0200, CrudOMatic
wrote:
The D documentation is a little lacking in a lot of areas. I'm needing
to know an exact way of making arrays of object
On Tuesday, 10 April 2012 at 08:05:33 UTC, simendsjo wrote:
On Tue, 10 Apr 2012 09:41:28 +0200, CrudOMatic
wrote:
The D documentation is a little lacking in a lot of areas. I'm
needing to know an exact way of making arrays of objects.
For example:
/* Deck class */
// Will be adjust
On Tue, 10 Apr 2012 09:41:28 +0200, CrudOMatic
wrote:
The D documentation is a little lacking in a lot of areas. I'm needing
to know an exact way of making arrays of objects.
For example:
/* Deck class */
// Will be adjusted with the proper cards for each game type
class D
The D documentation is a little lacking in a lot of areas. I'm
needing to know an exact way of making arrays of objects.
For example:
/* Deck class */
// Will be adjusted with the proper cards for each game type
class Deck {
/* Card count - used to keep track of how many cards
19 matches
Mail list logo