getfem-users
[Top][All Lists]
Advanced

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

Re: [Getfem-users] Commit 4120


From: logari81
Subject: Re: [Getfem-users] Commit 4120
Date: Wed, 25 Jul 2012 17:27:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0

Dear Andriy,

ok your intention with this commit is clear and solution 2 is easy to implement. However there is still an issue with your copy constructor. It will not copy an uninitialized mesh_fem:

getfem::mesh_fem mf1;
getfem::mesh_fem mf2(mf1);

of course a user will not do this but std::vector<mesh_fem>::resize() will do.

I will try to fix this and maybe I will have to ask you again to do some review/testing. It would be nice to have a fix before 4.2 is released in the next days.

Kostas

P.S.: thanks Roman for your comments

On 07/25/2012 02:41 PM, Andriy Andreykiv wrote:
Dear Kostas,

I think this was me who implemented copy constructor for mesh_fem
recently and "privatized" operator=.
The reason is that there was no copy constructor before, so the copy
operation was generated by the compiler
and it wasn't done correctly. I made the operator "=" private to point
out that if it's not, the default operator might
behave not the way you expect.

You can have two solutions here: 1)quick and dirty one - remove my
private declarations. Expect problems when
you copy one mesh_fem to the other and one of them is local variable
that goes out of scope, while the other is global (the global one will
get unvalid context)
2)The thorough solution (but still as quick as this email :) ) is to
still make operator "=" public but define it similarly to the copy
constructor.

Best regards,
                         Andriy


On 25 July 2012 13:18, logari81 <address@hidden> wrote:
Hi,

I have some issues with the change introduced in revision 4120. Making the =
operator for the mesh_fem class private, will not let you resize or fill a
std::vector<getfem::mesh_fem> because the copy operator is required.


Is it possible to rework this commit so that it doesn't cause this
restriction?

Best regards

Kostas


_______________________________________________
Getfem-users mailing list
address@hidden
https://mail.gna.org/listinfo/getfem-users




reply via email to

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