Re: [Boost-users] Error:" Non-const function called for const object" on Sun CC while using boost::multi_index::multi_index_container

Hi JoaquĆn, I was out of office several days. Sorry. So, I send my reply today. I don't have permissions to change something under /boost. But here other test I did: --- file foo19.cpp --- struct Bar { virtual ~Bar(){} }; int main() { const Bar* p1 = new Bar; const_cast<Bar*>(p1)->~Bar(); // No problem const Bar* p2 = new Bar; p2->~Bar(); // line 13: Error: Non-const function Bar::__SLIP.DELETER__A() called for const object. return 0; } ------------------- Compilation: %CC -m64 -library=stlport4 foo19.cpp ==================================================== "JOAQUIN M. LOPEZ MU?OZ" <joaquin@tid.es> wrote in message news:<D1B8B06869125E44A4B33FF31CBAEA591187ADF179@EXCLU2K7.hi.inet>... De: Alexander Vinokur [Alexander.Vinokur@amdocs.com] Enviado el: martes, 07 de octubre de 2008 18:28 Para: boost-users@lists.boost.org CC: JOAQUIN M. LOPEZ MU?OZ Asunto: RE: Error:" Non-const function called for const object" on Sun CC w=ile 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 th= 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 ---------- This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement, you may review at http://www.amdocs.com/email_disclaimer.asp
participants (1)
-
Alexander Vinokur