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

Optional pair #718

Closed
HGuillemet opened this issue Oct 14, 2023 · 2 comments
Closed

Optional pair #718

HGuillemet opened this issue Oct 14, 2023 · 2 comments
Labels

Comments

@HGuillemet
Copy link
Contributor

The JNI of container classes generated by:

infoMap.put(new Info("std::pair<int,int>").pointerTypes("IntPair").define());
infoMap.put(new Info("std::optional<std::pair<int,int> >").pointerTypes("IntPairOptional").define());

does't compile, with errors like:

error: 'class std::optional<std::pair<int, int> >' has no member named 'first'
 1452 |     int rval = ptr->first;

The optional container passes the first and second function members of std::pair through, which can be practical, but there seems to be missing an indirection. The line above should be:

int rval = (*ptr)->first;
@saudet
Copy link
Member

saudet commented Oct 15, 2023

Fixed in commit 78f0203

@HGuillemet
Copy link
Contributor Author

Thanks.

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

2 participants