[phobos] Would like to add std.log to the review queue
Jose Armando Garcia
jsancio at gmail.com
Mon Jun 13 13:05:04 PDT 2011
On Mon, Jun 13, 2011 at 4:59 PM, David Simcha <dsimcha at gmail.com> wrote:
>
>
> On Mon, Jun 13, 2011 at 3:56 PM, Jose Armando Garcia <jsancio at gmail.com>
> 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");
More information about the phobos
mailing list