• Allison Vacanti's avatar
    Update smart pointer semantics for C++11. · 30605cd7
    Allison Vacanti authored
    This adds complete move and noexcept semantics to vtkNew, vtkWeakPointer,
    and vtkSharedPointer, while doing more robust type-checking. In
    particular, this patch may expose bugs of the form:
    
    vtkWeakPointer<vtkRenderer> ren = ...;
    vtkWeakPointer<vtkCamera> cam = ...;
    cam = ren; // Shouldn't compile: types are unrelated.
    
    since vtkWeakPointer can no longer be constructed from an arbitrary
    vtkWeakPointerBase.
    
    Similarly, the comparisons between these objects has been updated.
    Comparing unrelated pointers is illegal in C++, and code such as:
    
    vtkSmartPointer<vtkIntArray> array1 = ...;
    vtkSmartPointer<vtkFloatArray> array2 = ...;
    if (array1 == array2) { ... }
    
    no longer compiles (similar to comparing float* and int*).
    
    All move operations are made noexcept to allow optimizations when stored
    in std containers (e.g. std::vector reallocs will now move instead of
    copy, bypassing reference counting).
    
    Note that some move operations (eg. move-constructing vtkWeakPointer from
    vtkNew, or move-assigning to a vtkSmartPointer) are not implemented, as
    they either don't makes sense, or don't provide any advantage over copying.
    
    vtkWeakPointer has been updated to treat vtkNew<T> like T* when
    constructing or assigning, similar to vtkSmartPointer.
    
    The enable_if statements have been replaced with static_asserts, since
    these will give nicer error messages ("Pointee types are incompatible",
    rather than "no matching overload found").
    30605cd7
Name
Last commit
Last update
..
Testing Loading commit data...
CMakeLists.txt Loading commit data...
vtk.module Loading commit data...
vtkCompositeSurfaceLICMapper.cxx Loading commit data...
vtkCompositeSurfaceLICMapper.h Loading commit data...
vtkImageDataLIC2D.cxx Loading commit data...
vtkImageDataLIC2D.h Loading commit data...
vtkLICNoiseHelper.cxx Loading commit data...
vtkLICNoiseHelper.h Loading commit data...
vtkLineIntegralConvolution2D.cxx Loading commit data...
vtkLineIntegralConvolution2D.h Loading commit data...
vtkLineIntegralConvolution2D_AA.glsl Loading commit data...
vtkLineIntegralConvolution2D_AAH.glsl Loading commit data...
vtkLineIntegralConvolution2D_AAV.glsl Loading commit data...
vtkLineIntegralConvolution2D_CE.glsl Loading commit data...
vtkLineIntegralConvolution2D_EE.glsl Loading commit data...
vtkLineIntegralConvolution2D_LIC0.glsl Loading commit data...
vtkLineIntegralConvolution2D_LICI.glsl Loading commit data...
vtkLineIntegralConvolution2D_LICN.glsl Loading commit data...
vtkLineIntegralConvolution2D_VT.glsl Loading commit data...
vtkPainterCommunicator.h Loading commit data...
vtkStructuredGridLIC2D.cxx Loading commit data...
vtkStructuredGridLIC2D.h Loading commit data...
vtkStructuredGridLIC2D_fs.glsl Loading commit data...
vtkSurfaceLICComposite.cxx Loading commit data...
vtkSurfaceLICComposite.h Loading commit data...
vtkSurfaceLICHelper.cxx Loading commit data...
vtkSurfaceLICHelper.h Loading commit data...
vtkSurfaceLICInterface.cxx Loading commit data...
vtkSurfaceLICInterface.h Loading commit data...
vtkSurfaceLICInterface_CE.glsl Loading commit data...
vtkSurfaceLICInterface_DCpy.glsl Loading commit data...
vtkSurfaceLICInterface_SC.glsl Loading commit data...
vtkSurfaceLICMapper.cxx Loading commit data...
vtkSurfaceLICMapper.h Loading commit data...
vtkTextureIO.cxx Loading commit data...
vtkTextureIO.h Loading commit data...