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
ba671c7c
Commit
ba671c7c
authored
Aug 08, 2023
by
Shariar Azad Riday
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor is_pointer<>::value to is_pointer_v<>
parent
cd8363aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
11 deletions
+10
-11
libcaf_core/caf/actor_cast.hpp
libcaf_core/caf/actor_cast.hpp
+5
-5
libcaf_core/caf/detail/init_fun_factory.hpp
libcaf_core/caf/detail/init_fun_factory.hpp
+1
-1
libcaf_core/caf/detail/stringification_inspector.hpp
libcaf_core/caf/detail/stringification_inspector.hpp
+1
-1
libcaf_core/caf/logger.hpp
libcaf_core/caf/logger.hpp
+1
-1
libcaf_core/caf/message.hpp
libcaf_core/caf/message.hpp
+1
-1
libcaf_test/caf/test/dsl.hpp
libcaf_test/caf/test/dsl.hpp
+1
-2
No files found.
libcaf_core/caf/actor_cast.hpp
View file @
ba671c7c
...
@@ -71,7 +71,7 @@ public:
...
@@ -71,7 +71,7 @@ public:
}
}
template
<
class
T
,
template
<
class
T
,
class
=
typename
std
::
enable_if
<!
std
::
is_pointer
<
T
>
::
value
>::
type
>
class
=
typename
std
::
enable_if
<!
std
::
is_pointer
_v
<
T
>
>::
type
>
To
operator
()(
const
T
&
x
)
const
{
To
operator
()(
const
T
&
x
)
const
{
return
x
.
get
();
return
x
.
get
();
}
}
...
@@ -89,7 +89,7 @@ public:
...
@@ -89,7 +89,7 @@ public:
}
}
template
<
class
T
,
template
<
class
T
,
class
=
typename
std
::
enable_if
<!
std
::
is_pointer
<
T
>
::
value
>::
type
>
class
=
typename
std
::
enable_if
<!
std
::
is_pointer
_v
<
T
>
>::
type
>
To
*
operator
()(
const
T
&
x
)
const
{
To
*
operator
()(
const
T
&
x
)
const
{
return
(
*
this
)(
x
.
get
());
return
(
*
this
)(
x
.
get
());
}
}
...
@@ -107,7 +107,7 @@ public:
...
@@ -107,7 +107,7 @@ public:
}
}
template
<
class
T
,
template
<
class
T
,
class
=
typename
std
::
enable_if
<!
std
::
is_pointer
<
T
>
::
value
>::
type
>
class
=
typename
std
::
enable_if
<!
std
::
is_pointer
_v
<
T
>
>::
type
>
actor_control_block
*
operator
()(
const
T
&
x
)
const
{
actor_control_block
*
operator
()(
const
T
&
x
)
const
{
return
x
.
get
();
return
x
.
get
();
}
}
...
@@ -148,10 +148,10 @@ T actor_cast(U&& what) {
...
@@ -148,10 +148,10 @@ T actor_cast(U&& what) {
using
from_type
=
using
from_type
=
typename
std
::
remove_const
<
typename
std
::
remove_reference
<
U
>::
type
>::
type
;
typename
std
::
remove_const
<
typename
std
::
remove_reference
<
U
>::
type
>::
type
;
// query traits for T
// query traits for T
constexpr
bool
to_raw
=
std
::
is_pointer
<
T
>::
value
;
constexpr
bool
to_raw
=
std
::
is_pointer
_v
<
T
>
;
constexpr
bool
to_weak
=
is_weak_ptr
<
T
>::
value
;
constexpr
bool
to_weak
=
is_weak_ptr
<
T
>::
value
;
// query traits for U
// query traits for U
constexpr
bool
from_raw
=
std
::
is_pointer
<
from_type
>::
value
;
constexpr
bool
from_raw
=
std
::
is_pointer
_v
<
from_type
>
;
constexpr
bool
from_weak
=
is_weak_ptr
<
from_type
>::
value
;
constexpr
bool
from_weak
=
is_weak_ptr
<
from_type
>::
value
;
// calculate x and y
// calculate x and y
constexpr
int
x
=
to_raw
?
0
:
(
to_weak
?
2
:
1
);
constexpr
int
x
=
to_raw
?
0
:
(
to_weak
?
2
:
1
);
...
...
libcaf_core/caf/detail/init_fun_factory.hpp
View file @
ba671c7c
...
@@ -124,7 +124,7 @@ public:
...
@@ -124,7 +124,7 @@ public:
using
arg_types
=
typename
trait
::
arg_types
;
using
arg_types
=
typename
trait
::
arg_types
;
using
res_type
=
typename
trait
::
result_type
;
using
res_type
=
typename
trait
::
result_type
;
using
first_arg
=
typename
detail
::
tl_head
<
arg_types
>::
type
;
using
first_arg
=
typename
detail
::
tl_head
<
arg_types
>::
type
;
constexpr
bool
selfptr
=
std
::
is_pointer
<
first_arg
>::
value
;
constexpr
bool
selfptr
=
std
::
is_pointer
_v
<
first_arg
>
;
constexpr
bool
rets
=
std
::
is_convertible
<
res_type
,
behavior
>::
value
;
constexpr
bool
rets
=
std
::
is_convertible
<
res_type
,
behavior
>::
value
;
using
tuple_type
=
decltype
(
std
::
make_tuple
(
detail
::
spawn_fwd
<
Ts
>
(
xs
)...));
using
tuple_type
=
decltype
(
std
::
make_tuple
(
detail
::
spawn_fwd
<
Ts
>
(
xs
)...));
using
helper
=
init_fun_factory_helper
<
Base
,
F
,
tuple_type
,
rets
,
selfptr
>
;
using
helper
=
init_fun_factory_helper
<
Base
,
F
,
tuple_type
,
rets
,
selfptr
>
;
...
...
libcaf_core/caf/detail/stringification_inspector.hpp
View file @
ba671c7c
...
@@ -221,7 +221,7 @@ public:
...
@@ -221,7 +221,7 @@ public:
if
constexpr
(
std
::
is_same_v
<
std
::
nullptr_t
,
T
>
)
{
if
constexpr
(
std
::
is_same_v
<
std
::
nullptr_t
,
T
>
)
{
return
"null"
;
return
"null"
;
}
else
if
constexpr
(
std
::
is_constructible
<
std
::
string_view
,
T
>::
value
)
{
}
else
if
constexpr
(
std
::
is_constructible
<
std
::
string_view
,
T
>::
value
)
{
if
constexpr
(
std
::
is_pointer
<
T
>::
value
)
{
if
constexpr
(
std
::
is_pointer
_v
<
T
>
)
{
if
(
x
==
nullptr
)
if
(
x
==
nullptr
)
return
"null"
;
return
"null"
;
}
}
...
...
libcaf_core/caf/logger.hpp
View file @
ba671c7c
...
@@ -165,7 +165,7 @@ public:
...
@@ -165,7 +165,7 @@ public:
line_builder
();
line_builder
();
template
<
class
T
>
template
<
class
T
>
detail
::
enable_if_t
<!
std
::
is_pointer
<
T
>::
value
,
line_builder
&>
detail
::
enable_if_t
<!
std
::
is_pointer
_v
<
T
>
,
line_builder
&>
operator
<<
(
const
T
&
x
)
{
operator
<<
(
const
T
&
x
)
{
if
(
!
str_
.
empty
())
if
(
!
str_
.
empty
())
str_
+=
" "
;
str_
+=
" "
;
...
...
libcaf_core/caf/message.hpp
View file @
ba671c7c
...
@@ -206,7 +206,7 @@ inline message make_message() {
...
@@ -206,7 +206,7 @@ inline message make_message() {
template
<
class
...
Ts
>
template
<
class
...
Ts
>
message
make_message
(
Ts
&&
...
xs
)
{
message
make_message
(
Ts
&&
...
xs
)
{
using
namespace
detail
;
using
namespace
detail
;
static_assert
((
!
std
::
is_pointer
<
strip_and_convert_t
<
Ts
>>::
value
&&
...));
static_assert
((
!
std
::
is_pointer
_v
<
strip_and_convert_t
<
Ts
>>
&&
...));
static_assert
((
is_complete
<
type_id
<
strip_and_convert_t
<
Ts
>>>
&&
...));
static_assert
((
is_complete
<
type_id
<
strip_and_convert_t
<
Ts
>>>
&&
...));
static
constexpr
size_t
data_size
static
constexpr
size_t
data_size
=
sizeof
(
message_data
)
+
(
padded_size_v
<
strip_and_convert_t
<
Ts
>>
+
...);
=
sizeof
(
message_data
)
+
(
padded_size_v
<
strip_and_convert_t
<
Ts
>>
+
...);
...
...
libcaf_test/caf/test/dsl.hpp
View file @
ba671c7c
...
@@ -164,8 +164,7 @@ public:
...
@@ -164,8 +164,7 @@ public:
return
*
this
;
return
*
this
;
}
}
template
<
class
T
,
template
<
class
T
,
class
E
=
caf
::
detail
::
enable_if_t
<!
std
::
is_pointer_v
<
T
>
>>
class
E
=
caf
::
detail
::
enable_if_t
<!
std
::
is_pointer
<
T
>
::
value
>>
caf_handle
&
operator
=
(
const
T
&
x
)
{
caf_handle
&
operator
=
(
const
T
&
x
)
{
set
(
x
);
set
(
x
);
return
*
this
;
return
*
this
;
...
...
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