Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup: Remove "using namespace std;" and add constness to searches. #7

Merged
merged 2 commits into from
Oct 8, 2014

Conversation

BenFrantzDale
Copy link
Contributor

Also new instead of malloc.

@ekg
Copy link
Owner

ekg commented Oct 4, 2014

Wow, thanks. This is a great cleanup!

I just have one question before I merge.

I'm a bit concerned about the effect of const-ness. Would you describe the objective of this part of the change?

@BenFrantzDale
Copy link
Contributor Author

Sure thing. I added the constness because the search functionality doesn't modify the data, so, for example, a function should be able to take a const IntervalTree<T,K>& as an argument and query it. Without the constness, the compiler wouldn't allow you to query a const IntervalTree<T,K> even though querying it doesn't actually modify it.

The namespace stuff is because headers should never do "using namespace ...;" since it pollutes the global namespace.

ekg added a commit that referenced this pull request Oct 8, 2014
Cleanup: Remove "using namespace std;" and add constness to searches.
@ekg ekg merged commit b704f19 into ekg:master Oct 8, 2014
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.

2 participants