Boost logo

Boost Users :

Subject: Re: [Boost-users] [MultiIndex] cryptic gcc error
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2011-09-02 09:44:28


Ok, sorry for the noise... composite_key expects the result_type as the
first parameter and I did not specify it...

Anyway thanks to all answers!

On Fri, Sep 2, 2011 at 3:07 PM, Ovanes Markarian <om_boost_at_[hidden]>wrote:

> Hello *,
>
> I try to use a multi_index container with a composite key. The container is
> defined as follows:
>
> struct index_data
> {
> entry_header header; //has various public fields one of them is
> timestamp_
> fs::entry entry;
> bool masked;
> };
>
> typedef size_t timestamp_t; //in reallity this type is a class, but the
> error can be reproduced with this typedef as well
>
> timestamp_t const& timestamp(index_data const& data)
> {
> return data.header.timestamp_;
> }
>
> bool mask_state(index_data const& data)
> {
> return data.masked;
> }
>
> struct entry_data_tag {};
>
> typedef mi::multi_index_container
> < index_data,
> mi::indexed_by
> < mi::ordered_non_unique
> < mi::tag<entry_data_tag>
> , mi::composite_key
> < mi::global_fun<index_data const&, bool, &mask_state> //this could
> be a direct member reference, but I intially used fusion::map and reduced
> the problem to minimum
> , mi::global_fun<index_data const&, timestamp_t const&, &timestamp>
> >
> >
> >
> > entry_index;
>
> typedef entry_index::index<entry_data_tag>::type entry_data;
>
>
> void mask_all()
> {
> using namespace boost::lambda;
> entry_data& entries = pimpl_->indexed;
>
> entries.find(boost::make_tuple(false)); //!!!! this line results in an
> error novel by gcc 4.3
> }
>
>
> The error description is:
> multi_index/composite_key.hpp:638: error: no match for 'operator*' in '*x'
>
> Does anyone have some suggestions why that happens?
>
>
> With Kind Regards,
> Ovanes
>



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