From 4dfea18a58b864da5e8fcda8e24654d161247b8f Mon Sep 17 00:00:00 2001 From: Wai-Shing Luk Date: Wed, 1 May 2024 11:57:55 +0000 Subject: [PATCH] apply fix-format from ubuntu --- include/recti/interval.hpp | 12 ++++++------ include/recti/merge_obj.hpp | 4 ++-- include/recti/point.hpp | 8 ++++---- include/recti/polygon.hpp | 16 ++++++++-------- include/recti/rpolygon.hpp | 12 ++++++------ include/recti/vector2.hpp | 16 ++++++++-------- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/include/recti/interval.hpp b/include/recti/interval.hpp index a16d072..047c12e 100644 --- a/include/recti/interval.hpp +++ b/include/recti/interval.hpp @@ -229,8 +229,8 @@ namespace recti { * * @return an `Interval` object. */ - template - friend constexpr auto operator+(Interval rhs, const U &alpha) -> Interval { + template friend constexpr auto operator+(Interval rhs, const U &alpha) + -> Interval { return rhs += alpha; } @@ -281,8 +281,8 @@ namespace recti { * * @return an `Interval` object. */ - template - friend constexpr auto operator-(const Interval &rhs, const U &alpha) -> Interval { + template friend constexpr auto operator-(const Interval &rhs, const U &alpha) + -> Interval { auto lower = rhs.lb() - alpha; auto upper = rhs.ub() - alpha; return Interval{std::move(lower), std::move(upper)}; @@ -424,8 +424,8 @@ namespace recti { * @param[in] intvl * @return Stream& */ - template - friend auto operator<<(Stream &out, const Interval &intvl) -> Stream & { + template friend auto operator<<(Stream &out, const Interval &intvl) + -> Stream & { out << "[" << intvl.lb() << ", " << intvl.ub() << "]"; return out; } diff --git a/include/recti/merge_obj.hpp b/include/recti/merge_obj.hpp index 3692f07..9a05497 100644 --- a/include/recti/merge_obj.hpp +++ b/include/recti/merge_obj.hpp @@ -233,8 +233,8 @@ namespace recti { * @param[in] p * @return Stream& */ - template - friend auto operator<<(Stream &out, const MergeObj &merge_obj) -> Stream & { + template friend auto operator<<(Stream &out, const MergeObj &merge_obj) + -> Stream & { out << "/" << merge_obj.xcoord() << ", " << merge_obj.ycoord() << "/"; return out; } diff --git a/include/recti/point.hpp b/include/recti/point.hpp index 5493e9a..bb23452 100644 --- a/include/recti/point.hpp +++ b/include/recti/point.hpp @@ -150,8 +150,8 @@ namespace recti { * @param[in] rhs - The vector to translate this Point by. * @return Reference to this Point after translation. */ - template - CONSTEXPR14 auto operator+=(const Vector2 &rhs) -> Self & { + template CONSTEXPR14 auto operator+=(const Vector2 &rhs) + -> Self & { this->_xcoord += rhs.x(); this->_ycoord += rhs.y(); return *this; @@ -184,8 +184,8 @@ namespace recti { * @param[in] rhs - The vector to translate this Point by. * @return Reference to this Point after translation. */ - template - CONSTEXPR14 auto operator-=(const Vector2 &rhs) -> Self & { + template CONSTEXPR14 auto operator-=(const Vector2 &rhs) + -> Self & { this->_xcoord -= rhs.x(); this->_ycoord -= rhs.y(); return *this; diff --git a/include/recti/polygon.hpp b/include/recti/polygon.hpp index 1ff4b38..a282c61 100644 --- a/include/recti/polygon.hpp +++ b/include/recti/polygon.hpp @@ -89,8 +89,8 @@ namespace recti { * @param[in] r * @return Stream& */ - template - auto operator<<(Stream &out, const Polygon &poly) -> Stream & { + template auto operator<<(Stream &out, const Polygon &poly) + -> Stream & { for (auto &&vtx : poly) { out << " \\draw " << vtx << ";\n"; } @@ -129,8 +129,8 @@ namespace recti { * @param[in] first * @param[in] last */ - template - inline auto create_xmono_polygon(FwIter &&first, FwIter &&last) -> void { + template inline auto create_xmono_polygon(FwIter &&first, FwIter &&last) + -> void { return create_mono_polygon(first, last, [](const auto &lhs, const auto &rhs) -> bool { return std::make_pair(lhs.xcoord(), lhs.ycoord()) < std::make_pair(rhs.xcoord(), rhs.ycoord()); @@ -144,8 +144,8 @@ namespace recti { * @param[in] first * @param[in] last */ - template - inline auto create_ymono_polygon(FwIter &&first, FwIter &&last) -> void { + template inline auto create_ymono_polygon(FwIter &&first, FwIter &&last) + -> void { return create_mono_polygon(first, last, [](const auto &lhs, const auto &rhs) -> bool { return std::make_pair(lhs.ycoord(), lhs.xcoord()) < std::make_pair(rhs.ycoord(), rhs.xcoord()); @@ -202,8 +202,8 @@ namespace recti { * @return true * @return false */ - template - inline auto polygon_is_clockwise(gsl::span> pointset) -> bool { + template inline auto polygon_is_clockwise(gsl::span> pointset) + -> bool { auto it1 = std::min_element(pointset.begin(), pointset.end()); auto it0 = it1 != pointset.begin() ? std::prev(it1) : std::prev(pointset.end()); auto it2 = std::next(it1) != pointset.end() ? std::next(it1) : pointset.begin(); diff --git a/include/recti/rpolygon.hpp b/include/recti/rpolygon.hpp index f6a9ec7..d05feb1 100644 --- a/include/recti/rpolygon.hpp +++ b/include/recti/rpolygon.hpp @@ -139,8 +139,8 @@ namespace recti { * @return true * @return false */ - template - inline auto create_xmono_rpolygon(FwIter &&first, FwIter &&last) -> bool { + template inline auto create_xmono_rpolygon(FwIter &&first, FwIter &&last) + -> bool { return create_mono_rpolygon( first, last, [](const auto &pt) { return std::make_pair(pt.xcoord(), pt.ycoord()); }); } @@ -154,8 +154,8 @@ namespace recti { * @return true * @return false */ - template - inline auto create_ymono_rpolygon(FwIter &&first, FwIter &&last) -> bool { + template inline auto create_ymono_rpolygon(FwIter &&first, FwIter &&last) + -> bool { return create_mono_rpolygon( first, last, [](const auto &pt) { return std::make_pair(pt.ycoord(), pt.xcoord()); }); } @@ -262,8 +262,8 @@ namespace recti { * @return true * @return false */ - template - inline auto rpolygon_is_clockwise(gsl::span> pointset) -> bool { + template inline auto rpolygon_is_clockwise(gsl::span> pointset) + -> bool { auto it1 = std::min_element(pointset.begin(), pointset.end()); auto it0 = it1 != pointset.begin() ? std::prev(it1) : pointset.end() - 1; if (it1->ycoord() < it0->ycoord()) { diff --git a/include/recti/vector2.hpp b/include/recti/vector2.hpp index 4a528a3..15c4b11 100644 --- a/include/recti/vector2.hpp +++ b/include/recti/vector2.hpp @@ -275,8 +275,8 @@ namespace recti { * @param[in] alpha * @return vector2 */ - template - friend constexpr auto operator*(Vector2 rhs, const R &alpha) -> Vector2 { + template friend constexpr auto operator*(Vector2 rhs, const R &alpha) + -> Vector2 { return rhs *= alpha; } @@ -288,8 +288,8 @@ namespace recti { * @param[in] x * @return vector2 */ - template - friend constexpr auto operator*(const R &alpha, Vector2 lhs) -> Vector2 { + template friend constexpr auto operator*(const R &alpha, Vector2 lhs) + -> Vector2 { return lhs *= alpha; } @@ -301,8 +301,8 @@ namespace recti { * @param[in] alpha * @return vector2 */ - template - friend constexpr auto operator/(Vector2 rhs, const R &alpha) -> Vector2 { + template friend constexpr auto operator/(Vector2 rhs, const R &alpha) + -> Vector2 { return rhs /= alpha; } @@ -316,8 +316,8 @@ namespace recti { * @param[in] v * @return Stream& */ - template - friend auto operator<<(Stream &out, const Vector2 &vec2) -> Stream & { + template friend auto operator<<(Stream &out, const Vector2 &vec2) + -> Stream & { out << "{" << vec2.x() << ", " << vec2.y() << "}"; return out; }