How to call opCall as template?

Namespace rswhite4 at googlemail.com
Thu Jan 30 08:53:32 PST 2014


On Thursday, 30 January 2014 at 16:47:46 UTC, Frustrated wrote:
> 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...

Example? I did not know how.


More information about the Digitalmars-d-learn mailing list