fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void f(unsigned char) { cout << "f(u)\n"; }
  5. void f(char) = delete;
  6.  
  7. int main()
  8. {
  9. char a = 'a';
  10. unsigned char b = 0x42;
  11. f(a);
  12. f(b);
  13. }
Compilation error #stdin compilation error #stdout 0s 5636KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11:5: error: use of deleted function ‘void f(char)’
  f(a);
     ^
prog.cpp:5:6: note: declared here
 void f(char) = delete;
      ^
stdout
Standard output is empty