point/vector: use coord constructors

This commit is contained in:
Danny Robson 2015-01-13 18:39:27 +11:00
parent 82ee179b64
commit 64c11bdcb0
4 changed files with 2 additions and 20 deletions

View File

@ -31,12 +31,6 @@ using namespace std;
#pragma GCC optimize("-O3") #pragma GCC optimize("-O3")
#endif #endif
//-----------------------------------------------------------------------------
template <size_t S, typename T>
util::point<S,T>::point ()
{ ; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <size_t S, typename T> template <size_t S, typename T>
util::point<S,T>& util::point<S,T>&

View File

@ -34,10 +34,7 @@ namespace util {
struct point : public detail::coord<S,T> { struct point : public detail::coord<S,T> {
static_assert (S > 0, "point dimensions must be strictly positive."); static_assert (S > 0, "point dimensions must be strictly positive.");
point (); using detail::coord<S,T>::coord;
template <typename... U>
point (U ...u): detail::coord<S,T> {std::forward<U> (u)...} { ; }
// point operators // point operators
template <typename U> typename std::common_type<T,U>::type distance (const point<S,U> &) const; template <typename U> typename std::common_type<T,U>::type distance (const point<S,U> &) const;

View File

@ -38,12 +38,6 @@ using std::begin;
using std::end; using std::end;
//-----------------------------------------------------------------------------
template <size_t S, typename T>
util::vector<S,T>::vector ()
{ ; }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <size_t S, typename T> template <size_t S, typename T>
util::vector<S,T> util::vector<S,T>

View File

@ -32,10 +32,7 @@ namespace util {
struct vector : public detail::coord<S, T> { struct vector : public detail::coord<S, T> {
static_assert (S > 0, "vector dimensions must be strictly positive"); static_assert (S > 0, "vector dimensions must be strictly positive");
vector (); using detail::coord<S,T>::coord;
template <typename... U>
vector (U ...u): detail::coord<S, T> {std::forward<U> (u)...} { ; }
// arithmetic operators // arithmetic operators
vector<S,T> operator* (T) const; vector<S,T> operator* (T) const;