Printing an std.container.Array

Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 16 13:07:13 PDT 2015


On Thu, 16 Apr 2015 19:55:52 +0000
Bayan Rafeh via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com> wrote:

> Executing this code:
> 
> import std.container.array;
> import std.stdio;
> 
> 
> int main() {
> 	writeln(Array!int([1, 2]));
> 	return 0;
> }
> 
> outputs the following:
> 
> Array!int(RefCounted!(Payload,
> cast(RefCountedAutoInitialize)0)(RefCountedStore(B694B0)))
> 
> 
> The strange thing is that this works fine:
> 
> import std.container.array;
> import std.stdio;
> 
> int main() {
> 	writeln(Array!int([1, 2])[0..$]);
> 	return 0;
> }
> 
> [1, 2]
> 
> How am I supposed to interpret this?

https://github.com/D-Programming-Language/phobos/pull/2875


More information about the Digitalmars-d-learn mailing list