-
Notifications
You must be signed in to change notification settings - Fork 19
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
Implicit assignment operator missing #163
Comments
There is definitionData->copyAssign field in the clang AST. The same place also has fields for moveAssign / copyCtor / defaultCtor / etc. Probably the implicit constructor and copy constructor might also be useful to add bindings for. |
If it helps, I ended up calling these Edit: I'm glad I took another look at this. I might have prematurely optimized for the namespace collisions. I think if the AST parsing for these members only occurs for RecordDecl types, there might not be any collisions and the simpler method names can be used instead. Another edit: I've refactored this a bit more. The Last edit I hope: This is possibly a breaking change for all affected Ctors and there are many duplicate implementations. |
The important thing to maintain here is consistency between implicit and explicit versions of this function in particular. Regarding copy constructors, they are useful for implementing meta-object "copy" support which in turn is needed for cross-thread signal emission. While useful, they can also in most cases be "emulated" with a default constructor call + assignment, moving them off the critical implementation path. |
Yeah, apologies for the unhinged rambling. I let myself get carried away. I ended up adding Sorry again for the previous incoherence. |
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Play around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transwer" ownership but this is not yet captured correctly by the flag (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
This update plays around with `sink`/`=destroy`/etc to provide basic memory management facilites relieving the user from having to free resources explicitly, specially when using value types like `QVariant`. To simplify this draft, all qt types are turned into move-only types with an ownership flag that is set for instances we create - this basic approach works ok for value types that are created with a simple constructor but will need more work to capture QObject parent/child relationships. Once mappu/miqt#163 has been fixed and all move/copy operators are available, copy support can be added for value types. There are also gaps in the ownership conventions, ie non-constructor functions sometimes "transfer" ownership but this is not yet captured correctly by the flag nor is there an interface for API outside of the flag being public for now (ie when a function returns a value rather than a reference on the C++ side) At the same time, the inheritance model changes to use `method`-style dynamic dispatch and `ref` for pointer stability which makes it significantly easier to use. * add ownership flag to wrapper classes - when owned, the destructor will free the underlying c++ instance * rework inheritance approach - when deriving from qt classes, derive from special `Virtual`-prefixed class which uses `ref` to maintain pointer stability and therefore can register itself with the C++ class * first steps towards tests
Types like
QModelIndex
have an implicit assignment operator that ideally should be exposed, just like the explicit ones.The text was updated successfully, but these errors were encountered: