C++17 modernization: add [[nodiscard]] to operator==()
parent
cb7bd0778b
commit
4683b9aeb6
|
@ -240,7 +240,7 @@ public:
|
|||
real = r;
|
||||
}
|
||||
virtual ~_matrix_iter() = default;
|
||||
bool
|
||||
[[nodiscard]] bool
|
||||
operator==(const _Self& it) const
|
||||
{
|
||||
return ptr == it.ptr;
|
||||
|
|
|
@ -211,7 +211,7 @@ public:
|
|||
return s;
|
||||
}
|
||||
// Exact equality
|
||||
bool operator==(const ConstVector& y) const;
|
||||
[[nodiscard]] bool operator==(const ConstVector& y) const;
|
||||
// Lexicographic ordering
|
||||
[[nodiscard]] std::partial_ordering operator<=>(const ConstVector& y) const;
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
OrdSequence() : data()
|
||||
{
|
||||
}
|
||||
bool operator==(const OrdSequence& s) const;
|
||||
[[nodiscard]] bool operator==(const OrdSequence& s) const;
|
||||
int operator[](int i) const;
|
||||
[[nodiscard]] std::partial_ordering operator<=>(const OrdSequence& s) const;
|
||||
[[nodiscard]] const std::vector<int>&
|
||||
|
@ -121,7 +121,7 @@ public:
|
|||
// Copy constructor plus gluing i1 and i2 in one class
|
||||
Equivalence(const Equivalence& e, int i1, int i2);
|
||||
|
||||
bool operator==(const Equivalence& e) const;
|
||||
[[nodiscard]] bool operator==(const Equivalence& e) const;
|
||||
[[nodiscard]] int
|
||||
getN() const
|
||||
{
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
// Constructs the tensor dimensions for slicing (see the implementation for details)
|
||||
TensorDimens(const IntSequence& ss, const IntSequence& coor);
|
||||
|
||||
bool
|
||||
[[nodiscard]] bool
|
||||
operator==(const TensorDimens& td) const
|
||||
{
|
||||
return nvs == td.nvs && sym == td.sym;
|
||||
|
|
|
@ -120,7 +120,7 @@ public:
|
|||
if (destroy)
|
||||
delete[] data;
|
||||
}
|
||||
bool operator==(const IntSequence& s) const;
|
||||
[[nodiscard]] bool operator==(const IntSequence& s) const;
|
||||
int&
|
||||
operator[](int i)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright © 2004 Ondra Kamenik
|
||||
* Copyright © 2019-2023 Dynare Team
|
||||
* Copyright © 2019-2024 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
|
||||
KronProdDimens& operator=(const KronProdDimens& kd) = default;
|
||||
KronProdDimens& operator=(KronProdDimens&& kd) = default;
|
||||
bool
|
||||
[[nodiscard]] bool
|
||||
operator==(const KronProdDimens& kd) const
|
||||
{
|
||||
return rows == kd.rows && cols == kd.cols;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright © 2004 Ondra Kamenik
|
||||
* Copyright © 2019-2023 Dynare Team
|
||||
* Copyright © 2019-2024 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
Permutation(const Permutation& p, int i) : permap(p.permap.insert(p.size(), i))
|
||||
{
|
||||
}
|
||||
bool
|
||||
[[nodiscard]] bool
|
||||
operator==(const Permutation& p) const
|
||||
{
|
||||
return permap == p.permap;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright © 2004 Ondra Kamenik
|
||||
* Copyright © 2019-2023 Dynare Team
|
||||
* Copyright © 2019-2024 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -115,7 +115,7 @@ public:
|
|||
{
|
||||
per.apply(nvmax);
|
||||
}
|
||||
bool
|
||||
[[nodiscard]] bool
|
||||
operator==(const PerTensorDimens& td) const
|
||||
{
|
||||
return TensorDimens::operator==(td) && per == td.per;
|
||||
|
|
|
@ -126,7 +126,7 @@ public:
|
|||
{
|
||||
return run;
|
||||
}
|
||||
bool
|
||||
[[nodiscard]] bool
|
||||
operator==(const symiterator& it)
|
||||
{
|
||||
return dim == it.dim && run == it.run;
|
||||
|
|
|
@ -150,7 +150,7 @@ public:
|
|||
{
|
||||
return offset;
|
||||
}
|
||||
bool
|
||||
[[nodiscard]] bool
|
||||
operator==(const index& n) const
|
||||
{
|
||||
return offset == n.offset;
|
||||
|
|
Loading…
Reference in New Issue