comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Anonymous access types
Date: Fri, 8 Jun 2007 20:08:12 +0200
Date: 2007-06-08T20:07:52+02:00	[thread overview]
Message-ID: <r588zk4in1we.192x4riohaidn$.dlg@40tude.net> (raw)
In-Reply-To: 1181304599.484497.300470@k79g2000hse.googlegroups.com

On Fri, 08 Jun 2007 05:09:59 -0700, adam.betts155@gmail.com wrote:

> Yep, sorry, was that a typo on my part. I actually did have:
>       new tree'(g.t);
> and not:
>       new tree(g.t);
> 
> Given that, why does the pointer not point to the correct place? Where
> is it pointing to since it is clearly not null and must be pointing to
> a variable of type tree?

Why if it really does? Are you using debugger to verify that?

If g.t is controlled you might need to check what its Adjust does. Is it
deep or shallow copy?

BTW, it is a strange looking design. Provided that get_tree has the copy
semantics, why don't you return the copy, but a pointer to?

function get_tree (g: graph) return tree['Class] is
begin
  return g.t;
end get_tree;

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



      reply	other threads:[~2007-06-08 18:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08  9:29 Anonymous access types adam.betts155
2007-06-08 12:01 ` Dmitry A. Kazakov
2007-06-08 12:09   ` adam.betts155
2007-06-08 18:08     ` Dmitry A. Kazakov [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox