mardi 28 mars 2017

C++ delete keyword assigned to copy c'tor and copy assignment operator - what does it mean? [duplicate]

This question already has an answer here:

While looking at boost examples, I came across a declaration like below.

class server
{
public:
  server(const server&) = delete;
  server& operator=(const server&) = delete;
  ...

  • What does this assignment to 'delete' mean here?
  • What is the code trying to do with copy c'tor and copy assgn operator?

I admit I have moved on to other programming languages (due to work compulsions), and hence lost touch with its new syntax and features. But the passion hasn't yet died.

Aucun commentaire:

Enregistrer un commentaire