On 10/9/22 03:08, Siarhei Siamashka via Digitalmars-d-learn wrote:
Does the difference really have to be two orders of magnitude for you to
acknowledge that there might be a performance problem in Phobos? [...] Except
that similar one-liners implemented using other programming languages are
fa
On Saturday, 8 October 2022 at 23:06:13 UTC, Anonymouse wrote:
I have some nested templated code that takes function pointers.
In many cases I pass it functions of identical signatures,
except some are `@safe` and others are `@system`. In those
cases the templates end up getting instantiated tw
On Saturday, 8 October 2022 at 23:06:13 UTC, Anonymouse wrote:
I have some nested templated code that takes function pointers.
In many cases I pass it functions of identical signatures,
except some are `@safe` and others are `@system`. In those
cases the templates end up getting instantiated tw
On Sunday, 9 October 2022 at 16:25:22 UTC, tsbockman wrote:
You might be templating more information than necessary. In
your example `foo` doesn't need to be a template at all:
```D
void foo(void function() @system fun) {
pragma(msg, typeof(fun).stringof);
}
```
Yes, it was a toy example.
On Sunday, 9 October 2022 at 17:42:57 UTC, user1234 wrote:
But surely there has to be a better way?
No.
Darn. Okay, thanks.
On Sunday, 25 September 2022 at 23:23:51 UTC, Nicholas Wilson
wrote:
On Saturday, 24 September 2022 at 07:04:34 UTC, Gregor Mückl
wrote:
extern(C++) extern(C++, class) struct Foo(T) {
T a, b;
}
alias FooFloat = Foo!float;
extern(C++) void bar(FooFloat f);
```
This works when you mirror al
Stumbled upon this question on HN
https://news.ycombinator.com/item?id=33142751#33147401
Can I write template A and then apply it to itself to get
template B and then apply that onto template C to get template
D.
Does anyone have an example for this?