# Using namespaces in VTK

**URL:** <https://discourse.vtk.org/t/using-namespaces-in-vtk/10826>\
**Category:** Development\
**Created:** [February 27, 2023, 2:29pm UTC](https://discourse.vtk.org/t/using-namespaces-in-vtk/10826 "2023-02-27T14:29:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcthomp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dcthomp/32/60_2.png) [@dcthomp](https://discourse.vtk.org/u/dcthomp)\
**Post date:** [February 27, 2023, 2:29pm UTC](https://discourse.vtk.org/t/using-namespaces-in-vtk/10826/1 "2023-02-27T14:29:52Z")

</div>

For those of you developing code you hope to merge into VTK,

- **do not** include `using namespace nlohmann` in your code.
- **avoid** `using namespace …` in general.
- **however** it is OK to use namespaces with string-literal and placeholder operators in them (e.g., `using namespace std::literals`, `using namespace boost::lambda::placeholders`).

The issue is C++ promotion rules end up causing ambiguous lookups for any `enum` comparison operators (particularly in gcc 4.8.5, but using namespace is something to generally avoid anyways)

`std::literals` is meant to be used that way and isnt going to dump ADL-confusing symbols on you; the same goes for `boost::lambda::placeholders` or whatever gave `_1` and the like for `boost::bind`.
