Generated vec1

//generated on Mon Oct 31 22:02:37 2016

#ifndef VEC1_H
#define VEC1_H










//============================
// vec1
//============================
template <typename T>
struct vec1
 {
      inline vec1();
      inline explicit vec1(const T *begin);
      inline vec1(const T &xv);
      inline vec1(const T (&that)[1]);


      inline T &x();
      inline const T &x() const;
      inline void setX(const T &x);


      inline unsigned int count() const;
      inline T &operator[](unsigned int i);
      inline const T &operator[](unsigned int i) const;


      inline T *begin();
      inline const T *begin() const;
      inline T *end();
      inline const T *end() const;


      inline vec1<T> &operator++();
      inline vec1<T> operator++(int);
      inline vec1<T> &operator--();
      inline vec1<T> operator--(int);




      inline vec1<T> &operator=(const vec1<T> &x);
      inline vec1<T> operator+(const vec1<T> &x) const;
      inline vec1<T> &operator+=(const vec1<T> &x);
      inline vec1<T> operator-(const vec1<T> &x) const;
      inline vec1<T> &operator-=(const vec1<T> &x);
      inline vec1<T> operator*(const vec1<T> &x) const;
      inline vec1<T> &operator*=(const vec1<T> &x);
      inline vec1<T> operator/(const vec1<T> &x) const;
      inline vec1<T> &operator/=(const vec1<T> &x);
      inline vec1<T> operator%(const vec1<T> &x) const;
      inline vec1<T> &operator%=(const vec1<T> &x);
      inline bool operator<(const vec1<T> &x) const;
      inline bool operator<=(const vec1<T> &x) const;
      inline bool operator>(const vec1<T> &x) const;
      inline bool operator>=(const vec1<T> &x) const;
      inline bool operator==(const vec1<T> &x) const;
      inline bool operator!=(const vec1<T> &x) const;
      inline vec1<T> operator<<(const vec1<T> &x) const;
      inline vec1<T> &operator<<=(const vec1<T> &x);
      inline vec1<T> operator>>(const vec1<T> &x) const;
      inline vec1<T> &operator>>=(const vec1<T> &x);
      inline vec1<T> operator|(const vec1<T> &x) const;
      inline vec1<T> &operator|=(const vec1<T> &x);
      inline vec1<T> operator^(const vec1<T> &x) const;
      inline vec1<T> &operator^=(const vec1<T> &x);
      inline vec1<T> operator&(const vec1<T> &x) const;
      inline vec1<T> operator&=(const vec1<T> &x) const;
      inline bool operator||(const vec1<T> &x) const;




      inline vec1<T> operator*(const T &x) const;
      inline vec1<T> &operator*=(const T &x);
      inline vec1<T> operator/(const T &x) const;
      inline vec1<T> &operator/=(const T &x);
      inline vec1<T> operator%(const T &x) const;
      inline vec1<T> &operator%=(const T &x);


      inline vec1<T> operator-() const;
      inline vec1<T> operator+() const;
      inline bool operator!() const;


      inline T (&array)[1]();
      inline const T (&array)[1]() const;
      inline operator T (&)[1]();
      inline operator const T (&)[1]() const;


      template <typename T1>
      inline vec1<T1> to();


   private:
      T xv;
 };




































template <typename T>
T &vec1<T>::x()
   { return xv; }


template <typename T>
const T &vec1<T>::x() const
   { return xv; }


template <typename T>
void vec1<T>::setX(const T &x)
   { xv=x; }


template <typename T>
vec1<T>::vec1()
 :xv(0)
   {
   }


template <typename T>
vec1<T>::vec1(const T *begin)
 :xv(begin[0])
   {
   }


template <typename T>
vec1<T>::vec1(const T &xv)
 :xv(xv)
   {
   }


template <typename T>
T *vec1<T>::begin()
   { return &xv; }


template <typename T>
const T *vec1<T>::begin() const
   { return &xv; }


template <typename T>
unsigned int vec1<T>::count() const
   { return 1; }


template <typename T>
T *vec1<T>::end()
   { return begin()+count(); }


template <typename T>
const T *vec1<T>::end() const
   { return begin()+count(); }


template <typename T>
T &vec1<T>::operator[](unsigned int i)
   {
      J_ASSERT(i<count(), "Index out of range!");
      return *(begin()+i);
   }


template <typename T>
const T &vec1<T>::operator[](unsigned int i) const
   {
      J_ASSERT(i<count(), "Index out of range!");
      return *(begin()+i);
   }


template <typename T>
vec1<T> &vec1<T>::operator++()
   {
      ++xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator++(int)
   { return vec1<T>(xv++); }


template <typename T>
vec1<T> &vec1<T>::operator--()
   {
      --xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator--(int)
   { return vec1<T>(xv--); }


template <typename T>
vec1<T> &vec1<T>::operator=(const vec1<T> &x)
   {
      xv=x.xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator+(const vec1<T> &x) const
   { return vec1<T>(xv+x.xv); }


template <typename T>
vec1<T> &vec1<T>::operator+=(const vec1<T> &x)
   {
      xv+=x.xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator-(const vec1<T> &x) const
   { return vec1<T>(xv-x.xv); }


template <typename T>
vec1<T> &vec1<T>::operator-=(const vec1<T> &x)
   {
      xv-=x.xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator*(const vec1<T> &x) const
   { return vec1<T>(xv*x.xv); }


template <typename T>
vec1<T> &vec1<T>::operator*=(const vec1<T> &x)
   {
      xv*=x.xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator/(const vec1<T> &x) const
   { return vec1<T>(xv/x.xv); }


template <typename T>
vec1<T> &vec1<T>::operator/=(const vec1<T> &x)
   {
      xv/=x.xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator%(const vec1<T> &x) const
   { return vec1<T>(xv%x.xv); }


template <typename T>
vec1<T> &vec1<T>::operator%=(const vec1<T> &x)
   {
      xv%=x.xv;
      return *this;
   }


template <typename T>
bool vec1<T>::operator<(const vec1<T> &x) const
   { return xv<x.xv; }


template <typename T>
bool vec1<T>::operator<=(const vec1<T> &x) const
   { return xv<=x.xv; }


template <typename T>
bool vec1<T>::operator>(const vec1<T> &x) const
   { return xv>x.xv; }


template <typename T>
bool vec1<T>::operator>=(const vec1<T> &x) const
   { return xv>=x.xv; }


template <typename T>
bool vec1<T>::operator==(const vec1<T> &x) const
   { return xv==x.xv; }


template <typename T>
bool vec1<T>::operator!=(const vec1<T> &x) const
   { return xv!=x.xv; }


template <typename T>
vec1<T> vec1<T>::operator<<(const vec1<T> &x) const
   { return vec1<T>(xv<<x.xv); }


template <typename T>
vec1<T> &vec1<T>::operator<<=(const vec1<T> &x)
   {
      xv<<=x.xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator>>(const vec1<T> &x) const
   { return vec1<T>(xv>>x.xv); }


template <typename T>
vec1<T> &vec1<T>::operator>>=(const vec1<T> &x)
   {
      xv>>=x.xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator|(const vec1<T> &x) const
   { return vec1<T>(xv|x.xv); }


template <typename T>
vec1<T> &vec1<T>::operator|=(const vec1<T> &x)
   {
      xv|=x.xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator^(const vec1<T> &x) const
   { return vec1<T>(xv^x.xv); }


template <typename T>
vec1<T> &vec1<T>::operator^=(const vec1<T> &x)
   {
      xv^=x.xv;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator&(const vec1<T> &x) const
   { return vec1<T>(xv&x.xv); }


template <typename T>
vec1<T> vec1<T>::operator&=(const vec1<T> &x) const
   { return vec1<T>(xv&=x.xv); }


template <typename T>
bool vec1<T>::operator||(const vec1<T> &x) const
   { return xv||x.xv; }


template <typename T>
vec1<T> vec1<T>::operator*(const T &x) const
   { return vec1<T>(xv*x); }


template <typename T>
vec1<T> &vec1<T>::operator*=(const T &x)
   {
      xv*=x;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator/(const T &x) const
   { return vec1<T>(xv/x); }


template <typename T>
vec1<T> &vec1<T>::operator/=(const T &x)
   {
      xv/=x;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator%(const T &x) const
   { return vec1<T>(xv%x); }


template <typename T>
vec1<T> &vec1<T>::operator%=(const T &x)
   {
      xv%=x;
      return *this;
   }


template <typename T>
vec1<T> vec1<T>::operator-() const
   { return vec1<T>(-xv); }


template <typename T>
vec1<T> vec1<T>::operator+() const
   { return vec1<T>(+xv); }


template <typename T>
bool vec1<T>::operator!() const
   { return !xv; }


template <typename T>
T (&vec1<T>::array)[1]()
   { return *reinterpret_cast<T (*)[1]>(begin()); }


template <typename T>
const T (&vec1<T>::array)[1]() const
   { return *reinterpret_cast<const T (*)[1]>(begin()); }


template <typename T>
vec1<T>::operator T (&)[1]()
   { return array(); }


template <typename T>
vec1<T>::operator const T (&)[1]() const
   { return array(); }


template <typename T, typename T1>
vec1<T1> vec1<T>::to()
   { return vec1<T1>(static_cast<T1>(xv)); }


template <typename T>
vec1<T>::vec1(const T (&that)[1])
 :xv(that[0])
   {
   }


#endif  // VEC1_H

//this header was generated in 5 milliseconds

No comments:

Post a Comment

Pages