# Goodbye GetVoidPointer: Using ArrayDispatch and DataArrayRanges

**URL:** <https://discourse.vtk.org/t/goodbye-getvoidpointer-using-arraydispatch-and-dataarrayranges/2097>\
**Category:** Development\
**Created:** [November 14, 2019, 9:05pm UTC](https://discourse.vtk.org/t/goodbye-getvoidpointer-using-arraydispatch-and-dataarrayranges/2097 "2019-11-14T21:05:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![allison.vacanti](https://discourse.vtk.org/user_avatar/discourse.vtk.org/allison.vacanti/32/679_2.png) [@allison.vacanti](https://discourse.vtk.org/u/allison.vacanti)\
**Post date:** [November 14, 2019, 9:05pm UTC](https://discourse.vtk.org/t/goodbye-getvoidpointer-using-arraydispatch-and-dataarrayranges/2097/1 "2019-11-14T21:05:58Z")

</div>

One of the topics discussed at the hackathon involved deprecating `vtkDataArray::GetVoidPointer`. While this is not likely to happen for a while, we’ve agreed to stop using `GetVoidPointer` and `vtkTemplateMacro` in new code, and start phasing it out of existing code.

A [new blog post](https://blog.kitware.com/working-with-vtkdataarrays-2019-edition/) just went up detailing how to use the replacements, `vtkArrayDispatch` and `vtk::DataArray[Tuple|Value]Range`. This is a short intro to what these utilities do and how to use them, and includes some example code along with links to find out more information about using these techniques. There are also some links to MRs from @RobertMaynard showing how to port existing filters (including SMP filters) to use these techniques.

---

<div class="post-metadata">

**Author:** ![ken-martin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ken-martin/32/884_2.png) [@ken-martin](https://discourse.vtk.org/u/ken-martin)\
**Post date:** [November 14, 2019, 11:03pm UTC](https://discourse.vtk.org/t/goodbye-getvoidpointer-using-arraydispatch-and-dataarrayranges/2097/2 "2019-11-14T23:03:52Z")

</div>

I noticed the new code uses a vtk namespace such as vtk::GetAPIType could that just as easily have been vtkGetAPIType? Is there some standard for when we should be using vtk:: versus just vtk?

---

<div class="post-metadata">

**Author:** ![allison.vacanti](https://discourse.vtk.org/user_avatar/discourse.vtk.org/allison.vacanti/32/679_2.png) [@allison.vacanti](https://discourse.vtk.org/u/allison.vacanti)\
**Post date:** [November 14, 2019, 11:36pm UTC](https://discourse.vtk.org/t/goodbye-getvoidpointer-using-arraydispatch-and-dataarrayranges/2097/3 "2019-11-14T23:36:00Z")

</div>

The `vtk::` namespace is used to store C++ metaprogramming utilities. I started using it when adding `vtk::Range` and I didn’t want to hog the generally useful name `vtkRange` when this was just a helper for writing C++ code.

I’ve found it to be a helpful separation to indicate that the tools inside are C++ specific and can’t / don’t need to be wrapped into other languages.
