Boost logo

Boost Users :

Subject: [Boost-users] [Interprocess] shared_ptr in a non-throwing mode
From: Pietro Versari (pietro.versari_at_[hidden])
Date: 2011-02-04 04:11:54


Hi Ion (and everyone else),

I'm a newbye and I have only one simple (stupid?) question:
how can I construct a shared_ptr in a non-throwing mode?

This example throw if there is enough space for MyType but isn't
enough for my_shared_ptr:

typedef managed_shared_ptr<MyType,managed_shared_memory>::type my_shared_ptr;
my_shared_ptr sh_ptr = make_managed_shared_ptr(
    segment.construct<MyType>("object to share", std::nothrow)(), segment);

Thanks

Pietro Versari


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