Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
3bd901a5
There was an error fetching the commit references. Please try again later.
Commit
3bd901a5
authored
6 years ago
by
Tomáš Oberhuber
Committed by
Jakub Klinkovský
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added method containsValue to List.
parent
6b7abdc2
No related branches found
No related tags found
1 merge request
!20
Traversers optimizations
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/TNL/Containers/List.h
+8
-1
8 additions, 1 deletion
src/TNL/Containers/List.h
src/TNL/Containers/List_impl.h
+8
-0
8 additions, 0 deletions
src/TNL/Containers/List_impl.h
with
16 additions
and
1 deletion
src/TNL/Containers/List.h
+
8
−
1
View file @
3bd901a5
...
...
@@ -109,6 +109,13 @@ template< class T > class List
template
<
typename
Array
>
void
toArray
(
Array
&
array
);
/***
* \brief Checks if there is an element with value \e v in given array.
*
* \param v Reference to a value.
*/
bool
containsValue
(
const
T
&
v
)
const
;
/// Erases data element at given position.
///
/// \param ind Index of the data element one chooses to remove.
...
...
@@ -146,7 +153,7 @@ template< class T > class List
///
/// \param file Name of file.
bool
DeepLoad
(
File
&
file
);
protected:
/// Pointer to the first element.
ListDataElement
<
T
>*
first
;
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Containers/List_impl.h
+
8
−
0
View file @
3bd901a5
...
...
@@ -207,6 +207,14 @@ void List< T >::toArray( Array& array )
for
(
int
i
=
0
;
i
<
this
->
getSize
();
i
++
)
array
[
i
]
=
(
*
this
)[
i
];
}
template
<
typename
T
>
bool
List
<
T
>::
containsValue
(
const
T
&
v
)
const
{
for
(
int
i
=
0
;
i
<
this
->
getSize
();
i
++
)
if
(
(
*
this
)[
i
]
==
v
)
return
true
;
return
false
;
}
template
<
typename
T
>
void
List
<
T
>::
Erase
(
const
int
&
ind
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment