From 58e2b9c01b31cef8a0fa263de3d984c22f1d7ca7 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sat, 15 Sep 2012 13:46:14 +0200 Subject: examples: Mark ctor's as explicit Make C++ class constructors that can be used with only one required argument 'explicit' to minimize wrong use of the class. Change-Id: Ida9f9c2f0c8608c35b0137b2512a6747afd69515 Reviewed-by: Mitch Curtis Reviewed-by: Thiago Macieira --- examples/opengl/pbuffers/cube.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/opengl/pbuffers/cube.h') diff --git a/examples/opengl/pbuffers/cube.h b/examples/opengl/pbuffers/cube.h index ad56e43e49..81e82637cb 100644 --- a/examples/opengl/pbuffers/cube.h +++ b/examples/opengl/pbuffers/cube.h @@ -95,7 +95,7 @@ class TileBuilder { public: enum { bl, br, tr, tl }; - TileBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f); + explicit TileBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f); Tile *newTile(const QVector3D &loc = QVector3D()) const; void setColor(QColor c) { color = c; } protected: @@ -140,7 +140,7 @@ private: class CubeBuilder : public TileBuilder { public: - CubeBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f); + explicit CubeBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f); Cube *newCube(const QVector3D &loc = QVector3D()) const; private: mutable int ix; -- cgit v1.2.3