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
ae3a0530
Commit
ae3a0530
authored
Jun 28, 2019
by
Anton Bukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some fixes
parent
1abeeed1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
boolinq.h
include/boolinq/boolinq.h
+6
-6
No files found.
include/boolinq/boolinq.h
View file @
ae3a0530
...
...
@@ -337,10 +337,10 @@ namespace boolinq {
return
start
;
}
template
<
typename
F
>
auto
sum
(
F
transform
)
const
->
typename
std
::
result_of
<
F
(
T
)
>::
type
template
<
typename
F
,
typename
_TRet
=
typename
std
::
result_of
<
F
(
T
)
>::
type
>
auto
sum
(
F
transform
)
const
->
_TRet
{
return
aggregate
<
T
>
(
T
(),
[
transform
](
T
accumulator
,
T
value
)
{
return
aggregate
<
_TRet
>
(
_TRet
(),
[
transform
](
_TRet
accumulator
,
T
value
)
{
return
accumulator
+
transform
(
value
);
});
}
...
...
@@ -351,11 +351,11 @@ namespace boolinq {
return
cast
<
TRet
>
().
sum
();
}
template
<
typename
F
>
auto
avg
(
F
transform
)
const
->
typename
std
::
result_of
<
F
(
T
)
>::
type
template
<
typename
F
,
typename
_TRet
=
typename
std
::
result_of
<
F
(
T
)
>::
type
>
auto
avg
(
F
transform
)
const
->
_TRet
{
int
count
=
0
;
T
res
=
sum
([
transform
,
&
count
](
T
value
)
{
_TRet
res
=
sum
([
transform
,
&
count
](
T
value
)
{
count
++
;
return
transform
(
value
);
});
...
...
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