freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Functors and Array ctors


From: Richard Guenther
Subject: Functors and Array ctors
Date: Thu, 4 Jul 2002 14:39:00 +0200 (CEST)

Hi!

In resurrecting RectilinearMesh, I came across the problem of creating
a Functor for IndexFunction engine containing an Array<> member. This
lead to lots of problems with appearantly incorrectly(?) autogenerated
copy constructors and assignment operators for this functor. Those seem
at some point always to invoke a Array.assign() operation which does
assert for uninitialized Arrays.

I worked around this by defining constructor, assignment and copy
constructors that do essentially

  whichever(const Array&a)
  {
    array_m.engine() = Engine<1, T, Brick>(a.engine());
    array_m = a;
  }

I.e. manually re-set the engines before assignment.

Is there a better way to achieve this? How would one handle Functors with
Array members? Is Array flawed in not allowing it to be compile-generated
copy-constructable?

Any hints/help appreciated, Richard.

--
Richard Guenther <address@hidden>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/
The GLAME Project: http://www.glame.de/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]