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

Return type of unordered_map erase methods should be iterator not void #1484

Closed
carlosdiez opened this issue Oct 10, 2016 · 4 comments
Closed
Labels
Milestone

Comments

@carlosdiez
Copy link

The return type of unordered_map erase methods should be iterator not void, like in vector.

https://github.com/cython/cython/blob/master/Cython/Includes/libcpp/unordered_map.pxd#L45

C++ reference: http://en.cppreference.com/w/cpp/container/unordered_map/erase

@robertwb
Copy link
Contributor

Thanks. We'd welcome a PR with a test :).

@carlosdiez
Copy link
Author

Ok, working on that :)

@carlosdiez
Copy link
Author

carlosdiez commented Oct 16, 2016

Created a PR for this #1490
I think it would be good to add more tests for erase method on other data structures.

Also, because unordered_map is from C++11, I don't know if it will compile on all platforms.

I added -std=c++11 to CXXFLAGS

(dev) carlos@macbookair:~/code/cython$ git diff HEAD
diff --git a/runtests.py b/runtests.py
index 0e0abf5..01f44a2 100755
--- a/runtests.py
+++ b/runtests.py
@@ -423,6 +423,7 @@ class build_ext(_build_ext):
                 compiler_obj = self.compiler
             if ext.language == 'c++':
                 compiler_obj.compiler_so.remove('-Wstrict-prototypes')
+                compiler_obj.compiler_so.append('-std=c++11')
             if CCACHE:
                 compiler_obj.compiler_so = CCACHE + compiler_obj.compiler_so
             if getattr(ext, 'openmp', None) and compiler_obj.compiler_type == 'msvc':
(dev) carlos@macbookair:~/code/cython$ 

MichaelWS added a commit to MichaelWS/cython that referenced this issue Oct 7, 2017
MichaelWS added a commit to MichaelWS/cython that referenced this issue Oct 7, 2017
@scoder scoder modified the milestone: 0.28 Oct 13, 2017
@scoder scoder added the Library label Oct 13, 2017
@scoder
Copy link
Contributor

scoder commented Oct 13, 2017

Fixed in #1933.

@scoder scoder closed this as completed Oct 13, 2017
@scoder scoder added this to the 0.27.2 milestone Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants