mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: treat self-assignment as no-op instead of a Fatal (#1473)
- this can help if using std algorithms that return a const reference such as std::min() does.
This commit is contained in:
committed by
Andrew Heather
parent
883752cfb9
commit
b0c88dff58
@ -265,9 +265,9 @@ inline bool Foam::string::match(const std::string& text) const
|
||||
|
||||
inline void Foam::string::swap(std::string& str)
|
||||
{
|
||||
// Self-swapping is a no-op
|
||||
if (this != &str)
|
||||
{
|
||||
// Self-swap is a no-op
|
||||
std::string::swap(str);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user