Cleanup: make some default constructors more consistent. v1.8.75
authorCarl Hetherington <cth@carlh.net>
Tue, 8 Aug 2023 16:21:24 +0000 (18:21 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 8 Aug 2023 16:21:31 +0000 (18:21 +0200)
src/types.cc
src/types.h

index 9b86819797c6fefe955a4fb30f88ae102c58dbb7..e2e72ad1ab5bdbfedc409d679adbbbaf60512d13 100644 (file)
@@ -109,12 +109,6 @@ dcp::operator!= (Fraction const & a, Fraction const & b)
 }
 
 
-Colour::Colour ()
-{
-
-}
-
-
 Colour::Colour (int r_, int g_, int b_)
        : r (r_)
        , g (g_)
index 340d86133524cae4896ee853ebf135405d5e60be..f6e996c7dfa96d8906046229b4b80bf7e6ee50e6 100644 (file)
@@ -69,10 +69,7 @@ namespace dcp
  */
 struct Size
 {
-       Size ()
-               : width (0)
-               , height (0)
-       {}
+       Size() = default;
 
        Size (int w, int h)
                : width (w)
@@ -83,8 +80,8 @@ struct Size
                return float (width) / height;
        }
 
-       int width;
-       int height;
+       int width = 0;
+       int height = 0;
 };
 
 
@@ -206,7 +203,8 @@ class Fraction
 {
 public:
        /** Construct a fraction of 0/0 */
-       Fraction () {}
+       Fraction() = default;
+
        explicit Fraction (std::string s);
        /** Construct a fraction with a specified numerator and denominator.
         *  @param n Numerator.
@@ -261,7 +259,7 @@ class Colour
 {
 public:
        /** Construct a Colour, initialising it to black */
-       Colour ();
+       Colour() = default;
 
        /** Construct a Colour from R, G and B.  The values run between
         *  0 and 255.