MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / Object_Lifetime_Vector2

Class Object_Lifetime_Vector2

unittests/compiled_tests.cpp:746–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

744
745template<typename T>
746struct Object_Lifetime_Vector2
747{
748 Object_Lifetime_Vector2() : x(0), y(0) {}
749 Object_Lifetime_Vector2(T px, T py) : x(px), y(py) {}
750 Object_Lifetime_Vector2(const Object_Lifetime_Vector2& cp) : x(cp.x), y(cp.y) {}
751
752 Object_Lifetime_Vector2& operator+=(const Object_Lifetime_Vector2& vec_r)
753 {
754 x += vec_r.x;
755 y += vec_r.y;
756 return *this;
757 }
758
759 Object_Lifetime_Vector2 operator+(const Object_Lifetime_Vector2& vec_r)
760 {
761 return Object_Lifetime_Vector2(*this += vec_r);
762 }
763
764 Object_Lifetime_Vector2 &operator=(const Object_Lifetime_Vector2& ver_r)
765 {
766 x = ver_r.x;
767 y = ver_r.y;
768 return *this;
769 }
770
771
772 T x;
773 T y;
774};
775
776Object_Lifetime_Vector2<float> Object_Lifetime_Vector2_GetValue()
777{

Callers 1

operator+Method · 0.85

Calls

no outgoing calls

Tested by 1

operator+Method · 0.68