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
1bdc08c6
Commit
1bdc08c6
authored
Aug 09, 2023
by
Shariar Azad Riday
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor all instances of is_base_of<>::value to is_base_of_v<>
parent
c37e971a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
22 deletions
+20
-22
libcaf_core/caf/actor_factory.hpp
libcaf_core/caf/actor_factory.hpp
+1
-1
libcaf_core/caf/actor_system.hpp
libcaf_core/caf/actor_system.hpp
+1
-1
libcaf_core/caf/actor_traits.hpp
libcaf_core/caf/actor_traits.hpp
+6
-7
libcaf_core/caf/detail/implicit_conversions.hpp
libcaf_core/caf/detail/implicit_conversions.hpp
+2
-2
libcaf_core/caf/detail/init_fun_factory.hpp
libcaf_core/caf/detail/init_fun_factory.hpp
+1
-1
libcaf_core/caf/exec_main.hpp
libcaf_core/caf/exec_main.hpp
+3
-3
libcaf_core/caf/infer_handle.hpp
libcaf_core/caf/infer_handle.hpp
+3
-3
libcaf_core/caf/mixin/sender.hpp
libcaf_core/caf/mixin/sender.hpp
+1
-2
libcaf_core/caf/mtl.hpp
libcaf_core/caf/mtl.hpp
+1
-1
libcaf_core/caf/typed_actor.hpp
libcaf_core/caf/typed_actor.hpp
+1
-1
No files found.
libcaf_core/caf/actor_factory.hpp
View file @
1bdc08c6
...
@@ -145,7 +145,7 @@ actor_factory make_actor_factory() {
...
@@ -145,7 +145,7 @@ actor_factory make_actor_factory() {
static_assert
(
static_assert
(
detail
::
conjunction
<
std
::
is_lvalue_reference
<
Ts
>::
value
...
>::
value
,
detail
::
conjunction
<
std
::
is_lvalue_reference
<
Ts
>::
value
...
>::
value
,
"all Ts must be lvalue references"
);
"all Ts must be lvalue references"
);
static_assert
(
std
::
is_base_of
<
local_actor
,
T
>::
value
,
static_assert
(
std
::
is_base_of
_v
<
local_actor
,
T
>
,
"T is not derived from local_actor"
);
"T is not derived from local_actor"
);
return
&
dyn_spawn_class
<
T
,
Ts
...
>
;
return
&
dyn_spawn_class
<
T
,
Ts
...
>
;
}
}
...
...
libcaf_core/caf/actor_system.hpp
View file @
1bdc08c6
...
@@ -778,7 +778,7 @@ public:
...
@@ -778,7 +778,7 @@ public:
private:
private:
template
<
class
T
>
template
<
class
T
>
void
check_invariants
()
{
void
check_invariants
()
{
static_assert
(
!
std
::
is_base_of
<
prohibit_top_level_spawn_marker
,
T
>::
value
,
static_assert
(
!
std
::
is_base_of
_v
<
prohibit_top_level_spawn_marker
,
T
>
,
"This actor type cannot be spawned through an actor system. "
"This actor type cannot be spawned through an actor system. "
"Probably you have tried to spawn a broker."
);
"Probably you have tried to spawn a broker."
);
}
}
...
...
libcaf_core/caf/actor_traits.hpp
View file @
1bdc08c6
...
@@ -60,20 +60,19 @@ template <class T>
...
@@ -60,20 +60,19 @@ template <class T>
struct
default_actor_traits
<
T
,
true
>
{
struct
default_actor_traits
<
T
,
true
>
{
/// Denotes whether `T` is dynamically typed.
/// Denotes whether `T` is dynamically typed.
static
constexpr
bool
is_dynamically_typed
static
constexpr
bool
is_dynamically_typed
=
std
::
is_base_of
<
dynamically_typed_actor_base
,
T
>::
value
;
=
std
::
is_base_of
_v
<
dynamically_typed_actor_base
,
T
>
;
/// Denotes whether `T` is statically typed.
/// Denotes whether `T` is statically typed.
static
constexpr
bool
is_statically_typed
static
constexpr
bool
is_statically_typed
=
std
::
is_base_of
<
statically_typed_actor_base
,
T
>::
value
;
=
std
::
is_base_of
_v
<
statically_typed_actor_base
,
T
>
;
/// Denotes whether `T` is a blocking actor type.
/// Denotes whether `T` is a blocking actor type.
static
constexpr
bool
is_blocking
static
constexpr
bool
is_blocking
=
std
::
is_base_of_v
<
blocking_actor_base
,
T
>
=
std
::
is_base_of
<
blocking_actor_base
,
T
>::
value
||
mixin
::
is_blocking_requester
<
T
>::
value
;
||
mixin
::
is_blocking_requester
<
T
>::
value
;
/// Denotes whether `T` is a non-blocking actor type.
/// Denotes whether `T` is a non-blocking actor type.
static
constexpr
bool
is_non_blocking
static
constexpr
bool
is_non_blocking
=
std
::
is_base_of
<
non_blocking_actor_base
,
T
>::
value
;
=
std
::
is_base_of
_v
<
non_blocking_actor_base
,
T
>
;
/// Denotes whether `T` is an incomplete actor type that misses one or more
/// Denotes whether `T` is an incomplete actor type that misses one or more
/// markers.
/// markers.
...
@@ -91,6 +90,6 @@ struct default_actor_traits<T, true> {
...
@@ -91,6 +90,6 @@ struct default_actor_traits<T, true> {
/// Provides uniform access to properties of actor types.
/// Provides uniform access to properties of actor types.
template
<
class
T
>
template
<
class
T
>
struct
actor_traits
struct
actor_traits
:
default_actor_traits
<
T
,
std
::
is_base_of
<
abstract_actor
,
T
>::
value
>
{};
:
default_actor_traits
<
T
,
std
::
is_base_of
_v
<
abstract_actor
,
T
>
>
{};
}
// namespace caf
}
// namespace caf
libcaf_core/caf/detail/implicit_conversions.hpp
View file @
1bdc08c6
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
namespace
caf
::
detail
{
namespace
caf
::
detail
{
template
<
class
T
,
template
<
class
T
,
bool
IsDyn
=
std
::
is_base_of
<
dynamically_typed_actor_base
,
T
>
::
value
,
bool
IsDyn
=
std
::
is_base_of
_v
<
dynamically_typed_actor_base
,
T
>
,
bool
IsStat
=
std
::
is_base_of
<
statically_typed_actor_base
,
T
>::
value
>
bool
IsStat
=
std
::
is_base_of
_v
<
statically_typed_actor_base
,
T
>
>
struct
implicit_actor_conversions
{
struct
implicit_actor_conversions
{
using
type
=
T
;
using
type
=
T
;
};
};
...
...
libcaf_core/caf/detail/init_fun_factory.hpp
View file @
1bdc08c6
...
@@ -118,7 +118,7 @@ public:
...
@@ -118,7 +118,7 @@ public:
template
<
class
...
Ts
>
template
<
class
...
Ts
>
ptr_type
make
(
F
f
,
Ts
&&
...
xs
)
{
ptr_type
make
(
F
f
,
Ts
&&
...
xs
)
{
static_assert
(
std
::
is_base_of
<
local_actor
,
Base
>::
value
,
static_assert
(
std
::
is_base_of
_v
<
local_actor
,
Base
>
,
"Given Base does not extend local_actor"
);
"Given Base does not extend local_actor"
);
using
trait
=
typename
detail
::
get_callable_trait
<
F
>::
type
;
using
trait
=
typename
detail
::
get_callable_trait
<
F
>::
type
;
using
arg_types
=
typename
trait
::
arg_types
;
using
arg_types
=
typename
trait
::
arg_types
;
...
...
libcaf_core/caf/exec_main.hpp
View file @
1bdc08c6
...
@@ -37,7 +37,7 @@ struct exec_main_helper<detail::type_list<actor_system&, const T&>> {
...
@@ -37,7 +37,7 @@ struct exec_main_helper<detail::type_list<actor_system&, const T&>> {
template
<
class
T
>
template
<
class
T
>
void
exec_main_init_meta_objects_single
()
{
void
exec_main_init_meta_objects_single
()
{
if
constexpr
(
std
::
is_base_of
<
actor_system
::
module
,
T
>::
value
)
if
constexpr
(
std
::
is_base_of
_v
<
actor_system
::
module
,
T
>
)
T
::
init_global_meta_objects
();
T
::
init_global_meta_objects
();
else
else
init_global_meta_objects
<
T
>
();
init_global_meta_objects
<
T
>
();
...
@@ -50,7 +50,7 @@ void exec_main_init_meta_objects() {
...
@@ -50,7 +50,7 @@ void exec_main_init_meta_objects() {
template
<
class
T
>
template
<
class
T
>
void
exec_main_load_module
(
actor_system_config
&
cfg
)
{
void
exec_main_load_module
(
actor_system_config
&
cfg
)
{
if
constexpr
(
std
::
is_base_of
<
actor_system
::
module
,
T
>::
value
)
if
constexpr
(
std
::
is_base_of
_v
<
actor_system
::
module
,
T
>
)
cfg
.
template
load
<
T
>();
cfg
.
template
load
<
T
>();
}
}
...
@@ -67,7 +67,7 @@ int exec_main(F fun, int argc, char** argv) {
...
@@ -67,7 +67,7 @@ int exec_main(F fun, int argc, char** argv) {
using
arg2
=
typename
detail
::
tl_at
<
arg_types
,
1
>::
type
;
using
arg2
=
typename
detail
::
tl_at
<
arg_types
,
1
>::
type
;
using
decayed_arg2
=
typename
std
::
decay
<
arg2
>::
type
;
using
decayed_arg2
=
typename
std
::
decay
<
arg2
>::
type
;
static_assert
(
std
::
is_same_v
<
arg2
,
unit_t
>
static_assert
(
std
::
is_same_v
<
arg2
,
unit_t
>
||
(
std
::
is_base_of
<
actor_system_config
,
decayed_arg2
>::
value
||
(
std
::
is_base_of
_v
<
actor_system_config
,
decayed_arg2
>
&&
std
::
is_same
<
arg2
,
const
decayed_arg2
&>::
value
),
&&
std
::
is_same
<
arg2
,
const
decayed_arg2
&>::
value
),
"second parameter of main function must take a subtype of "
"second parameter of main function must take a subtype of "
"actor_system_config as const reference"
);
"actor_system_config as const reference"
);
...
...
libcaf_core/caf/infer_handle.hpp
View file @
1bdc08c6
...
@@ -66,8 +66,8 @@ struct infer_handle_from_fun_impl<typed_behavior<Sigs...>, Impl, false> {
...
@@ -66,8 +66,8 @@ struct infer_handle_from_fun_impl<typed_behavior<Sigs...>, Impl, false> {
// statically typed actor with self pointer
// statically typed actor with self pointer
template
<
class
...
Sigs
,
class
Impl
>
template
<
class
...
Sigs
,
class
Impl
>
struct
infer_handle_from_fun_impl
<
typed_behavior
<
Sigs
...
>
,
Impl
*
,
true
>
{
struct
infer_handle_from_fun_impl
<
typed_behavior
<
Sigs
...
>
,
Impl
*
,
true
>
{
static_assert
(
std
::
is_base_of
<
typed_event_based_actor
<
Sigs
...
>
,
Impl
>::
value
static_assert
(
std
::
is_base_of
_v
<
typed_event_based_actor
<
Sigs
...
>
,
Impl
>
||
std
::
is_base_of
<
io
::
typed_broker
<
Sigs
...
>
,
Impl
>::
value
,
||
std
::
is_base_of
_v
<
io
::
typed_broker
<
Sigs
...
>
,
Impl
>
,
"Self pointer does not match the returned behavior type."
);
"Self pointer does not match the returned behavior type."
);
using
type
=
typed_actor
<
Sigs
...
>
;
using
type
=
typed_actor
<
Sigs
...
>
;
using
impl
=
Impl
;
using
impl
=
Impl
;
...
@@ -109,7 +109,7 @@ struct infer_handle_from_behavior<typed_behavior<Sigs...>> {
...
@@ -109,7 +109,7 @@ struct infer_handle_from_behavior<typed_behavior<Sigs...>> {
/// Deduces `actor` for dynamically typed actors, otherwise `typed_actor<...>`
/// Deduces `actor` for dynamically typed actors, otherwise `typed_actor<...>`
/// is deduced.
/// is deduced.
template
<
class
T
,
bool
=
std
::
is_base_of
<
abstract_actor
,
T
>
::
value
>
template
<
class
T
,
bool
=
std
::
is_base_of
_v
<
abstract_actor
,
T
>
>
struct
infer_handle_from_class
{
struct
infer_handle_from_class
{
using
type
=
using
type
=
typename
infer_handle_from_behavior
<
typename
T
::
behavior_type
>::
type
;
typename
infer_handle_from_behavior
<
typename
T
::
behavior_type
>::
type
;
...
...
libcaf_core/caf/mixin/sender.hpp
View file @
1bdc08c6
...
@@ -230,8 +230,7 @@ private:
...
@@ -230,8 +230,7 @@ private:
}
}
template
<
class
T
=
Base
>
template
<
class
T
=
Base
>
detail
::
enable_if_t
<
std
::
is_base_of
<
abstract_actor
,
T
>::
value
,
Subtype
*>
detail
::
enable_if_t
<
std
::
is_base_of_v
<
abstract_actor
,
T
>
,
Subtype
*>
dptr
()
{
dptr
()
{
return
static_cast
<
Subtype
*>
(
this
);
return
static_cast
<
Subtype
*>
(
this
);
}
}
...
...
libcaf_core/caf/mtl.hpp
View file @
1bdc08c6
...
@@ -102,7 +102,7 @@ private:
...
@@ -102,7 +102,7 @@ private:
/// @ref deserializer directly or that provides a compatible API.
/// @ref deserializer directly or that provides a compatible API.
template
<
class
Self
,
class
Adapter
,
class
Reader
>
template
<
class
Self
,
class
Adapter
,
class
Reader
>
auto
make_mtl
(
Self
*
self
,
Adapter
adapter
,
Reader
*
reader
)
{
auto
make_mtl
(
Self
*
self
,
Adapter
adapter
,
Reader
*
reader
)
{
if
constexpr
(
std
::
is_base_of
<
non_blocking_actor_base
,
Self
>::
value
)
{
if
constexpr
(
std
::
is_base_of
_v
<
non_blocking_actor_base
,
Self
>
)
{
return
event_based_mtl
{
self
,
adapter
,
reader
};
return
event_based_mtl
{
self
,
adapter
,
reader
};
}
else
{
}
else
{
static_assert
(
detail
::
always_false_v
<
Self
>
,
static_assert
(
detail
::
always_false_v
<
Self
>
,
...
...
libcaf_core/caf/typed_actor.hpp
View file @
1bdc08c6
...
@@ -131,7 +131,7 @@ public:
...
@@ -131,7 +131,7 @@ public:
// Enable `handle_type{self}` for typed actor views.
// Enable `handle_type{self}` for typed actor views.
template
<
class
T
,
class
=
std
::
enable_if_t
<
template
<
class
T
,
class
=
std
::
enable_if_t
<
std
::
is_base_of
<
typed_actor_view_base
,
T
>
::
value
>>
std
::
is_base_of
_v
<
typed_actor_view_base
,
T
>
>>
explicit
typed_actor
(
T
ptr
)
:
ptr_
(
ptr
.
ctrl
())
{
explicit
typed_actor
(
T
ptr
)
:
ptr_
(
ptr
.
ctrl
())
{
static_assert
(
static_assert
(
detail
::
tl_subset_of
<
signatures
,
typename
T
::
signatures
>::
value
,
detail
::
tl_subset_of
<
signatures
,
typename
T
::
signatures
>::
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