This commit is contained in:
r.koeppe
2024-05-14 02:14:13 +02:00
parent 0052d3984b
commit 2d22ccd2d6
1423 changed files with 354055 additions and 7 deletions

View File

@ -0,0 +1,45 @@
/// \file
/// {COMMON_HEADER}
#ifndef _VNUTIL_NOCOPY_H_
#define _VNUTIL_NOCOPY_H_
#include "export.h"
namespace vn {
namespace util {
/// \brief Identifies a derived class as being unable to be copied and prevents
/// copy attempts.
///
/// Example for making derived objects uncopyable.
/// \code
/// class MyClass : private NoCopy
/// {
/// // Class implementation.
/// }
/// \endcode
class vn_proglib_DLLEXPORT NoCopy
{
protected:
/// \brief Allows construction of derived objects.
NoCopy() { }
/// \brief Allows destruction of derived objects.
~NoCopy() { }
private:
/// \brief Prevent copying of derived objects.
NoCopy(const NoCopy&);
/// \brief Prevent assignment copying of derived objects.
NoCopy& operator=(const NoCopy&);
};
}
}
#endif