fork download
  1. #include <map>
  2. #include <string>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. class TT{
  8. public:
  9. TT(const string& str);
  10. template<class T>T Read(const string& key)const;
  11. template<class T>T Read(const string& key, const T& value)const;
  12. };
  13.  
  14. TT::TT(const string& str){
  15. cout<<str<<endl;
  16. }
  17.  
  18. template<class T>T TT::Read(const string& key)const{
  19. std::cout<<key<<std::endl;
  20. return 1;
  21. }
  22.  
  23. template<class T>T TT::Read(const string& key, const T& value)const{
  24. std::cout<<key<<'\t'<<value<<std::endl;
  25. return value;
  26. }
  27.  
  28. int main(void){
  29. TT tt("First");
  30.  
  31. tt.Read("Hello");
  32. return 1;
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:31: error: no matching function for call to ‘TT::Read(const char [6])’
stdout
Standard output is empty