Boost logo

Boost :

Subject: Re: [boost] [ptr_container] Can't store a pointer to const in multimap?
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-06-15 15:44:37


Amit Kumar skrev:
> Please consider the following code:
>
> #include "boost/ptr_container/ptr_map.hpp"
>
> int main()
> {
> typedef boost::ptr_multimap<char, const int> M;
>
> M m;
> char c = 'c';
>
> int* j = new int(7);
>
> m.insert(c, j);
>
> return 0;
> }
>
> The gcc 4.3.3 compiler fails to compiler the above code. Am I doing
> something wrong by inserting a non-const? Can't I store a pointer to const
> in the multimap?

This is currently unsupported, though I might get it to work. I'll put
it on my todo list.

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk