aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-05-19 23:25:16 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-05-19 23:25:16 +0100
commit89c11e6679346e77ee32eb1343d3cf4e7d429a46 (patch)
tree788d5a12705580bf2a3ef6521e8431908c28566e
parent3014c3bc831d613c2de7513aefdc7d3cb711b749 (diff)
downloadYAGE-89c11e6679346e77ee32eb1343d3cf4e7d429a46.tar.gz
YAGE-89c11e6679346e77ee32eb1343d3cf4e7d429a46.zip
Working on Vector class
-rw-r--r--include/YAGE/Math/vector.hpp4
-rw-r--r--test/vector2d_test.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/include/YAGE/Math/vector.hpp b/include/YAGE/Math/vector.hpp
index 83c16502..5f3161df 100644
--- a/include/YAGE/Math/vector.hpp
+++ b/include/YAGE/Math/vector.hpp
@@ -26,7 +26,7 @@ public:
return members_[index];
}
- inline Vector &operator=(const Vector &other)
+ inline Vector operator=(Vector other)
{
this->members_=other.members_;
return *this;
@@ -73,7 +73,7 @@ public:
return *this;
}
- inline Vector operator+(const Vector &other) const
+ inline Vector operator+(Vector other) const
{
Vector v(members_);
return v+=other;
diff --git a/test/vector2d_test.cpp b/test/vector2d_test.cpp
index 20a5be3e..2eb00de4 100644
--- a/test/vector2d_test.cpp
+++ b/test/vector2d_test.cpp
@@ -7,7 +7,7 @@ int main()
yage::Vector2D v;
yage::Vector2D v2(1, 5);
- v=v2;
+ v=v2+2;
std::cout<<v<<'\n';