Boost logo

Boost :

Subject: Re: [boost] [log] Comments
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2010-03-15 18:29:15


On 03/15/2010 11:30 PM, Steven Watanabe wrote:
> 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.

This looks similar to what Vladimir suggested. See my answer to him.

>>> 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?

I answered that question to Vladimir, too.


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