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

Implement __copy_constructor__, __move__, and __assign__ for HeldClass #409

Open
braxtonmckee opened this issue Jan 17, 2023 · 0 comments
Open
Labels

Comments

@braxtonmckee
Copy link
Collaborator

We want to be able to fully mimic C++ semantics for HeldClasses (since that's what they basically are). To do that we need to be able to model copy construction and instance movement.

Currently, our implementation assumes that all TP instances are trivially moveable (you can just copy the memory from one place to another). So to do this we will need to:

  1. mark all TP types that do not have trivial copy constructors or trivial move operators
  2. make sure we call those operators in the interpreter layer everywhere instead of just moving memory around at will
  3. ensure that we have a valid model for exceptions that get thrown during these calls
  4. implement them in the compiler
  5. optionally - make allow a pathway to let compiled versions of these functions get invoked by the interpreter if they're available

Once this is done, we should be able to implement any new data type directly in a HeldClass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant