Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 010ac5e

Browse files
committed
Explicitly use the default copy constructor and assignment
1 parent ac0d98d commit 010ac5e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

System/Vector.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ namespace RTE {
2929
explicit Vector(const float inputX = 0.0F, const float inputY = 0.0F) :
3030
m_X(inputX),
3131
m_Y(inputY) {};
32+
33+
/// <summary>
34+
/// Copy constructor method used to instantiate a Vector object identical to an already existing one.
35+
/// </summary>
36+
/// <param name="reference">A Vector object which is passed in by reference.</param>
37+
Vector(const Vector &reference) = default;
3238
#pragma endregion
3339

3440
#pragma region Getters and Setters
@@ -325,6 +331,13 @@ namespace RTE {
325331
#pragma endregion
326332

327333
#pragma region Operator Overloads
334+
/// <summary>
335+
/// Copy assignment operator for Vectors.
336+
/// </summary>
337+
/// <param name="rhs">A Vector reference.</param>
338+
/// <returns>A reference to the changed Vector.</returns>
339+
Vector & operator=(const Vector &rhs) = default;
340+
328341
/// <summary>
329342
/// An assignment operator for setting this Vector equal to the average of an std::deque of Vectors.
330343
/// </summary>

0 commit comments

Comments
 (0)