On Thursday, 27 January 2022 at 02:49:22 UTC, Andrey Zherikov
wrote:
What is the best way to emulate a default value for template
sequence parameter of a function?
I want something like this:
```d
void foo(MODULES... = __MODULE__)() {}
// these should work:
foo!(module1, module2);
On Tuesday, 25 January 2022 at 01:41:03 UTC, Steven Schveighoffer
wrote:
On 1/24/22 8:31 PM, Jaime wrote:
Can I, for instance, safely call Fiber.yield in a C callback
that I know will be run in a Fiber?
I would *imagine* it's fine, all the fiber context switch is
doing (WRT the stack) is
**The lede**:
Can I, for instance, safely call Fiber.yield in a C callback that
I know will be run in a Fiber?
The stack will look like:
Thread
|- Fiber in D runtime
| |- Call into a C API (stays on same thread)
| | |- Extern (C) callback (stays on same thread)
| | | |- Fiber.yield <-- Is
On Saturday, 22 January 2022 at 19:06:38 UTC, Adam D Ruppe wrote:
No. Anything allocated with `new` is not thread local... and
even if it was, you can send the pointer to other threads
anyway.
The only things in thread local storage are the direct values
in the non-shared global variables.
Howdy.
How do I make sure data isn't allocated thread-local, if I also
want to immediately use it in a thread-local way, because, for
instance, I happen to already possess its intended mutex, which
was allocated before it?
Is this sufficient? Also, is it even something to worry about?
```d
On Saturday, 15 January 2022 at 02:52:20 UTC, Steven
Schveighoffer wrote:
you probably can fix the issue via:
```d
class C
{
shared:
... // everything
}
```
This seems like a good solution. To achieve implicit sharing on
the aggregate itself, I can use this approach to define a
Some code that produces the strange behavior I'm seeing:
```d
shared class MyClass {
this() {}
this(As...)(As args) if (As.length > 0) {}
}
void main() {
pragma(msg, typeof(new MyClass));
pragma(msg, typeof(new MyClass(1, 2, 3, "hello world")));
pragma(msg, typeof(new