fork download
  1. #define furrovineexport
  2.  
  3. template<class T>
  4. class TVector2;
  5. template<class T>
  6. class TVector3;
  7. template<class T>
  8. class TVector4;
  9.  
  10. template<class T, unsigned one, unsigned two>
  11. struct furrovineexport swizzler_two {
  12. T v[4];
  13. swizzler_two & operator= (const TVector2<T>& right) {
  14. v[one] = right.x;
  15. v[two] = right.y;
  16. return *this;
  17. }
  18. operator TVector3<T> () const { return TVector4<T>(v[one], v[two]); }
  19. };
  20. template<class T, unsigned one, unsigned two, unsigned three>
  21. struct furrovineexport swizzler_three {
  22. T v[4];
  23. swizzler_three& operator= (const TVector3<T>& right) {
  24. v[one] = right.x;
  25. v[two] = right.y;
  26. v[three] = right.z;
  27. return *this;
  28. }
  29. operator TVector3<T> () const { return TVector4<T>(v[one], v[two], v[three]); }
  30. };
  31. template<class T, unsigned one, unsigned two, unsigned three, unsigned four>
  32. struct furrovineexport swizzler_four {
  33. T v[4];
  34. operator TVector4<T> () const { return TVector4<T>(v[one], v[two], v[three], v[four]); }
  35. };
  36.  
  37. int main() {}
  38.  
Success #stdin #stdout 0.01s 2676KB
stdin
Standard input is empty
stdout
Standard output is empty