Skip to content

Conversation

@mathstuf
Copy link

VTK has removed the using for these symbols.

Thanks for contributing to TTK!

Before submitting your pull request, please:

  • Review our Contributor Guidelines, in particular regarding code formatting (with clang-format) and continuous integration.

  • Please provide a quick description of your contributions below:

VTK has removed <iostream> and using std::{cerr,cin,cout} from its headers. Also did endl because they were nearby, but can remove that if wanted.

VTK has removed the `using` for these symbols.
@mathstuf mathstuf marked this pull request as ready for review December 10, 2025 03:25
@julien-tierny
Copy link
Collaborator

hi there, thanks for your suggestion.
removing using seems like a bigger project than this PR though (TTK uses many STL classes).
@pierre-guillou what do you think?

@mathstuf
Copy link
Author

For sure, there are many more instances here. This just aims to handle the cases that were relying on VTK's headers to do it for TTK's code.

@pierre-guillou
Copy link
Contributor

The using keyword is used in different C++ constructs (c.f. https://en.cppreference.com/w/cpp/keyword/using.html) but as library developpers, what we want to avoid IMO is using or using namespace directives in the global namespace in public headers.

In the current case, public VTK headers did contain using std:cout (and a few other) but they were removed recently, causing potential compilation errors in downstream libraries like TTK (which should be fixed by this very PR).

There is already a rule in .github/workflows/check.yml to prevent the use of using namespace directives in TTK's header files.

However, using in the global namespace might have some legitimacy in TTK, in particular in core/vtk where code is not namespaced.

Back to this PR, I think this is a good thing to make explicit calls (with std:: prefixes) to std classes and functions. We might want to remove the remaining using namespace std still in .cpp files. But that is just coding style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants