Printing an std.container.Array
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Apr 17 07:35:19 PDT 2015
On 4/16/15 5:18 PM, Dennis Ritchie wrote:
> On Thursday, 16 April 2015 at 20:34:19 UTC, Steven Schveighoffer wrote:
>> On 4/16/15 4:18 PM, Panke wrote:
>>>>
>>>> Yep, but problem is almost no one expect this, or know this. We
>>>> definitely
>>>> should do better.
>>>
>>> How?
>>
>> By doing what is expected. Print the array contents. See my new
>> comment in that PR.
>>
>> -Steve
>
> I think that this action should print the contents of the container, not
> it's type, ie [1, 2, 3, 4]:
>
> import std.stdio : writeln;
> import std.container.rbtree : redBlackTree;
>
> void main() {
>
> auto a = redBlackTree(1, 2, 1, 3, 4, 3);
>
> writeln(a);
> // std.container.rbtree.RedBlackTree!(int, "a < b",
> false).RedBlackTree
> }
>
> Will it be modified in future versions of DMD?
Yes, that's what should happen.
-Steve
More information about the Digitalmars-d-learn
mailing list