Getting with below error for following codes. Look like bug?
onlineapp.d(61): Error: scope variable `a` assigned to non-scope
parameter `a` calling `foo`
@safe:
struct A(S = string)
{
@safe:
S s;
void delegate() c;
}
struct B(S = string)
{
@safe
import std.stdio;
void main()
{
float f = 6394763.345f;
import std.format : sformat;
char[80] vBuffer = void;
writeln("6394763.345 = ", sformat(vBuffer[], "%.4f", f));
}
Output
6394763.345 = 6394763.5000
On Saturday, 2 December 2023 at 15:30:39 UTC, zoujiaqing wrote:
```D
string appKey =
"1";
ubyte[1024] data = cast(ubyte[])(appKey.dup[0..$]);
sha256.put(data);
Your data has garbage at the end; try
sha256.put(data[0..appKey.leng
On Saturday, 20 January 2024 at 15:59:59 UTC, Anonymouse wrote:
I remember reading this was an issue and now I ran into it
myself.
```d
import std.stdio;
void main()
{
auto names = [ "foo", "bar", "baz" ];
void delegate()[] dgs;
foreach (name; names)
{
dgs ~= () => wri
On Sunday, 21 January 2024 at 20:13:38 UTC, An Pham wrote:
On Saturday, 20 January 2024 at 15:59:59 UTC, Anonymouse wrote:
I remember reading this was an issue and now I ran into it
myself.
```d
import std.stdio;
void main()
{
auto names = [ "foo", "bar", "baz" ];
void delegate()[] dg
import core.thread.osthread : Thread;
import std.stdio : writeln;
__gshared static Thread th;
__gshared static size_t tht;
void run()
{
writeln("run");
while (tht == 0) {}
}
shared static this()
{
writeln("this");
th = new Thread(&run).start()
On Thursday, 27 June 2024 at 18:51:19 UTC, Josh Holtrop wrote:
Hello all. In my application I came across a desire to store an
ordered array of handles that could point to one of several
different objects, and it seems like the tool I want for that
is SumType.
I started with something like (s
pragma(msg, os.stringof...?);
pragma(msg, target.stringof...?);
what is use case for this? mixin & import
Long list of version.
version(Windows)
mixin(import("foo_windows.enum."));
else version(AArch64)
mixin(import("foo_aarch64.enum"));
else
static as