Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-03-05 15:10:15


Peter Dimov wrote:
> Jonathan Turkanis wrote:
>> David Abrahams wrote:
>>> "Peter Dimov" <pdimov_at_[hidden]> writes:
>>>
>>>>> BOOST_BEFRIEND_TEMPLATE(shared_ptr, Y, 1)
>>>>> BOOST_BEFRIEND_TEMPLATE(weak_ptr, Y, 1)
>>>>> T * px; // contained pointer
>>>>> detail::shared_count pn; // reference counter
>>>>
>>>> This doesn't look any better to me than the original, sorry. ;-)
>>>
>>> I agree with Peter. In fact, to me it looks significantly worse.
>>
>> Well, there's no accounting for taste. ;-) I use similar macros a lot
>> in the Preboost Interfaces library.
>
> This has nothing to do with taste. The original version of the code
> can be understood immediately as it only relies on general C++
> knowledge. The macro-based version adds a level of indirection; you
> now need to look at the documentation or the definition of the macros.

To me the meaning is immediately obvious. If it's not immediately obvious to
nearly everyone, then it's not a suitable config macro; by this standard, and
judging by the comments the suggestion has received, it's unsuitable.

Nobody likes macros with obscure names which require the reader to consult the
documentation.

Jonathan


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