Boost logo

Boost Users :

From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2004-09-15 08:37:31


Lars Kunert <lkunert <at> mpi-sb.mpg.de> writes:

>
> Hi!

Hi Lars

>
> for some reason these two typdefs do not work in my code:
>
> typedef typename PriorityQueue::nth_index<0>::type DissimilarityIndex;
> typedef typename PriorityQueue::index<DissimilarityT>::type
> DissimilarityIndex;

PriorityQueue is a template parameter or a dependent type,
right? Otherwise, you should omit the typename keyword.

>
> When I actually use them:
>
> const DissimilarityIndex& di =_priority_queue.get<DissimilarityT>();
>
> I get error-messages like this:
>
[...]
>
> The following typedef works:
>
> typedef typename
> boost::multi_index::index<PriorityQueue,DissimilarityT>::type
> DissimilarityIndex;
>
> The first two typedefs are in some way the more "natural" way to use
> indices and I wonder if I have just missed to set some preprocessor
> symbol...

You are not missing anything. The three typedefs are equivalent
and should work the same way. I agree with you the former variants
are preferrable over the third.

>
> ...I am using gcc 3.2.2
>

Maybe that's the problem. GCC 3.2.2 is at the bottom of
what is supported by Boost.MultiIndex. If this is feasible,
you might try upgrading your compiler. Also, if you are in the
position to send me some failing snippet that I can examine,
I'd be happy to do so, but my feeling is that the problem does
not have to do with your code.

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