|
Boost : |
From: Rozental, Gennadiy (gennadiy.rozental_at_[hidden])
Date: 2004-07-20 05:27:06
> Anyway, the technique I suggested, which we use in Spirit, is
> better than your trick of hoisting the names into namespace
> std which is a hack that should be avoided if there are other ways.
Why is it better?
Let's compare:
I. Hoisting the names into namespace std
- require ifdef/endif
+ names are fully qualified, that prevent possible ambiguity/invalid
function resolution (due to ADL for example)
- does not allow to use ADL
+ located in one place
+ promote uniformity of access to the symbols in std namespace (particularly
in a point on use, so I could see where this symbol came from)
II. Use using declaration on function level
+ doesn't require ifdef/endif
+ allows ADL usage
- unqualified name is a possible source of ambiguity/invalid function
resolution
- needs to be repeated in all functions that refer symbol
- may stand out from the rest of std symbols, potentially leading to
confusion/errors
My personal preference is fully qualified reference everywhere. And I don't
see how other solution is any better.
> Regards,
> --
> Joel de Guzman
Regards,
Gennadiy.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk