diff options
author | Nao Pross <naopross@thearcway.org> | 2019-01-21 00:39:13 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2019-01-21 00:39:13 +0100 |
commit | e6595cf9c527e97198806c48aa0a14ae8e895e87 (patch) | |
tree | 18e6b0112da7fdda39ad121a813dc16fbcb5b258 /example.cpp | |
parent | Initial commit, add mmvec.hpp with example, makefile and .gitignore (diff) | |
download | libmm-e6595cf9c527e97198806c48aa0a14ae8e895e87.tar.gz libmm-e6595cf9c527e97198806c48aa0a14ae8e895e87.zip |
Add member operator =, +=, -=, *= overloads for basic_vec
Diffstat (limited to '')
-rw-r--r-- | example.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/example.cpp b/example.cpp index e72d65b..3a00f58 100644 --- a/example.cpp +++ b/example.cpp @@ -21,6 +21,8 @@ int main(int argc, char *argv[]) { std::cout << "u * v = " << u * v << std::endl; std::cout << std::endl; + u += v; + // three dimensional vectors std::cout << "three dimensional (double) vectors" << std::endl; @@ -37,6 +39,8 @@ int main(int argc, char *argv[]) { std::cout << "spherical(a) = " << a.spherical() << std::endl; std::cout << std::endl; + a -= b; + // two dimensional vector std::cout << "two dimensional (complex) vectors" << std::endl; @@ -52,5 +56,7 @@ int main(int argc, char *argv[]) { std::cout << "polar(j) = " << j.polar() << std::endl; std::cout << std::endl; + j *= 10; + return 0; } |