Extend `cetl::rtti_helper` to support non-default constructor of the first base type.
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start at cetl::rtti_helper and trace its current base-type and constructor behavior. Compare the requested TestCopyableOnly and DogCat forms, then define acceptance checks for forwarding arguments to the first base, supporting multiple inheritance, and avoiding duplicated type IDs. No file or test path is named in the issue.
Written by the indexing model from the issue text.
Description
Currently, I have to write something like this to inherit from TestBase and have RTTI support:
struct TestCopyableOnly final : TestBase
{
explicit TestCopyableOnly(const char payload) : TestBase(payload) { ... }
// rtti
static constexpr type_id _get_type_id_() noexcept { ... }
CETL_NODISCARD void* _cast_(const type_id& id) & noexcept override { ... }
CETL_NODISCARD const void* _cast_(const type_id& id) const& noexcept override { ... }
Ideally make it possible to write like this:
struct TestCopyableOnly final : rtti_helper<type_id_type<...>, TestBase>
{
using base = rtti_helper<type_id_type<...>, TestBase>::base; // TBD
explicit TestCopyableOnly(const char payload) : base(payload)) { ... }
Although, I'm not sure how it will better tune api of rtti_helper so that:
- easier make the
using base = ...declaration (without duplicating type id!) - support multiple inheritance (like
struct DogCat : rtti_helper<type_id_type<...>, Dog, Cat> { ... }) while passing all (variadic?) arguments to at least the first base constructor (theDog(some_args)one).
- Dominant language
- C++
- Stars
- 18
- Forks
- 4
- Avg merge
- 7d 16h
- Merged PRs (30d)
- 7
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from OpenCyphal/CETL
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenCyphal/CETL#271 ·
-
accepted
Difficulty 3/5 1-2 days Newbie friendliness 70/100
OpenCyphal/CETL#270 ·
-
documentation
Difficulty 3/5 1-2 days Newbie friendliness 45/100
OpenCyphal/CETL#262 ·
-
under consideration
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OpenCyphal/CETL#252 ·
-
tracking
Difficulty 3/5 1-2 days Newbie friendliness 35/100
OpenCyphal/CETL#194 ·
Similar issues
-
good first issue hardware-report help wanted
Difficulty 1/5 Under an hour Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
launcher: settings are never saved on macOS — QSettings SystemScope points to /Library/PreferencesOpen
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
documentation ready
Difficulty 1/5 Under an hour Newbie friendliness 80/100
MartinPTielemans/ilo#3806 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100