Re: [multi_index] BOOST_MULTI_INDEX_CONST_MEM_FUN and membertemplate functions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [multi_index] BOOST_MULTI_INDEX_CONST_MEM_FUN and membertemplate functions

Joaquin M LópezMuñoz
Hello Felipe,

----- Mensaje original -----
De: Felipe Magno de Almeida <[hidden email]>
Fecha: Viernes, Marzo 3, 2006 11:22 pm
Asunto: [boost] [multi_index] BOOST_MULTI_INDEX_CONST_MEM_FUN and
membertemplate functions

> Hi,
>
> BOOST_MULTI_INDEX_CONST_MEM_FUN is implemented ths way:
>
> #define BOOST_MULTI_INDEX_CONST_MEM_FUN(Class,Type,MemberFunName) \
> ::boost::multi_index::const_mem_fun<Class,Type,&Class::MemberFunName>
>
> But when I need to do something like this:
>
> typedef boost::tuple<std::string, std::string> tuple;
>
> BOOST_MULTI_INDEX_CONST_MEM_FUN(tuple, std::string const&, get<0>);
>
> It doesnt work because of the two closing brackets that results from
> the macro expansion.
> Couldnt be added a space after &Class::MemberFunName ?
> Here it works ok adding the space.
>

Of course, count on this being committed asap. I've got
a couple of questions, though:

1. Regardless of whether your compiler takes the expanded
macro as containing a '>>' instead of two '>'s, it is my
understanding that a *conformant* preprocessor shouldn't
do this. Is this correct? (I'll add the blank, anyway.)

2. Do you say this particular use of const_mem_fun
(macro problems aside) works for you? Which compiler
and version of Boost (1.33.1,CVS) are you using?
I'm a little surprised because accessing tuple::get
with const_mem_fun is a very tricky issue, as discussed
for instance in the following thread:

http://lists.boost.org/boost-users/2005/12/16087.php

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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [multi_index] BOOST_MULTI_INDEX_CONST_MEM_FUN and membertemplate functions

Felipe Magno de Almeida
On 3/4/06, JOAQUIN LOPEZ MU?Z <[hidden email]> wrote:
> Hello Felipe,
>

[snip]

> Of course, count on this being committed asap. I've got
> a couple of questions, though:

Thanks,

>
> 1. Regardless of whether your compiler takes the expanded
> macro as containing a '>>' instead of two '>'s, it is my
> understanding that a *conformant* preprocessor shouldn't
> do this. Is this correct? (I'll add the blank, anyway.)

To be honest, I'm not a preprocessor expert, so I really dont know...

>
> 2. Do you say this particular use of const_mem_fun
> (macro problems aside) works for you? Which compiler
> and version of Boost (1.33.1,CVS) are you using?
> I'm a little surprised because accessing tuple::get
> with const_mem_fun is a very tricky issue, as discussed
> for instance in the following thread:

It worked allright here. I'm using the cvs version. My compiler is VC7.1

>
> http://lists.boost.org/boost-users/2005/12/16087.php
>
> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo

best regards,
--
Felipe Magno de Almeida

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost