Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Multiindex namespace problem
From: JOAQUIN M. LOPEZ MUÑOZ (joaquin_at_[hidden])
Date: 2008-09-05 10:11:02


Hi Axel,

________________________________________
De: boost-users-bounces_at_[hidden] [boost-users-bounces_at_[hidden]] En nombre de Axel [axel.azerty_at_[hidden]]
Enviado el: viernes, 05 de septiembre de 2008 14:56
Para: boost-users_at_[hidden]
Asunto: [Boost-users] Boost.Multiindex namespace problem
>
> Hello
>
> I m using boost 1.35 and g++ v4.1.3 20070929 (Ubuntu 4.1.2-16ubuntu2) on
> ubuntu gutsy, I have a problem when using multindex namespaces.
>
> This compiles without problem : (this is in a class)
>
> using namespace boost::multi_index ;
> class myClass
> {
> public:
> struct foo
> {
> public:
> int getLocalDataId() ;
> } ;
> typedef hashed_unique<boost::multi_index::mem_fun<foo, int,
> &foo::getLocalDataId> > myIndex ;
> };
>
> But the same code without the prefix "boost::multi_index" doesnt compile :
> typedef hashed_unique<mem_fun<foo, int, &foo::getLocalDataId> > myIndex ;
>
> I can obviously add the namespace before mem_fun, I just wonder why this
> compile error occurs.

What's the compiler error you're getting? I presume this is a name clash,
possibly with std::mem_fun in case you're also having the directive
"using namespace std;".

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net