Skip to content

Commit

Permalink
Merge pull request #12767 from KratosMultiphysics/core/remove-unused-…
Browse files Browse the repository at this point in the history
…members
  • Loading branch information
matekelemen authored Oct 24, 2024
2 parents 2c81c26 + dc4d299 commit 0c5d396
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
25 changes: 14 additions & 11 deletions kratos/containers/global_pointers_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,21 @@ class GlobalPointersVector final
}

/**
* @brief Equality comparison operator to check if two GlobalPointersVector objects are equal.
* @details This function checks if the sizes are equal and then compares the elements for equality
* using the EqualKeyTo() function.
* @param r The GlobalPointersVector to compare with.
* @return True if the containers are equal, false otherwise.
* @brief Equality comparison operator to check if two @å GlobalPointersVector objects are equal.
* @details This function checks if the sizes are equal and then compares the elements using @a operator==.
* @param rRhs The GlobalPointersVector to compare with.
* @return True if the containers have identical sizes and store identical items in the exact same order.
*/
bool operator==(const GlobalPointersVector& r) const // nothrow
{
if (size() != r.size())
return false;
else
return std::equal(mData.begin(), mData.end(), r.mData.begin(), this->EqualKeyTo());
bool operator==(const GlobalPointersVector& rRhs) const noexcept
{
return this->size() == rRhs.size() && std::equal(
mData.begin(),
mData.end(),
rRhs.begin(),
[](const data_type& rLhs, const data_type& rRhs) -> bool {
return rLhs == rRhs;
}
);
}

///@}
Expand Down
24 changes: 14 additions & 10 deletions kratos/containers/pointer_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
// Multi-Physics
//
// License: BSD License
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Pooyan Dadvand
// Riccardo Rossi
//
//
//


Expand Down Expand Up @@ -154,12 +154,16 @@ class PointerVector final
return mData[i];
}

bool operator==( const PointerVector& r ) const // nothrow
bool operator==(const PointerVector& rRhs) const noexcept
{
if( size() != r.size() )
return false;
else
return std::equal(mData.begin(), mData.end(), r.mData.begin(), this->EqualKeyTo());
return this->size() == rRhs.size() && std::equal(
mData.begin(),
mData.end(),
rRhs.begin(),
[](const data_type& rLhs, const data_type& rRhs) -> bool {
return rLhs == rRhs;
}
);
}

///@}
Expand Down Expand Up @@ -278,7 +282,7 @@ class PointerVector final
}

template<class... Args>
void emplace_back(Args&&... args)
void emplace_back(Args&&... args)
{
mData.emplace_back(std::forward<Args>(args)...);
}
Expand Down Expand Up @@ -520,4 +524,4 @@ inline std::ostream& operator << (std::ostream& rOStream,

} // namespace Kratos.

#endif // KRATOS_POINTER_VECTOR_SET_H_INCLUDED defined
#endif // KRATOS_POINTER_VECTOR_SET_H_INCLUDED defined

0 comments on commit 0c5d396

Please sign in to comment.