Core: Explicit destructor notation fixed

git-svn-id: svn://ultimatepp.org/upp/trunk@11861 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2018-03-22 10:44:07 +00:00
parent 6119e7719f
commit 7800c43343
6 changed files with 8 additions and 8 deletions

View file

@ -35,8 +35,8 @@ public:
T& Tail() { ASSERT(items > 0); return vector[EI()]; }
const T& Head() const { ASSERT(items > 0); return vector[start]; }
const T& Tail() const { ASSERT(items > 0); return vector[EI()]; }
void DropHead() { (&Head())->T::~T(); items--; start = Ix(1); }
void DropTail() { (&Tail())->T::~T(); items--; }
void DropHead() { (&Head())->~T(); items--; start = Ix(1); }
void DropTail() { (&Tail())->~T(); items--; }
T PopHead() { T x = Head(); DropHead(); return x; }
T PopTail() { T x = Tail(); DropTail(); return x; }
void DropHead(int n) { while(n-- > 0) BiVector<T>::DropHead(); }

View file

@ -155,6 +155,6 @@ T *tiny_new(Args... args)
template <class T>
void tiny_delete(T *ptr)
{
ptr->T::~T();
ptr->~T();
TinyFree(sizeof(T), ptr);
}

View file

@ -256,7 +256,7 @@ void Mitor<T>::Clear()
if(count > 2)
delete vector;
if(count && count != 2)
((T*)elem0)->T::~T();
((T*)elem0)->~T();
count = 0;
}

View file

@ -210,7 +210,7 @@ class DeepCopyOption : public B {
public:
#ifdef DEPRECATED
friend T& operator<<=(T& dest, const T& src)
{ if(&dest != &src) { (&dest)->T::~T(); ::new(&dest) T(src, 1); } return dest; }
{ if(&dest != &src) { (&dest)->~T(); ::new(&dest) T(src, 1); } return dest; }
#endif
friend T do_clone(const T& src) { T c(src, 1); return c; }
};
@ -220,7 +220,7 @@ class MoveableAndDeepCopyOption : public B {
friend void AssertMoveable0(T *) {}
#ifdef DEPRECATED
friend T& operator<<=(T& dest, const T& src)
{ if(&dest != &src) { (&dest)->T::~T(); ::new(&dest) T(src, 1); } return dest; }
{ if(&dest != &src) { (&dest)->~T(); ::new(&dest) T(src, 1); } return dest; }
#endif
friend T clone(const T& src) { T c(src, 1); return c; }
};

View file

@ -25,7 +25,7 @@ template <class T>
inline void Destroy(T *t, const T *end)
{
while(t != end) {
t->T::~T();
t->~T();
t++;
}
}

View file

@ -240,7 +240,7 @@ void Vector<T>::Remove(const int *sorted_list, int n)
for(;;) {
ASSERT(pos < items);
if(pos == *sorted_list) {
(vector + pos)->T::~T();
(vector + pos)->~T();
pos++;
sorted_list++;
if(--n == 0) break;