<div dir="ltr">On 6 July 2013 11:41, Daniel Murphy <span dir="ltr"><<a href="mailto:yebblies@nospamgmail.com" target="_blank">yebblies@nospamgmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
"Manu" <<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>> wrote in message<br>
news:mailman.1752.1373074509.13711.digitalmars-d@puremagic.com...<br>
<div><div class="h5">> Okay, so I feel like this should be possible, but I can't make it work...<br>
> I want to use template deduction to deduce the argument type, but I want<br>
> the function arg to be Unqual!T of the deduced type, rather than the<br>
> verbatim type of the argument given.<br>
><br>
> I've tried: void f(T : Unqual!U, U)(T a) {}<br>
> and: void f(T)(Unqual!T a) {}<br>
><br>
> Ie, if called with:<br>
> const int x;<br>
> f(x);<br>
> Then f() should be generated void f(int) rather than void f(const int).<br>
><br>
> I don't want a million permutations of the template function for each<br>
> combination of const/immutabe/shared/etc, which especially blows out when<br>
> the function has 2 or more args.<br>
><br>
> Note: T may only be a primitive type. Obviously const(int*) can never be<br>
> passed to int*.<br>
><br>
<br>
</div></div>void f(T)(T _a) { Unqual!T a = _a; ... }<br>
</blockquote></div><br></div><div class="gmail_extra" style>That doesn't do what I want at all. The signature is still f(T) not f(Unqual!T).</div></div>