[Dune-devel] [Dune] Reference and pointer type when dereferencing EntityPointer

Oliver Sander sander at igpm.rwth-aachen.de
Mon Oct 20 11:25:44 CEST 2014


>>
>> Then e1 = e2 makes sense again. For grids like UGGrid or ALUGrid, where
>> the Entity class carries a lot of information this can still be
>> implemented via a proxy class and some smart allocation/deallocation of
>> Entity objects.
> 
> That extra cost is certainly a problem,

UGGrid entities are mostly just three pointers, so copying them should be okay.
--
Oliver

 but I think the problem can be alleviated by returning
> a const ref to an Entity when dereferencing the facade classes. That way, each implementation
> can decide whether to return a temporary object (if creating / copying an entity is cheap) or a
> const reference to an object that is stored inside the iterator (if Entity objects are large / expensive).
> 
> Steffen
> 
>>
>> Best,
>>
>> Robert
>>
> 
> 
> 
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20141020/6f5e1bfe/attachment.sig>


More information about the Dune-devel mailing list