On 08.07.19 23:55, aliak wrote:
struct ustring {
string data;
this(string data) {
this.data = data;
}
auto get() {
static struct Range {
typeof(string.init.byGrapheme) source;
bool empty() { return source.empty; }
void p
Problem 1:
I'm trying to get a string to behave as a .byGrapheme range by
default, but I can't figure out Grapheme. I'm trying to replicate
this behavior:
foreach (g; "hello".byGrapheme) {
write(g[]);
}
In a custom type:
struct ustring {
string data;
this(string data) {
08.07.2019 13:38, Joseph Rushton Wakeling пишет:
Thanks for taking the time to answer, but I don't think this really
addresses my question.
Your example shows a struct with `toString` overloads. However,
SysTime.toISOExtString does not work like this: it is a method with two
explicit overl
On Sunday, 7 July 2019 at 20:12:30 UTC, drug wrote:
07.07.2019 17:49, Joseph Rushton Wakeling пишет:
it's possible to do something like
`writefln!"%s"(now.toISOExtString)` and have it automatically
use the output range overload rather than allocating a new
string instance.
This is exactly ho