Boost logo

Boost Users :

Subject: Re: [Boost-users] Is GCC
From: Roland Bock (rbock_at_[hidden])
Date: 2009-12-02 10:19:35

hce wrote:
> Hi,
> I am using gcc version 4.3.0 and /lib64/ on fedora 9, is it
> stable to use std::vector and std::map to contain shared_ptr<MyObject>
> MyObjectPtr? I've got Segmentation fault while accessing
> vector and map contain MyObjectPtr.
> Thank you.
> Kind regards,
> Jupiter

I can't say that I have used that exact same setup, but I started using
shared pointers with STL-Containers with varying gcc versions with 64bit
linux about 1.5 years ago and never ever had a problem with them.

But of course, shared_ptrs do not make everything fail-safe. For
instance, a shared_ptr could contain NULL. In that case, calling a
member function of the contained object would result in a segmentation

You should try to boil down the problem to a few lines. You will
probably see the problem then (or you can then ask for more specific help).



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at