fork(1) download
  1. #include <string>
  2. #include <iostream>
  3.  
  4. template<typename T>
  5. class test
  6. {
  7. private:
  8. T _m;
  9. public:
  10. constexpr test(T value) : _m(value) {};
  11.  
  12. constexpr T m() const { return _m; }
  13. void m(T value) { _m = value; }
  14. };
  15.  
  16. typedef test<std::string> teststr;
  17.  
  18. int main(int argc, char const *argv[])
  19. {
  20. teststr ts("Hello");
  21.  
  22. std::cout << ts.m() << std::endl;
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
Hello