Boost logo

Boost :

Subject: Re: [boost] [log] Comments
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-03-15 16:30:37


AMDG

Andrey Semashev wrote:
>> As already expressed by Tom, logging library is fairly basic component
>> that should be useable by everybody. And lambda functions in current C++
>> in not something everybody know so forcing the user to pick between
>> using lambda, and much more verbose non-lambda style does not help.
>> <snip>
>> Why cannot you provide and equally convenient ordinary functions?
>
> Can you suggest a better interface? Because I can't imagine how to
> make it shorter, while keeping the other features intact.

Just have a function that returns the attribute or throws an
att_not_found exception (Or whatever you want to call it).
The library can catch this.

>> Of course I can use namespace aliases to alleviate the problem. However,
>> I don't see how namespaces are necessary. Are there actually things with
>> the same names in those different namespaces?
>
> Yes. attr is a formatter and a filter, for example. There are "format"
> names in "formatters" and "keywords" namespaces. Perhaps other exist,
> I didn't examine the code thoroughly.

Is there a good reason that the same attr can't be both a formatter and
a filter?

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk