Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-03-16 10:18:23


At 09:55 AM 3/16/2001, williamkempf_at_[hidden] wrote:

>--- In boost_at_y..., Jesse Jones <jejones_at_a...> wrote:
>> 6) It's better to provide an operator const void*() method instead
>of
>> operator bool(). (Unlike bool the const void* one won't implicitly
>convert
>> to umpteen different types).
>
>This argument has come up on here before, and I'm not 100% sure that
>a consensus opinion was reached on this. Conversion to bool is more
>natural to my mind, and the implicit conversion "to umpteen different
>types" doesn't seem to dangerous to me... at least in this case.
>Changing this will be trivial, so I'll defer to the "experts"
>opinions on this, but I'm not sure that they've fully agreed with
>each other in the past. Am I wrong?

As people become sensitized to a practice that is sometimes dangerous,
somebody questions it every time they see it. You spend a lot of time
explaining that this isn't one of those cases where it is
dangerous. Sometimes it is just easier to use the always safe flavor and
save yourself time.

>> 9) I think the code would be clearer if member data names were
>decorated
>> somehow, eg fCount, mCount, _count, etc. :-)
>
>Stylistic suggestion, typically not entertained by Boost
>submissions. However, I'm interested in this topic and wouldn't mind
>hearing what others have to say on this, even if it's in private e-
>mail.

Yes, it is stylistic so anything reasonable is acceptable. I've personally
become used to the _count style, and feel most programmers will understand
it right away when they see it. It fits well with the other naming
conventions we use. But each to his own...

--Beman


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