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
968f0bbd
Commit
968f0bbd
authored
Nov 23, 2009
by
mattijs
Browse files
added last() member function
parent
5bb620de
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/containers/Lists/UList/UList.H
View file @
968f0bbd
...
...
@@ -184,6 +184,12 @@ public:
// an out-of-range element returns false without any ill-effects
inline
const
T
&
operator
[](
const
label
)
const
;
//- Return last element of UList.
inline
T
&
last
();
//- Return last element of UList.
inline
const
T
&
last
()
const
;
//- Allow cast to a const List<T>&
inline
operator
const
Foam
::
List
<
T
>&
()
const
;
...
...
src/OpenFOAM/containers/Lists/UList/UListI.H
View file @
968f0bbd
...
...
@@ -114,6 +114,20 @@ inline void Foam::UList<T>::checkIndex(const label i) const
}
template
<
class
T
>
inline
T
&
Foam
::
UList
<
T
>::
last
()
{
return
this
->
operator
[](
this
->
size
()
-
1
);
}
template
<
class
T
>
inline
const
T
&
Foam
::
UList
<
T
>::
last
()
const
{
return
this
->
operator
[](
this
->
size
()
-
1
);
}
template
<
class
T
>
inline
const
T
*
Foam
::
UList
<
T
>::
cdata
()
const
{
...
...
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