]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/value.h
Remove the loaded flag from PackSource files
[libs/datafile.git] / source / value.h
index 219b0e42dd5174cf8b5eabecf55df7f5b03b17d5..e2b9fb1c569782fcbc96dc9d687d9b48eb83388d 100644 (file)
@@ -4,7 +4,6 @@
 #include <vector>
 #include <msp/core/meta.h>
 #include <msp/core/variant.h>
-#include "except.h"
 #include "type.h"
 
 namespace Msp {
@@ -26,7 +25,7 @@ public:
        Value(Symbol d): sig(TypeInfo<Symbol>::signature), data(d) { }
 
        template<typename T>
-       typename RemoveReference<T>::Type get() const
+       typename TypeInfo<T>::Load get() const
        { return get_<typename TypeInfo<T>::Store>(); }
 
        char get_signature() const { return sig; }
@@ -40,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>();
 }
 
@@ -51,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