Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Extend `cetl::rtti_helper` to support non-default constructor of the first base type.

Aperta
#111 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cpp
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

  1. easier make the using base = ... declaration (without duplicating type id!)
  2. 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 (the Dog(some_args) one).
Lingua principale
C++
Stelle
18
Fork
4
Merge medio
1g 33m
PR unite (30g)
33

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenCyphal/CETL

Tutte le issue di OpenCyphal/CETL

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.