The Right Approach to Exceptions

deadalnix deadalnix at gmail.com
Sun Feb 26 04:12:34 PST 2012


Le 25/02/2012 14:10, Timon Gehr a écrit :
> On 02/21/2012 07:57 PM, deadalnix wrote:
>> opDispatch is nice, but rather incomplete. It doesn't handle template
>> methods for example.
>
> It surely does.
>
> struct S{
> template opDispatch(string op){
> auto opDispatch(T...)(T args){
> writeln(op, args);
> }
> }
> }
> void main() {
> S s;
> s.foo(1,2.0,"bar");
> }

Explicit template argument, I should have precised.


More information about the Digitalmars-d mailing list