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
8f8baff2
Commit
8f8baff2
authored
May 12, 2016
by
Vit Babel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
boolinq: refactor linq-creators
parent
0c21a0ca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
26 deletions
+21
-26
boolinq.h
include/boolinq/boolinq.h
+21
-26
No files found.
include/boolinq/boolinq.h
View file @
8f8baff2
...
...
@@ -757,48 +757,43 @@ namespace boolinq
return
from
<
T
>
(
array
,
array
+
N
);
}
// std::list, vector, dequeue
template
<
template
<
class
,
class
>
class
TV
,
typename
TT
,
typename
TU
>
auto
from
(
const
TV
<
TT
,
TU
>
&
container
)
->
LinqObj
<
Enumerator
<
TT
,
IteratorContainerPair
<
decltype
(
container
.
cbegin
()),
const
TV
<
TT
,
TU
>
>
>
>
template
<
template
<
class
>
class
TV
,
typename
TT
>
auto
from
(
const
TV
<
TT
>
&
container
)
->
decltype
(
from
<
TT
>
(
std
::
begin
(
container
),
std
::
end
(
container
)))
{
typedef
IteratorContainerPair
<
decltype
(
container
.
cbegin
()),
const
TV
<
TT
,
TU
>
>
DataType
;
return
from
<
TT
>
(
std
::
begin
(
container
),
std
::
end
(
container
));
}
return
Enumerator
<
TT
,
DataType
>
([](
DataType
&
pair
){
return
(
pair
.
first
==
pair
.
second
.
cend
())
?
throw
EnumeratorEndException
()
:
*
(
pair
.
first
++
);
},
DataType
(
container
,
[](
const
TV
<
TT
,
TU
>
&
cont
){
return
cont
.
cbegin
();}));
// std::list, std::vector, std::dequeue
template
<
template
<
class
,
class
>
class
TV
,
typename
TT
,
typename
TU
>
auto
from
(
const
TV
<
TT
,
TU
>
&
container
)
->
decltype
(
from
<
TT
>
(
std
::
begin
(
container
),
std
::
end
(
container
)))
{
return
from
<
TT
>
(
std
::
begin
(
container
),
std
::
end
(
container
));
}
// std::set
template
<
template
<
class
,
class
,
class
>
class
TV
,
typename
TT
,
typename
TS
,
typename
TU
>
auto
from
(
const
TV
<
TT
,
TS
,
TU
>
&
container
)
->
LinqObj
<
Enumerator
<
TT
,
IteratorContainerPair
<
decltype
(
container
.
cbegin
()),
const
TV
<
TT
,
TS
,
TU
>
>
>
>
auto
from
(
const
TV
<
TT
,
TS
,
TU
>
&
container
)
->
decltype
(
from
<
TT
>
(
std
::
begin
(
container
),
std
::
end
(
container
)))
{
typedef
IteratorContainerPair
<
decltype
(
container
.
cbegin
()),
const
TV
<
TT
,
TS
,
TU
>
>
DataType
;
return
Enumerator
<
TT
,
DataType
>
([](
DataType
&
pair
){
return
(
pair
.
first
==
pair
.
second
.
cend
())
?
throw
EnumeratorEndException
()
:
*
(
pair
.
first
++
);
},
DataType
(
container
,
[](
const
TV
<
TT
,
TS
,
TU
>
&
cont
){
return
cont
.
cbegin
();}));
return
from
<
TT
>
(
std
::
begin
(
container
),
std
::
end
(
container
));
}
// std::map
template
<
template
<
class
,
class
,
class
,
class
>
class
TV
,
typename
TK
,
typename
TT
,
typename
TS
,
typename
TU
>
auto
from
(
const
TV
<
TK
,
TT
,
TS
,
TU
>
&
container
)
->
LinqObj
<
Enumerator
<
std
::
pair
<
TK
,
TT
>
,
IteratorContainerPair
<
decltype
(
container
.
cbegin
()),
const
TV
<
TK
,
TT
,
TS
,
TU
>
>
>
>
auto
from
(
const
TV
<
TK
,
TT
,
TS
,
TU
>
&
container
)
->
decltype
(
from
<
std
::
pair
<
TK
,
TT
>
>
(
std
::
begin
(
container
),
std
::
end
(
container
)))
{
typedef
IteratorContainerPair
<
decltype
(
container
.
cbegin
()),
const
TV
<
TK
,
TT
,
TS
,
TU
>
>
DataType
;
return
Enumerator
<
std
::
pair
<
TK
,
TT
>
,
DataType
>
([](
DataType
&
pair
){
return
(
pair
.
first
==
pair
.
second
.
cend
())
?
throw
EnumeratorEndException
()
:
*
(
pair
.
first
++
);
},
DataType
(
container
,
[](
const
TV
<
TK
,
TT
,
TS
,
TU
>
&
cont
){
return
cont
.
cbegin
();}));
return
from
<
std
::
pair
<
TK
,
TT
>
>
(
std
::
begin
(
container
),
std
::
end
(
container
));
}
// std::array
template
<
template
<
class
,
unsigned
>
class
TV
,
typename
TT
,
unsigned
TL
>
auto
from
(
const
TV
<
TT
,
TL
>
&
container
)
->
LinqObj
<
Enumerator
<
TT
,
IteratorContainerPair
<
decltype
(
container
.
cbegin
()),
const
TV
<
TT
,
TL
>
>
>
>
template
<
template
<
class
,
size_t
>
class
TV
,
typename
TT
,
size_t
TL
>
auto
from
(
const
TV
<
TT
,
TL
>
&
container
)
->
decltype
(
from
<
TT
>
(
std
::
begin
(
container
),
std
::
end
(
container
)))
{
typedef
IteratorContainerPair
<
decltype
(
container
.
cbegin
()),
const
TV
<
TT
,
TL
>
>
DataType
;
return
Enumerator
<
TT
,
DataType
>
([](
DataType
&
pair
){
return
(
pair
.
first
==
pair
.
second
.
cend
())
?
throw
EnumeratorEndException
()
:
*
(
pair
.
first
++
);
},
DataType
(
container
,
[](
const
TV
<
TT
,
TL
>
&
cont
){
return
cont
.
cbegin
();}));
return
from
<
TT
>
(
std
::
begin
(
container
),
std
::
end
(
container
));
}
template
<
typename
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