mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
feature: add NonCopyableOrMovable and NonCopyable concepts
Inheriting from NonCopyableOrMovableClass or NonCopyableClass does not prevent derived classes from accidentally defining their own copy or move constructors, violating the intended design. This commit introduces two concepts: - NonCopyableOrMovable - NonCopyable Using static asserts with these concepts will guarantee the intended copy and move limitations. Related-To: NEO-14068 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
904d90df90
commit
899abf3aac
@@ -46,6 +46,7 @@ struct AllocationProperties;
|
||||
struct HardwareInfo;
|
||||
|
||||
struct RootDeviceEnvironment : NonCopyableClass {
|
||||
|
||||
protected:
|
||||
std::unique_ptr<HardwareInfo> hwInfo;
|
||||
|
||||
@@ -135,4 +136,6 @@ struct RootDeviceEnvironment : NonCopyableClass {
|
||||
std::mutex mtx;
|
||||
};
|
||||
|
||||
static_assert(NEO::NonCopyable<RootDeviceEnvironment>);
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user