Skip to content

Conversation

@cosmith-nvidia
Copy link
Contributor

Previously: X::Pack forwarded to CreateX.

Now: CreateX will forward to X::Pack.

This is a step toward enabling using native types for tables when using the object API. When defining a native table, the user will be able to define a custom X::Pack method (which is more consistent with the existing native_type functionality for structs). By reversing the order of the dependencies, CreateX can continue to be auto-generated and will use the custom X::Pack method when overriden for native_type tables.

@github-actions github-actions bot added c++ codegen Involving generating code from schema labels Nov 3, 2025
@aardappel
Copy link
Collaborator

Thanks, this seems like a sensible thing to swap. Likely the reason it was the other way around was historical, whichever came first.

The CI error thinks you haven't checked in all the modified generated code, though for some reason only on Windows, even though it runs the same script/generate_code.py script..

Previously: X::Pack forwarded to CreateX.

Now: CreateX will forward to X::Pack.

This is a step toward enabling using native types for tables when using the
object API. When defining a native table, the user will be able to define a
custom X::Pack method (which is more consistent with the existing native_type
functionality for structs). By reversing the order of the dependencies, CreateX
can continue to be auto-generated and will use the custom X::Pack method when
overriden for native_type tables.
@cosmith-nvidia
Copy link
Contributor Author

Thanks, this seems like a sensible thing to swap. Likely the reason it was the other way around was historical, whichever came first.

The CI error thinks you haven't checked in all the modified generated code, though for some reason only on Windows, even though it runs the same script/generate_code.py script..

@aardappel thanks! I manually copied the missing files over from the build/ directory. PTAL.

@aardappel
Copy link
Collaborator

Ok, LGTM, thanks!

@aardappel aardappel merged commit 78a3d59 into google:master Nov 4, 2025
49 of 50 checks passed
@cosmith-nvidia cosmith-nvidia deleted the create-pack branch November 5, 2025 00:26
@fliiiix
Copy link
Contributor

fliiiix commented Nov 7, 2025

@aardappel fyi if we still target c++11 as lowest standard supported i think some test code here needs to be changed
or the lowest version need to be set to c++14 as std::make_unique is a 14 feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants