V2 & V2i constructable from std::pair
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user