[Dune] [Dune-Commit] dune-grid r7145 - trunk/dune/grid/common
Carsten Gräser
graeser at math.fu-berlin.de
Fri Jan 7 11:12:19 CET 2011
Hi,
altough this comment is a little late:
Was there any discussion on this interface change?
Even if we agree to forbid the copy constructor
and assignment they should at least remain public
for the next release.
In case we want to remove them: Is anyone aware of
a mechanism that generates warnings only if it's
used in a public context?
Best,
Carsten
Am 27.11.2010 13:56, schrieb mnolte at dune-project.org:
> Author: mnolte
> Date: 2010-11-27 13:56:58 +0100 (Sat, 27 Nov 2010)
> New Revision: 7145
>
> Modified:
> trunk/dune/grid/common/intersection.hh
> Log:
> make copy constructor protected. Intersections, like entities, may not be copied or assigned to
>
>
> Modified: trunk/dune/grid/common/intersection.hh
> ===================================================================
> --- trunk/dune/grid/common/intersection.hh 2010-11-27 12:45:59 UTC (rev 7144)
> +++ trunk/dune/grid/common/intersection.hh 2010-11-27 12:56:58 UTC (rev 7145)
> @@ -407,10 +407,6 @@
> /** Copy Constructor from IntersectionImp */
> Intersection(const IntersectionImp<const GridImp> & i) :
> real(i) {};
> -
> - /** Copy constructor */
> - Intersection(const Intersection& i) :
> - real(i.real) {}
> //@}
>
> typedef typename remove_const<GridImp>::type mutableGridImp;
> @@ -430,6 +426,17 @@
> //! return reference to the real implementation
> const ImplementationType & getRealImp() const { return real; }
>
> + /* hide copy constructor */
> + Intersection ( const Intersection &i )
> + : real( i.real )
> + {}
> +
> + /* hide assignment operator */
> + const Intersection &operator= ( const Intersection &i )
> + {
> + real = i.real;
> + return *this;
> + }
> };
More information about the Dune
mailing list