From: Mikko Rasa Date: Mon, 25 Jul 2011 14:10:01 +0000 (+0300) Subject: Let Variant take care of detecting type mismatches X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=commitdiff_plain;h=67146b1b3bcb7d02307dcd4cc8b88cf778b41205 Let Variant take care of detecting type mismatches --- 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