C++: Do auto-generated classes need to be final?

Open
#280 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

The issue concerns C++ classes generated by Nunavut and whether their final specifier should be removed or made optional. Start by locating the C++ class templates in the code generator and tracing how they mark generated classes. Decide whether configurability is appropriate, including the destructor and optimization constraints raised in the issue; no tests or files are named in the payload.

Written by the indexing model from the issue text.

Description

From Matrix:

  • I found myself needing to subclass a C++ class generated by Nunavut, then I discovered that the generated classes are marked final. Would it be frowned upon if I proposed to remove the final specifier or to make it optional? (inb4 fix your codebase rather than breaking nunavut)

  • I think this could be made optional but it does lower the availability of some optimizations and puts different constraints on the classes (e.g. the need for virtual destructors if non-trival, et-al). Can you open an issue against this so I can evaluate it?

Dominant language
Python
Stars
48
Forks
26
Avg merge
1d 18h
Merged PRs (30d)
9

Getting set up

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 OpenCyphal/nunavut

All issues in OpenCyphal/nunavut

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.