fork download
  1. #include <memory>
  2.  
  3. struct Bar {
  4. std::unique_ptr<char> p;
  5. };
  6.  
  7. void fooA(const Bar& bar) {
  8. //Bar bar_copy(bar); // error: use of deleted function 'Bar::Bar(const Bar&)'
  9. }
  10.  
  11. void fooB(Bar bar) {
  12. }
  13.  
  14. int main() {
  15. fooB(Bar());
  16. }
Success #stdin #stdout 0s 3092KB
stdin
Standard input is empty
stdout
Standard output is empty