Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2007-05-20 09:48:39


Hi Francesco,

----- Mensaje original -----
De: Francesco Biscani <bluescarni_at_[hidden]>
Fecha: Domingo, Mayo 20, 2007 3:13 pm
Asunto: [Boost-users] [Multiindex] Const_mem_fun from base class
Para: boost-users_at_[hidden]

> Hello,
>
> I get an error when I'm trying to use a const member function in a
> multi-index container, as a template parameter for indexed_by<>.
> This const member function comes from a base class, from which the
> class contained in the multiindex container is derived. The error
> is the following:
>
> /home/yardbird/documenti/work/prog/piranha/pyranha/Gsp/../../src/
> polynomial.h:41: error: could not convert template argument
> ‘&piranha::base_monomial_gmp_array<piranha::double_cf>::get_degree’
> to ‘int (piranha::monomial_gmp_array<piranha::double_cf>::*)()const’
[...]

This is probably #1 B.MI-related FAQ as of the last few months :)
Please read the following post where the issue is explained:

http://lists.boost.org/boost-users/2006/12/24042.php

To sum it up, you've got two options:

1. If you're already using Boost 1.34, use the following key
extractor:

  const_mem_fun<
    base_monomial_gmp_array<double_cf>,
    int,
    &base_monomial_gmp_array<double_cf>::get_degree
>

2. If you have to stick to Boost 1.33.1, write up a custom
key extractor.

Does this help? Thanks for using Boost.MultiIndex,

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