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
fb3397d4
Commit
fb3397d4
authored
May 15, 2016
by
Anton Bukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor some export methods
parent
8e85b80f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
26 deletions
+19
-26
boolinq.h
include/boolinq/boolinq.h
+19
-26
No files found.
include/boolinq/boolinq.h
View file @
fb3397d4
...
...
@@ -589,53 +589,46 @@ namespace boolinq
// Export methods
std
::
vector
<
T
>
toVector
()
const
{
std
::
vector
<
T
>
vec
;
private
:
template
<
typename
C
>
C
pushBackToContainer
()
const
{
C
container
;
try
{
auto
en
=
_enumerator
;
for
(;;)
vec
.
push_back
(
en
.
nextObject
());
container
.
push_back
(
en
.
nextObject
());
}
catch
(
EnumeratorEndException
&
)
{}
return
vec
;
return
container
;
}
std
::
set
<
T
>
toSet
()
const
public
:
std
::
vector
<
T
>
toVector
()
const
{
std
::
set
<
T
>
res
;
try
{
auto
en
=
_enumerator
;
for
(;;)
res
.
insert
(
en
.
nextObject
());
}
catch
(
EnumeratorEndException
&
)
{}
return
res
;
return
pushBackToContainer
<
std
::
vector
<
T
>
>
();
}
std
::
list
<
T
>
toList
()
const
{
std
::
list
<
T
>
res
;
try
{
auto
en
=
_enumerator
;
for
(;;)
res
.
push_back
(
en
.
nextObject
());
}
catch
(
EnumeratorEndException
&
)
{}
return
res
;
return
pushBackToContainer
<
std
::
list
<
T
>
>
();
}
std
::
deque
<
T
>
toDeque
()
const
{
std
::
deque
<
T
>
res
;
return
pushBackToContainer
<
std
::
deque
<
T
>
>
();
}
std
::
set
<
T
>
toSet
()
const
{
std
::
set
<
T
>
res
;
try
{
auto
en
=
_enumerator
;
for
(;;)
res
.
push_back
(
en
.
nextObject
());
res
.
insert
(
en
.
nextObject
());
}
catch
(
EnumeratorEndException
&
)
{}
return
res
;
...
...
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