Skip to content

Commit

Permalink
apply fix-format
Browse files Browse the repository at this point in the history
  • Loading branch information
luk036 committed Jun 6, 2024
1 parent 4799154 commit 5f70101
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
12 changes: 6 additions & 6 deletions include/recti/interval.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ namespace recti {
* @param[in] alpha The scalar value to add to the `Interval` object.
* @return A new `Interval` object with the scalar value added to the bounds.
*/
template <typename U> friend constexpr auto operator+(Interval rhs, const U &alpha)
-> Interval {
template <typename U>
friend constexpr auto operator+(Interval rhs, const U &alpha) -> Interval {
return rhs += alpha;
}

Expand Down Expand Up @@ -288,8 +288,8 @@ namespace recti {
*
* @return A new `Interval` object with the scalar value subtracted from the bounds.
*/
template <typename U> friend constexpr auto operator-(const Interval &rhs, const U &alpha)
-> Interval {
template <typename U>
friend constexpr auto operator-(const Interval &rhs, const U &alpha) -> Interval {
auto lower = rhs.lb() - alpha;
auto upper = rhs.ub() - alpha;
return Interval<decltype(lower)>{std::move(lower), std::move(upper)};
Expand Down Expand Up @@ -461,8 +461,8 @@ namespace recti {
* @param intvl The Interval object to be printed.
* @return A reference to the output stream (`out`) for chaining stream operations.
*/
template <class Stream> friend auto operator<<(Stream &out, const Interval &intvl)
-> Stream & {
template <class Stream>
friend auto operator<<(Stream &out, const Interval &intvl) -> Stream & {
out << "[" << intvl.lb() << ", " << intvl.ub() << "]";
return out;
}
Expand Down
4 changes: 2 additions & 2 deletions include/recti/merge_obj.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ namespace recti {
* @param[in] merge_obj The `MergeObj` object to be written to the output stream.
* @return The modified output stream.
*/
template <class Stream> friend auto operator<<(Stream &out, const MergeObj &merge_obj)
-> Stream & {
template <class Stream>
friend auto operator<<(Stream &out, const MergeObj &merge_obj) -> Stream & {
out << "/" << merge_obj.xcoord() << ", " << merge_obj.ycoord() << "/";
return out;
}
Expand Down
8 changes: 4 additions & 4 deletions include/recti/point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ namespace recti {
* @param[in] rhs - The vector to translate this Point by.
* @return Reference to this Point after translation.
*/
template <typename U1, typename U2> CONSTEXPR14 auto operator+=(const Vector2<U1, U2> &rhs)
-> Self & {
template <typename U1, typename U2>
CONSTEXPR14 auto operator+=(const Vector2<U1, U2> &rhs) -> Self & {
this->_xcoord += rhs.x();
this->_ycoord += rhs.y();
return *this;
Expand Down Expand Up @@ -184,8 +184,8 @@ namespace recti {
* @param[in] rhs - The vector to translate this Point by.
* @return Reference to this Point after translation.
*/
template <typename U1, typename U2> CONSTEXPR14 auto operator-=(const Vector2<U1, U2> &rhs)
-> Self & {
template <typename U1, typename U2>
CONSTEXPR14 auto operator-=(const Vector2<U1, U2> &rhs) -> Self & {
this->_xcoord -= rhs.x();
this->_ycoord -= rhs.y();
return *this;
Expand Down
16 changes: 8 additions & 8 deletions include/recti/polygon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ namespace recti {
* @param poly The polygon to write to the output stream.
* @return The output stream, for method chaining.
*/
template <class Stream, typename T> auto operator<<(Stream &out, const Polygon<T> &poly)
-> Stream & {
template <class Stream, typename T>
auto operator<<(Stream &out, const Polygon<T> &poly) -> Stream & {
for (auto &&vtx : poly) {
out << " \\draw " << vtx << ";\n";
}
Expand Down Expand Up @@ -156,8 +156,8 @@ namespace recti {
* @param[in] first The beginning of the range of points.
* @param[in] last The end of the range of points.
*/
template <typename FwIter> inline auto create_xmono_polygon(FwIter &&first, FwIter &&last)
-> void {
template <typename FwIter>
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());
Expand All @@ -175,8 +175,8 @@ namespace recti {
* @param[in] first The beginning of the range of points.
* @param[in] last The end of the range of points.
*/
template <typename FwIter> inline auto create_ymono_polygon(FwIter &&first, FwIter &&last)
-> void {
template <typename FwIter>
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());
Expand Down Expand Up @@ -236,8 +236,8 @@ namespace recti {
* @param pointset The range of points representing the polygon.
* @return true if the polygon is oriented clockwise, false otherwise.
*/
template <typename T> inline auto polygon_is_clockwise(gsl::span<const Point<T>> pointset)
-> bool {
template <typename T>
inline auto polygon_is_clockwise(gsl::span<const Point<T>> 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();
Expand Down
12 changes: 6 additions & 6 deletions include/recti/rpolygon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ namespace recti {
* @param[in] last The end of the range of points.
* @return `true` if the resulting RPolygon is anti-clockwise, `false` otherwise.
*/
template <typename FwIter> inline auto create_xmono_rpolygon(FwIter &&first, FwIter &&last)
-> bool {
template <typename FwIter>
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()); });
}
Expand All @@ -172,8 +172,8 @@ namespace recti {
* @param[in] last The end of the range of points.
* @return `true` if the resulting RPolygon is clockwise, `false` otherwise.
*/
template <typename FwIter> inline auto create_ymono_rpolygon(FwIter &&first, FwIter &&last)
-> bool {
template <typename FwIter>
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()); });
}
Expand Down Expand Up @@ -282,8 +282,8 @@ namespace recti {
* @param pointset The set of points defining the rectilinear polygon.
* @return true if the polygon is oriented clockwise, false otherwise.
*/
template <typename T> inline auto rpolygon_is_clockwise(gsl::span<const Point<T>> pointset)
-> bool {
template <typename T>
inline auto rpolygon_is_clockwise(gsl::span<const Point<T>> 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()) {
Expand Down
16 changes: 8 additions & 8 deletions include/recti/vector2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ namespace recti {
* @param[in] alpha The scalar to multiply the vector components by.
* @return A new vector that is the result of multiplying the input vector by the scalar.
*/
template <typename R> friend constexpr auto operator*(Vector2 rhs, const R &alpha)
-> Vector2 {
template <typename R>
friend constexpr auto operator*(Vector2 rhs, const R &alpha) -> Vector2 {
return rhs *= alpha;
}

Expand All @@ -314,8 +314,8 @@ namespace recti {
* @param[in] lhs The vector to multiply.
* @return A new vector that is the result of multiplying the input vector by the scalar.
*/
template <typename R> friend constexpr auto operator*(const R &alpha, Vector2 lhs)
-> Vector2 {
template <typename R>
friend constexpr auto operator*(const R &alpha, Vector2 lhs) -> Vector2 {
return lhs *= alpha;
}

Expand All @@ -327,8 +327,8 @@ namespace recti {
* @param[in] alpha The scalar to divide the vector components by.
* @return A new vector that is the result of dividing the input vector by the scalar.
*/
template <typename R> friend constexpr auto operator/(Vector2 rhs, const R &alpha)
-> Vector2 {
template <typename R>
friend constexpr auto operator/(Vector2 rhs, const R &alpha) -> Vector2 {
return rhs /= alpha;
}

Expand All @@ -342,8 +342,8 @@ namespace recti {
* @param[in] vec2 The Vector2 object to insert into the stream.
* @return Stream& The modified output stream.
*/
template <class Stream> friend auto operator<<(Stream &out, const Vector2 &vec2)
-> Stream & {
template <class Stream>
friend auto operator<<(Stream &out, const Vector2 &vec2) -> Stream & {
out << "{" << vec2.x() << ", " << vec2.y() << "}";
return out;
}
Expand Down

0 comments on commit 5f70101

Please sign in to comment.