char[][] to std::vector<std::string> - DIP or dmd-issue?

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jun 13 10:37:29 PDT 2015


On Saturday, 13 June 2015 at 17:02:06 UTC, Dennis Ritchie wrote:
> On Saturday, 13 June 2015 at 16:20:46 UTC, anonymous wrote:
[...]
>> Yeah, that would be neat. But typing out ".dup" isn't that 
>> bad, and converting a `string[]` to a `char[][]` is simple:
>>     import std.conv: to;
>> auto a = ["foo"].to!(char[][]);
>
> Yes, but it is not suitable for multidimensional array of 
> strings.

Please show how it is not. Seems to work just fine.

[...]
> And why in C++ is running `std::vector<std::string>` ?
> Really in D can not do something like that?
>
> Maybe a new type will not solve anything, but there should be 
> other ways to do in D analogue strings of C++.

Your definitions of "something like that" and "other ways" are 
unreasonably narrow, in my opinion. Typing out ".dup" is D's way 
to do mutable strings. You just don't like it.



More information about the Digitalmars-d-learn mailing list