lundi 19 février 2018

Most concise way to disable copy and move semantics

The following surely works but is very tedious:

T(const T&) = delete;
T(T&&) = delete;
T& operator=(const T&) = delete;
T& operator=(T&&) = delete;

I'm trying to discover the most concise way. Will the following work?

T& operator=(T) = delete;

Aucun commentaire:

Enregistrer un commentaire