Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
f46de13c
Commit
f46de13c
authored
Dec 12, 2012
by
laurence
Browse files
BUG: Reinstate reverse() function in UList
parent
cc1a3e58
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/containers/Lists/UList/UList.H
View file @
f46de13c
...
...
@@ -348,6 +348,10 @@ void stableSort(UList<T>&, const Cmp&);
template
<
class
T
>
void
shuffle
(
UList
<
T
>&
);
// Reverse the first n elements of the list
template
<
class
T
>
inline
void
reverse
(
UList
<
T
>&
,
const
label
n
);
// Reverse all the elements of the list
template
<
class
T
>
inline
void
reverse
(
UList
<
T
>&
);
...
...
src/OpenFOAM/containers/Lists/UList/UListI.H
View file @
f46de13c
...
...
@@ -25,7 +25,6 @@ License
#include
"error.H"
#include
"pTraits.H"
#include
"ListOps.H"
#include
"Swap.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
...
...
@@ -319,10 +318,19 @@ inline bool Foam::UList<T>::empty() const
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template
<
class
T
>
inline
void
Foam
::
reverse
(
UList
<
T
>&
ul
,
const
label
n
)
{
for
(
int
i
=
0
;
i
<
n
/
2
;
i
++
)
{
Swap
(
ul
[
i
],
ul
[
n
-
1
-
i
]);
}
}
template
<
class
T
>
inline
void
Foam
::
reverse
(
UList
<
T
>&
ul
)
{
inplaceReverseList
(
ul
);
reverse
(
ul
,
ul
.
size
()
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment