Re: variadic mixin templates and other stuff

2012-04-21 Thread Martin Drasar
On 20.4.2012 19:00, John Chapman wrote: On Friday, 20 April 2012 at 14:57:03 UTC, Martin Drasar wrote: On 20.4.2012 16:09, Timon Gehr wrote: I tried but it still refuses to compile: string interfaceGuid(string ifaceName) { return ifaceName ~ Guid; } mixin template

variadic mixin templates and other stuff

2012-04-20 Thread Martin Drasar
Hi, I am migrating a C++ project to D and I have hit a roadblock that I hope you might help me with. My code is heavily inspired by the COM architecture, so I have naturally take a look at std/c/windows/com.d, just to find out that it does not contain all I need. In the C++ code I have several

Re: variadic mixin templates and other stuff

2012-04-20 Thread Timon Gehr
On 04/20/2012 03:23 PM, Martin Drasar wrote: Hi, I am migrating a C++ project to D and I have hit a roadblock that I hope you might help me with. My code is heavily inspired by the COM architecture, so I have naturally take a look at std/c/windows/com.d, just to find out that it does not

Re: variadic mixin templates and other stuff

2012-04-20 Thread Martin Drasar
On 20.4.2012 16:09, Timon Gehr wrote: Thanks Timon for the answer. My questions are following: - can mixin templates be used this way? They can only mixin declarations. - why are they complaining? Because if is a statement and not a declaration. Ok. - is there a better way to do

Re: variadic mixin templates and other stuff

2012-04-20 Thread John Chapman
On Friday, 20 April 2012 at 14:57:03 UTC, Martin Drasar wrote: On 20.4.2012 16:09, Timon Gehr wrote: I tried but it still refuses to compile: string interfaceGuid(string ifaceName) { return ifaceName ~ Guid; } mixin template EXPOSE_INTERFACES(T...)(T args) Try this: mixin template