Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
b713a845
Commit
b713a845
authored
Oct 29, 2022
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve static assertions
parent
df3f8be3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
libcaf_core/caf/flow/observable.hpp
libcaf_core/caf/flow/observable.hpp
+7
-1
No files found.
libcaf_core/caf/flow/observable.hpp
View file @
b713a845
...
@@ -607,6 +607,9 @@ auto observable<T>::merge(Inputs&&... xs) {
...
@@ -607,6 +607,9 @@ auto observable<T>::merge(Inputs&&... xs) {
static_assert
(
static_assert
(
sizeof
...(
Inputs
)
>
0
,
sizeof
...(
Inputs
)
>
0
,
"merge without arguments expects this observable to emit observables"
);
"merge without arguments expects this observable to emit observables"
);
static_assert
(
(
std
::
is_same_v
<
Out
,
output_type_t
<
std
::
decay_t
<
Inputs
>>>
&&
...),
"can only merge observables with the same observed type"
);
using
impl_t
=
op
::
merge
<
Out
>
;
using
impl_t
=
op
::
merge
<
Out
>
;
return
make_observable
<
impl_t
>
(
ctx
(),
*
this
,
std
::
forward
<
Inputs
>
(
xs
)...);
return
make_observable
<
impl_t
>
(
ctx
(),
*
this
,
std
::
forward
<
Inputs
>
(
xs
)...);
}
}
...
@@ -622,7 +625,10 @@ auto observable<T>::concat(Inputs&&... xs) {
...
@@ -622,7 +625,10 @@ auto observable<T>::concat(Inputs&&... xs) {
}
else
{
}
else
{
static_assert
(
static_assert
(
sizeof
...(
Inputs
)
>
0
,
sizeof
...(
Inputs
)
>
0
,
"merge without arguments expects this observable to emit observables"
);
"concat without arguments expects this observable to emit observables"
);
static_assert
(
(
std
::
is_same_v
<
Out
,
output_type_t
<
std
::
decay_t
<
Inputs
>>>
&&
...),
"can only concatenate observables with the same observed type"
);
using
impl_t
=
op
::
concat
<
Out
>
;
using
impl_t
=
op
::
concat
<
Out
>
;
return
make_observable
<
impl_t
>
(
ctx
(),
*
this
,
std
::
forward
<
Inputs
>
(
xs
)...);
return
make_observable
<
impl_t
>
(
ctx
(),
*
this
,
std
::
forward
<
Inputs
>
(
xs
)...);
}
}
...
...
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