mirror of
https://github.com/UberGames/rpgxEF.git
synced 2025-02-24 04:51:12 +00:00
23 lines
496 B
C++
23 lines
496 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <type_traits>
|
|
|
|
namespace common {
|
|
|
|
template<typename T>
|
|
class Point2d {
|
|
public:
|
|
template<typename A, typename B, typename = std::enable_if_t<std::is_convertible_v<A, T> && std::is_convertible_v<B, T>>>
|
|
constexpr explicit Point2d(A _x = 0, B _y = 0) : x{T{_x}}, y{T{_y}} {}
|
|
|
|
T x;
|
|
T y;
|
|
};
|
|
|
|
using Point2dI = Point2d<int32_t>;
|
|
using Point2dF = Point2d<float>;
|
|
using Point2dD = Point2d<double>;
|
|
|
|
}
|
|
|