Address of overloaded functions

Artur Skawina art.08.09 at gmail.com
Wed Jul 3 14:05:13 PDT 2013


On 07/03/13 22:44, H. S. Teoh wrote:
> On Wed, Jul 03, 2013 at 10:10:08PM +0200, Artur Skawina wrote:
>> On 07/03/13 21:02, H. S. Teoh wrote:
>>> On Wed, Jul 03, 2013 at 06:52:56PM +0200, Artur Skawina wrote:
>>>>    void main()
>>>>    {
>>>>        auto b = pickOverload!(foo, long);
>>>
>>> Now *that's* what I call coolness. Self-documenting and convenient
>>> to use (though in this case it's arguable whether it's actually
>>> better than native syntax).
>>
>> At some point somebody is going to ask for
>>
>>    auto b = foo.pickOverload!(long)
>>
>> with a better name for 'pickOverload'. :)
>>
>>
>> Which actually is possible, but would need sane optional-() and
>> UFCS models. Ie not right now.
> [...]
> 
> I don't think UFCS applies to compile-time arguments? So this wouldn't
> work.

Like i said - not right now. Extending UFCS to be explicit can be done,
and is a good idea for other reasons. Once something like that exists
then the problem is the 'foo' symbol -- that's why the optional-parens
get in the way.

I'm just saying that doing that might be possible, not that it will
happen in the current D incarnation. For some reason some people
seem to like the optional parens. :^)

artur


More information about the Digitalmars-d-learn mailing list