Boost logo

Boost Users :

From: James Emerton (ephelon_at_[hidden])
Date: 2007-09-04 18:54:52


On 8/31/07, Jeffrey Jiang <gamedboy_at_[hidden]> wrote:

> I would rather use a shared_ptr<Character> **characterGrid instead, which
> bring us back to the problem below.

The problem with your approach is that it depends on dynamically
allocating objects that were not meant to be allocated dynamically.
The boost::shared_* types are meant to be created on the stack and
passed by value. When you start nesting them like that you're going
to end up with very confusing deref statements.

Technically, I suppose it's feasible. If you really must attempt it,
use the typedef statement to make things look a little more sane.

James


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