Fun with templates

Manu turkeyman at gmail.com
Sat Jul 6 03:33:51 PDT 2013


On 6 July 2013 18:45, monarch_dodra <monarchdodra at gmail.com> wrote:

> On Saturday, 6 July 2013 at 08:42:45 UTC, monarch_dodra wrote:
>
>> On Saturday, 6 July 2013 at 01:35:09 UTC, Manu wrote:
>>
>>> Okay, so I feel like this should be possible, but I can't make it work...
>>> I want to use template deduction to deduce the argument type, but I want
>>> the function arg to be Unqual!T of the deduced type, rather than the
>>> verbatim type of the argument given.
>>>
>> You could just forward to an implementation template, passing explicitly
>> the arguments.
>>
>
> Hum.. just realized you explicitly wanted to do this via template
> deduction. I'm not sure then :/ Sorry. Hope my workaround will be useful
> for you? Chances are you probably already had it worked out.
>

Nope, still have no good idea of my own. My first 2 impulses were the best
shot I had, but they didn't work.

Forwarding to an Impl template doesn't really address my problem. I still
end out with bucket loads of instantiations, and double-call performance
will really suffer in debug builds, which might be okay if these were big
functions, but they're many trivial functions, so the cost is very high.

I'm getting the distinct feeling that what I want is not actually possible.
Which I have to say, is rather surprising.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130706/7359defb/attachment.html>


More information about the Digitalmars-d mailing list