Skip to content

Commit

Permalink
add operator += and -=
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkichler committed Oct 7, 2024
1 parent b966771 commit e8f2fde
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/cutangent/tangent.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ struct tangent

constexpr auto operator<=>(const tangent &other) const noexcept { return v <=> other.v; }
constexpr bool operator==(const tangent &other) const noexcept { return v == other.v; }

constexpr tangent &operator+=(const tangent &other)
{
v += other.v;
d += other.d;
return *this;
}

constexpr tangent &operator-=(const tangent &other)
{
v -= other.v;
d -= other.d;
return *this;
}
};

template<typename T>
Expand Down

0 comments on commit e8f2fde

Please sign in to comment.