-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Open
Copy link
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).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels