|
Boost : |
From: Vesa Karvonen (vesa.karvonen_at_[hidden])
Date: 2001-07-05 14:15:10
From: "Toon Knapen" <toon_at_[hidden]>
> > I actually think the conflicts are rare enough that this is a non-
> > issue. When the conflicts do arise you simply must choose a
> > different name for one of the conflicting entities. The suggestion
> > to change the type to *_t is one choice, the other would be to pick a
> > synonym or use the get_* wart for this one case in the function
> > name. Since the C++ standard has settled on this as their guidelines
> > we should follow suit. Existing Boost code is also a strong
> > argument. So let's leave well enough alone ;).
>
> using get_* from time to time is the worst option. Since you won't
> remember when you've added the get_ and when you did not you'll be
> forced to look to the doc everty time again. Also this makes code really
> ugly. Guidelines should at least provide some uniformity !! Same goes
> for synonyms, first you'll have to think about a good synonym while
> coding and users will never see the connection between both
>
> Adding the *_t is also ugly I think.
>
> But as I'm apparantly the only one who feels this way, I can't believe
> nobody encountered this problem already, I'll rest my case.
I've encountered this problem many times.
Template metaprogramming libraries often have class names that collide with
function names. If class names and function names use the same decoration,
then metafunction names should preferably have some consistent distinguishing
prefix or suffix.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk