C++ - virtual destructor disable move semantic

less than 1 minute read

Declaring virtual destructor will disable move sematic

Basic Move Semantic

1
2
3
4
5
6
class Customer {
  protected:
    std::string name;
  public:
    virtual ~Customer() = default; // this will disable the move semantic
}

Categories:

Updated: