Flow 2.0.0
Flow project: Public API.
|
Useful as a no-unique-address private member to make a type noncopyable while keeping that type an aggregate (can be direct-initialized). More...
#include <util.hpp>
Public Member Functions | |
Noncopyable ()=default | |
Makes it possible to instantiate. | |
Noncopyable (const Noncopyable &)=delete | |
Forbid copying. | |
void | operator= (const Noncopyable &)=delete |
Forbid copying. | |
Useful as a no-unique-address private member to make a type noncopyable while keeping that type an aggregate (can be direct-initialized).
So you can do: [[no_unique_address]] flow::util::Noncopyable m_nc{};
.
The usual technique of deriving from boost::noncopyable
disables aggregateness. In C++20 declaring a = delete
copy ctor also disables it. This trick still works though.