0

Imagine simple class something like this:

struct A {
    void* const memory;
    int const size;
}

Implementation of copy and move constructors are really trivial, but I am not able to grasp, how to implement move and copy operators. I've tried to do copy-and-swap, but it requires overload of std::swap and I was not able to invent it, since I am not able to change const variables. Is making my class members non-const is the only way?

Starl1ght
  • 4,422
  • 1
  • 21
  • 49

0 Answers0