Closed HertzDevil closed 3 years ago
PR #100 ! :partying_face:
Marking the support "partial" until I'm done with overloaded operators (non-member definitions are a must even if they only apply to left-hand operands of wrapped types)
LGTM now :+1: ! Not much that's marked as TBD in the feature matrix anymore :eyes:
Wraps a lot of overloaded operators, provided they are defined inside a C++ class body. Some operators cannot be overloaded in Crystal (most notably the compound assignments), so they are renamed to normal methods containing
!
in their names, see SPEC.md for the list of renamings. A few details have been left out for separate PRs in the future:QVector3D
multiplication.operator=
needs special care, due to its relation with copy constructors. It would probably be calledassign!
.operator[]
usually has both non-const and const overloads and Bindgen will always select the former. This becomes a problem if they return entirely different types.<=>
or includeComparable
even if all 6 relational operators are defined. This is best done in the config, since each type may use its own comparison category. C++20'soperator<=>
is not supported either.operator&()
may conflict with the cookbook, so I left it out. (That said, the C++ wrappers should be usingstd::addressof
instead.)On Qt almost all the additions are relational operators. Some notable exceptions are
QRect
(union / intersection / margins),QStringList
(itsoperator+
andoperator<<
are class members), andQDir
(hasoperator[]
).