[pooma-dev] Is Default Constructable really required?
Jeffrey Oldham
oldham at codesourcery.com
Fri Mar 8 17:44:07 UTC 2002
Scott is probably the best person to take a first whack at answering
this.
On Thu, Mar 07, 2002 at 05:36:37PM -0700, John H. Hall wrote:
> 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.
> //
> ----------------------------------------------------------------------------
Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
More information about the pooma-dev
mailing list