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

Add auto_ptr & std_map keys() method on Javascript #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add auto_ptr & std_map keys() method on Javascript #1

wants to merge 1 commit into from

Conversation

sergioferreiradt
Copy link

Swig now generate a new method to access to the keys of st::map(s) on the javascript wrapping.
Swig with javascript now support getting values from an std::auto_ptr. Even if std::auto_ptr it less and less used, there still exist code that use them.

Copy link
Owner

@vadz vadz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good, I'd just like to separate this in 2 different commits, but I can do this on my own.

Also, I wonder if we should do the same changes to jsc files? AFAICS the same typemaps should work for them too, shouldn't they?

@@ -61,6 +61,13 @@ namespace std {
std::map< K, T, C >::iterator i = self->find(key);
return i != self->end();
}
std::vector<K> keys() {
std::vector<K> keys;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd call keys.reserve(self->size()) here, it could be a useful optimization for bigger maps.

@vadz
Copy link
Owner

vadz commented Oct 23, 2019

I've created PRs for map::keys() and another one for auto_ptr in the main SWIG repo. Let's see if the CI builds pass for them before merging it into our version.

ojwb pushed a commit that referenced this pull request Mar 17, 2024
Update octrun.swg to work with Octave v8.1.0
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