Skip to content

Implement __copy_constructor__, __move__, and __assign__ for HeldClass #409

Open
@braxtonmckee

Description

@braxtonmckee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions