template<typename U>
RefPtr<T> &RefPtr<T>::assign(const RefPtr<U> &p)
{
+ if(static_cast<const void *>(&p)==this)
+ return *this;
+
decref();
data = p.data;
counts = p.counts;
template<typename U>
WeakPtr<T> &WeakPtr<T>::assign(const WeakPtr<U> &p)
{
+ if(&p==this)
+ return *this;
+
decref();
data = p.get();
counts = (data ? p.counts : nullptr);
Variant &operator=(const Variant &v)
{
+ if(&v==this)
+ return *this;
+
delete store;
store = (v.store ? v.store->clone() : nullptr);
return *this;
Stat &Stat::operator=(const Stat &other)
{
+ if(&other==this)
+ return *this;
+
exists = other.exists;
type = other.type;
size = other.size;
Formatter &Formatter::operator=(const Formatter &other)
{
+ if(&other==this)
+ return *this;
+
fmt = other.fmt;
pos = fmt.begin()+(other.pos-other.fmt.begin());
result = other.result;