]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/variant.h
Fix a shadowed variable warning
[libs/core.git] / source / core / variant.h
index 04c372b54ef305205e6f38e661a408eab75d18d6..60501f3308e0c36e54ab4c5bafac4379f279db58 100644 (file)
@@ -61,9 +61,14 @@ public:
        const T &value() const { return const_cast<Variant *>(this)->get<T>(); }
 
        template<typename T>
-       bool check_type() const { return funcs==get_functions<typename std::remove_cv<T>::type>(); }
+       bool has_type() const { return funcs==get_functions<typename std::remove_cv<T>::type>(); }
 
-       bool check_same_type(const Variant &v) const { return (funcs && funcs==v.funcs); }
+       bool has_same_type(const Variant &v) const { return (funcs && funcs==v.funcs); }
+
+       template<typename T>
+       DEPRECATED bool check_type() const { return has_type<T>(); }
+
+       DEPRECATED bool check_same_type(const Variant &v) const { return has_same_type(v); }
 
        bool operator==(const Variant &v) const { return (has_same_type(v) && funcs->compare(storage, v.storage)); }
        bool operator!=(const Variant &v) const { return !(operator==(v)); }
@@ -126,13 +131,13 @@ private:
 
 
 template<typename T>
-inline void Variant::assign(const T &value)
+inline void Variant::assign(const T &v)
 {
        if(funcs)
                funcs->destroy(storage);
 
        funcs = get_functions<typename std::remove_cv<T>::type>();
-       create(storage, value);
+       create(storage, v);
 }
 
 inline void Variant::copy_from(const Variant &v)