Boost logo

Boost Users :

Subject: Re: [Boost-users] Error:" Non-const function called for const object" on Sun CC while using boost::multi_index::multi_index_container
From: JOAQUIN M. LOPEZ MUÑOZ (joaquin_at_[hidden])
Date: 2008-10-07 14:01:35


De: Alexander Vinokur [Alexander.Vinokur_at_[hidden]]
Enviado el: martes, 07 de octubre de 2008 18:28
Para: boost-users_at_[hidden]
CC: JOAQUIN M. LOPEZ MUÑOZ
Asunto: RE: Error:" Non-const function called for const object" on Sun CC while using boost::multi_index::multi_index_container
>
> Joaquin, thank you.
>
> Here code I compiled.
>
> // --- File foo3.cpp ---
> [...]
> const Bar* p4 = new Bar;
> p4->~Bar(); // line 19: Error: Non-const function
> Bar::__SLIP.DELETER__A() called for const object.

OK, seems like the bug we were after, if only in a slightly different guise
(deleting a const T* works, but directly calling ~T() on a const object
does not).

Alex, can you do the following? Please try replacing the
/boost/detail/allocator_utilities.hpp file in your local Boost copy
with the attached file and rebuild the multi_index_container code
that was failing. Does this fix it? If so, I'll commit this version into the
trunk so that it'll be available in Boost 1.38 (though you can use it
now with your local Boost copy, of course).

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