June 13, 2015 Re: char[][] to std::vector<std::string> - DIP or dmd-issue? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis Ritchie | Type is probably possible, though conversion method will be simpler. You can even try to write a specialization of `to` for multidimentional arrays if it doesn't work. |
June 13, 2015 Re: char[][] to std::vector<std::string> - DIP or dmd-issue? | ||||
---|---|---|---|---|
| ||||
Posted in reply to anonymous | On Saturday, 13 June 2015 at 17:37:31 UTC, anonymous wrote: > Please show how it is not. Seems to work just fine. OK. Still, this method works: char[][][][][][] strArr = [[[[["foo", "baz"], ["bar", "tor"]]]].to!(char[][][][][])]; But I don't want to write this `.to!(char[][][][][])`. On Saturday, 13 June 2015 at 17:37:31 UTC, anonymous wrote: > 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. Yes, I don't like it. |
June 13, 2015 Re: char[][] to std::vector<std::string> - DIP or dmd-issue? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On Saturday, 13 June 2015 at 17:39:25 UTC, Kagamin wrote:
> Type is probably possible, though conversion method will be simpler. You can even try to write a specialization of `to` for multidimentional arrays if it doesn't work.
It appears the problem can be solved by creating specifications .to!strArray, which will determine the dimension of the array and convert it to char[][][][]...
Actually, I will file issue `std.conv` in Phobos to add such specifications. It will suit me.
Thanks to all. I just didn't know that such a conversion is running.
|
June 13, 2015 Re: char[][] to std::vector<std::string> - DIP or dmd-issue? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis Ritchie | On Saturday, 13 June 2015 at 18:15:30 UTC, Dennis Ritchie wrote:
> Actually, I will file issue `std.conv` in Phobos to add such specifications. It will suit me.
*specializations
|
Copyright © 1999-2021 by the D Language Foundation