Browse Source

cacheset: Fix -Wdeprecated-copy warnings

Remove the operator= from Container_iterator, as it was basically
just the default anyway, and add copy constructors to *Interface
that match their operator=.

Tried adding copy constructor to Container_iterator, but that only
made things worse.
tags/devuan/2.0.1+devuan1
Julian Andres Klode 8 months ago
parent
commit
62ca61ff4a
3 changed files with 10 additions and 4 deletions
  1. +4
    -0
      apt-pkg/cacheset.cc
  2. +4
    -4
      apt-pkg/cacheset.h
  3. +2
    -0
      debian/libapt-pkg6.0.symbols

+ 4
- 0
apt-pkg/cacheset.cc View File

@@ -915,6 +915,7 @@ CacheSetHelper::CacheSetHelper(bool const ShowError, GlobalError::MsgType ErrorT
CacheSetHelper::~CacheSetHelper() {}

PackageContainerInterface::PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN), d(NULL) {}
PackageContainerInterface::PackageContainerInterface(PackageContainerInterface const &by) : PackageContainerInterface() { *this = by; }
PackageContainerInterface::PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by), d(NULL) {}
PackageContainerInterface& PackageContainerInterface::operator=(PackageContainerInterface const &other) {
if (this != &other)
@@ -928,6 +929,9 @@ PackageUniverse::PackageUniverse(pkgCacheFile * const Owner) : _cont(Owner->GetP
PackageUniverse::~PackageUniverse() {}

VersionContainerInterface::VersionContainerInterface() : d(NULL) {}
VersionContainerInterface::VersionContainerInterface(VersionContainerInterface const &other) : VersionContainerInterface() {
*this = other;
};
VersionContainerInterface& VersionContainerInterface::operator=(VersionContainerInterface const &) {
return *this;
}


+ 4
- 4
apt-pkg/cacheset.h View File

@@ -201,7 +201,7 @@ template<typename Interface, typename Master, typename iterator_type, typename c
protected:
container_iterator _iter;
public:
explicit Container_iterator_base(container_iterator i) : _iter(i) {}
explicit Container_iterator_base(container_iterator const &i) : _iter(i) {}
inline container_value operator*(void) const { return static_cast<iterator_type const*>(this)->getType(); };
operator container_iterator(void) const { return _iter; }
inline iterator_type& operator++() { ++_iter; return static_cast<iterator_type&>(*this); }
@@ -241,12 +241,10 @@ template<class Interface, class Container, class Master> class Container_iterato
typedef Container_iterator<Interface, Container, Master> iterator_type;
typedef typename Container::iterator container_iterator;
public:
explicit Container_iterator(container_iterator i) :
explicit Container_iterator(container_iterator const &i) :
Container_iterator_base<Interface, Master, iterator_type, container_iterator, typename Container::value_type>(i) {}

operator typename Master::const_iterator() { return typename Master::const_iterator(this->_iter); }
inline iterator_type& operator=(iterator_type const &i) { this->_iter = i._iter; return static_cast<iterator_type&>(*this); }
inline iterator_type& operator=(container_iterator const &i) { this->_iter = i; return static_cast<iterator_type&>(*this); }
inline typename Container::iterator::reference operator*(void) const { return *this->_iter; }

inline typename Container::value_type getType(void) const { return *this->_iter; }
@@ -325,6 +323,7 @@ public:
CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; }
PackageContainerInterface();
explicit PackageContainerInterface(CacheSetHelper::PkgSelector const by);
PackageContainerInterface(PackageContainerInterface const &by);
PackageContainerInterface& operator=(PackageContainerInterface const &other);
virtual ~PackageContainerInterface();

@@ -762,6 +761,7 @@ public:
CacheSetHelper &helper);

VersionContainerInterface();
VersionContainerInterface(VersionContainerInterface const &other);
VersionContainerInterface& operator=(VersionContainerInterface const &other);
virtual ~VersionContainerInterface();
private:


+ 2
- 0
debian/libapt-pkg6.0.symbols View File

@@ -1018,6 +1018,7 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER#
(c++)"APT::Configuration::getLanguages[abi:cxx11](bool const&, bool const&, char const**)@APTPKG_6.0" 1.1~exp9
(c++)"APT::PackageContainerInterface::operator=(APT::PackageContainerInterface const&)@APTPKG_6.0" 1.1~exp9
(c++)"APT::PackageContainerInterface::PackageContainerInterface(APT::CacheSetHelper::PkgSelector)@APTPKG_6.0" 1.1~exp9
(c++)"APT::PackageContainerInterface::PackageContainerInterface(APT::PackageContainerInterface const&)@APTPKG_6.0" 1.9.11~
(c++)"APT::PackageContainerInterface::~PackageContainerInterface()@APTPKG_6.0" 1.1~exp9
(c++)"APT::PackageContainerInterface::PackageContainerInterface()@APTPKG_6.0" 1.1~exp9
(c++)"APT::PackageUniverse::~PackageUniverse()@APTPKG_6.0" 1.1~exp9
@@ -1028,6 +1029,7 @@ libapt-pkg.so.6.0 libapt-pkg6.0 #MINVER#
(c++)"APT::VersionContainerInterface::operator=(APT::VersionContainerInterface const&)@APTPKG_6.0" 1.1~exp9
(c++)"APT::VersionContainerInterface::~VersionContainerInterface()@APTPKG_6.0" 1.1~exp9
(c++)"APT::VersionContainerInterface::VersionContainerInterface()@APTPKG_6.0" 1.1~exp9
(c++)"APT::VersionContainerInterface::VersionContainerInterface(APT::VersionContainerInterface const&)@APTPKG_6.0" 1.9.11~
(c++)"CommandLine::CommandLine()@APTPKG_6.0" 1.1~exp9
(c++)"Configuration::FindVector(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const@APTPKG_6.0" 1.1~exp9
(c++)"debDebianSourceDirIndex::GetType() const@APTPKG_6.0" 1.1~exp9


Loading…
Cancel
Save