summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/plib/plists.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/plib/plists.h')
-rwxr-xr-xsrc/lib/netlist/plib/plists.h28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/lib/netlist/plib/plists.h b/src/lib/netlist/plib/plists.h
index 328f0b1ad23..19c34717126 100755
--- a/src/lib/netlist/plib/plists.h
+++ b/src/lib/netlist/plib/plists.h
@@ -172,7 +172,7 @@ namespace plib {
/// \brief a simple linked list.
///
- /// The list allows insertions deletions whilst being processed.
+ /// The list allows insertions and deletions whilst being processed.
///
template <class LC>
class linkedlist_t
@@ -187,10 +187,10 @@ namespace plib {
constexpr element_t() : m_next(nullptr), m_prev(nullptr) {}
~element_t() noexcept = default;
- PCOPYASSIGNMOVE(element_t, delete)
+ PCOPYASSIGNMOVE(element_t, default)
- constexpr LC *next() const noexcept { return m_next; }
- constexpr LC *prev() const noexcept { return m_prev; }
+ constexpr LC * &next() noexcept { return m_next; }
+ constexpr LC * &prev() noexcept { return m_prev; }
private:
LC * m_next;
LC * m_prev;
@@ -202,22 +202,14 @@ namespace plib {
LC* p;
public:
explicit constexpr iter_t(LC* x) noexcept : p(x) { }
- constexpr iter_t(iter_t &rhs) noexcept : p(rhs.p) { }
- iter_t(iter_t &&rhs) noexcept { std::swap(*this, rhs); }
+ constexpr iter_t(const iter_t &rhs) noexcept = default;
+ iter_t(iter_t &&rhs) noexcept = default;
- iter_t& operator=(const iter_t &rhs) noexcept // NOLINT(bugprone-unhandled-self-assignment, cert-oop54-cpp)
- {
- if (this == &rhs)
- return *this;
-
- p = rhs.p;
- return *this;
- }
-
- iter_t& operator=(iter_t &&rhs) noexcept { std::swap(*this, rhs); return *this; }
- ~iter_t() = default;
+ iter_t& operator=(const iter_t &rhs) noexcept = default;
+ iter_t& operator=(iter_t &&rhs) noexcept = default;
+ ~iter_t() noexcept = default;
- iter_t& operator++() noexcept { p = p->next();return *this; }
+ iter_t& operator++() noexcept { p = p->next(); return *this; }
// NOLINTNEXTLINE(cert-dcl21-cpp)
iter_t operator++(int) & noexcept { const iter_t tmp(*this); operator++(); return tmp; }