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
1abeeed1
Commit
1abeeed1
authored
Jun 28, 2019
by
Anton Bukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove C++14 auto argument type from lambda
parent
b0302f7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
boolinq.h
include/boolinq/boolinq.h
+15
-15
No files found.
include/boolinq/boolinq.h
View file @
1abeeed1
...
@@ -73,7 +73,7 @@ namespace boolinq {
...
@@ -73,7 +73,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqIndex
<
S
,
T
>
,
T
>
(
return
Linq
<
LinqIndex
<
S
,
T
>
,
T
>
(
{
*
this
,
0
},
{
*
this
,
0
},
[
filter
](
auto
&
pair
)
{
[
filter
](
LinqIndex
<
S
,
T
>
&
pair
)
{
while
(
true
)
{
while
(
true
)
{
T
ret
=
pair
.
linq
.
next
();
T
ret
=
pair
.
linq
.
next
();
if
(
filter
(
ret
,
pair
.
index
++
))
{
if
(
filter
(
ret
,
pair
.
index
++
))
{
...
@@ -130,7 +130,7 @@ namespace boolinq {
...
@@ -130,7 +130,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqIndexFlag
<
S
,
T
>
,
T
>
(
return
Linq
<
LinqIndexFlag
<
S
,
T
>
,
T
>
(
{
*
this
,
0
,
false
},
{
*
this
,
0
,
false
},
[
predicate
](
auto
&
tuple
)
{
[
predicate
](
LinqIndexFlag
<
S
,
T
>
&
tuple
)
{
if
(
tuple
.
flag
)
{
if
(
tuple
.
flag
)
{
return
tuple
.
linq
.
next
();
return
tuple
.
linq
.
next
();
}
}
...
@@ -154,7 +154,7 @@ namespace boolinq {
...
@@ -154,7 +154,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqIndex
<
S
,
T
>
,
_TRet
>
(
return
Linq
<
LinqIndex
<
S
,
T
>
,
_TRet
>
(
{
*
this
,
0
},
{
*
this
,
0
},
[
apply
](
auto
&
pair
)
{
[
apply
](
LinqIndex
<
S
,
T
>
&
pair
)
{
return
apply
(
pair
.
linq
.
next
(),
pair
.
index
++
);
return
apply
(
pair
.
linq
.
next
(),
pair
.
index
++
);
}
}
);
);
...
@@ -184,7 +184,7 @@ namespace boolinq {
...
@@ -184,7 +184,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqLinq
<
S
,
T
,
S2
,
T2
>
,
T
>
(
return
Linq
<
LinqLinq
<
S
,
T
,
S2
,
T2
>
,
T
>
(
{
*
this
,
rhs
,
false
},
{
*
this
,
rhs
,
false
},
[](
auto
&
tuple
){
[](
LinqLinq
<
S
,
T
,
S2
,
T2
>
&
tuple
){
if
(
!
tuple
.
flag
)
{
if
(
!
tuple
.
flag
)
{
try
{
try
{
return
tuple
.
first
.
next
();
return
tuple
.
first
.
next
();
...
@@ -210,7 +210,7 @@ namespace boolinq {
...
@@ -210,7 +210,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqCurrentIndexFinished
<
S
,
T
,
_TRet
>
,
typename
_TRet
::
value_type
>
(
return
Linq
<
LinqCurrentIndexFinished
<
S
,
T
,
_TRet
>
,
typename
_TRet
::
value_type
>
(
{
*
this
,
_TRet
(),
0
,
true
},
{
*
this
,
_TRet
(),
0
,
true
},
[
apply
](
auto
&
tuple
)
{
[
apply
](
LinqCurrentIndexFinished
<
S
,
T
,
_TRet
>
&
tuple
)
{
while
(
true
)
{
while
(
true
)
{
if
(
tuple
.
finished
)
{
if
(
tuple
.
finished
)
{
tuple
.
current
=
apply
(
tuple
.
linq
.
next
(),
tuple
.
index
++
);
tuple
.
current
=
apply
(
tuple
.
linq
.
next
(),
tuple
.
index
++
);
...
@@ -245,7 +245,7 @@ namespace boolinq {
...
@@ -245,7 +245,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqUnorderedSet
<
S
,
T
,
_TRet
>
,
T
>
(
return
Linq
<
LinqUnorderedSet
<
S
,
T
,
_TRet
>
,
T
>
(
{
*
this
,
std
::
unordered_set
<
_TRet
>
()},
{
*
this
,
std
::
unordered_set
<
_TRet
>
()},
[
transform
](
auto
&
tuple
)
{
[
transform
](
LinqUnorderedSet
<
S
,
T
,
_TRet
>
&
tuple
)
{
while
(
true
)
{
while
(
true
)
{
T
value
=
tuple
.
linq
.
next
();
T
value
=
tuple
.
linq
.
next
();
if
(
tuple
.
set
.
insert
(
transform
(
value
)).
second
)
{
if
(
tuple
.
set
.
insert
(
transform
(
value
)).
second
)
{
...
@@ -279,7 +279,7 @@ namespace boolinq {
...
@@ -279,7 +279,7 @@ namespace boolinq {
return
Linq
<
StdVectorAndIterator
<
T
>
,
T
>
(
return
Linq
<
StdVectorAndIterator
<
T
>
,
T
>
(
{
items
,
TIter
()},
{
items
,
TIter
()},
[](
auto
&
tuple
)
{
[](
StdVectorAndIterator
<
T
>
&
tuple
)
{
if
(
tuple
.
it
==
TIter
())
{
if
(
tuple
.
it
==
TIter
())
{
tuple
.
it
=
tuple
.
vec
.
begin
();
tuple
.
it
=
tuple
.
vec
.
begin
();
}
}
...
@@ -310,7 +310,7 @@ namespace boolinq {
...
@@ -310,7 +310,7 @@ namespace boolinq {
return
Linq
<
StdListAndReverseIterator
<
T
>
,
T
>
(
return
Linq
<
StdListAndReverseIterator
<
T
>
,
T
>
(
{
items
,
TIter
()},
{
items
,
TIter
()},
[](
auto
&
tuple
)
{
[](
StdListAndReverseIterator
<
T
>
&
tuple
)
{
if
(
tuple
.
it
==
TIter
())
{
if
(
tuple
.
it
==
TIter
())
{
tuple
.
it
=
tuple
.
list
.
rbegin
();
tuple
.
it
=
tuple
.
list
.
rbegin
();
}
}
...
@@ -583,7 +583,7 @@ namespace boolinq {
...
@@ -583,7 +583,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqBytesBitsValueIndex
<
S
,
T
>
,
int
>
(
return
Linq
<
LinqBytesBitsValueIndex
<
S
,
T
>
,
int
>
(
{
*
this
,
direction
,
BitsHighToLow
,
T
(),
sizeof
(
T
)},
{
*
this
,
direction
,
BitsHighToLow
,
T
(),
sizeof
(
T
)},
[](
auto
&
tuple
)
{
[](
LinqBytesBitsValueIndex
<
S
,
T
>
&
tuple
)
{
if
(
tuple
.
index
==
sizeof
(
T
))
{
if
(
tuple
.
index
==
sizeof
(
T
))
{
tuple
.
value
=
tuple
.
linq
.
next
();
tuple
.
value
=
tuple
.
linq
.
next
();
tuple
.
index
=
0
;
tuple
.
index
=
0
;
...
@@ -607,7 +607,7 @@ namespace boolinq {
...
@@ -607,7 +607,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqBytesBitsValueIndex
<
S
,
T
>
,
TRet
>
(
return
Linq
<
LinqBytesBitsValueIndex
<
S
,
T
>
,
TRet
>
(
{
*
this
,
direction
,
BitsHighToLow
,
T
(),
0
},
{
*
this
,
direction
,
BitsHighToLow
,
T
(),
0
},
[](
auto
&
tuple
)
{
[](
LinqBytesBitsValueIndex
<
S
,
T
>
&
tuple
)
{
TRet
value
;
TRet
value
;
uint8_t
*
ptr
=
reinterpret_cast
<
uint8_t
*>
(
&
value
);
uint8_t
*
ptr
=
reinterpret_cast
<
uint8_t
*>
(
&
value
);
...
@@ -629,7 +629,7 @@ namespace boolinq {
...
@@ -629,7 +629,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqBytesBitsValueIndex
<
S
,
T
>
,
int
>
(
return
Linq
<
LinqBytesBitsValueIndex
<
S
,
T
>
,
int
>
(
{
*
this
,
bytesDir
,
bitsDir
,
T
(),
sizeof
(
T
)},
{
*
this
,
bytesDir
,
bitsDir
,
T
(),
sizeof
(
T
)},
[](
auto
&
tuple
)
{
[](
LinqBytesBitsValueIndex
<
S
,
T
>
&
tuple
)
{
if
(
tuple
.
index
==
sizeof
(
T
))
{
if
(
tuple
.
index
==
sizeof
(
T
))
{
tuple
.
value
=
tuple
.
linq
.
next
();
tuple
.
value
=
tuple
.
linq
.
next
();
tuple
.
index
=
0
;
tuple
.
index
=
0
;
...
@@ -658,7 +658,7 @@ namespace boolinq {
...
@@ -658,7 +658,7 @@ namespace boolinq {
{
{
return
Linq
<
LinqBytesBitsValueIndex
<
S
,
T
>
,
TRet
>
(
return
Linq
<
LinqBytesBitsValueIndex
<
S
,
T
>
,
TRet
>
(
{
*
this
,
bytesDir
,
bitsDir
,
T
(),
0
},
{
*
this
,
bytesDir
,
bitsDir
,
T
(),
0
},
[](
auto
&
tuple
)
{
[](
LinqBytesBitsValueIndex
<
S
,
T
>
&
tuple
)
{
TRet
value
;
TRet
value
;
uint8_t
*
ptr
=
reinterpret_cast
<
uint8_t
*>
(
&
value
);
uint8_t
*
ptr
=
reinterpret_cast
<
uint8_t
*>
(
&
value
);
...
@@ -703,7 +703,7 @@ namespace boolinq {
...
@@ -703,7 +703,7 @@ namespace boolinq {
{
{
return
Linq
<
std
::
pair
<
T
,
T
>
,
typename
std
::
iterator_traits
<
T
>::
value_type
>
(
return
Linq
<
std
::
pair
<
T
,
T
>
,
typename
std
::
iterator_traits
<
T
>::
value_type
>
(
{
begin
,
end
},
{
begin
,
end
},
[](
auto
&
pair
)
{
[](
std
::
pair
<
T
,
T
>
&
pair
)
{
if
(
pair
.
first
==
pair
.
second
)
{
if
(
pair
.
first
==
pair
.
second
)
{
throw
LinqEndException
();
throw
LinqEndException
();
}
}
...
@@ -767,7 +767,7 @@ namespace boolinq {
...
@@ -767,7 +767,7 @@ namespace boolinq {
Linq
<
std
::
pair
<
T
,
int
>
,
T
>
repeat
(
T
value
,
int
count
)
{
Linq
<
std
::
pair
<
T
,
int
>
,
T
>
repeat
(
T
value
,
int
count
)
{
return
Linq
<
std
::
pair
<
T
,
int
>
,
T
>
(
return
Linq
<
std
::
pair
<
T
,
int
>
,
T
>
(
{
value
,
count
},
{
value
,
count
},
[](
auto
&
pair
)
{
[](
std
::
pair
<
T
,
int
>
&
pair
)
{
if
(
pair
.
second
>
0
)
{
if
(
pair
.
second
>
0
)
{
pair
.
second
--
;
pair
.
second
--
;
return
pair
.
first
;
return
pair
.
first
;
...
@@ -781,7 +781,7 @@ namespace boolinq {
...
@@ -781,7 +781,7 @@ namespace boolinq {
Linq
<
std
::
pair
<
std
::
pair
<
T
,
T
>
,
T
>
,
T
>
range
(
T
start
,
T
end
,
T
step
)
{
Linq
<
std
::
pair
<
std
::
pair
<
T
,
T
>
,
T
>
,
T
>
range
(
T
start
,
T
end
,
T
step
)
{
return
Linq
<
std
::
pair
<
std
::
pair
<
T
,
T
>
,
T
>
,
T
>
(
return
Linq
<
std
::
pair
<
std
::
pair
<
T
,
T
>
,
T
>
,
T
>
(
{{
start
,
end
},
step
},
{{
start
,
end
},
step
},
[](
auto
&
tuple
)
{
[](
std
::
pair
<
std
::
pair
<
T
,
T
>
,
T
>
&
tuple
)
{
if
(
tuple
.
first
.
first
<
tuple
.
first
.
second
)
{
if
(
tuple
.
first
.
first
<
tuple
.
first
.
second
)
{
return
*
(
tuple
.
first
.
first
+=
tuple
.
second
);
return
*
(
tuple
.
first
.
first
+=
tuple
.
second
);
}
}
...
...
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