Skip to content
GitLab
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
435013ea
Commit
435013ea
authored
Jun 07, 2010
by
Mark Olesen
Browse files
ENH: consistency with DynamicList - add append(const T&) to List
parent
e5e76840
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H
View file @
435013ea
...
...
@@ -310,7 +310,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
const
T
&
t
)
{
label
elemI
=
List
<
T
>::
size
();
const
label
elemI
=
List
<
T
>::
size
();
setSize
(
elemI
+
1
);
this
->
operator
[](
elemI
)
=
t
;
...
...
@@ -361,7 +361,7 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
template
<
class
T
,
unsigned
SizeInc
,
unsigned
SizeMult
,
unsigned
SizeDiv
>
inline
T
Foam
::
DynamicList
<
T
,
SizeInc
,
SizeMult
,
SizeDiv
>::
remove
()
{
label
elemI
=
List
<
T
>::
size
()
-
1
;
const
label
elemI
=
List
<
T
>::
size
()
-
1
;
if
(
elemI
<
0
)
{
...
...
src/OpenFOAM/containers/Lists/List/List.H
View file @
435013ea
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -180,6 +180,9 @@ public:
//- Clear the list, i.e. set size to zero.
void
clear
();
//- Append an element at the end of the list
inline
void
append
(
const
T
&
);
//- Append a List at the end of this list
inline
void
append
(
const
UList
<
T
>&
);
...
...
src/OpenFOAM/containers/Lists/List/ListI.H
View file @
435013ea
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-200
9
OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-20
1
0 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -93,6 +93,13 @@ inline Foam::Xfer<Foam::List<T> > Foam::List<T>::xfer()
}
template
<
class
T
>
inline
void
Foam
::
List
<
T
>::
append
(
const
T
&
t
)
{
setSize
(
size
()
+
1
,
t
);
}
template
<
class
T
>
inline
void
Foam
::
List
<
T
>::
append
(
const
UList
<
T
>&
lst
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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