]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/value.h
Let Variant take care of detecting type mismatches
[libs/datafile.git] / source / value.h
index 1b12db9a22db5f40e77578199bdfd7817fff4093..78ec54a89b512599305316c9ff6ad0b35cb67b3e 100644 (file)
@@ -1,17 +1,9 @@
-/* $Id$
-
-This file is part of libmspdatafile
-Copyright © 2006-2008, 2010  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_DATAFILE_VALUE_H_
 #define MSP_DATAFILE_VALUE_H_
 
 #include <vector>
 #include <msp/core/meta.h>
 #include <msp/core/variant.h>
-#include "except.h"
 #include "type.h"
 
 namespace Msp {
@@ -47,9 +39,6 @@ typedef std::vector<Value> ValueArray __attribute__((deprecated));
 template<typename T>
 inline T Value::get_() const
 {
-       if(sig!=TypeInfo<T>::signature)
-               throw TypeError("Type mismatch");
-
        return data.value<typename TypeInfo<T>::Store>();
 }
 
@@ -58,10 +47,8 @@ inline FloatType::Store Value::get_<FloatType::Store>() const
 {
        if(sig==IntType::signature)
                return data.value<IntType::Store>();
-       else if(sig!=FloatType::signature)
-               throw TypeError("Type mismatch");
-
-       return data.value<FloatType::Store>();
+       else
+               return data.value<FloatType::Store>();
 }
 
 } // namespace DataFile