On Mon, Jun 13, 2011 at 4:59 PM, David Simcha <[email protected]> wrote:
>
>
> On Mon, Jun 13, 2011 at 3:56 PM, Jose Armando Garcia <[email protected]>
> wrote:
>>
>> I can make them free standing template but to use them the client must:
>>
>> logInfo!()("Hello world");
>
> IFTI with parameterless templates works fine:
>
> int doStuff()(int num) {
>     return num + 1;
> }
>
> void main() {
>     doStuff(1);
> }
>

logInfo is not a template function. It is a template. And it is used
to alias against an internal object. Looks something like this:

private LogFilter _info; // provides a bunch of methods including
when, opCall(), etc.

template logInfo()
{
   alias _info logInfo;
}

I haven''t tried your solution but I think the API would look like this:

doStuff()("Info message");
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to