Add geom::point::zero()
This commit is contained in:
parent
1571e9032b
commit
5d44efa2ea
1 changed files with 11 additions and 0 deletions
|
|
@ -41,11 +41,22 @@ namespace psemek::geom
|
|||
|
||||
point & operator += (vector<T, N> const & v);
|
||||
point & operator -= (vector<T, N> const & v);
|
||||
|
||||
static point zero();
|
||||
};
|
||||
|
||||
template <typename ... Args>
|
||||
point(Args && ...) -> point<std::common_type_t<Args...>, sizeof...(Args)>;
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
point<T, N> point<T, N>::zero()
|
||||
{
|
||||
point<T, N> p;
|
||||
for (std::size_t i = 0; i < N; ++i)
|
||||
p[i] = 0;
|
||||
return p;
|
||||
}
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
bool operator == (point<T, N> const & p1, point<T, N> const & p2)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue