Stream: helpdesk (published)

Topic: Vector of concrete types only


view this post on Zulip Mikhail Kagalenko (Mar 02 2021 at 20:39):

Is it possible to restrict the element type of a custom vector to some concrete type from a union by type constraint in the definition, rather thandoing runtime check in the constructor?

view this post on Zulip Mason Protter (Mar 02 2021 at 21:29):

No, but the check doesn't have to happen at runtime. It should be able to be checked at compile time

view this post on Zulip Mikhail Kagalenko (Mar 03 2021 at 12:21):

Not always, the element type may depend on data


Last updated: Oct 02 2023 at 04:34 UTC