fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void Func(int a, std::string b)
  5. {
  6. std::cout << a;
  7. std::cout << b;
  8. }
  9.  
  10. int main() {
  11. Func(33, "test"); // работает
  12.  
  13. std::pair <int,std::string> myPair (33, "test");
  14. Func(myPair); // не компилируется
  15.  
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 15232KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:14:13: error: cannot convert ‘std::pair<int, std::__cxx11::basic_string<char> >’ to ‘int’ for argument ‘1’ to ‘void Func(int, std::__cxx11::string)’
  Func(myPair);
             ^
stdout
Standard output is empty