Assorted C++11/formatting cleanups.
[dcpomatic.git] / src / lib / rect.h
index 4851ad007fe11c6ce7b7469c2cb6f7367dd2eccd..5f807f4999a155a8de737adc30eac87fe1a43d65 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_RECT_H
 #define DCPOMATIC_RECT_H
 
+
 #include "position.h"
 #include <boost/optional.hpp>
 #include <algorithm>
 
+
 /* Put this inside a namespace as Apple put a Rect in the global namespace */
 
 namespace dcpomatic
 {
 
+
 /** @struct Rect
  *  @brief A rectangle.
  */
@@ -69,7 +73,7 @@ public:
                return Position<T> (x, y);
        }
 
-       boost::optional<Rect<T> > intersection (Rect<T> const & other) const
+       boost::optional<Rect<T>> intersection (Rect<T> const & other) const
        {
                /* This isn't exactly the paragon of mathematical precision */
 
@@ -83,7 +87,7 @@ public:
                        );
 
                if (r.width < 0 || r.height < 0) {
-                       return boost::optional<Rect<T> > ();
+                       return {};
                }
 
                return r;
@@ -114,6 +118,8 @@ public:
        }
 };
 
+
 }
 
+
 #endif