fork(9) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <class T> class vec3
  5. {
  6. public:
  7. vec3(T x = 0, T y = 0, T z = 0) :
  8. x(x),
  9. y(y),
  10. z(z)
  11. {
  12. }
  13.  
  14. static const vec3 right;
  15. static const vec3 up;
  16. static const vec3 forward;
  17.  
  18. T x, y, z;
  19. };
  20.  
  21. template <typename T> const vec3<T> vec3<T>::right(1, 0, 0);
  22. template <typename T> const vec3<T> vec3<T>::up(0, 1, 0);
  23. template <typename T> const vec3<T> vec3<T>::forward(0, 0, 1);
  24.  
  25.  
  26. int main() {
  27. vec3<int> vi;
  28. vec3<float> vf;
  29. }
Success #stdin #stdout 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty