aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/model/DataObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/model/DataObject.h')
-rw-r--r--src/core/model/DataObject.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/model/DataObject.h b/src/core/model/DataObject.h
index 49082d09..63c829c5 100644
--- a/src/core/model/DataObject.h
+++ b/src/core/model/DataObject.h
@@ -29,9 +29,12 @@
#pragma once
#include <any>
+#include <typeindex>
+#include <typeinfo>
#include "core/GpgFrontendCoreExport.h"
#include "core/utils/MemoryUtils.h"
+#include "spdlog/spdlog.h"
namespace GpgFrontend {
@@ -66,7 +69,14 @@ class GPGFRONTEND_CORE_EXPORT DataObject {
std::vector<std::type_info const*> type_list = {&typeid(Args)...};
for (size_t i = 0; i < type_list.size(); ++i) {
- if (type_list[i] != &((*this)[i]).type()) return false;
+ if (std::type_index(*type_list[i]) !=
+ std::type_index((*this)[i].type())) {
+ SPDLOG_ERROR(
+ "value of index {} in data object is type: {}, "
+ "not expected type: {}",
+ i, ((*this)[i]).type().name(), type_list[i]->name());
+ return false;
+ }
}
return true;
}