What's the proper way to output all characters in the extended
character set?
```d
void main()
{
foreach(char c; 0 .. 256)
{
write(isControl(c) ? '.' : c);
}
}
```
Expected output:
```
!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX
On Friday, 8 April 2022 at 05:46:56 UTC, Elvis Zhou wrote:
On Friday, 8 April 2022 at 04:31:45 UTC, Elvis Zhou wrote:
[...]
I know where the issue comes from, dynamic array is GCed and
save the reference of a local variable in GCed memory is not
allowed, but here structs is assumed to not es
On Friday, 8 April 2022 at 04:31:45 UTC, Elvis Zhou wrote:
struct A {}
struct B { A a; }
struct C { A a; }
A*[] structs;
B b;
init(&b);
structs ~= cast(A*)&b;
//Error: copying `cast(A*)& b` into allocated memory escapes a
reference to local variable `b`
C c;
init(&c);
structs ~= cast(A*)&c;
On 4/7/22 21:31, Elvis Zhou wrote:
>
> struct A {}
> struct B { A a; }
> struct C { A a; }
>
> A*[] structs;
>
> B b;
> init(&b);
> structs ~= cast(A*)&b;
> //Error: copying `cast(A*)& b` into allocated memory escapes a reference
> to local variable `b`
If that really is the case, you want to pla
On Friday, 8 April 2022 at 04:54:35 UTC, Era Scarecrow wrote:
Maybe it should be `cast(A*) &b.a`?
Confusing HTML entities bit on here. Probably just ignore it.
Maybe you are doing it backwards.
What if you had
```d
struct B {
A* a;
}
A[] arraylist;
```
then in the init append a new item t
On Friday, 8 April 2022 at 04:31:45 UTC, Elvis Zhou wrote:
B b;
init(\&b);
structs ~= cast(A*)\&b;
//Error: copying `cast(A*)\& b` into allocated memory escapes a
reference to local variable `b`
Maybe it should be `cast(A*) \&b.a`?
struct A {}
struct B { A a; }
struct C { A a; }
A*[] structs;
B b;
init(&b);
structs ~= cast(A*)&b;
//Error: copying `cast(A*)& b` into allocated memory escapes a
reference to local variable `b`
C c;
init(&c);
structs ~= cast(A*)&c;
//Error: copying `cast(A*)& c` into allocated memory escap
On Friday, 8 April 2022 at 03:20:29 UTC, dangbinghoo wrote:
hi,
I just asked for help about this before, on that time, my
solution is to remove whatever dub dependencies which are
optional.
now, I'm re-examining the dlang program footprint size, and I
put a github example repo here:
https
hi,
I just asked for help about this before, on that time, my
solution is to remove whatever dub dependencies which are
optional.
now, I'm re-examining the dlang program footprint size, and I put
a github example repo here:
https://github.com/dangbinghoo/dlang_footprint_test.git
the examp
On Thursday, 7 April 2022 at 12:56:05 UTC, MoonlightSentinel
wrote:
On Wednesday, 6 April 2022 at 18:10:32 UTC, Guillaume Piolat
wrote:
Any idea how to workaround that? I really need the same UDA in
parent and child class.
Use a frontend >= dmd 2.099, it works according to run.dlang.io.
Good
On Thursday, 7 April 2022 at 12:51:26 UTC, Stanislav Blinov wrote:
On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote:
wchar_t* clang_string = cast(wchar_t *)"AA";
You're witnessing undefined behavior. "AA" is a string
literal and is stored in the data seg
On Wednesday, 6 April 2022 at 18:10:32 UTC, Guillaume Piolat
wrote:
Any idea how to workaround that? I really need the same UDA in
parent and child class.
Use a frontend >= dmd 2.099, it works according to run.dlang.io.
On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote:
wchar_t* clang_string = cast(wchar_t *)"AA";
You're witnessing undefined behavior. "AA" is a string
literal and is stored in the data segment. Mere cast to wchar_t*
does not make writing through that poin
On Thursday, 7 April 2022 at 11:03:39 UTC, Tejas wrote:
On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote:
Here I try to concatenate three character strings using
`wcsncat()`.
[...]
Maybe try using `wstring` instead of string? Also use the `w`
postfix
```d
wstring dlang_string = "BBB
On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote:
Here I try to concatenate three character strings using
`wcsncat()`.
[...]
Maybe try using `wstring` instead of string? Also use the `w`
postfix
```d
wstring dlang_string = "BBB"w;
I can't test because I'm not on my PC and I
Here I try to concatenate three character strings using
`wcsncat()`.
`clang_string` AA
`dlang_string` BBB
`winpointer_to_string` CC
```
import std.stdio;
@system void main(){
import std.utf: toUTF16z, toUTF16;
import cor
On Thursday, 7 April 2022 at 07:24:03 UTC, Johann wrote:
Hi all,
anybody knows if there are functions (preferably) in Phobos,
that translate from unicode to other encodings and vice versa?
Johann
https://dlang.org/phobos/std_encoding.html
Hi all,
anybody knows if there are functions (preferably) in Phobos, that
translate from unicode to other encodings and vice versa?
Johann
18 matches
Mail list logo