Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Solution to functions that tries modifying immutable arguments passed by reference

Open
#167 5 comments 0 reactions 0 assignees View on GitHub

@GabrielJMS is already working on this.

Since Jun 17, 2026.

  • #203 by @GabrielJMS — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp, python
Domain
api

Research direction

Start with BRep_Tool::CurveOnSurface and review the linked pybind11 FAQ and pyOCCT developer notes on reference arguments. Determine the binding-level scope needed to expose the modified first and last curve parameters, then verify that callers can retrieve those values.

Written by the indexing model from the issue text.

Description

Hello,

Have you found any solution for handling functions that return values via output parameters passed by reference, especially when those parameters are of immutable types?

This becomes a problem with important functions like BRep_Tool::CurveOnSurface. In such cases, the function modifies the arguments passed by reference (e.g., to return the first and last parameters of the Geom2d_Curve), but when these are immutable types in the binding language, we can’t retrieve the modified values.

This effectively blocks access to important return data.

Some relevant references:

pybind11 FAQ – Limitations involving reference arguments

pyOCCT developer notes – Reference arguments

Would appreciate any guidance or workarounds!

Thanks in advance.

Dominant language
C++
Stars
203
Forks
50
Avg merge
3d 4h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CadQuery/OCP

All issues in CadQuery/OCP

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.