How to call opCall as template?
Frustrated
c1514843 at drdrb.com
Thu Jan 30 08:47:45 PST 2014
On Thursday, 30 January 2014 at 16:28:42 UTC, Namespace wrote:
> On Thursday, 30 January 2014 at 16:24:00 UTC, Stanislav Blinov
> wrote:
>>> void main() {
>>> F f;
>>> int i = f(3,4,5);
>>> float f_ = f!float(6, 7, 8);
>>> }
>>> ----
>>>
>>> Does not work, it fails with:
>>> Error: template instance f!float f is not a template
>>> declaration, it is a variable
>>
>> f.opCall!float(6, 7, 8);
>
> ... Yes, of course. But where is the sense to use opCall if I
> need to call it explicitly?
Could you not use opDispatch? Not sure if you can templatize it
or not though...
More information about the Digitalmars-d-learn
mailing list