Templates class member functions not conditional?

monarch_dodra monarchdodra at gmail.com
Tue Sep 11 09:38:49 PDT 2012


On Tuesday, 11 September 2012 at 16:34:33 UTC, monarch_dodra 
wrote:
> At the very least, I wish we could write:
> --------
> struct S(T)
> {
>     @property void front(T value)
>         if(isAssignable!(T,T))
>     {
>         ...
>     }
> }
> --------

..Yeah... that wouldn't work would it?

That would just prevent "front" from being matched when the call 
is attempted, but since it is a non-template, it will still get 
compiled...

Wish it did work though!

Well... time to move on...


More information about the Digitalmars-d-learn mailing list