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
84617bbb
Commit
84617bbb
authored
Jun 30, 2013
by
Anton Bukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made skipWhile_i more lazy
parent
23f54ad6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
boolinq.h
boolinq/boolinq.h
+12
-13
No files found.
boolinq/boolinq.h
View file @
84617bbb
...
...
@@ -190,22 +190,21 @@ namespace boolinq
return
where_i
([
=
](
T
,
int
i
){
return
i
>=
count
;});
}
LinqObj
<
TE
>
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
{
auto
enumerator
=
_enumerator
;
try
{
int
i
=
0
;
while
(
predicate
(
TE
(
enumerator
).
nextObject
(),
i
++
))
enumerator
.
nextObject
();
}
catch
(
EnumeratorEndException
&
){}
return
enumerator
;
return
Enumerator
<
T
,
std
::
pair
<
TE
,
int
>
>
([
=
](
std
::
pair
<
TE
,
int
>
&
pair
)
->
T
{
if
(
pair
.
second
!=
0
)
return
pair
.
first
.
nextObject
();
T
object
;
do
object
=
pair
.
first
.
nextObject
();
while
(
predicate
(
object
,
pair
.
second
++
));
return
object
;
},
std
::
make_pair
(
_enumerator
,
0
));
}
LinqObj
<
TE
>
skipWhile
(
std
::
function
<
bool
(
T
)
>
predicate
)
const
LinqObj
<
Enumerator
<
T
,
std
::
pair
<
TE
,
int
>
>
>
skipWhile
(
std
::
function
<
bool
(
T
)
>
predicate
)
const
{
return
skipWhile_i
([
=
](
T
t
,
int
/*i*/
){
return
predicate
(
t
);});
}
...
...
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