typedefs added

This commit is contained in:
{{QWERTYKBGUI}} 2023-10-02 16:17:52 +02:00
parent 75108e7076
commit 9ddffcf4f7
2 changed files with 12 additions and 3 deletions

View File

@ -180,7 +180,7 @@ namespace polygun::math {
template <typename T, size_t N>
Vector<T, N>& Vector<T, N>::operator=(const Vector<T, N>& other) {
if (this != &other) { // self-assignment check
if (this != &other) {
m_data = other.m_data;
}
return *this;

View File

@ -68,8 +68,17 @@ namespace polygun::math {
T magnitude() const;
Vector<T, N> normalize() const;
};
typedef Vector<int, 2> Vector2i;
typedef Vector<float, 2> Vector2f;
typedef Vector<int, 3> Vector3i;
typedef Vector<float, 3> Vector3f;
typedef Vector<int, 4> Vector4i;
typedef Vector<float, 4> Vector4f;
typedef Vector<unsigned char, 4> RGBAColor;
}
#include "vector.cpp"
#endif // POLYGUN_MATH_VECTOR_HPP