Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
6e3e2591
Commit
6e3e2591
authored
Oct 10, 2014
by
Mathieu Giraud
Browse files
core/list_utils.h: make keep_n_first really work
parent
739a4e30
Changes
1
Hide whitespace changes
Inline
Side-by-side
algo/core/list_utils.h
View file @
6e3e2591
...
...
@@ -16,7 +16,7 @@ list<T> keep_n_first(list<T> l, size_t count) {
size_t
i
=
0
;
typename
list
<
T
>::
iterator
it
=
l
.
begin
();
for
(;
it
!=
l
.
end
()
&&
i
<
count
;
it
++
)
count
++
;
i
++
;
return
list
<
T
>
(
l
.
begin
(),
it
);
}
...
...
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