fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <tuple>
  4. using namespace std;
  5.  
  6. template <class DataType>
  7. class Tiles {
  8. public:
  9. void AddTile(DataType x) { tiles_.push_back(x); }
  10. std::vector<DataType> tiles_;
  11. };
  12.  
  13. int main() {
  14. Tiles<int> a;
  15. a.AddTile(10);
  16.  
  17. Tiles<std::string> b;
  18. b.AddTile("hello, world");
  19.  
  20. Tiles<std::tuple<int, double>> c;
  21. c.AddTile(std::make_tuple(20, 12.5));
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 4348KB
stdin
Standard input is empty
stdout
Standard output is empty