]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/variant.h
Use nullptr instead of 0 for pointers
[libs/core.git] / source / core / variant.h
index 2e9caaf9b79440bacff303975a208321f6cdcd22..443befb481620b4242e178a4b377192179af1adc 100644 (file)
@@ -50,13 +50,13 @@ private:
                { return false; }
        };
 
-       StoreBase *store = 0;
+       StoreBase *store = nullptr;
 
 public:
        Variant() = default;
        template<typename T>
        Variant(const T &v): store(new Store<typename std::remove_cv<T>::type>(v)) { }
-       Variant(const Variant &v): store(v.store ? v.store->clone() : 0) { }
+       Variant(const Variant &v): store(v.store ? v.store->clone() : nullptr) { }
        ~Variant() { delete store; }
 
        template<typename T>
@@ -70,7 +70,7 @@ public:
        Variant &operator=(const Variant &v)
        {
                delete store;
-               store = (v.store ? v.store->clone() : 0);
+               store = (v.store ? v.store->clone() : nullptr);
                return *this;
        }
 
@@ -101,7 +101,7 @@ public:
        template<typename T>
        bool check_type() const
        {
-               return dynamic_cast<Store<typename std::remove_cv<T>::type> *>(store)!=0;
+               return dynamic_cast<Store<typename std::remove_cv<T>::type> *>(store);
        }
 
        bool check_same_type(const Variant &v) const