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: Alexander Vinokur (Alexander.Vinokur_at_[hidden])
Date: 2008-10-07 12:28:06


Joaquin, thank you.

Here code I compiled.

// --- File foo3.cpp ---
struct Bar
{
    virtual ~Bar(){}
};

int main()
{
        
        Bar* p1 = new Bar;
        delete p1;
        
        Bar* p2 = new Bar;
        p2->~Bar();

        const Bar* p3 = new Bar;
        delete p3;
        
        const Bar* p4 = new Bar;
        p4->~Bar(); // line 19: Error: Non-const function
Bar::__SLIP.DELETER__A() called for const object.
        
        return 0;
}
// ---------------------------

Compilation:

% CC -V
CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25

% CC -m64 -I/home/BOOST/boost_1_34_0 -library=stlport4 foo3.cpp
"foo3.cpp", line 19: Error: Non-const function Bar::__SLIP.DELETER__A()
called for const object.
1 Error(s) detected.

Alex Vinokur

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


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