V2 & V2i constructable from std::pair
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 1m25s
Build Docs With Doxygen / Explore-Gitea-Actions (push) Successful in 24s

This commit is contained in:
2025-06-04 15:40:39 -04:00
parent 966f6fc77d
commit 2886bbb397
2 changed files with 4 additions and 2 deletions

View File

@@ -55,11 +55,12 @@ namespace J3ML::LinearAlgebra {
Vector2(float X, float Y);
/// Constructs this float2 from a C array, to the value (data[0], data[1]).
explicit Vector2(const float* data);
// Constructs a new Vector2 with the value {scalar, scalar}
/// Constructs a new Vector2 with the value {scalar, scalar}
explicit Vector2(float scalar);
Vector2(const Vector2& rhs); // Copy Constructor
explicit Vector2(const Vector2i& rhs);
//Vector2(Vector2&&) = default; // Move Constructor
/// Constructs a new Vector2 from std::pair<float, float>,.
explicit Vector2(const std::pair<float, float>& rhs) : x(rhs.first), y(rhs.second) {}
[[nodiscard]] float GetX() const;
[[nodiscard]] float GetY() const;

View File

@@ -14,6 +14,7 @@ public:
Vector2i(int x, int y) : x(x), y(y) {}
explicit Vector2i(int rhs) : x(rhs), y(rhs) {}
explicit Vector2i(const Vector2& rhs) : x(rhs.x), y(rhs.y) { }
explicit Vector2i(const std::pair<int, int>& rhs) : x(rhs.first), y(rhs.second) {}
public:
bool operator == (const Vector2i& rhs) const;
bool operator != (const Vector2i& rhs) const;