summaryrefslogtreecommitdiff
path: root/src/CommonAPI/SerializableVariant.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommonAPI/SerializableVariant.hpp')
-rw-r--r--src/CommonAPI/SerializableVariant.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/CommonAPI/SerializableVariant.hpp b/src/CommonAPI/SerializableVariant.hpp
index 2919638..febff2d 100644
--- a/src/CommonAPI/SerializableVariant.hpp
+++ b/src/CommonAPI/SerializableVariant.hpp
@@ -453,8 +453,13 @@ const _Type & Variant<_Types...>::get() const {
if (cType == valueType_) {
return *(reinterpret_cast<const _Type *>(&valueStorage_));
} else {
+#ifdef __EXCEPTIONS
std::bad_cast toThrow;
throw toThrow;
+#else
+ printf("SerializableVariant.hpp:%i %s: Incorrect access to variant; attempting to get type not currently contained", __LINE__, __FUNCTION__);
+ abort();
+#endif
}
}