Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2006-07-02 15:09:35


----- Mensaje original -----
De: Francesco Biscani <bluescarni_at_[hidden]>
Fecha: Domingo, Julio 2, 2006 6:19 pm
Asunto: [Boost-users] Retrieve multindex value type?

> Hello,
>
> is there a way to retrieve from a multiIndex container the type of
> its content?
>
> I need to do something like this:
>
> template <class T>
> class my_class
> {
> private:
> T set;
>
> public:
> void insert(const T::value_type &); <------ ?
> };
>
> Here T is a multiIndex container, and the insert function should
> add a term to the set. Hence "insert" must accept as input the
> kind of values that are stored in the multiIndex container. Is
> there a way to do so or should I just add another parameter to
> the template and use that as argument for insert?
> Thanks,

Hello Francesco,

Indeed, multi_index_container provides a nested value_type typedef
that you can use exactly in the way you describe. Have you
encountered any problem in doing so?

Thank you 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