<div dir="ltr">On 7 July 2013 00:49, Timon Gehr <span dir="ltr"><<a href="mailto:timon.gehr@gmx.ch" target="_blank">timon.gehr@gmx.ch</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">
On 07/06/2013 04:06 PM, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
...<div class="im"><br>
    It seems that your code works if you put the Template Type explicit:<br>
    ----<br>
    import std.stdio;<br>
    import std.traits : Unqual;<br>
<br>
    void foo(T)(Unqual!T a) {<br>
             writeln(typeof(a).stringof, " <-> ", T.stringof);<br>
    }<br>
<br>
    void main() {<br>
             int a;<br>
             const int b;<br>
             immutable int c;<br>
<br>
             //foo(c); /// Error<br>
             foo!(typeof(a))(a);<br>
             foo!(typeof(b))(b);<br>
             foo!(typeof(c))(c);<br>
    }<br>
    ----<br>
<br>
<br></div><div class="im">
Indeed, hence my point that the type deduction is the key issue here.<br>
It should be possible... maybe a bit tricky though.<br>
</div></blockquote>
<br>
The key issue is that the syntax void foo(T)(Unqual!T a); denotes roughly the opposite of what you think it denotes. Basically, inference is instructed to find a T, such that Unqual!T is the argument type.<br>
</blockquote></div><br></div><div class="gmail_extra" style>Perhaps what you say is true, but does that mean something to the effect of what I'm trying to demonstrate is impossible? I feel like it would be a much cleaner solution than any of the others presented in this thread...</div>
</div>