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
857aba16
Unverified
Commit
857aba16
authored
Nov 27, 2019
by
Dominik Charousset
Committed by
GitHub
Nov 27, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #984
Fix conversion constructor for caf::span
parents
4c2c9871
06cfaf7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+2
-2
libcaf_core/test/span.cpp
libcaf_core/test/span.cpp
+6
-0
No files found.
libcaf_core/caf/detail/type_traits.hpp
View file @
857aba16
...
@@ -695,8 +695,8 @@ template <class T, class To>
...
@@ -695,8 +695,8 @@ template <class T, class To>
class
has_convertible_data_member
{
class
has_convertible_data_member
{
private:
private:
template
<
class
U
>
template
<
class
U
>
static
auto
sfinae
(
U
*
x
)
static
auto
sfinae
(
U
*
x
)
->
std
::
integral_constant
<
->
decltype
(
std
::
declval
<
To
*>
()
=
x
->
data
(),
std
::
true_type
())
;
bool
,
std
::
is_convertible
<
decltype
(
x
->
data
()),
To
*>::
value
>
;
template
<
class
U
>
template
<
class
U
>
static
auto
sfinae
(...)
->
std
::
false_type
;
static
auto
sfinae
(...)
->
std
::
false_type
;
...
...
libcaf_core/test/span.cpp
View file @
857aba16
...
@@ -114,4 +114,10 @@ CAF_TEST(make_span) {
...
@@ -114,4 +114,10 @@ CAF_TEST(make_span) {
CAF_CHECK_EQUAL
(
begin
(
ys
),
begin
(
zs
));
CAF_CHECK_EQUAL
(
begin
(
ys
),
begin
(
zs
));
}
}
CAF_TEST
(
spans
are
convertible
from
compatible
containers
)
{
std
::
vector
<
int
>
xs
{
1
,
2
,
3
};
span
<
const
int
>
ys
{
xs
};
CAF_CHECK
(
std
::
equal
(
xs
.
begin
(),
xs
.
end
(),
ys
.
begin
()));
}
CAF_TEST_FIXTURE_SCOPE_END
()
CAF_TEST_FIXTURE_SCOPE_END
()
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