We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, we register nullable types in Embind using custom type definitions that map to 'T | null' in TypeScript. For example:
FilteredLogEventMapTsType
number[] | null
LogEventIdxTsType
number | null
Embind now provides built-in support for std::optional<T> through the register_optional() function, as documented here.
std::optional<T>
register_optional()
Convert all nullable type registrations to use std::optional<T> with register_optional().
The text was updated successfully, but these errors were encountered:
junhaoliao
No branches or pull requests
Background
Currently, we register nullable types in Embind using custom type definitions that map to 'T | null' in TypeScript. For example:
FilteredLogEventMapTsType
->number[] | null
LogEventIdxTsType
->number | null
Embind now provides built-in support for
std::optional<T>
through theregister_optional()
function, as documented here.Proposed Changes
Convert all nullable type registrations to use
std::optional<T>
withregister_optional()
.References
The text was updated successfully, but these errors were encountered: