Skip to content

Commit bbb11ec

Browse files
committed
Container/VecN: operator==
1 parent 4d84c12 commit bbb11ec

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

modules/Container/Vec2.mpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export namespace CppUtils::Container
3131
[[nodiscard]] inline constexpr auto width(this auto&& self) noexcept -> decltype(auto) { return self[0]; }
3232
[[nodiscard]] inline constexpr auto height(this auto&& self) noexcept -> decltype(auto) { return self[1]; }
3333

34+
[[nodiscard]] friend inline constexpr auto operator==(const Vec2& lhs, const Vec2& rhs) noexcept -> bool
35+
{
36+
return lhs.m_values == rhs.m_values;
37+
}
38+
3439
inline constexpr auto apply(this auto&& self, auto&& function) noexcept -> decltype(auto)
3540
{
3641
for (const auto axis : {0uz, 1uz})

modules/Container/Vec3.mpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ export namespace CppUtils::Container
3333
[[nodiscard]] inline constexpr auto height(this auto&& self) noexcept -> decltype(auto) { return self[1]; }
3434
[[nodiscard]] inline constexpr auto depth(this auto&& self) noexcept -> decltype(auto) { return self[2]; }
3535

36+
[[nodiscard]] friend inline constexpr auto operator==(const Vec3& lhs, const Vec3& rhs) noexcept -> bool
37+
{
38+
return lhs.m_values == rhs.m_values;
39+
}
40+
3641
inline constexpr auto apply(this auto&& self, auto&& function) noexcept -> decltype(auto)
3742
{
3843
for (const auto axis : {0uz, 1uz, 2uz})

0 commit comments

Comments
 (0)