Replies: 1 comment
-
If you don't want to include the variant headers, you can define a stub type plus a type caster for it that exposes the correct name:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For example, if a function returns
object
, but it's really a union ofint
andstr
, for example. Perhaps something likenb::typed<nb::union_, int, nb::str>
. Ideally this could nest with other types, likenb::typed<nb::list, nb::typed<nb::union_, int, nb::str>>
.Is this possible already? I was wondering if we could do this with
std::variant
but ideally we don't include an extra header if we're not using it for anything else.Beta Was this translation helpful? Give feedback.
All reactions