On 2017-10-14 05:47, Jonathan M Davis wrote:
On Saturday, October 14, 2017 00:18:35 myst via Digitalmars-d-learn wrote:
I'm sorry if this has been answered already, it seems like a very
basic question.
There is .toString() method convention for printing, but I can
not find anything alike for re
On Saturday, 14 October 2017 at 03:47:29 UTC, Jonathan M Davis
wrote:
The function to use for conversions in general is std.conv.to.
And really, there isn't much of a reason to ever call toString.
Functions like writeln, format, and to may use it internally,
but it's more or less an anti-patter
On Saturday, October 14, 2017 00:18:35 myst via Digitalmars-d-learn wrote:
> I'm sorry if this has been answered already, it seems like a very
> basic question.
>
> There is .toString() method convention for printing, but I can
> not find anything alike for reading. Is there something like
> operat
On Saturday, 14 October 2017 at 02:16:12 UTC, Fra Mecca wrote:
On Saturday, 14 October 2017 at 00:18:35 UTC, myst wrote:
...
some snippet of a c++ code that does what you mean
#include
#include
struct S {
std::string s;
int p;
int n;
};
std::istream& operator>>(std::istream& is,
On Saturday, 14 October 2017 at 00:18:35 UTC, myst wrote:
I'm sorry if this has been answered already, it seems like a
very basic question.
There is .toString() method convention for printing, but I can
not find anything alike for reading. Is there something like
operator>>() in C++? What's a
I'm sorry if this has been answered already, it seems like a very
basic question.
There is .toString() method convention for printing, but I can
not find anything alike for reading. Is there something like
operator>>() in C++? What's an ideomatic way of reading an object?