Boost logo

Boost Users :

Subject: [Boost-users] Boost.MultiIndex template substitution failure?
From: fredbaba (fred.baba_at_[hidden])
Date: 2013-07-08 17:31:39


I'm attempting to use boost::multi_index_container and it seems to be choking
on the template metaprogramming magic somewhere. I'm getting a massive error
dump ending in:

/opt/local/include/boost/multi_index/hashed_index.hpp:743:9: error: ‘class
boost::multi_index::detail::hashed_index, boost::hash, std::equal_to,
boost::multi_index::detail::nth_layer<1, boost::intrusive_ptr,
boost::multi_index::indexed_by >, boost::multi_index::ordered_non_unique,
&md::Order::px> > >, std::allocator > >, boost::mpl::vector0,
boost::multi_index::detail::hashed_unique_tag>’ has no member named
‘final_delete_node_’ this->final_delete_node_(

I'm using Boost 1.53 (MacPorts) on Mac OS X.8 Mountain Lion. How do I get
the following code to compile? Thanks.

p.s. I originally posted this question on StackOverflow
<http://stackoverflow.com/questions/17536227/boost-multiindex-template-substitution-failure>
but thought this might be a better forum. Sorry for the cross-post...

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/mem_fun.hpp>
#include "Product.hpp"
#include <iostream>

int main(int argc, char* argv[])
{

    boost::multi_index_container<
        boost::intrusive_ptr<Product>,
        boost::multi_index::indexed_by<
            boost::multi_index::hashed_unique<
                boost::multi_index::const_mem_fun<
                    Product,
                    id_t,
                    static_cast<id_t (Product::*)() const>(&Product::id)
>
>,
            boost::multi_index::ordered_non_unique<
                boost::multi_index::const_mem_fun<
                    Product,
                    price_t,
                    static_cast<price_t (Product::*)()
const>(&Product::price)
>
>
>
> cont;

    auto o = boost::intrusive_ptr<Product>(new Product());
    o->id(1).price(price_t(14.75));
    cont.insert(o);

    auto it = cont.get<1>().find(price_t(14.75));
    if (it!=cont.get<1>().end())
        std::cout << *(it);

    return 0;
}

--
View this message in context: http://boost.2283326.n4.nabble.com/Boost-MultiIndex-template-substitution-failure-tp4649531.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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