#pragma once namespace lt::math { template struct vec2_impl { vec2_impl(): x(), y() { } explicit vec2_impl(T scalar): x(scalar), y(scalar) { } vec2_impl(T x, T y): x(x), y(y) { } [[nodiscard]] auto operator*(const vec2_impl &other) const -> vec2_impl { return { x * other.x, y * other.y, }; } [[nodiscard]] auto operator-(const vec2_impl &other) const -> vec2_impl { return { x - other.x, y - other.y, }; } [[nodiscard]] auto operator*(float scalar) const -> vec2_impl { return { x * scalar, y * scalar, }; } T x; // NOLINT T y; // NOLINT }; using vec2 = vec2_impl; using ivec2 = vec2_impl; using uvec2 = vec2_impl; } // namespace lt::math