|
Boost : |
From: Ross Smith (r-smith_at_[hidden])
Date: 2002-01-31 01:41:55
Aleksey Gurtovoy wrote:
>
> Peter Dimov wrote:
>
> > FWIW I find it much more intuitive when class
> > N::X is defined in N/X.hpp.
>
> I follow the principle as well, - where it's applicable.
It's always applicable.
I've worked on large C++ projects where we almost, but not quite, used
matching include paths and namespace paths. That "almost" was a right
royal PITA. "Is class foo::bar::zap in header <foo/bar/zap.hpp>, or is
it one of the ones we put straight into the foo directory?" "Should this
tiny handful of classes in namespace xyz go in a separate directory?"
"Hang on, this namespace has a capital letter -- shouldn't the directory
have one too?" "Er ... Windows or Unix?"
If you have a project whose classes are divided among multiple
namespaces _and_ multiple directories, and you don't take care to
maintain a rigid one-to-one mapping between namespaces and directories,
you _will_ regret it. Been there, done that, got the t-shirt delivered
to the wrong address.
-- Ross Smith ...................................... Auckland, New Zealand r-smith_at_[hidden] ......................... http://storm.net.nz/~ross/ "We need a new cosmology. New gods. New sacraments. Another drink." -- Patti Smith
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk