Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
folly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
folly
Commits
58d9eab5
Commit
58d9eab5
authored
Oct 16, 2018
by
Eric Niebler
Committed by
Facebook Github Bot
Oct 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce needless out_from_fn instantiations
fbshipit-source-id: 7df1094b2072726b2d0fe8fb75693b4aff93cda2
parent
d6f75f2e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
30 deletions
+32
-30
folly/experimental/pushmi/include/pushmi.h
folly/experimental/pushmi/include/pushmi.h
+16
-15
folly/experimental/pushmi/include/pushmi/o/extension_operators.h
...xperimental/pushmi/include/pushmi/o/extension_operators.h
+15
-11
folly/experimental/pushmi/include/pushmi/o/submit.h
folly/experimental/pushmi/include/pushmi/o/submit.h
+1
-4
No files found.
folly/experimental/pushmi/include/pushmi.h
View file @
58d9eab5
...
...
@@ -5851,29 +5851,27 @@ constexpr decltype(auto) apply(F&& f, Tuple&& t) {
namespace
detail
{
template
<
class
...
TagN
>
template
<
class
Cardinality
,
bool
IsFlow
=
false
>
struct
make_receiver
;
template
<
>
struct
make_receiver
<
is_none
<>
,
void
>
:
construct_deduced
<
none
>
{};
struct
make_receiver
<
is_none
<>>
:
construct_deduced
<
none
>
{};
template
<
>
struct
make_receiver
<
is_single
<>
,
void
>
:
construct_deduced
<
single
>
{};
struct
make_receiver
<
is_single
<>>
:
construct_deduced
<
single
>
{};
template
<
>
struct
make_receiver
<
is_many
<>
,
void
>
:
construct_deduced
<
many
>
{};
struct
make_receiver
<
is_many
<>>
:
construct_deduced
<
many
>
{};
template
<
>
struct
make_receiver
<
is_single
<>
,
is_flow
<>
>
:
construct_deduced
<
flow_single
>
{};
struct
make_receiver
<
is_single
<>
,
true
>
:
construct_deduced
<
flow_single
>
{};
template
<
PUSHMI_TYPE_CONSTRAINT
(
Sender
)
In
>
struct
out_from_fn
{
using
Cardinality
=
property_set_index_t
<
properties_t
<
In
>
,
is_silent
<>>
;
using
Flow
=
std
::
conditional_t
<
property_query_v
<
properties_t
<
In
>
,
is_flow
<>>
,
is_flow
<>
,
void
>
;
using
Make
=
make_receiver
<
Cardinality
,
Flow
>
;
template
<
class
Cardinality
,
bool
IsFlow
>
struct
out_from_impl
{
using
Make
=
make_receiver
<
Cardinality
,
IsFlow
>
;
PUSHMI_TEMPLATE
(
class
...
Ts
)
(
requires
Invocable
<
Make
,
Ts
...
>
)
auto
operator
()(
std
::
tuple
<
Ts
...
>
args
)
const
{
return
pushmi
::
apply
(
Make
(),
std
::
move
(
args
));
}
PUSHMI_TEMPLATE
(
class
...
Ts
,
class
...
Fns
,
class
This
=
std
::
enable_if_t
<
sizeof
...(
Fns
)
!=
0
,
out_from_
fn
>
)
class
This
=
std
::
enable_if_t
<
sizeof
...(
Fns
)
!=
0
,
out_from_
impl
>
)
(
requires
And
<
SemiMovable
<
Fns
>
...
>
&&
Invocable
<
Make
,
std
::
tuple
<
Ts
...
>>
&&
Invocable
<
This
,
pushmi
::
invoke_result_t
<
Make
,
std
::
tuple
<
Ts
...
>>
,
Fns
...
>
)
...
...
@@ -5887,6 +5885,12 @@ struct out_from_fn {
}
};
template
<
PUSHMI_TYPE_CONSTRAINT
(
Sender
)
In
>
using
out_from_fn
=
out_from_impl
<
property_set_index_t
<
properties_t
<
In
>
,
is_silent
<>>
,
property_query_v
<
properties_t
<
In
>
,
is_flow
<>>>
;
template
<
class
In
,
class
FN
>
struct
submit_transform_out_1
{
FN
fn_
;
...
...
@@ -6196,10 +6200,7 @@ using receiver_type_t =
pushmi
::
invoke_result_t
<
pushmi
::
detail
::
make_receiver
<
property_set_index_t
<
properties_t
<
In
>
,
is_silent
<>>
,
std
::
conditional_t
<
property_query_v
<
properties_t
<
In
>
,
is_flow
<>>
,
is_flow
<>
,
void
>>
,
property_query_v
<
properties_t
<
In
>
,
is_flow
<>>>
,
AN
...
>
;
PUSHMI_CONCEPT_DEF
(
...
...
folly/experimental/pushmi/include/pushmi/o/extension_operators.h
View file @
58d9eab5
...
...
@@ -48,29 +48,27 @@ constexpr decltype(auto) apply(F&& f, Tuple&& t) {
namespace
detail
{
template
<
class
...
TagN
>
template
<
class
Cardinality
,
bool
IsFlow
=
false
>
struct
make_receiver
;
template
<
>
struct
make_receiver
<
is_none
<>
,
void
>
:
construct_deduced
<
none
>
{};
struct
make_receiver
<
is_none
<>>
:
construct_deduced
<
none
>
{};
template
<
>
struct
make_receiver
<
is_single
<>
,
void
>
:
construct_deduced
<
single
>
{};
struct
make_receiver
<
is_single
<>>
:
construct_deduced
<
single
>
{};
template
<
>
struct
make_receiver
<
is_many
<>
,
void
>
:
construct_deduced
<
many
>
{};
struct
make_receiver
<
is_many
<>>
:
construct_deduced
<
many
>
{};
template
<
>
struct
make_receiver
<
is_single
<>
,
is_flow
<>
>
:
construct_deduced
<
flow_single
>
{};
struct
make_receiver
<
is_single
<>
,
true
>
:
construct_deduced
<
flow_single
>
{};
template
<
PUSHMI_TYPE_CONSTRAINT
(
Sender
)
In
>
struct
out_from_fn
{
using
Cardinality
=
property_set_index_t
<
properties_t
<
In
>
,
is_silent
<>>
;
using
Flow
=
std
::
conditional_t
<
property_query_v
<
properties_t
<
In
>
,
is_flow
<>>
,
is_flow
<>
,
void
>
;
using
Make
=
make_receiver
<
Cardinality
,
Flow
>
;
template
<
class
Cardinality
,
bool
IsFlow
>
struct
out_from_impl
{
using
Make
=
make_receiver
<
Cardinality
,
IsFlow
>
;
PUSHMI_TEMPLATE
(
class
...
Ts
)
(
requires
Invocable
<
Make
,
Ts
...
>
)
auto
operator
()(
std
::
tuple
<
Ts
...
>
args
)
const
{
return
pushmi
::
apply
(
Make
(),
std
::
move
(
args
));
}
PUSHMI_TEMPLATE
(
class
...
Ts
,
class
...
Fns
,
class
This
=
std
::
enable_if_t
<
sizeof
...(
Fns
)
!=
0
,
out_from_
fn
>
)
class
This
=
std
::
enable_if_t
<
sizeof
...(
Fns
)
!=
0
,
out_from_
impl
>
)
(
requires
And
<
SemiMovable
<
Fns
>
...
>
&&
Invocable
<
Make
,
std
::
tuple
<
Ts
...
>>
&&
Invocable
<
This
,
pushmi
::
invoke_result_t
<
Make
,
std
::
tuple
<
Ts
...
>>
,
Fns
...
>
)
...
...
@@ -84,6 +82,12 @@ struct out_from_fn {
}
};
template
<
PUSHMI_TYPE_CONSTRAINT
(
Sender
)
In
>
using
out_from_fn
=
out_from_impl
<
property_set_index_t
<
properties_t
<
In
>
,
is_silent
<>>
,
property_query_v
<
properties_t
<
In
>
,
is_flow
<>>>
;
template
<
class
In
,
class
FN
>
struct
submit_transform_out_1
{
FN
fn_
;
...
...
folly/experimental/pushmi/include/pushmi/o/submit.h
View file @
58d9eab5
...
...
@@ -22,10 +22,7 @@ using receiver_type_t =
pushmi
::
invoke_result_t
<
pushmi
::
detail
::
make_receiver
<
property_set_index_t
<
properties_t
<
In
>
,
is_silent
<>>
,
std
::
conditional_t
<
property_query_v
<
properties_t
<
In
>
,
is_flow
<>>
,
is_flow
<>
,
void
>>
,
property_query_v
<
properties_t
<
In
>
,
is_flow
<>>>
,
AN
...
>
;
PUSHMI_CONCEPT_DEF
(
...
...
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