Object arrays in D

Jesse Phillips Jessekphillips+D at gmail.com
Tue Apr 10 08:34:57 PDT 2012


> 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();


More information about the Digitalmars-d mailing list