Skip to content
New issue

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

Simplified API for custom types (yet again) #71

Merged
merged 2 commits into from
Apr 5, 2024

Conversation

AjayBrahmakshatriya
Copy link
Collaborator

This change further simplifies custom types in 2 ways -

  1. Custom types are no longer required to inherit from builder::custom_type, although they can choose to do so for appending template args to names. Custom types are also not required to define the type_name member. If they don't, an automatically generated name will be assigned. This can be used in combination with c_code_generator::generate_struct_decl to create custom types.
  2. Members are no longer required to use member_of, although they can use it if members are created outside the constructor itself or if they are using specialization for dyn_var. Instead they can simply with with_name to name the members or leave the member uninitialized in which case it is assigned a generated name. This can be again used in combination with c_code_generator::generate_struct_decl to create custom types.

Sample56 has been added to test this. Older APIs are still all supported completely.

@AjayBrahmakshatriya AjayBrahmakshatriya merged commit 9e098d4 into BuildIt-lang:master Apr 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant