January 24, 2021 Issues » [Issue 6747] Implicitly allowing objects which contain delegates to be shared/immutable can cause races | |||
|---|---|---|---|
| |||
...file1Task = task!sharedInc(f);
file1Task.executeInNewThread();
// Read bar.txt in parallel.
sharedInc(f);
// Get the... | |||
January 23, 2021 Issues » [Issue 21576] New: __traits(compile) does not automatically infer to empty parameter template | |||
|---|---|---|---|
| |||
...r; range) bar(r);
}
void foo(TRange ...)()
{
foreach(T; TRange) bar!T;
}
void bar(T... | |||
January 23, 2021 General » getting template overloads for a function template | |||
|---|---|---|---|
| |||
...template foo(T)
{
void bar(T t) {}
}
__traits(getOverloads, foo!int, "bar") // ok!
Is there... | |||
January 20, 2021 Learn » Re: isCallable fails | |||
|---|---|---|---|
| |||
...has to be `foo!bar`, so we need a type named `bar` to use for... | |||
January 20, 2021 Learn » Re: isCallable fails | |||
|---|---|---|---|
| |||
...posting code then :( fun!T just returns bar or null. Manually calling works. but if... | |||
January 20, 2021 Learn » Re: isCallable fails | |||
|---|---|---|---|
| |||
...traits(getMember, T, property);
// typeof(S) = foo!bar
static if (isCallable!S) {
// some other magic... | |||
January 19, 2021 Learn » Value of type enum members | |||
|---|---|---|---|
| |||
...2)
pragma(msg, TENUM.bar); // T(3)
writeln(TENUM.foo); // foo
writeln(TENUM.bar); // bar
} | |||
January 17, 2021 Learn » Re: Template argument deduction not working with template specialization | |||
|---|---|---|---|
| |||
...example: Will cause "called with argument types `(Bar!(2u, int))` matches both:DUB" (And "undefined... | |||
January 17, 2021 General » Re: Annoyance with function template unwrapping | |||
|---|---|---|---|
| |||
...foo () {}
}
template S (T) {
void bar () {}
}
auto fp = &S!int.bar;
depicts the programmer's... | |||
January 16, 2021 General » Re: How do you benchmark? | |||
|---|---|---|---|
| |||
...std/datetime/stopwatch/benchmark.html As simple as: auto timings = 1000.benchmark!(foo, bar, baz); | |||
Copyright © 1999-2021 by the D Language Foundation