summaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2024-01-07 00:00:50 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2024-01-07 00:00:50 +0100
commit2778f650bfd8b7ba7825e1cf8a1a28899458649d (patch)
tree306ca4d63d64422d612c1126687d85609b87e3f8 /modules/core
parent8f56be892fe95bbd7b533c9701e68d46f69351c9 (diff)
core,codec: Adding dangling changes
Diffstat (limited to 'modules/core')
-rw-r--r--modules/core/c++/common.cpp7
-rw-r--r--modules/core/c++/common.h8
-rw-r--r--modules/core/c++/error.h7
3 files changed, 15 insertions, 7 deletions
diff --git a/modules/core/c++/common.cpp b/modules/core/c++/common.cpp
new file mode 100644
index 0000000..4812c66
--- /dev/null
+++ b/modules/core/c++/common.cpp
@@ -0,0 +1,7 @@
+#include "common.h"
+
+namespace saw {
+void_t make_void(){
+ return {};
+}
+}
diff --git a/modules/core/c++/common.h b/modules/core/c++/common.h
index a06c238..d892efe 100644
--- a/modules/core/c++/common.h
+++ b/modules/core/c++/common.h
@@ -60,8 +60,16 @@ template <typename Func> struct return_type_helper<Func, void> {
template <typename Func, typename T>
using return_type = typename return_type_helper<Func, T>::Type;
+/**
+ * Struct describing a void type
+ */
struct void_t {};
+/**
+ * Helper function since changing returns between void_t{} and make_error<...>() is a bit annoying.
+ */
+void_t make_void();
+
template <typename T> struct void_fix { typedef T Type; };
template <> struct void_fix<void> { typedef void_t Type; };
template <typename T> using fix_void = typename void_fix<T>::Type;
diff --git a/modules/core/c++/error.h b/modules/core/c++/error.h
index 581782d..2728c8e 100644
--- a/modules/core/c++/error.h
+++ b/modules/core/c++/error.h
@@ -144,13 +144,6 @@ error::code get_template_id(){
}
}
-/**
- * Helper function since changing returns between void_t{} and make_error<...>() is a bit annoying.
- */
-void_t make_void(){
- return {};
-}
-
template<typename T> error make_error(const std::string_view& generic){
error::code id = impl::get_template_id<T>();