fork download
  1. #include <iostream>
  2.  
  3. enum Type {
  4. UNTEXTURED = 0,
  5. TEXTURED = 2
  6. };
  7.  
  8. template <Type type>
  9. struct Vertex {
  10. float pos[3];
  11. float normal[3];
  12. float texCoord[type];
  13. };
  14.  
  15. template <Type type>
  16. class Mesh {
  17. Vertex<type> array[256];
  18. };
  19.  
  20. int main() {
  21. Mesh<TEXTURED> test1;
  22. std::cout << sizeof(test1) << std::endl;
  23.  
  24. Mesh<UNTEXTURED> test2;
  25. std::cout << sizeof(test2) << std::endl;
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
8192
6144