From 67146b1b3bcb7d02307dcd4cc8b88cf778b41205 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 25 Jul 2011 17:10:01 +0300 Subject: [PATCH] Let Variant take care of detecting type mismatches --- source/value.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source/value.h b/source/value.h index 219b0e4..78ec54a 100644 --- a/source/value.h +++ b/source/value.h @@ -4,7 +4,6 @@ #include #include #include -#include "except.h" #include "type.h" namespace Msp { @@ -40,9 +39,6 @@ typedef std::vector ValueArray __attribute__((deprecated)); template inline T Value::get_() const { - if(sig!=TypeInfo::signature) - throw TypeError("Type mismatch"); - return data.value::Store>(); } @@ -51,10 +47,8 @@ inline FloatType::Store Value::get_() const { if(sig==IntType::signature) return data.value(); - else if(sig!=FloatType::signature) - throw TypeError("Type mismatch"); - - return data.value(); + else + return data.value(); } } // namespace DataFile -- 2.45.2