# Use std::unique\_ptr with vtkObject instead of vtkSmartPointer

**URL:** https://discourse.vtk.org/t/use-std-unique-ptr-with-vtkobject-instead-of-vtksmartpointer/5195
**Category:** Support
**Created:** [February 15, 2021, 8:26pm UTC](https://discourse.vtk.org/t/use-std-unique-ptr-with-vtkobject-instead-of-vtksmartpointer/5195 "2021-02-15T20:26:50Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 16, 2021, 2:47pm UTC](https://discourse.vtk.org/t/use-std-unique-ptr-with-vtkobject-instead-of-vtksmartpointer/5195/8 "2021-02-16T14:47:20Z")

</div>

vtkNew already has move semantics - see [vtkNew and vtkSmartPointer](https://discourse.vtk.org/t/vtknew-and-vtksmartpointer/469/9), so you don’t get simplified syntax with std::unique\_ptr.

I understand that developers don’t want to learn new things if it is not necessary. However, in this case the slightly different syntax is used for a good reason: to clearly differentiate objects that use internal reference counting. Trying to cover this up to ease the burden on developers seems to be a step in the wrong direction, as developers may make wrong decisions if they are not aware how things actually work.

---

_[View the full topic](https://discourse.vtk.org/t/use-std-unique-ptr-with-vtkobject-instead-of-vtksmartpointer/5195)._
