Drop const assignment operator.

Also, silence cert-oop54-cpp - self-assignment is already handled in
VectorImpl class.

Bug: 289151149
Test: it builds
Change-Id: I8be7714ed53d1515df7cfdf6de6f3c90b3e5cc76
This commit is contained in:
Tomasz Wasilczyk 2023-06-27 16:06:35 -07:00
parent 1477714262
commit aab4105ef6
1 changed files with 12 additions and 24 deletions

View File

@ -67,13 +67,10 @@ public:
virtual ~Vector();
/*! copy operator */
const Vector<TYPE>& operator = (const Vector<TYPE>& rhs) const;
Vector<TYPE>& operator = (const Vector<TYPE>& rhs);
Vector<TYPE>& operator=(const Vector<TYPE>& rhs); // NOLINT(cert-oop54-cpp)
Vector<TYPE>& operator=(const SortedVector<TYPE>& rhs); // NOLINT(cert-oop54-cpp)
const Vector<TYPE>& operator = (const SortedVector<TYPE>& rhs) const;
Vector<TYPE>& operator = (const SortedVector<TYPE>& rhs);
/*
/*
* empty the vector
*/
@ -248,27 +245,18 @@ Vector<TYPE>::~Vector() {
finish_vector();
}
template<class TYPE> inline
Vector<TYPE>& Vector<TYPE>::operator = (const Vector<TYPE>& rhs) {
VectorImpl::operator = (rhs);
template <class TYPE>
inline Vector<TYPE>& Vector<TYPE>::operator=(const Vector<TYPE>& rhs) // NOLINT(cert-oop54-cpp)
{
VectorImpl::operator=(rhs);
return *this;
}
template<class TYPE> inline
const Vector<TYPE>& Vector<TYPE>::operator = (const Vector<TYPE>& rhs) const {
VectorImpl::operator = (static_cast<const VectorImpl&>(rhs));
return *this;
}
template<class TYPE> inline
Vector<TYPE>& Vector<TYPE>::operator = (const SortedVector<TYPE>& rhs) {
VectorImpl::operator = (static_cast<const VectorImpl&>(rhs));
return *this;
}
template<class TYPE> inline
const Vector<TYPE>& Vector<TYPE>::operator = (const SortedVector<TYPE>& rhs) const {
VectorImpl::operator = (rhs);
template <class TYPE>
inline Vector<TYPE>& Vector<TYPE>::operator=(
const SortedVector<TYPE>& rhs) // NOLINT(cert-oop54-cpp)
{
VectorImpl::operator=(static_cast<const VectorImpl&>(rhs));
return *this;
}