How do you take the address of a specific overloaded function.
This won't compile
---
import std.range;
void main()
{
ForwardAssignable!int range;
int delegate() @property get = &range.front;
void delegate(int) @property set = &range.front;
}
---
On Wednesday, 30 September 2015 at 22:48:03 UTC, Freddy wrote:
How do you take the address of a specific overloaded function.
This won't compile
You can write a helper function that uses __traits(getOverloads)
and searches them for the right signature:
http://dlang.org/traits.html#getOverloa
On 2015-10-01 00:48, Freddy wrote:
How do you take the address of a specific overloaded function. This
won't compile
---
import std.range;
void main()
{
ForwardAssignable!int range;
int delegate() @property get = &range.front;
void delegate(int) @property set = &range.front;
}
---