Wrapping a const function that returns a pointer
Open
Nobody has claimed this yet.
- Dominant language
- Fortran
- Stars
- 97
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
In the references example, there is the following case:
- decl: double* getArray() +dimension(getSize())
I ran into a problem wrapping the function if it is const, e.g.
- decl: double* getArray() const +dimension(getSize())
The errors were of the form:
<src>.cpp: error: a value of type "const ArrayWrapper *" cannot be used to initialize an entity of type "ArrayWrapper *"
ArrayWrapper *obj = static_cast<const ArrayWrapper *>(self->addr);
Could you please add the const versions of these functions, with shroud wrappers?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the references example and the double* getArray() const +dimension(getSize()) declaration. Compare its generated wrapper with the non-const case and investigate the reported ArrayWrapper * versus const ArrayWrapper * error. Done means the const versions of these functions have working Shroud wrappers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100