2

First:

class T1 : boost::noncopyable {
    // ...
}

Second:

class T2 {
public:
    T2(const T2&) = delete;
    T2& operator=(const T2&) = delete;
}

Are they the same? What are disadvantages of each? I mean runtime costs, not comfort of writing code or readability.

In 2016 with C++11/14 is there any advantage to use boost::noncopyable instead of C++11 = delete?

vladon
  • 8,158
  • 2
  • 47
  • 91

0 Answers0