[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pooma-dev] Is Default Constructable really required?
From: |
Jeffrey Oldham |
Subject: |
Re: [pooma-dev] Is Default Constructable really required? |
Date: |
Mon, 11 Mar 2002 15:25:52 -0800 |
User-agent: |
Mutt/1.2.5.1i |
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.
I concur with your analysis. See src/Field/Relations/PeriodicFaceBC.h
for an example. It does not have a default constructor but does have
a non-default, non-copy constructor.
I have attached a patch aligning the comments to the extant source
code. Would someone (Scott? Stephen?) approve these changes? I also
added the (gratituous) change of s/L/Target/.
Thanks,
Jeffrey D. Oldham
address@hidden
2002Mar11 Jeffrey D. Oldham <address@hidden>
This patch corrects functor requirement comments and improves them
by replacing "L" by "Target".
* Relations.h (Relation[0-6]): Change introductory comment, replacing
"Default Constructable" with "Copy Constructible." Change
constructor specification to list "RelationFunctor" first. Change
"L" to "Target".
(RelationFunctionPtr[0-6]): Change template parameter's name from
"L" to "Target".
(RelationMemberPtr[0-6]): Likewise.
(newRelation): Likewise.
(functionPtr): Likewise.
(memberPtr): Likewise.
Tested on sequential Linux using g++ by compiling Pooma library and
running all Field tests.
Approved by ??you??
Applied to mainline
Relations-comments.patch
Description: Text document