mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: qualify Swap with Foam:: prefix (visibility)
- drop unnecessary Foam::Swap specializations when MoveConstructible
and MoveAssignable already apply. The explicit redirect to swap
member functions was needed before proper move semantics where
added.
Removed specializations: autoPtr, refPtr, tmp, UList.
Retained specialization: DynamicList, FixedList.
Special handling for DynamicList is only to accommodate dissimilar
sizing template parameters (which probably doesn't occur in
practice).
Special handling for FixedList to apply element-wise swapping.
- use std::swap for primitives. No need to mask with Foam::Swap wrapper
This commit is contained in:
@ -254,8 +254,8 @@ int main(int argc, char *argv[])
|
||||
Info<< "mem: "
|
||||
<< name(list1.data()) << " " << name(list2.data()) << nl;
|
||||
|
||||
Swap(list1, list2);
|
||||
Info<< "The Swap() function" << nl;
|
||||
Foam::Swap(list1, list2);
|
||||
Info<< "Foam::Swap() function" << nl;
|
||||
Info<< "list1: " << list1 << nl
|
||||
<< "list2: " << list2 << nl;
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ void runSwapTest
|
||||
|
||||
for (label iLoop = 0; iLoop < nLoops; ++iLoop)
|
||||
{
|
||||
Swap(list1, list2);
|
||||
Foam::Swap(list1, list2);
|
||||
}
|
||||
|
||||
Info<< "output 1: " << list1.first() << nl;
|
||||
|
||||
@ -366,8 +366,8 @@ int main()
|
||||
Info<< nl << "input values" << nl;
|
||||
Info<<"table1 = " << table1 << nl <<"table2 = " << table2 << nl;
|
||||
|
||||
Info<<"global Swap function" << nl;
|
||||
Swap(table1, table2);
|
||||
Info<<"std::swap function" << nl;
|
||||
std::swap(table1, table2);
|
||||
Info<<"table1 = " << table1 << nl <<"table2 = " << table2 << nl;
|
||||
|
||||
Info<<"swap method" << nl;
|
||||
|
||||
Reference in New Issue
Block a user