summaryrefslogtreecommitdiff
path: root/src/owner.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-03-26 09:21:22 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2024-03-26 10:15:49 +0100
commit9b3b365a6645c16b0f93dcd798da83494e481d26 (patch)
treeb56c5b2369d7b7e10f2dc6072aee296fa43a42cf /src/owner.h
parent2b86429f762d8d977ceb4d610189e7c01fc52ee8 (diff)
Linter fixes for audiocache.cc
Diffstat (limited to 'src/owner.h')
-rw-r--r--src/owner.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/owner.h b/src/owner.h
new file mode 100644
index 0000000..0c67ae5
--- /dev/null
+++ b/src/owner.h
@@ -0,0 +1,24 @@
+//! -*- c++ -*-
+#pragma once
+
+//#include <type_traits> // for enable_if_t, is_convertible, is_assignable
+
+// Taken from the GSL Core Guidelines Support Library
+namespace gsl
+{
+
+//
+// owner
+//
+// `gsl::owner<T>` is designed as a safety mechanism for code that must deal directly with raw pointers that own memory.
+// Ideally such code should be restricted to the implementation of low-level abstractions. `gsl::owner` can also be used
+// as a stepping point in converting legacy code to use more modern RAII constructs, such as smart pointers.
+//
+// T must be a pointer type
+// - disallow construction from any type other than pointer type
+//
+//template <class T, class = std::enable_if_t<std::is_pointer<T>::value>>
+template<typename T>
+using owner = T;
+
+}// gsl::