jeudi 5 mai 2016

Any disadvantage of inheriting from boost::noncopyable vs delete copy ctor and op? [duplicate]

This question already has an answer here:

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?

Aucun commentaire:

Enregistrer un commentaire