freepooma-devel
[Top][All Lists]
Advanced

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

Is Default Constructable really required?


From: John H. Hall
Subject: Is Default Constructable really required?
Date: Thu, 7 Mar 2002 17:36:37 -0700

Gang:
In the notes on Relations (in relations.h, copied below) it states "The RelationFunctor must be Default Constructable...", yet from the use of it, I don't see any actual requirement for this. It seems we just pass around const references and use the alternate required constructor mentioned below, along with a copy constructor. I need to set up some state in my RelationFunctors and I would prefer to do it during construction, along with providing the correct copy constructors and a version of this required constructor which is essentially a copy constructor++.

So I guess my question boils down to: "How do I set and keep state in RelationFunctors?" Any non-trivial use of Relations will require this.

Thanks,
John Hall


// ----------------------------------------------------------------------------
// Relation0 is a template used to construct relations, such as boundary
// conditions, that do not depend on additional fields. The Target must be // a Field. The RelationFunctor must be Default Constructable and Assignable.
// In addition, it must provide the constructor
//
//   template<class L>
//   RelationFunctor(const L &, const RelationFunctor &)
//
// and the member function
//
//   template<class L>
//   void operator()(const L &) const
//
// where L is a Field. The constructor should use the arguments to
// initialize itself and the function should apply the relation.
// ----------------------------------------------------------------------------
reply via email to

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