Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
boolinq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
boolinq
Commits
a42067d7
Commit
a42067d7
authored
Jul 03, 2013
by
Anton Bukov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3 from jell0nek/master
skipWhile_i improvements
parents
84617bbb
5a1c6f99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
SkipWhileRangeTest.cpp
boolinq/SkipWhileRangeTest.cpp
+0
-2
boolinq.h
boolinq/boolinq.h
+11
-10
No files found.
boolinq/SkipWhileRangeTest.cpp
View file @
a42067d7
...
@@ -19,8 +19,6 @@ TEST(SkipWhileRange, ManyToMore)
...
@@ -19,8 +19,6 @@ TEST(SkipWhileRange, ManyToMore)
auto
rng
=
from
(
src
);
auto
rng
=
from
(
src
);
auto
dst
=
rng
.
skipWhile
([](
int
it
){
return
it
<
0
||
it
>
10
;});
auto
dst
=
rng
.
skipWhile
([](
int
it
){
return
it
<
0
||
it
>
10
;});
auto
vec
=
dst
.
toVector
();
CheckRangeEqArray
(
dst
,
ans
);
CheckRangeEqArray
(
dst
,
ans
);
}
}
...
...
boolinq/boolinq.h
View file @
a42067d7
...
@@ -192,16 +192,17 @@ namespace boolinq
...
@@ -192,16 +192,17 @@ namespace boolinq
LinqObj
<
Enumerator
<
T
,
std
::
pair
<
TE
,
int
>
>
>
skipWhile_i
(
std
::
function
<
bool
(
T
,
int
)
>
predicate
)
const
LinqObj
<
Enumerator
<
T
,
std
::
pair
<
TE
,
int
>
>
>
skipWhile_i
(
std
::
function
<
bool
(
T
,
int
)
>
predicate
)
const
{
{
return
Enumerator
<
T
,
std
::
pair
<
TE
,
int
>
>
([
=
](
std
::
pair
<
TE
,
int
>
&
pair
)
->
T
{
return
Enumerator
<
T
,
std
::
pair
<
TE
,
int
>
>
([
=
](
std
::
pair
<
TE
,
int
>
&
pair
)
->
T
{
if
(
pair
.
second
!=
0
)
if
(
pair
.
second
!=
0
)
return
pair
.
first
.
nextObject
();
return
pair
.
first
.
nextObject
();
T
object
;
T
object
;
do
do
object
=
pair
.
first
.
nextObject
();
object
=
pair
.
first
.
nextObject
();
while
(
predicate
(
object
,
pair
.
second
++
));
while
(
predicate
(
object
,
pair
.
second
++
));
return
object
;
},
std
::
make_pair
(
_enumerator
,
0
));
return
object
;
},
std
::
make_pair
(
_enumerator
,
0
));
}
}
LinqObj
<
Enumerator
<
T
,
std
::
pair
<
TE
,
int
>
>
>
skipWhile
(
std
::
function
<
bool
(
T
)
>
predicate
)
const
LinqObj
<
Enumerator
<
T
,
std
::
pair
<
TE
,
int
>
>
>
skipWhile
(
std
::
function
<
bool
(
T
)
>
predicate
)
const
...
...
Write
Preview
Markdown
is supported
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