[vtk-developers] Implicit copy constructors in VTK

Bill Lorensen bill.lorensen at gmail.com
Wed Jul 24 11:43:28 EDT 2013


I think most classes do this:
private:
  vtkAnnotation(const vtkAnnotation&);  // Not implemented.

  void operator=(const vtkAnnotation&);  // Not implemented.

while the two classes you mentioned do not have similar lines.



On Wed, Jul 24, 2013 at 10:50 AM, Sean McBride <sean at rogue-research.com>wrote:

> Hi all,
>
> So I'm looking at the clang warnings on Rogue7, but need C++ help before I
> can proceed further.  We have two similar warnings, repeated for several
> classes:
>
> VTK/Common/DataModel/vtkBond.h:30:3: warning: definition of implicit copy
> constructor for 'vtkBond' is deprecated because it has a user-declared
> destructor [-Wdeprecated]
>   ~vtkBond();
>   ^
>
> VTK/Common/Math/vtkQuaternion.h:201:8: warning: definition of implicit
> copy constructor for 'vtkQuaternion<float>' is deprecated because it has a
> user-declared copy assignment operator [-Wdeprecated]
>   void operator=(const vtkQuaternion<T>& q);
>        ^
>
> From what I can tell, in C++11, the implicit generation of copy
> constructors is now deprecated if 1) you provide a user-declared destructor
> or 2) you provide a user-declared copy assignment operator.
> <http://stackoverflow.com/a/11255258>
>
> So it would seem a solution is to provide an explicit copy constructor,
> but VTK's coding standards gives me pause: "Classes should have protected
> constructors and destructors, and privately declared but unimplemented copy
> constructor and assignment operator. Rationale: VTK’s reference counting
> implementation depends on carefully controlling each object’s reference
> count".
>
> So now I'm not sure how to proceed...
>
> Thanks,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130724/d6c6040d/attachment.html>


More information about the vtk-developers mailing list