Boost logo

Boost :

From: Corwin Joy (cjoy_at_[hidden])
Date: 2001-06-22 19:43:33


> > From: Beman Dawes <bdawes_at_[hidden]>
> > > At 06:40 PM 6/22/2001, Greg Colvin wrote:
> > >
> > > >The safe rule is not to use leading underscores, although I
> > > >think those above are technically OK, if useless.
> > >
> > > Why? Lots of programmers (me included) use a single leading
underscore in
> > > private member names. It never causes any problems, and is completely
> > > standard conforming.
> >
> > So long as you remember not to follow the underscore with
> > a capital letter.
> >
> > Also, some shops use a leading underscore for unavoidable
> > variables in statement macros that might interfere with
> > other names. I know, don't use macros ...
>
> Just this week I wasted a couple hours when I got killed by a platform
header
> file (socket.h) that has _send, _shutdown, _recv as macro definitions.
This did
> very nasty things to some C++ code. Macros are EVIL, and sometimes you
can't
> avoid them....
>
> Jeff
>
>

My aversion to underscore comes from the reverse. I used to prefix #include
guard macros with an underscore ... until I had the fun of wasting several
days tracking down why I couldn't get a standard library to compile when I
included it. (way deep in the include heirarchy a variable type definition
got ifdefed out by my include guard..)


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