freepooma-devel
[Top][All Lists]
Advanced

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

Relations and required copy constructor


From: Richard Guenther
Subject: Relations and required copy constructor
Date: Wed, 31 Mar 2004 16:45:41 +0200 (CEST)

Hi!

Does anyone remember why relation functors require a "copy constructor"
with the relation target as the second parameter?  I.e. why

RelationBase.h:
template<class Target, class Functor>
class RelationBase : public RelationRetargetBase<Target> {
public:


//---------------------------------------------------------------------------
  // Constructors.

  // Initialize the target and functor.

  RelationBase(const Target &t, const Functor &f)
  : RelationRetargetBase<Target>(t),
    functor_m(f, t)
    { }

here functor_m is constucted from f and t and not just f

which is called from newRelation(...) via RelationN constructor:

Relations.h:
template<class Target, class R1, class R2, class RelationFunctor>
class Relation2: public RelationBase<Target, RelationFunctor>
{
public:


//---------------------------------------------------------------------------
  // Constructors.

  Relation2(const Target &t, const R1 &r1, const R2 &r2,
    const RelationFunctor &f)
  : RelationBase<Target, RelationFunctor>(t, f), r1_m(r1), r2_m(r2)
  { }

?

I.e. what was the purpose of exposing the target to the relation functor
constructor here?

Thanks,

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/

reply via email to

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