fork download
  1. #include <array>
  2.  
  3. template<typename T>
  4. struct vec4
  5. {
  6. bool operator==(const vec4<T>& right)
  7. {return (x == right.x && y == right.y && z = right.z && w = right.w); }
  8.  
  9. union {
  10. struct { T x,y,z,w; };
  11. struct { T r,g,b,a; };
  12. T data4[4];
  13. };
  14.  
  15. std::array<T, 4> swizzle(unsigned idx, unsigned idy, unsigned idz, unsigned idw) {
  16. std::array<T, 4> r = {{data4[idx], data4[idy], data4[idz], data4[idw]}};
  17. return r;
  18. }
  19. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/array:40,
                 from prog.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/c++0x_warning.h:36:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
stdout
Standard output is empty