Language: C++

#include<bits/stdc++.h>
class temp{
  int value;
};
void swapVal(temp t1,temp t2){
  swap(t1.value,t2.value);
}
int main(){
  temp A,B,C;
  cin>>A.value>>B.value>>C.value;
  swap(A,B);
  swap(A,C);
  cout<<A.value<<" "<<B.value<<" "<<C.value<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'void swapVal(temp, temp)':
a.cc:6:11: error: 'int temp::value' is private within this context
    6 |   swap(t1.value,t2.value);
      |           ^~~~~
a.cc:3:7: note: declared private here
    3 |   int value;
      |       ^~~~~
a.cc:6:20: error: 'int temp::value' is private within this context
    6 |   swap(t1.value,t2.value);
      |                    ^~~~~
a.cc:3:7: note: declared private here
    3 |   int value;
      |       ^~~~~
a.cc:6:3: error: 'swap' was not declared in this scope
    6 |   swap(t1.value,t2.value);
      |   ^~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
                 from a.cc:1:
/usr/include/c++/14/bits/regex.h:2230:5: note:   'std::__cxx11::swap'
 2230 |     swap(match_results<_Bi_iter, _Alloc>& __lhs,
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
In file included from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/stdexcept:38,
                 from /usr/include/c++/14/system_error:43,
                 from /usr/include/c++/14/bits/ios_base.h:46,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/exception_ptr.h:229:5: note:   'std::__exception_ptr::swap'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
In file included from /usr/include/c++/14/filesystem:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_path.h:736:15: note:   'std::filesystem::__cxx11::swap'
  736 |   inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
      |               ^~~~
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin>>A.value>>B.value>>C.value;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:10: error: 'int temp::value' is private within this context
   10 |   cin>>A.value>>B.value>>C.value;
      |          ^~~~~
a.cc:3:7: note: declared private here
    3 |   int value;
      |       ^~~~~
a.cc:10:19: error: 'int temp::value' is private within this context
   10 |   cin>>A.value>>B.value>>C.value;
      |                   ^~~~~
a.cc:3:7: note: declared private here
    3 |   int value;
      |       ^~~~~
a.cc:10:28: error: 'int temp::value' is private within this context
   10 |   cin>>A.value>>B.value>>C.value;
      |                            ^~~~~
a.cc:3:7: note: declared private here
    3 |   int value;
      |       ^~~~~
a.cc:11:3: error: 'swap' was not declared in this scope
   11 |   swap(A,B);
      |   ^~~~
a.cc:11:3: note: suggested alternatives:
/usr/include/c++/14/bits/regex.h:2230:5: note:   'std::__cxx11::swap'
 2230 |     swap(match_results<_Bi_iter, _Alloc>& __lhs,
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
/usr/include/c++/14/bits/exception_ptr.h:229:5: note:   'std::__exception_ptr::swap'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
/usr/include/c++/14/bits/fs_path.h:736:15: note:   'std::filesystem::__cxx11::swap'
  736 |   inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
      |               ^~~~
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout<<A.value<<" "<<B.value<<" "<<C.value<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:11: error: 'int temp::value' is private within this context
   13 |   cout<<A.value<<" "<<B.value<<" "<<C.value<<endl;
      |           ^~~~~
a.cc:3:7: note: declared private here
    3 |   int value;
      |       ^~~~~
a.cc:13:25: error: 'int temp::value' is private within this context
   13 |   cout<<A.value<<" "<<B.value<<" "<<C.value<<endl;
      |                         ^~~~~
a.cc:3:7: note: declared private here
    3 |   int value;
      |       ^~~~~
a.cc:13:39: error: 'int temp::value' is private within this context
   13 |   cout<<A.value<<" "<<B.value<<" "<<C.value<<endl;
      |                                       ^~~~~
a.cc:3:7: note: declared private here
    3 |   int value;
      |       ^~~~~
a.cc:13:46: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   cout<<A.value<<" "<<B.value<<" "<<C.value<<endl;
      |                                              ^~~~
      |                                              std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~