fork download
  1. #include <array>
  2. #include <tuple>
  3.  
  4. template<unsigned int size>
  5. class MyBase
  6. {
  7. protected:
  8. std::array<int, size*size + 6*size> myArray;
  9. };
  10.  
  11. template<unsigned int size>
  12. class MyClass : public MyBase<size>
  13. {
  14. public:
  15. void set(int a, int b, float c) {myArray[a] = std::make_tuple(b, c);}
  16. private:
  17. std::array<std::tuple<int, float>, 6> myArray;
  18. };
  19. int main()
  20. {
  21. MyClass<4> m;
  22. m.set(4, 35, 56.885);
  23. return 0;
  24. }
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty