-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
under considerationNew feature or requestNew feature or request
Description
I suggest we introduce a public base class for cetl::unbounded_variant that contains a subset of its API that is not dependent on the size, footprint, copyability, and movability properties of the class. This base class will enable certain more advanced usages that are not currently possible.
At the minimum, the polymorphic base should allow the following:
- Check if the variant
has_value. resetthe variant.- The freestanding
getandget_ifshould be defined on the polymorphic base instead of the concrete type. - Add
type() const -> type_idsimilarly toindex() const -> std::size_tin the regular variant to enhance runtime introspection.
I think this can be retrofitted quite easily with just a few changes. @serges147 could you please confirm?
It would be super nice to support visitation similar to std::visit but I see no way to do it via the non-template base. We could perhaps do it at the implementation level but that is a lot less useful so perhaps not worth the trouble.
Metadata
Metadata
Assignees
Labels
under considerationNew feature or requestNew feature or request