On 4/19/22 8:44 PM, Andrey Zherikov wrote:
On Tuesday, 19 April 2022 at 20:29:01 UTC, Steven Schveighoffer wrote:
You can work around the dual context, if you are OK with passing the
second context explicitly.
The easiest way is to move the member function to a UFCS function. an
example:
On Tuesday, 19 April 2022 at 20:29:01 UTC, Steven Schveighoffer
wrote:
You can work around the dual context, if you are OK with
passing the second context explicitly.
The easiest way is to move the member function to a UFCS
function. an example:
```d
struct X
{
int x;
void
On Tuesday, 19 April 2022 at 19:07:37 UTC, Ali Çehreli wrote:
On 4/19/22 11:18, Andrey Zherikov wrote:
> Is there a way/workaround to achieve the desired behavior?
Can you describe the goal a little more. For example, I assume
you really need a more useful lambda although the example you
On 4/19/22 2:18 PM, Andrey Zherikov wrote:
On Tuesday, 19 April 2022 at 16:38:42 UTC, Steven Schveighoffer wrote:
On 4/19/22 11:46 AM, Paul Backus wrote:
If you remove `static` from `f_new`, you get an error message talking
about this explicitly:
Interesting that `static` does anything
On 4/19/22 11:18, Andrey Zherikov wrote:
> Is there a way/workaround to achieve the desired behavior?
Can you describe the goal a little more. For example, I assume you
really need a more useful lambda although the example you show seems
unnecessary:
enum dg = () => func();
That lambda
I get the same error even with just `struct`:
```d
struct S
{
static void f_new(alias func)()
{
func();
}
}
void f_new(alias func)()
{
func();
}
void f(FUNC)(FUNC func)
{
f_new!(() => func()); // works
// S.f_new!(() => func()); // doesn't work
}
```
On Tuesday, 19 April 2022 at 18:18:26 UTC, Andrey Zherikov wrote:
Is there a way/workaround to achieve the desired behavior?
Those two bugs pointed above were reported in 2017 and 2011 (!)
which makes me think that they won't be fixed any time soon
(I'm not sure that they are actually the same
On Tuesday, 19 April 2022 at 16:38:42 UTC, Steven Schveighoffer
wrote:
On 4/19/22 11:46 AM, Paul Backus wrote:
If you remove `static` from `f_new`, you get an error message
talking about this explicitly:
Interesting that `static` does anything there, since it's a
no-op.
-Steve
I put
On 4/19/22 11:46 AM, Paul Backus wrote:
On Tuesday, 19 April 2022 at 13:36:26 UTC, Andrey Zherikov wrote:
I want to migrate my library API from standalone function that takes
delegate as argument to a template member function that takes delegate
as a template parameter but compiler errors out.
On Tuesday, 19 April 2022 at 13:36:26 UTC, Andrey Zherikov wrote:
I want to migrate my library API from standalone function that
takes delegate as argument to a template member function that
takes delegate as a template parameter but compiler errors out.
Here is code example:
```d
import
On 4/19/22 9:36 AM, Andrey Zherikov wrote:
I want to migrate my library API from standalone function that takes
delegate as argument to a template member function that takes delegate
as a template parameter but compiler errors out. Here is code example:
```d
import std.stdio;
template T(P)
{
11 matches
Mail list logo