Mark QSimplex{,Constraint} final, AnchorData non-copyable

These final touch-ups for CID 390828 make the code easier to
understand and safer, because more unsafe operations are now forbidden
(subclassing and copying).

Coverity-Id: 390828
Pick-to: 6.9 6.8 6.5
Change-Id: I2e43be71d8c3db59d95e69ec16c41c1547a2f180
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
This commit is contained in:
Marc Mutz 2025-03-12 15:09:46 +01:00
parent eb1342a3c2
commit 912388b306
2 changed files with 6 additions and 2 deletions

View File

@ -75,6 +75,8 @@ struct AnchorVertex
Represents an edge (anchor) in the internal graph.
*/
struct AnchorData : public QSimplexVariable {
Q_DISABLE_COPY_MOVE(AnchorData)
enum Type {
Normal = 0,
Sequential,

View File

@ -43,8 +43,10 @@ struct QSimplexVariable
Where (ci, Xi) are the pairs in "variables" and K the real "constant".
*/
struct QSimplexConstraint
struct QSimplexConstraint final
{
Q_DISABLE_COPY_MOVE(QSimplexConstraint)
QSimplexConstraint() : constant(0), ratio(Equal), artificial(nullptr) {}
enum Ratio {
@ -109,7 +111,7 @@ struct QSimplexConstraint
#endif
};
class QSimplex
class QSimplex final
{
Q_DISABLE_COPY_MOVE(QSimplex)
public: