Boost.Bimap - new name for the container?

Hi all, Thanks to John Maddok test of Boost.Bimap we discovered that some compilers (VS7.1 for example) may have a hard time recognizing between the "bimap" namespace and the "bimap" class if you try to compile the following code: using namespace boost::bimap; using namespace boost; typedef bimap<int, double> bm_type; If you switch the using statements this problem is gone in VS7.1 but persist in VS8 The following code compiles in VS7.1 using namespace boost; using namespace boost::bimap; typedef bimap<int, double> bm_type; You can use the container with the full namespace path in order to solve this problem: using namespace boost; using namespace boost::bimap; typedef ::boost::bimap::bimap<int, double> bm_type; Is this a problem that can be solved with a warning in the docs? Do you think it may be better to rename the "bimap" class to something else like "bidirectional_map"? Ideas are welcome Regards Matias

Matias Capeletto wrote:
Hi all,
Thanks to John Maddok test of Boost.Bimap we discovered that some compilers (VS7.1 for example) may have a hard time recognizing between the "bimap" namespace and the "bimap" class if you try to compile the following code:
using namespace boost::bimap; using namespace boost; typedef bimap<int, double> bm_type;
If you switch the using statements this problem is gone in VS7.1 but persist in VS8 The following code compiles in VS7.1
using namespace boost; using namespace boost::bimap; typedef bimap<int, double> bm_type;
You can use the container with the full namespace path in order to solve this problem:
using namespace boost; using namespace boost::bimap; typedef ::boost::bimap::bimap<int, double> bm_type;
Is this a problem that can be solved with a warning in the docs? Do you think it may be better to rename the "bimap" class to something else like "bidirectional_map"?
According to: http://www.boost.org/more/lib_guide.htm#Guidelines "The library's primary namespace (in parent ::boost) is given that same name, except when there's a component with that name (e.g., boost::tuple), in which case the namespace name is pluralized. For example, ::boost::filesystem." i.e. bimap should be in namespace boost::bimaps - Michael Marcin

Michael Marcin wrote:
According to:
http://www.boost.org/more/lib_guide.htm#Guidelines
"The library's primary namespace (in parent ::boost) is given that same name, except when there's a component with that name (e.g., boost::tuple), in which case the namespace name is pluralized. For example,
boost::filesystem."
i.e. bimap should be in namespace boost::bimaps
That would do the trick nicely too, well spotted. John.

John Maddock wrote:
Michael Marcin wrote:
According to:
http://www.boost.org/more/lib_guide.htm#Guidelines
"The library's primary namespace (in parent ::boost) is given that same name, except when there's a component with that name (e.g., boost::tuple), in which case the namespace name is pluralized. For example,
boost::filesystem."
i.e. bimap should be in namespace boost::bimaps
namespace boost { using bimaps::bimap; } would would be good IMO. -Thorsten

On 2/27/07, Thorsten Ottosen <thorsten.ottosen@dezide.com> wrote:
John Maddock wrote:
Michael Marcin wrote:
According to:
http://www.boost.org/more/lib_guide.htm#Guidelines
"The library's primary namespace (in parent ::boost) is given that same name, except when there's a component with that name (e.g., boost::tuple), in which case the namespace name is pluralized. For example,
boost::filesystem."
i.e. bimap should be in namespace boost::bimaps
I like "bimaps" for the namespace.
namespace boost { using bimaps::bimap; }
would would be good IMO.
Do you proposed to add this into a general header: <boost/bimap.hpp>? Regards Matias

Matias Capeletto wrote:
Hi all,
Thanks to John Maddok test of Boost.Bimap we discovered that some compilers (VS7.1 for example) may have a hard time recognizing between the "bimap" namespace and the "bimap" class if you try to compile the following code:
using namespace boost::bimap; using namespace boost; typedef bimap<int, double> bm_type;
Oh shucks :-(
If you switch the using statements this problem is gone in VS7.1 but persist in VS8 The following code compiles in VS7.1
using namespace boost; using namespace boost::bimap; typedef bimap<int, double> bm_type;
You can use the container with the full namespace path in order to solve this problem:
using namespace boost; using namespace boost::bimap; typedef ::boost::bimap::bimap<int, double> bm_type;
Is this a problem that can be solved with a warning in the docs? Do you think it may be better to rename the "bimap" class to something else like "bidirectional_map"?
Personally I like the short name "bimap", so I would be happy with a big warning in the docs. John.

Matias Capeletto wrote:
[snip]
Is this a problem that can be solved with a warning in the docs? Do you think it may be better to rename the "bimap" class to something else like "bidirectional_map"?
I actually like that class name better than bimap. But that's really becasue with my background I have to fight my mind not to read "biTmap" (the graphics thingy). Best Fernando
participants (5)
-
Fernando Cacciola
-
John Maddock
-
Matias Capeletto
-
Michael Marcin
-
Thorsten Ottosen