Skip to content

Optional pair #718

@HGuillemet

Description

@HGuillemet

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions