Skip to content

[SUGGESTION] Mark moved-from objects as unitialised #246

Closed
@AbhinavK00

Description

@AbhinavK00

This is a simple suggestion, track the use of moved-from objects just like cppfront does with unitialised objects so that there is a compile time error when using a moved-from object without an assignment after the move.
This is what we teach today, don't use moved-from objects without reassigning to them.
This will prevent errors due to access of moved-from objects and should be good enough reason to implement.
As a side note, what are the performance effects (both compile and run time) of tracking unitialised objects? And can we reuse the objects passed to function via move/forward?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions