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

Allow custom types to specify a dereference_type for operator[] #86

Merged

Conversation

AjayBrahmakshatriya
Copy link
Collaborator

When dyn_var<> is wrapped around a custom type, the operator[] behaves like a usual type and returns generic builder. This doesn't allow accessing members from the return value (a very common requirement in custom vector implementations).

This change allows custom types to optionally specify a dereference_type typedef. If defined the return type of operator[] is set accordingly and the operator returns an object of type dyn_var_mimic<T::dereference_type> (just like dyn_vars of pointers).

sample59 has been added to test this.

@AjayBrahmakshatriya AjayBrahmakshatriya merged commit d7852a3 into BuildIt-lang:master Dec 4, 2024
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