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
b3478445
Unverified
Commit
b3478445
authored
Aug 22, 2023
by
Shariar Azad Riday
Committed by
GitHub
Aug 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer $pred_t<> over $pred<>::type
parent
77f80967
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
133 additions
and
120 deletions
+133
-120
libcaf_core/caf/actor_cast.hpp
libcaf_core/caf/actor_cast.hpp
+2
-2
libcaf_core/caf/actor_factory.hpp
libcaf_core/caf/actor_factory.hpp
+3
-3
libcaf_core/caf/actor_system_config.hpp
libcaf_core/caf/actor_system_config.hpp
+2
-2
libcaf_core/caf/blocking_actor.hpp
libcaf_core/caf/blocking_actor.hpp
+2
-3
libcaf_core/caf/check_typed_input.hpp
libcaf_core/caf/check_typed_input.hpp
+2
-3
libcaf_core/caf/cow_tuple.hpp
libcaf_core/caf/cow_tuple.hpp
+2
-2
libcaf_core/caf/detail/init_fun_factory.hpp
libcaf_core/caf/detail/init_fun_factory.hpp
+2
-2
libcaf_core/caf/detail/parser/read_floating_point.hpp
libcaf_core/caf/detail/parser/read_floating_point.hpp
+1
-1
libcaf_core/caf/detail/parser/read_signed_integer.hpp
libcaf_core/caf/detail/parser/read_signed_integer.hpp
+1
-1
libcaf_core/caf/detail/parser/read_unsigned_integer.hpp
libcaf_core/caf/detail/parser/read_unsigned_integer.hpp
+1
-1
libcaf_core/caf/detail/spawn_fwd.hpp
libcaf_core/caf/detail/spawn_fwd.hpp
+6
-8
libcaf_core/caf/detail/type_list.hpp
libcaf_core/caf/detail/type_list.hpp
+4
-0
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+16
-9
libcaf_core/caf/detail/typed_actor_util.hpp
libcaf_core/caf/detail/typed_actor_util.hpp
+6
-1
libcaf_core/caf/exec_main.hpp
libcaf_core/caf/exec_main.hpp
+2
-3
libcaf_core/caf/function_view.hpp
libcaf_core/caf/function_view.hpp
+5
-2
libcaf_core/caf/fwd.hpp
libcaf_core/caf/fwd.hpp
+5
-1
libcaf_core/caf/infer_handle.hpp
libcaf_core/caf/infer_handle.hpp
+4
-4
libcaf_core/caf/init_global_meta_objects.hpp
libcaf_core/caf/init_global_meta_objects.hpp
+8
-2
libcaf_core/caf/local_actor.hpp
libcaf_core/caf/local_actor.hpp
+3
-3
libcaf_core/caf/mailbox_element.hpp
libcaf_core/caf/mailbox_element.hpp
+1
-1
libcaf_core/caf/message_handler.hpp
libcaf_core/caf/message_handler.hpp
+4
-5
libcaf_core/caf/response_promise.hpp
libcaf_core/caf/response_promise.hpp
+4
-5
libcaf_core/caf/span.hpp
libcaf_core/caf/span.hpp
+1
-1
libcaf_core/caf/string_view.hpp
libcaf_core/caf/string_view.hpp
+1
-2
libcaf_core/caf/type_id_list.hpp
libcaf_core/caf/type_id_list.hpp
+1
-1
libcaf_core/caf/typed_actor_view.hpp
libcaf_core/caf/typed_actor_view.hpp
+3
-4
libcaf_core/tests/legacy/detail/parser/read_number.cpp
libcaf_core/tests/legacy/detail/parser/read_number.cpp
+2
-2
libcaf_core/tests/legacy/detail/parser/read_number_or_timespan.cpp
...re/tests/legacy/detail/parser/read_number_or_timespan.cpp
+2
-2
libcaf_io/caf/io/broker.hpp
libcaf_io/caf/io/broker.hpp
+1
-2
libcaf_io/caf/io/middleman.hpp
libcaf_io/caf/io/middleman.hpp
+7
-7
libcaf_io/caf/io/network/default_multiplexer.cpp
libcaf_io/caf/io/network/default_multiplexer.cpp
+4
-6
libcaf_io/caf/io/network/native_socket.hpp
libcaf_io/caf/io/network/native_socket.hpp
+1
-1
libcaf_io/caf/io/typed_broker.hpp
libcaf_io/caf/io/typed_broker.hpp
+1
-2
libcaf_net/caf/net/datagram_socket.cpp
libcaf_net/caf/net/datagram_socket.cpp
+1
-1
libcaf_net/caf/net/datagram_socket.hpp
libcaf_net/caf/net/datagram_socket.hpp
+2
-2
libcaf_net/caf/net/socket_id.hpp
libcaf_net/caf/net/socket_id.hpp
+1
-1
libcaf_net/caf/net/tcp_accept_socket.cpp
libcaf_net/caf/net/tcp_accept_socket.cpp
+2
-3
libcaf_net/caf/net/tcp_stream_socket.cpp
libcaf_net/caf/net/tcp_stream_socket.cpp
+2
-3
libcaf_test/caf/test/dsl.hpp
libcaf_test/caf/test/dsl.hpp
+3
-3
libcaf_test/caf/test/unit_test.hpp
libcaf_test/caf/test/unit_test.hpp
+12
-13
No files found.
libcaf_core/caf/actor_cast.hpp
View file @
b3478445
...
@@ -149,8 +149,8 @@ public:
...
@@ -149,8 +149,8 @@ public:
/// handle or raw pointer of type `T`.
/// handle or raw pointer of type `T`.
template
<
class
T
,
class
U
>
template
<
class
T
,
class
U
>
T
actor_cast
(
U
&&
what
)
{
T
actor_cast
(
U
&&
what
)
{
using
from_type
=
// Should use remove_cvref in C++20.
typename
std
::
remove_const
<
typename
std
::
remove_reference
<
U
>::
type
>::
type
;
using
from_type
=
std
::
remove_const_t
<
std
::
remove_reference_t
<
U
>>
;
// query traits for T
// query traits for T
constexpr
bool
to_raw
=
std
::
is_pointer_v
<
T
>
;
constexpr
bool
to_raw
=
std
::
is_pointer_v
<
T
>
;
constexpr
bool
to_weak
=
is_weak_ptr_v
<
T
>
;
constexpr
bool
to_weak
=
is_weak_ptr_v
<
T
>
;
...
...
libcaf_core/caf/actor_factory.hpp
View file @
b3478445
...
@@ -103,7 +103,7 @@ actor_factory make_actor_factory(F fun) {
...
@@ -103,7 +103,7 @@ actor_factory make_actor_factory(F fun) {
return
{};
return
{};
cfg
.
init_fun
=
actor_config
::
init_fun_type
{
cfg
.
init_fun
=
actor_config
::
init_fun_type
{
[
=
](
local_actor
*
x
)
mutable
->
behavior
{
[
=
](
local_actor
*
x
)
mutable
->
behavior
{
using
ctrait
=
typename
detail
::
get_callable_trait
<
F
>::
type
;
using
ctrait
=
detail
::
get_callable_trait_t
<
F
>
;
using
fd
=
fun_decorator
<
F
,
impl
,
behavior_t
,
trait
::
mode
,
using
fd
=
fun_decorator
<
F
,
impl
,
behavior_t
,
trait
::
mode
,
typename
ctrait
::
result_type
,
typename
ctrait
::
result_type
,
typename
ctrait
::
arg_types
>
;
typename
ctrait
::
arg_types
>
;
...
@@ -132,7 +132,7 @@ struct dyn_spawn_class_helper {
...
@@ -132,7 +132,7 @@ struct dyn_spawn_class_helper {
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
actor_factory_result
dyn_spawn_class
(
actor_config
&
cfg
,
message
&
msg
)
{
actor_factory_result
dyn_spawn_class
(
actor_config
&
cfg
,
message
&
msg
)
{
CAF_ASSERT
(
cfg
.
host
);
CAF_ASSERT
(
cfg
.
host
);
using
handle
=
typename
infer_handle_from_class
<
T
>::
type
;
using
handle
=
infer_handle_from_class_t
<
T
>
;
handle
hdl
;
handle
hdl
;
message_handler
factory
{
dyn_spawn_class_helper
<
handle
,
T
,
Ts
...
>
{
hdl
,
cfg
}};
message_handler
factory
{
dyn_spawn_class_helper
<
handle
,
T
,
Ts
...
>
{
hdl
,
cfg
}};
factory
(
msg
);
factory
(
msg
);
...
@@ -142,7 +142,7 @@ actor_factory_result dyn_spawn_class(actor_config& cfg, message& msg) {
...
@@ -142,7 +142,7 @@ actor_factory_result dyn_spawn_class(actor_config& cfg, message& msg) {
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
actor_factory
make_actor_factory
()
{
actor_factory
make_actor_factory
()
{
static_assert
(
detail
::
conjunction
<
std
::
is_lvalue_reference_v
<
Ts
>
...
>::
value
,
static_assert
(
detail
::
conjunction
_v
<
std
::
is_lvalue_reference_v
<
Ts
>
...
>
,
"all Ts must be lvalue references"
);
"all Ts must be lvalue references"
);
static_assert
(
std
::
is_base_of_v
<
local_actor
,
T
>
,
static_assert
(
std
::
is_base_of_v
<
local_actor
,
T
>
,
"T is not derived from local_actor"
);
"T is not derived from local_actor"
);
...
...
libcaf_core/caf/actor_system_config.hpp
View file @
b3478445
...
@@ -120,7 +120,7 @@ public:
...
@@ -120,7 +120,7 @@ public:
/// @experimental
/// @experimental
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
actor_system_config
&
add_actor_type
(
std
::
string
name
)
{
actor_system_config
&
add_actor_type
(
std
::
string
name
)
{
using
handle
=
typename
infer_handle_from_class
<
T
>::
type
;
using
handle
=
infer_handle_from_class_t
<
T
>
;
static_assert
(
detail
::
is_complete
<
type_id
<
handle
>>
);
static_assert
(
detail
::
is_complete
<
type_id
<
handle
>>
);
return
add_actor_factory
(
std
::
move
(
name
),
make_actor_factory
<
T
,
Ts
...
>
());
return
add_actor_factory
(
std
::
move
(
name
),
make_actor_factory
<
T
,
Ts
...
>
());
}
}
...
@@ -130,7 +130,7 @@ public:
...
@@ -130,7 +130,7 @@ public:
/// @experimental
/// @experimental
template
<
class
F
>
template
<
class
F
>
actor_system_config
&
add_actor_type
(
std
::
string
name
,
F
f
)
{
actor_system_config
&
add_actor_type
(
std
::
string
name
,
F
f
)
{
using
handle
=
typename
infer_handle_from_fun
<
F
>::
type
;
using
handle
=
infer_handle_from_fun_t
<
F
>
;
static_assert
(
detail
::
is_complete
<
type_id
<
handle
>>
);
static_assert
(
detail
::
is_complete
<
type_id
<
handle
>>
);
return
add_actor_factory
(
std
::
move
(
name
),
make_actor_factory
(
std
::
move
(
f
)));
return
add_actor_factory
(
std
::
move
(
name
),
make_actor_factory
(
std
::
move
(
f
)));
}
}
...
...
libcaf_core/caf/blocking_actor.hpp
View file @
b3478445
...
@@ -306,9 +306,8 @@ public:
...
@@ -306,9 +306,8 @@ public:
static_assert
(
sizeof
...(
Ts
),
"at least one argument required"
);
static_assert
(
sizeof
...(
Ts
),
"at least one argument required"
);
// extract how many arguments are actually the behavior part,
// extract how many arguments are actually the behavior part,
// i.e., neither `after(...) >> ...` nor `others >> ...`.
// i.e., neither `after(...) >> ...` nor `others >> ...`.
using
filtered
=
using
filtered
=
tl_filter_not_t
<
type_list
<
std
::
decay_t
<
Ts
>
...
>
,
typename
tl_filter_not
<
type_list
<
typename
std
::
decay
<
Ts
>::
type
...
>
,
is_timeout_or_catch_all
>
;
is_timeout_or_catch_all
>::
type
;
filtered
tk
;
filtered
tk
;
behavior
bhvr
{
apply_moved_args
(
make_behavior_impl
,
get_indices
(
tk
),
tup
)};
behavior
bhvr
{
apply_moved_args
(
make_behavior_impl
,
get_indices
(
tk
),
tup
)};
using
tail_indices
=
using
tail_indices
=
...
...
libcaf_core/caf/check_typed_input.hpp
View file @
b3478445
...
@@ -11,7 +11,7 @@ namespace caf {
...
@@ -11,7 +11,7 @@ namespace caf {
template
<
class
T
>
template
<
class
T
>
struct
signatures_of
{
struct
signatures_of
{
using
type
=
typename
std
::
remove_pointer
<
T
>::
type
::
signatures
;
using
type
=
typename
std
::
remove_pointer
_t
<
T
>
::
signatures
;
};
};
template
<
class
T
>
template
<
class
T
>
...
@@ -19,8 +19,7 @@ using signatures_of_t = typename signatures_of<T>::type;
...
@@ -19,8 +19,7 @@ using signatures_of_t = typename signatures_of<T>::type;
template
<
class
T
>
template
<
class
T
>
constexpr
bool
statically_typed
()
{
constexpr
bool
statically_typed
()
{
return
!
std
::
is_same
<
return
!
std
::
is_same_v
<
none_t
,
typename
std
::
remove_pointer_t
<
T
>::
signatures
>
;
none_t
,
typename
std
::
remove_pointer
<
T
>::
type
::
signatures
>::
value
;
}
}
template
<
class
T
>
template
<
class
T
>
...
...
libcaf_core/caf/cow_tuple.hpp
View file @
b3478445
...
@@ -104,8 +104,8 @@ private:
...
@@ -104,8 +104,8 @@ private:
/// Creates a new copy-on-write tuple from given arguments.
/// Creates a new copy-on-write tuple from given arguments.
/// @relates cow_tuple
/// @relates cow_tuple
template
<
class
...
Ts
>
template
<
class
...
Ts
>
cow_tuple
<
typename
std
::
decay
<
Ts
>::
type
...
>
make_cow_tuple
(
Ts
&&
...
xs
)
{
cow_tuple
<
std
::
decay_t
<
Ts
>
...
>
make_cow_tuple
(
Ts
&&
...
xs
)
{
return
cow_tuple
<
typename
std
::
decay
<
Ts
>::
type
...
>
{
std
::
forward
<
Ts
>
(
xs
)...};
return
cow_tuple
<
std
::
decay_t
<
Ts
>
...
>
{
std
::
forward
<
Ts
>
(
xs
)...};
}
}
/// Convenience function for calling `get<N>(xs.data())`.
/// Convenience function for calling `get<N>(xs.data())`.
...
...
libcaf_core/caf/detail/init_fun_factory.hpp
View file @
b3478445
...
@@ -120,10 +120,10 @@ public:
...
@@ -120,10 +120,10 @@ public:
ptr_type
make
(
F
f
,
Ts
&&
...
xs
)
{
ptr_type
make
(
F
f
,
Ts
&&
...
xs
)
{
static_assert
(
std
::
is_base_of_v
<
local_actor
,
Base
>
,
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
=
detail
::
get_callable_trait_t
<
F
>
;
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
=
detail
::
tl_head_t
<
arg_types
>
;
constexpr
bool
selfptr
=
std
::
is_pointer_v
<
first_arg
>
;
constexpr
bool
selfptr
=
std
::
is_pointer_v
<
first_arg
>
;
constexpr
bool
rets
=
std
::
is_convertible_v
<
res_type
,
behavior
>
;
constexpr
bool
rets
=
std
::
is_convertible_v
<
res_type
,
behavior
>
;
using
tuple_type
=
decltype
(
std
::
make_tuple
(
detail
::
spawn_fwd
<
Ts
>
(
xs
)...));
using
tuple_type
=
decltype
(
std
::
make_tuple
(
detail
::
spawn_fwd
<
Ts
>
(
xs
)...));
...
...
libcaf_core/caf/detail/parser/read_floating_point.hpp
View file @
b3478445
...
@@ -171,7 +171,7 @@ void read_floating_point(State& ps, Consumer&& consumer,
...
@@ -171,7 +171,7 @@ void read_floating_point(State& ps, Consumer&& consumer,
template
<
class
State
,
class
Consumer
>
template
<
class
State
,
class
Consumer
>
void
read_floating_point
(
State
&
ps
,
Consumer
&&
consumer
)
{
void
read_floating_point
(
State
&
ps
,
Consumer
&&
consumer
)
{
using
consumer_type
=
typename
std
::
decay
<
Consumer
>::
type
;
using
consumer_type
=
std
::
decay_t
<
Consumer
>
;
using
value_type
=
typename
consumer_type
::
value_type
;
using
value_type
=
typename
consumer_type
::
value_type
;
return
read_floating_point
(
ps
,
consumer
,
std
::
optional
<
value_type
>
{});
return
read_floating_point
(
ps
,
consumer
,
std
::
optional
<
value_type
>
{});
}
}
...
...
libcaf_core/caf/detail/parser/read_signed_integer.hpp
View file @
b3478445
...
@@ -26,7 +26,7 @@ namespace caf::detail::parser {
...
@@ -26,7 +26,7 @@ namespace caf::detail::parser {
/// `double`.
/// `double`.
template
<
class
State
,
class
Consumer
>
template
<
class
State
,
class
Consumer
>
void
read_signed_integer
(
State
&
ps
,
Consumer
&&
consumer
)
{
void
read_signed_integer
(
State
&
ps
,
Consumer
&&
consumer
)
{
using
consumer_type
=
typename
std
::
decay
<
Consumer
>::
type
;
using
consumer_type
=
std
::
decay_t
<
Consumer
>
;
using
value_type
=
typename
consumer_type
::
value_type
;
using
value_type
=
typename
consumer_type
::
value_type
;
static_assert
(
std
::
is_integral_v
<
value_type
>
&&
std
::
is_signed_v
<
value_type
>
,
static_assert
(
std
::
is_integral_v
<
value_type
>
&&
std
::
is_signed_v
<
value_type
>
,
"expected a signed integer type"
);
"expected a signed integer type"
);
...
...
libcaf_core/caf/detail/parser/read_unsigned_integer.hpp
View file @
b3478445
...
@@ -26,7 +26,7 @@ namespace caf::detail::parser {
...
@@ -26,7 +26,7 @@ namespace caf::detail::parser {
/// `double`.
/// `double`.
template
<
class
State
,
class
Consumer
>
template
<
class
State
,
class
Consumer
>
void
read_unsigned_integer
(
State
&
ps
,
Consumer
&&
consumer
)
{
void
read_unsigned_integer
(
State
&
ps
,
Consumer
&&
consumer
)
{
using
consumer_type
=
typename
std
::
decay
<
Consumer
>::
type
;
using
consumer_type
=
std
::
decay_t
<
Consumer
>
;
using
value_type
=
typename
consumer_type
::
value_type
;
using
value_type
=
typename
consumer_type
::
value_type
;
static_assert
(
std
::
is_integral_v
<
value_type
>
static_assert
(
std
::
is_integral_v
<
value_type
>
&&
std
::
is_unsigned_v
<
value_type
>
,
&&
std
::
is_unsigned_v
<
value_type
>
,
...
...
libcaf_core/caf/detail/spawn_fwd.hpp
View file @
b3478445
...
@@ -26,20 +26,18 @@ struct spawn_fwd_convert<T*> {
...
@@ -26,20 +26,18 @@ struct spawn_fwd_convert<T*> {
/// Converts `scoped_actor` and pointers to actors to handles of type `actor`
/// Converts `scoped_actor` and pointers to actors to handles of type `actor`
/// but simply forwards any other argument in the same way `std::forward` does.
/// but simply forwards any other argument in the same way `std::forward` does.
template
<
class
T
>
template
<
class
T
>
typename
std
::
conditional
<
std
::
conditional_t
<
spawn_fwd_convert
<
std
::
remove_reference_t
<
T
>>::
value
,
actor
,
spawn_fwd_convert
<
typename
std
::
remove_reference
<
T
>::
type
>::
value
,
actor
,
T
&&>
T
&&>::
type
spawn_fwd
(
std
::
remove_reference_t
<
T
>&
arg
)
noexcept
{
spawn_fwd
(
typename
std
::
remove_reference
<
T
>::
type
&
arg
)
noexcept
{
return
static_cast
<
T
&&>
(
arg
);
return
static_cast
<
T
&&>
(
arg
);
}
}
/// Converts `scoped_actor` and pointers to actors to handles of type `actor`
/// Converts `scoped_actor` and pointers to actors to handles of type `actor`
/// but simply forwards any other argument in the same way `std::forward` does.
/// but simply forwards any other argument in the same way `std::forward` does.
template
<
class
T
>
template
<
class
T
>
typename
std
::
conditional
<
std
::
conditional_t
<
spawn_fwd_convert
<
std
::
remove_reference_t
<
T
>>::
value
,
actor
,
spawn_fwd_convert
<
typename
std
::
remove_reference
<
T
>::
type
>::
value
,
actor
,
T
&&>
T
&&>::
type
spawn_fwd
(
std
::
remove_reference_t
<
T
>&&
arg
)
noexcept
{
spawn_fwd
(
typename
std
::
remove_reference
<
T
>::
type
&&
arg
)
noexcept
{
static_assert
(
!
std
::
is_lvalue_reference_v
<
T
>
,
static_assert
(
!
std
::
is_lvalue_reference_v
<
T
>
,
"silently converting an lvalue to an rvalue"
);
"silently converting an lvalue to an rvalue"
);
return
static_cast
<
T
&&>
(
arg
);
return
static_cast
<
T
&&>
(
arg
);
...
...
libcaf_core/caf/detail/type_list.hpp
View file @
b3478445
...
@@ -32,6 +32,10 @@ struct strip_param<param<T>> {
...
@@ -32,6 +32,10 @@ struct strip_param<param<T>> {
using
type
=
T
;
using
type
=
T
;
};
};
/// Convenience alias for `strip_param<T>::type`.
template
<
class
T
>
using
strip_param_t
=
typename
strip_param
<
T
>::
type
;
/// Denotes the empty list.
/// Denotes the empty list.
using
empty_type_list
=
type_list
<>
;
using
empty_type_list
=
type_list
<>
;
...
...
libcaf_core/caf/detail/type_traits.hpp
View file @
b3478445
...
@@ -63,21 +63,21 @@ constexpr T* null_v = nullptr;
...
@@ -63,21 +63,21 @@ constexpr T* null_v = nullptr;
// -- backport of C++14 additions ----------------------------------------------
// -- backport of C++14 additions ----------------------------------------------
template
<
class
T
>
template
<
class
T
>
using
decay_t
=
typename
std
::
decay
<
T
>::
type
;
using
decay_t
=
std
::
decay_t
<
T
>
;
template
<
bool
B
,
class
T
,
class
F
>
template
<
bool
B
,
class
T
,
class
F
>
using
conditional_t
=
typename
std
::
conditional
<
B
,
T
,
F
>::
type
;
using
conditional_t
=
typename
std
::
conditional
<
B
,
T
,
F
>::
type
;
template
<
bool
V
,
class
T
=
void
>
template
<
bool
V
,
class
T
=
void
>
using
enable_if_t
=
typename
std
::
enable_if
<
V
,
T
>::
type
;
using
enable_if_t
=
std
::
enable_if_t
<
V
,
T
>
;
// -- custom traits ------------------------------------------------------------
// -- custom traits ------------------------------------------------------------
template
<
class
Trait
,
class
T
=
void
>
template
<
class
Trait
,
class
T
=
void
>
using
enable_if_tt
=
typename
std
::
enable_if
<
Trait
::
value
,
T
>::
type
;
using
enable_if_tt
=
std
::
enable_if_t
<
Trait
::
value
,
T
>
;
template
<
class
T
>
template
<
class
T
>
using
remove_reference_t
=
typename
std
::
remove_reference
<
T
>::
type
;
using
remove_reference_t
=
std
::
remove_reference_t
<
T
>
;
/// Checks whether `T` defines a free function `to_string`.
/// Checks whether `T` defines a free function `to_string`.
template
<
class
T
>
template
<
class
T
>
...
@@ -119,6 +119,10 @@ struct conjunction<X, Xs...> {
...
@@ -119,6 +119,10 @@ struct conjunction<X, Xs...> {
static
constexpr
bool
value
=
X
&&
conjunction
<
Xs
...
>::
value
;
static
constexpr
bool
value
=
X
&&
conjunction
<
Xs
...
>::
value
;
};
};
/// Convenience alias for `conjunction<BoolConstants...>::value`.
template
<
bool
...
BoolConstants
>
bool
constexpr
conjunction_v
=
conjunction
<
BoolConstants
...
>::
value
;
/// Joins all bool constants using operator ||.
/// Joins all bool constants using operator ||.
template
<
bool
...
BoolConstants
>
template
<
bool
...
BoolConstants
>
struct
disjunction
;
struct
disjunction
;
...
@@ -133,6 +137,10 @@ struct disjunction<X, Xs...> {
...
@@ -133,6 +137,10 @@ struct disjunction<X, Xs...> {
static
constexpr
bool
value
=
X
||
disjunction
<
Xs
...
>::
value
;
static
constexpr
bool
value
=
X
||
disjunction
<
Xs
...
>::
value
;
};
};
/// Convenience alias for `disjunction<BoolConstants...>::value`.
template
<
bool
...
BoolConstants
>
bool
constexpr
disjunction_v
=
disjunction
<
BoolConstants
...
>::
value
;
/// Checks whether `T` is a `std::chrono::duration`.
/// Checks whether `T` is a `std::chrono::duration`.
template
<
class
T
>
template
<
class
T
>
struct
is_duration
:
std
::
false_type
{};
struct
is_duration
:
std
::
false_type
{};
...
@@ -327,10 +335,9 @@ struct has_apply_operator {
...
@@ -327,10 +335,9 @@ struct has_apply_operator {
// matches (IsFun || IsMemberFun)
// matches (IsFun || IsMemberFun)
template
<
class
T
,
template
<
class
T
,
bool
IsFun
bool
IsFun
=
std
::
is_function_v
<
T
>
=
std
::
is_function_v
<
T
>
||
std
::
is_function_v
<
std
::
remove_pointer_t
<
T
>>
||
std
::
is_function
<
typename
std
::
remove_pointer
<
T
>::
type
>::
value
||
std
::
is_member_function_pointer_v
<
T
>
,
||
std
::
is_member_function_pointer_v
<
T
>
,
bool
HasApplyOp
=
has_apply_operator
<
T
>::
value
>
bool
HasApplyOp
=
has_apply_operator
<
T
>::
value
>
struct
get_callable_trait_helper
{
struct
get_callable_trait_helper
{
using
type
=
callable_trait
<
T
>
;
using
type
=
callable_trait
<
T
>
;
...
@@ -368,7 +375,7 @@ using get_callable_trait_t = typename get_callable_trait<T>::type;
...
@@ -368,7 +375,7 @@ using get_callable_trait_t = typename get_callable_trait<T>::type;
template
<
class
T
>
template
<
class
T
>
struct
is_callable
{
struct
is_callable
{
template
<
class
C
>
template
<
class
C
>
static
bool
_fun
(
C
*
,
typename
get_callable_trait
<
C
>::
type
*
=
nullptr
);
static
bool
_fun
(
C
*
,
get_callable_trait_t
<
C
>
*
=
nullptr
);
static
void
_fun
(
void
*
);
static
void
_fun
(
void
*
);
...
...
libcaf_core/caf/detail/typed_actor_util.hpp
View file @
b3478445
...
@@ -30,8 +30,13 @@ struct make_response_promise_helper<response_promise> {
...
@@ -30,8 +30,13 @@ struct make_response_promise_helper<response_promise> {
using
type
=
response_promise
;
using
type
=
response_promise
;
};
};
/// Convenience alias for `make_response_promise_helper<Ts...>::type`.
template
<
class
...
Ts
>
template
<
class
...
Ts
>
using
response_promise_t
=
typename
make_response_promise_helper
<
Ts
...
>::
type
;
using
make_response_promise_helper_t
=
typename
make_response_promise_helper
<
Ts
...
>::
type
;
template
<
class
...
Ts
>
using
response_promise_t
=
make_response_promise_helper_t
<
Ts
...
>
;
template
<
class
Output
,
class
F
>
template
<
class
Output
,
class
F
>
struct
type_checker
{
struct
type_checker
{
...
...
libcaf_core/caf/exec_main.hpp
View file @
b3478445
...
@@ -56,13 +56,12 @@ void exec_main_load_module(actor_system_config& cfg) {
...
@@ -56,13 +56,12 @@ void exec_main_load_module(actor_system_config& cfg) {
template
<
class
...
Ts
,
class
F
=
void
(
*
)(
actor_system
&
)>
template
<
class
...
Ts
,
class
F
=
void
(
*
)(
actor_system
&
)>
int
exec_main
(
F
fun
,
int
argc
,
char
**
argv
)
{
int
exec_main
(
F
fun
,
int
argc
,
char
**
argv
)
{
using
trait
=
typename
detail
::
get_callable_trait
<
F
>::
type
;
using
trait
=
detail
::
get_callable_trait_t
<
F
>
;
using
arg_types
=
typename
trait
::
arg_types
;
using
arg_types
=
typename
trait
::
arg_types
;
static_assert
(
detail
::
tl_size
<
arg_types
>::
value
==
1
static_assert
(
detail
::
tl_size
<
arg_types
>::
value
==
1
||
detail
::
tl_size
<
arg_types
>::
value
==
2
,
||
detail
::
tl_size
<
arg_types
>::
value
==
2
,
"main function must have one or two arguments"
);
"main function must have one or two arguments"
);
static_assert
(
std
::
is_same
<
typename
detail
::
tl_head
<
arg_types
>::
type
,
static_assert
(
std
::
is_same_v
<
detail
::
tl_head_t
<
arg_types
>
,
actor_system
&>
,
actor_system
&>::
value
,
"main function must take actor_system& as first parameter"
);
"main function must take actor_system& as first parameter"
);
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
;
...
...
libcaf_core/caf/function_view.hpp
View file @
b3478445
...
@@ -52,6 +52,10 @@ private:
...
@@ -52,6 +52,10 @@ private:
std
::
tuple
<
Ts
...
>*
storage_
;
std
::
tuple
<
Ts
...
>*
storage_
;
};
};
/// Convenience alias for `function_view_storage<T>::type`.
template
<
class
T
>
using
function_view_storage_t
=
typename
function_view_storage
<
T
>::
type
;
struct
CAF_CORE_EXPORT
function_view_storage_catch_all
{
struct
CAF_CORE_EXPORT
function_view_storage_catch_all
{
message
*
storage_
;
message
*
storage_
;
...
@@ -166,8 +170,7 @@ public:
...
@@ -166,8 +170,7 @@ public:
function_view_result
<
value_type
>
result
;
function_view_result
<
value_type
>
result
;
self_
->
request
(
impl_
,
timeout
,
std
::
forward
<
Ts
>
(
xs
)...)
self_
->
request
(
impl_
,
timeout
,
std
::
forward
<
Ts
>
(
xs
)...)
.
receive
([
&
](
error
&
x
)
{
err
=
std
::
move
(
x
);
},
.
receive
([
&
](
error
&
x
)
{
err
=
std
::
move
(
x
);
},
typename
function_view_storage
<
value_type
>::
type
{
function_view_storage_t
<
value_type
>
{
result
.
value
});
result
.
value
});
if
(
err
)
if
(
err
)
return
result_type
{
err
};
return
result_type
{
err
};
else
else
...
...
libcaf_core/caf/fwd.hpp
View file @
b3478445
...
@@ -283,12 +283,16 @@ struct gauge_oracle<int64_t> {
...
@@ -283,12 +283,16 @@ struct gauge_oracle<int64_t> {
using
type
=
telemetry
::
int_gauge
;
using
type
=
telemetry
::
int_gauge
;
};
};
/// Convenience alias for `detail::gauge_oracle<ValueType>::type`.
template
<
class
ValueType
>
using
gauge_oracle_t
=
typename
gauge_oracle
<
ValueType
>::
type
;
}
// namespace detail
}
// namespace detail
namespace
telemetry
{
namespace
telemetry
{
template
<
class
ValueType
>
template
<
class
ValueType
>
using
gauge
=
typename
detail
::
gauge_oracle
<
ValueType
>::
type
;
using
gauge
=
detail
::
gauge_oracle_t
<
ValueType
>
;
}
// namespace telemetry
}
// namespace telemetry
...
...
libcaf_core/caf/infer_handle.hpp
View file @
b3478445
...
@@ -27,8 +27,8 @@ using spawn_mode_token = std::integral_constant<spawn_mode, X>;
...
@@ -27,8 +27,8 @@ using spawn_mode_token = std::integral_constant<spawn_mode, X>;
// default: dynamically typed actor without self pointer
// default: dynamically typed actor without self pointer
template
<
class
Result
,
class
FirstArg
,
template
<
class
Result
,
class
FirstArg
,
bool
FirstArgValid
=
std
::
is_base_of
<
bool
FirstArgValid
local_actor
,
typename
std
::
remove_pointer
<
FirstArg
>
::
type
>::
value
>
=
std
::
is_base_of_v
<
local_actor
,
std
::
remove_pointer_t
<
FirstArg
>
>
>
struct
infer_handle_from_fun_impl
{
struct
infer_handle_from_fun_impl
{
using
type
=
actor
;
using
type
=
actor
;
using
impl
=
event_based_actor
;
using
impl
=
event_based_actor
;
...
@@ -76,11 +76,11 @@ struct infer_handle_from_fun_impl<typed_behavior<Sigs...>, Impl*, true> {
...
@@ -76,11 +76,11 @@ struct infer_handle_from_fun_impl<typed_behavior<Sigs...>, Impl*, true> {
};
};
/// Deduces an actor handle type from a function or function object.
/// Deduces an actor handle type from a function or function object.
template
<
class
F
,
class
Trait
=
typename
detail
::
get_callable_trait
<
F
>
::
type
>
template
<
class
F
,
class
Trait
=
detail
::
get_callable_trait_t
<
F
>
>
struct
infer_handle_from_fun
{
struct
infer_handle_from_fun
{
using
result_type
=
typename
Trait
::
result_type
;
using
result_type
=
typename
Trait
::
result_type
;
using
arg_types
=
typename
Trait
::
arg_types
;
using
arg_types
=
typename
Trait
::
arg_types
;
using
first_arg
=
typename
detail
::
tl_head
<
arg_types
>::
type
;
using
first_arg
=
detail
::
tl_head_t
<
arg_types
>
;
using
delegate
=
infer_handle_from_fun_impl
<
result_type
,
first_arg
>
;
using
delegate
=
infer_handle_from_fun_impl
<
result_type
,
first_arg
>
;
using
type
=
typename
delegate
::
type
;
using
type
=
typename
delegate
::
type
;
using
impl
=
typename
delegate
::
impl
;
using
impl
=
typename
delegate
::
impl
;
...
...
libcaf_core/caf/init_global_meta_objects.hpp
View file @
b3478445
...
@@ -35,9 +35,15 @@ struct type_id_sequence_helper<type_id_pair<Begin, End>, Is...> {
...
@@ -35,9 +35,15 @@ struct type_id_sequence_helper<type_id_pair<Begin, End>, Is...> {
Is
...,
Begin
>::
type
;
Is
...,
Begin
>::
type
;
};
};
/// Convenience alias for `type_id_sequence_helper<class Range,
/// uint16_t...>::type`.
template
<
class
Range
,
uint16_t
...
Is
>
using
type_id_sequence_helper_t
=
typename
type_id_sequence_helper
<
Range
,
Is
...
>::
type
;
template
<
class
Range
>
template
<
class
Range
>
using
make_type_id_sequence
=
typename
type_id_sequence_helper
<
using
make_type_id_sequence
type_id_pair
<
Range
::
begin
,
Range
::
end
>>::
type
;
=
type_id_sequence_helper_t
<
type_id_pair
<
Range
::
begin
,
Range
::
end
>>
;
}
// namespace caf::detail
}
// namespace caf::detail
...
...
libcaf_core/caf/local_actor.hpp
View file @
b3478445
...
@@ -407,9 +407,9 @@ public:
...
@@ -407,9 +407,9 @@ public:
template
<
message_priority
P
=
message_priority
::
normal
,
class
Handle
=
actor
,
template
<
message_priority
P
=
message_priority
::
normal
,
class
Handle
=
actor
,
class
...
Ts
>
class
...
Ts
>
typename
response_type
<
typename
Handle
::
signatures
,
typename
response_type
<
detail
::
implicit_conversions_t
<
typename
Handle
::
signatures
,
typename
std
::
decay
<
Ts
>::
type
>
...
>::
delegated_type
detail
::
implicit_conversions_t
<
std
::
decay_t
<
Ts
>
>
...
>::
delegated_type
delegate
(
const
Handle
&
dest
,
Ts
&&
...
xs
)
{
delegate
(
const
Handle
&
dest
,
Ts
&&
...
xs
)
{
auto
rp
=
make_response_promise
();
auto
rp
=
make_response_promise
();
return
rp
.
template
delegate
<
P
>(
dest
,
std
::
forward
<
Ts
>
(
xs
)...);
return
rp
.
template
delegate
<
P
>(
dest
,
std
::
forward
<
Ts
>
(
xs
)...);
...
...
libcaf_core/caf/mailbox_element.hpp
View file @
b3478445
...
@@ -109,7 +109,7 @@ make_mailbox_element(strong_actor_ptr sender, message_id id,
...
@@ -109,7 +109,7 @@ make_mailbox_element(strong_actor_ptr sender, message_id id,
/// @relates mailbox_element
/// @relates mailbox_element
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
std
::
enable_if_t
<!
std
::
is_same_v
<
typename
std
::
decay
<
T
>::
type
,
message
>
std
::
enable_if_t
<!
std
::
is_same_v
<
std
::
decay_t
<
T
>
,
message
>
||
(
sizeof
...(
Ts
)
>
0
),
||
(
sizeof
...(
Ts
)
>
0
),
mailbox_element_ptr
>
mailbox_element_ptr
>
make_mailbox_element
(
strong_actor_ptr
sender
,
message_id
id
,
make_mailbox_element
(
strong_actor_ptr
sender
,
message_id
id
,
...
...
libcaf_core/caf/message_handler.hpp
View file @
b3478445
...
@@ -62,8 +62,7 @@ public:
...
@@ -62,8 +62,7 @@ public:
void
assign
(
Ts
...
xs
)
{
void
assign
(
Ts
...
xs
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"assign without arguments called"
);
static_assert
(
sizeof
...(
Ts
)
>
0
,
"assign without arguments called"
);
static_assert
(
static_assert
(
!
detail
::
disjunction
<
!
detail
::
disjunction
<
may_have_timeout
<
std
::
decay_t
<
Ts
>>::
value
...
>::
value
,
may_have_timeout
<
typename
std
::
decay
<
Ts
>::
type
>::
value
...
>::
value
,
"Timeouts are only allowed in behaviors"
);
"Timeouts are only allowed in behaviors"
);
impl_
=
detail
::
make_behavior
(
xs
...);
impl_
=
detail
::
make_behavior
(
xs
...);
}
}
...
@@ -84,9 +83,9 @@ public:
...
@@ -84,9 +83,9 @@ public:
/// Returns a new handler that concatenates this handler
/// Returns a new handler that concatenates this handler
/// with a new handler from `xs...`.
/// with a new handler from `xs...`.
template
<
class
...
Ts
>
template
<
class
...
Ts
>
typename
std
::
conditional
<
detail
::
disjunction
<
may_have_timeou
t
<
std
::
conditional_
t
<
typename
std
::
decay
<
Ts
>::
type
>::
value
...
>::
value
,
detail
::
disjunction_v
<
may_have_timeout
<
std
::
decay_t
<
Ts
>>::
value
...
>
,
behavior
,
message_handler
>::
type
behavior
,
message_handler
>
or_else
(
Ts
&&
...
xs
)
const
{
or_else
(
Ts
&&
...
xs
)
const
{
// using a behavior is safe here, because we "cast"
// using a behavior is safe here, because we "cast"
// it back to a message_handler when appropriate
// it back to a message_handler when appropriate
...
...
libcaf_core/caf/response_promise.hpp
View file @
b3478445
...
@@ -134,13 +134,12 @@ public:
...
@@ -134,13 +134,12 @@ public:
/// @post `pending() == false`
/// @post `pending() == false`
template
<
message_priority
P
=
message_priority
::
normal
,
class
Handle
=
actor
,
template
<
message_priority
P
=
message_priority
::
normal
,
class
Handle
=
actor
,
class
...
Ts
>
class
...
Ts
>
delegated_response_type_t
<
delegated_response_type_t
<
typename
Handle
::
signatures
,
typename
Handle
::
signatures
,
detail
::
implicit_conversions_t
<
std
::
decay_t
<
Ts
>>
...
>
detail
::
implicit_conversions_t
<
typename
std
::
decay
<
Ts
>::
type
>
...
>
delegate
(
const
Handle
&
dest
,
Ts
&&
...
xs
)
{
delegate
(
const
Handle
&
dest
,
Ts
&&
...
xs
)
{
static_assert
(
sizeof
...(
Ts
)
>
0
,
"nothing to delegate"
);
static_assert
(
sizeof
...(
Ts
)
>
0
,
"nothing to delegate"
);
using
token
=
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
using
token
typename
std
::
decay
<
Ts
>::
type
>::
type
...
>
;
=
detail
::
type_list
<
detail
::
implicit_conversions_t
<
std
::
decay_t
<
Ts
>>
...
>
;
static_assert
(
response_type_unbox
<
signatures_of_t
<
Handle
>
,
token
>::
valid
,
static_assert
(
response_type_unbox
<
signatures_of_t
<
Handle
>
,
token
>::
valid
,
"receiver does not accept given message"
);
"receiver does not accept given message"
);
if
(
pending
())
{
if
(
pending
())
{
...
...
libcaf_core/caf/span.hpp
View file @
b3478445
...
@@ -21,7 +21,7 @@ public:
...
@@ -21,7 +21,7 @@ public:
using
element_type
=
T
;
using
element_type
=
T
;
using
value_type
=
typename
std
::
remove_cv
<
T
>::
type
;
using
value_type
=
std
::
remove_cv_t
<
T
>
;
using
index_type
=
size_t
;
using
index_type
=
size_t
;
...
...
libcaf_core/caf/string_view.hpp
View file @
b3478445
...
@@ -42,8 +42,7 @@ struct is_string_like {
...
@@ -42,8 +42,7 @@ struct is_string_like {
static
void
sfinae
(
void
*
);
static
void
sfinae
(
void
*
);
// Result of SFINAE test.
// Result of SFINAE test.
using
result_type
using
result_type
=
decltype
(
sfinae
(
static_cast
<
std
::
decay_t
<
T
>*>
(
nullptr
)));
=
decltype
(
sfinae
(
static_cast
<
typename
std
::
decay
<
T
>::
type
*>
(
nullptr
)));
// Trait result.
// Trait result.
static
constexpr
bool
value
=
std
::
is_same_v
<
bool
,
result_type
>
;
static
constexpr
bool
value
=
std
::
is_same_v
<
bool
,
result_type
>
;
...
...
libcaf_core/caf/type_id_list.hpp
View file @
b3478445
...
@@ -146,7 +146,7 @@ struct to_type_id_list_helper;
...
@@ -146,7 +146,7 @@ struct to_type_id_list_helper;
template
<
class
...
Ts
>
template
<
class
...
Ts
>
struct
to_type_id_list_helper
<
type_list
<
Ts
...
>>
{
struct
to_type_id_list_helper
<
type_list
<
Ts
...
>>
{
static
constexpr
type_id_list
get
()
{
static
constexpr
type_id_list
get
()
{
return
make_type_id_list
<
typename
strip_param
<
Ts
>::
type
...
>
();
return
make_type_id_list
<
strip_param_t
<
Ts
>
...
>
();
}
}
};
};
...
...
libcaf_core/caf/typed_actor_view.hpp
View file @
b3478445
...
@@ -46,13 +46,13 @@ public:
...
@@ -46,13 +46,13 @@ public:
/// @copydoc local_actor::spawn
/// @copydoc local_actor::spawn
template
<
class
T
,
spawn_options
Os
=
no_spawn_options
,
class
...
Ts
>
template
<
class
T
,
spawn_options
Os
=
no_spawn_options
,
class
...
Ts
>
typename
infer_handle_from_class
<
T
>::
type
spawn
(
Ts
&&
...
xs
)
{
infer_handle_from_class_t
<
T
>
spawn
(
Ts
&&
...
xs
)
{
return
self_
->
spawn
<
T
,
Os
>
(
std
::
forward
<
Ts
>
(
xs
)...);
return
self_
->
spawn
<
T
,
Os
>
(
std
::
forward
<
Ts
>
(
xs
)...);
}
}
/// @copydoc local_actor::spawn
/// @copydoc local_actor::spawn
template
<
spawn_options
Os
=
no_spawn_options
,
class
F
,
class
...
Ts
>
template
<
spawn_options
Os
=
no_spawn_options
,
class
F
,
class
...
Ts
>
typename
infer_handle_from_fun
<
F
>::
type
spawn
(
F
fun
,
Ts
&&
...
xs
)
{
infer_handle_from_fun_t
<
F
>
spawn
(
F
fun
,
Ts
&&
...
xs
)
{
return
self_
->
spawn
<
Os
>
(
std
::
move
(
fun
),
std
::
forward
<
Ts
>
(
xs
)...);
return
self_
->
spawn
<
Os
>
(
std
::
move
(
fun
),
std
::
forward
<
Ts
>
(
xs
)...);
}
}
...
@@ -252,8 +252,7 @@ public:
...
@@ -252,8 +252,7 @@ public:
}
}
template
<
class
...
Ts
>
template
<
class
...
Ts
>
typename
detail
::
make_response_promise_helper
<
Ts
...
>::
type
detail
::
make_response_promise_helper_t
<
Ts
...
>
make_response_promise
()
{
make_response_promise
()
{
return
self_
->
make_response_promise
<
Ts
...
>
();
return
self_
->
make_response_promise
<
Ts
...
>
();
}
}
...
...
libcaf_core/tests/legacy/detail/parser/read_number.cpp
View file @
b3478445
...
@@ -105,12 +105,12 @@ struct range_parser {
...
@@ -105,12 +105,12 @@ struct range_parser {
};
};
template
<
class
T
>
template
<
class
T
>
typename
std
::
enable_if
<
std
::
is_integral_v
<
T
>
,
res_t
>::
type
res
(
T
x
)
{
std
::
enable_if_t
<
std
::
is_integral_v
<
T
>
,
res_t
>
res
(
T
x
)
{
return
{
static_cast
<
int64_t
>
(
x
)};
return
{
static_cast
<
int64_t
>
(
x
)};
}
}
template
<
class
T
>
template
<
class
T
>
typename
std
::
enable_if
<
std
::
is_floating_point_v
<
T
>
,
res_t
>::
type
res
(
T
x
)
{
std
::
enable_if_t
<
std
::
is_floating_point_v
<
T
>
,
res_t
>
res
(
T
x
)
{
return
{
static_cast
<
double
>
(
x
)};
return
{
static_cast
<
double
>
(
x
)};
}
}
...
...
libcaf_core/tests/legacy/detail/parser/read_number_or_timespan.cpp
View file @
b3478445
...
@@ -72,12 +72,12 @@ struct fixture {
...
@@ -72,12 +72,12 @@ struct fixture {
};
};
template
<
class
T
>
template
<
class
T
>
typename
std
::
enable_if
<
std
::
is_integral_v
<
T
>
,
res_t
>::
type
res
(
T
x
)
{
std
::
enable_if_t
<
std
::
is_integral_v
<
T
>
,
res_t
>
res
(
T
x
)
{
return
res_t
{
static_cast
<
int64_t
>
(
x
)};
return
res_t
{
static_cast
<
int64_t
>
(
x
)};
}
}
template
<
class
T
>
template
<
class
T
>
typename
std
::
enable_if
<
std
::
is_floating_point_v
<
T
>
,
res_t
>::
type
res
(
T
x
)
{
std
::
enable_if_t
<
std
::
is_floating_point_v
<
T
>
,
res_t
>
res
(
T
x
)
{
return
res_t
{
static_cast
<
double
>
(
x
)};
return
res_t
{
static_cast
<
double
>
(
x
)};
}
}
...
...
libcaf_io/caf/io/broker.hpp
View file @
b3478445
...
@@ -49,8 +49,7 @@ public:
...
@@ -49,8 +49,7 @@ public:
using
signatures
=
none_t
;
using
signatures
=
none_t
;
template
<
class
F
,
class
...
Ts
>
template
<
class
F
,
class
...
Ts
>
typename
infer_handle_from_fun
<
F
>::
type
infer_handle_from_fun_t
<
F
>
fork
(
F
fun
,
connection_handle
hdl
,
Ts
&&
...
xs
)
{
fork
(
F
fun
,
connection_handle
hdl
,
Ts
&&
...
xs
)
{
CAF_ASSERT
(
context
()
!=
nullptr
);
CAF_ASSERT
(
context
()
!=
nullptr
);
auto
sptr
=
this
->
take
(
hdl
);
auto
sptr
=
this
->
take
(
hdl
);
CAF_ASSERT
(
sptr
->
hdl
()
==
hdl
);
CAF_ASSERT
(
sptr
->
hdl
()
==
hdl
);
...
...
libcaf_io/caf/io/middleman.hpp
View file @
b3478445
...
@@ -83,7 +83,7 @@ public:
...
@@ -83,7 +83,7 @@ public:
template
<
class
Handle
>
template
<
class
Handle
>
expected
<
uint16_t
>
publish
(
Handle
&&
whom
,
uint16_t
port
,
expected
<
uint16_t
>
publish
(
Handle
&&
whom
,
uint16_t
port
,
const
char
*
in
=
nullptr
,
bool
reuse
=
false
)
{
const
char
*
in
=
nullptr
,
bool
reuse
=
false
)
{
detail
::
type_list
<
typename
std
::
decay
<
Handle
>::
type
>
tk
;
detail
::
type_list
<
std
::
decay_t
<
Handle
>
>
tk
;
return
publish
(
actor_cast
<
strong_actor_ptr
>
(
std
::
forward
<
Handle
>
(
whom
)),
return
publish
(
actor_cast
<
strong_actor_ptr
>
(
std
::
forward
<
Handle
>
(
whom
)),
system
().
message_types
(
tk
),
port
,
in
,
reuse
);
system
().
message_types
(
tk
),
port
,
in
,
reuse
);
}
}
...
@@ -224,7 +224,7 @@ public:
...
@@ -224,7 +224,7 @@ public:
/// Spawns a new functor-based broker.
/// Spawns a new functor-based broker.
template
<
spawn_options
Os
=
no_spawn_options
,
template
<
spawn_options
Os
=
no_spawn_options
,
class
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
class
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
typename
infer_handle_from_fun
<
F
>::
type
spawn_broker
(
F
fun
,
Ts
&&
...
xs
)
{
infer_handle_from_fun_t
<
F
>
spawn_broker
(
F
fun
,
Ts
&&
...
xs
)
{
using
impl
=
infer_impl_from_fun_t
<
F
>
;
using
impl
=
infer_impl_from_fun_t
<
F
>
;
static
constexpr
bool
spawnable
=
detail
::
spawnable
<
F
,
impl
,
Ts
...
>
();
static
constexpr
bool
spawnable
=
detail
::
spawnable
<
F
,
impl
,
Ts
...
>
();
static_assert
(
spawnable
,
static_assert
(
spawnable
,
...
@@ -240,7 +240,7 @@ public:
...
@@ -240,7 +240,7 @@ public:
/// @warning Blocks the caller for the timespan of the connection process.
/// @warning Blocks the caller for the timespan of the connection process.
template
<
spawn_options
Os
=
no_spawn_options
,
template
<
spawn_options
Os
=
no_spawn_options
,
class
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
class
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
expected
<
typename
infer_handle_from_fun
<
F
>::
type
>
expected
<
infer_handle_from_fun_t
<
F
>
>
spawn_client
(
F
fun
,
const
std
::
string
&
host
,
uint16_t
port
,
Ts
&&
...
xs
)
{
spawn_client
(
F
fun
,
const
std
::
string
&
host
,
uint16_t
port
,
Ts
&&
...
xs
)
{
using
impl
=
typename
infer_handle_from_fun
<
F
>::
impl
;
using
impl
=
typename
infer_handle_from_fun
<
F
>::
impl
;
return
spawn_client_impl
<
Os
,
impl
>
(
std
::
move
(
fun
),
host
,
port
,
return
spawn_client_impl
<
Os
,
impl
>
(
std
::
move
(
fun
),
host
,
port
,
...
@@ -251,7 +251,7 @@ public:
...
@@ -251,7 +251,7 @@ public:
/// @warning Blocks the caller until the server socket is initialized.
/// @warning Blocks the caller until the server socket is initialized.
template
<
spawn_options
Os
=
no_spawn_options
,
template
<
spawn_options
Os
=
no_spawn_options
,
class
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
class
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
expected
<
typename
infer_handle_from_fun
<
F
>::
type
>
expected
<
infer_handle_from_fun_t
<
F
>
>
spawn_server
(
F
fun
,
uint16_t
&
port
,
Ts
&&
...
xs
)
{
spawn_server
(
F
fun
,
uint16_t
&
port
,
Ts
&&
...
xs
)
{
using
impl
=
typename
infer_handle_from_fun
<
F
>::
impl
;
using
impl
=
typename
infer_handle_from_fun
<
F
>::
impl
;
return
spawn_server_impl
<
Os
,
impl
>
(
std
::
move
(
fun
),
port
,
return
spawn_server_impl
<
Os
,
impl
>
(
std
::
move
(
fun
),
port
,
...
@@ -262,7 +262,7 @@ public:
...
@@ -262,7 +262,7 @@ public:
/// @warning Blocks the caller until the server socket is initialized.
/// @warning Blocks the caller until the server socket is initialized.
template
<
spawn_options
Os
=
no_spawn_options
,
template
<
spawn_options
Os
=
no_spawn_options
,
class
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
class
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
expected
<
typename
infer_handle_from_fun
<
F
>::
type
>
expected
<
infer_handle_from_fun_t
<
F
>
>
spawn_server
(
F
fun
,
const
uint16_t
&
port
,
Ts
&&
...
xs
)
{
spawn_server
(
F
fun
,
const
uint16_t
&
port
,
Ts
&&
...
xs
)
{
uint16_t
dummy
=
port
;
uint16_t
dummy
=
port
;
using
impl
=
typename
infer_handle_from_fun
<
F
>::
impl
;
using
impl
=
typename
infer_handle_from_fun
<
F
>::
impl
;
...
@@ -315,7 +315,7 @@ protected:
...
@@ -315,7 +315,7 @@ protected:
private:
private:
template
<
spawn_options
Os
,
class
Impl
,
class
F
,
class
...
Ts
>
template
<
spawn_options
Os
,
class
Impl
,
class
F
,
class
...
Ts
>
expected
<
typename
infer_handle_from_class
<
Impl
>::
type
>
expected
<
infer_handle_from_class_t
<
Impl
>
>
spawn_client_impl
(
F
fun
,
const
std
::
string
&
host
,
uint16_t
port
,
Ts
&&
...
xs
)
{
spawn_client_impl
(
F
fun
,
const
std
::
string
&
host
,
uint16_t
port
,
Ts
&&
...
xs
)
{
auto
eptr
=
backend
().
new_tcp_scribe
(
host
,
port
);
auto
eptr
=
backend
().
new_tcp_scribe
(
host
,
port
);
if
(
!
eptr
)
if
(
!
eptr
)
...
@@ -333,7 +333,7 @@ private:
...
@@ -333,7 +333,7 @@ private:
}
}
template
<
spawn_options
Os
,
class
Impl
,
class
F
,
class
...
Ts
>
template
<
spawn_options
Os
,
class
Impl
,
class
F
,
class
...
Ts
>
expected
<
typename
infer_handle_from_class
<
Impl
>::
type
>
expected
<
infer_handle_from_class_t
<
Impl
>
>
spawn_server_impl
(
F
fun
,
uint16_t
&
port
,
Ts
&&
...
xs
)
{
spawn_server_impl
(
F
fun
,
uint16_t
&
port
,
Ts
&&
...
xs
)
{
auto
eptr
=
backend
().
new_tcp_doorman
(
port
);
auto
eptr
=
backend
().
new_tcp_doorman
(
port
);
if
(
!
eptr
)
if
(
!
eptr
)
...
...
libcaf_io/caf/io/network/default_multiplexer.cpp
View file @
b3478445
...
@@ -735,9 +735,8 @@ bool ip_connect(native_socket fd, const std::string& host, uint16_t port) {
...
@@ -735,9 +735,8 @@ bool ip_connect(native_socket fd, const std::string& host, uint16_t port) {
CAF_LOG_TRACE
(
"Family ="
<<
(
Family
==
AF_INET
?
"AF_INET"
:
"AF_INET6"
)
CAF_LOG_TRACE
(
"Family ="
<<
(
Family
==
AF_INET
?
"AF_INET"
:
"AF_INET6"
)
<<
CAF_ARG
(
fd
)
<<
CAF_ARG
(
host
));
<<
CAF_ARG
(
fd
)
<<
CAF_ARG
(
host
));
static_assert
(
Family
==
AF_INET
||
Family
==
AF_INET6
,
"invalid family"
);
static_assert
(
Family
==
AF_INET
||
Family
==
AF_INET6
,
"invalid family"
);
using
sockaddr_type
=
using
sockaddr_type
typename
std
::
conditional
<
Family
==
AF_INET
,
sockaddr_in
,
=
std
::
conditional_t
<
Family
==
AF_INET
,
sockaddr_in
,
sockaddr_in6
>
;
sockaddr_in6
>::
type
;
sockaddr_type
sa
;
sockaddr_type
sa
;
memset
(
&
sa
,
0
,
sizeof
(
sockaddr_type
));
memset
(
&
sa
,
0
,
sizeof
(
sockaddr_type
));
inet_pton
(
Family
,
host
.
c_str
(),
&
addr_of
(
sa
));
inet_pton
(
Family
,
host
.
c_str
(),
&
addr_of
(
sa
));
...
@@ -830,9 +829,8 @@ expected<native_socket> new_ip_acceptor_impl(uint16_t port, const char* addr,
...
@@ -830,9 +829,8 @@ expected<native_socket> new_ip_acceptor_impl(uint16_t port, const char* addr,
reinterpret_cast
<
setsockopt_ptr
>
(
&
on
),
reinterpret_cast
<
setsockopt_ptr
>
(
&
on
),
static_cast
<
socket_size_type
>
(
sizeof
(
on
))));
static_cast
<
socket_size_type
>
(
sizeof
(
on
))));
}
}
using
sockaddr_type
=
using
sockaddr_type
typename
std
::
conditional
<
Family
==
AF_INET
,
sockaddr_in
,
=
std
::
conditional_t
<
Family
==
AF_INET
,
sockaddr_in
,
sockaddr_in6
>
;
sockaddr_in6
>::
type
;
sockaddr_type
sa
;
sockaddr_type
sa
;
memset
(
&
sa
,
0
,
sizeof
(
sockaddr_type
));
memset
(
&
sa
,
0
,
sizeof
(
sockaddr_type
));
family_of
(
sa
)
=
Family
;
family_of
(
sa
)
=
Family
;
...
...
libcaf_io/caf/io/network/native_socket.hpp
View file @
b3478445
...
@@ -28,7 +28,7 @@ using socket_recv_ptr = void*;
...
@@ -28,7 +28,7 @@ using socket_recv_ptr = void*;
using
socket_size_type
=
unsigned
;
using
socket_size_type
=
unsigned
;
#endif
#endif
using
signed_size_type
=
std
::
make_signed
<
size_t
>::
type
;
using
signed_size_type
=
std
::
make_signed
_t
<
size_t
>
;
// More bootstrapping.
// More bootstrapping.
CAF_IO_EXPORT
extern
const
int
ec_out_of_memory
;
CAF_IO_EXPORT
extern
const
int
ec_out_of_memory
;
...
...
libcaf_io/caf/io/typed_broker.hpp
View file @
b3478445
...
@@ -96,8 +96,7 @@ public:
...
@@ -96,8 +96,7 @@ public:
}
}
template
<
class
F
,
class
...
Ts
>
template
<
class
F
,
class
...
Ts
>
typename
infer_handle_from_fun
<
F
>::
type
infer_handle_from_fun_t
<
F
>
fork
(
F
fun
,
connection_handle
hdl
,
Ts
&&
...
xs
)
{
fork
(
F
fun
,
connection_handle
hdl
,
Ts
&&
...
xs
)
{
CAF_ASSERT
(
this
->
context
()
!=
nullptr
);
CAF_ASSERT
(
this
->
context
()
!=
nullptr
);
auto
sptr
=
this
->
take
(
hdl
);
auto
sptr
=
this
->
take
(
hdl
);
CAF_ASSERT
(
sptr
->
hdl
()
==
hdl
);
CAF_ASSERT
(
sptr
->
hdl
()
==
hdl
);
...
...
libcaf_net/caf/net/datagram_socket.cpp
View file @
b3478445
...
@@ -36,7 +36,7 @@ error allow_connreset(datagram_socket x, bool) {
...
@@ -36,7 +36,7 @@ error allow_connreset(datagram_socket x, bool) {
#endif // CAF_WINDOWS
#endif // CAF_WINDOWS
std
::
variant
<
size_t
,
sec
>
std
::
variant
<
size_t
,
sec
>
check_datagram_socket_io_res
(
std
::
make_signed
<
size_t
>::
type
res
)
{
check_datagram_socket_io_res
(
std
::
make_signed
_t
<
size_t
>
res
)
{
if
(
res
<
0
)
{
if
(
res
<
0
)
{
auto
code
=
last_socket_error
();
auto
code
=
last_socket_error
();
if
(
code
==
std
::
errc
::
operation_would_block
if
(
code
==
std
::
errc
::
operation_would_block
...
...
libcaf_net/caf/net/datagram_socket.hpp
View file @
b3478445
...
@@ -27,7 +27,7 @@ error CAF_NET_EXPORT allow_connreset(datagram_socket x, bool new_value);
...
@@ -27,7 +27,7 @@ error CAF_NET_EXPORT allow_connreset(datagram_socket x, bool new_value);
/// Converts the result from I/O operation on a ::datagram_socket to either an
/// Converts the result from I/O operation on a ::datagram_socket to either an
/// error code or a integer greater or equal to zero.
/// error code or a integer greater or equal to zero.
/// @relates datagram_socket
/// @relates datagram_socket
std
::
variant
<
size_t
,
sec
>
CAF_NET_EXPORT
std
::
variant
<
size_t
,
sec
>
check_datagram_socket_io_res
(
std
::
make_signed
<
size_t
>::
type
res
);
CAF_NET_EXPORT
check_datagram_socket_io_res
(
std
::
make_signed_t
<
size_t
>
res
);
}
// namespace caf::net
}
// namespace caf::net
libcaf_net/caf/net/socket_id.hpp
View file @
b3478445
...
@@ -34,6 +34,6 @@ constexpr socket_id invalid_socket_id = -1;
...
@@ -34,6 +34,6 @@ constexpr socket_id invalid_socket_id = -1;
/// Signed counterpart of `socket_id`.
/// Signed counterpart of `socket_id`.
/// @relates socket
/// @relates socket
using
signed_socket_id
=
std
::
make_signed
<
socket_id
>::
type
;
using
signed_socket_id
=
std
::
make_signed
_t
<
socket_id
>
;
}
// namespace caf::net
}
// namespace caf::net
libcaf_net/caf/net/tcp_accept_socket.cpp
View file @
b3478445
...
@@ -61,9 +61,8 @@ expected<tcp_accept_socket> new_tcp_acceptor_impl(uint16_t port,
...
@@ -61,9 +61,8 @@ expected<tcp_accept_socket> new_tcp_acceptor_impl(uint16_t port,
reinterpret_cast
<
setsockopt_ptr
>
(
&
on
),
reinterpret_cast
<
setsockopt_ptr
>
(
&
on
),
static_cast
<
socket_size_type
>
(
sizeof
(
on
))));
static_cast
<
socket_size_type
>
(
sizeof
(
on
))));
}
}
using
sockaddr_type
=
using
sockaddr_type
typename
std
::
conditional
<
Family
==
AF_INET
,
sockaddr_in
,
=
std
::
conditional_t
<
Family
==
AF_INET
,
sockaddr_in
,
sockaddr_in6
>
;
sockaddr_in6
>::
type
;
sockaddr_type
sa
;
sockaddr_type
sa
;
memset
(
&
sa
,
0
,
sizeof
(
sockaddr_type
));
memset
(
&
sa
,
0
,
sizeof
(
sockaddr_type
));
detail
::
family_of
(
sa
)
=
Family
;
detail
::
family_of
(
sa
)
=
Family
;
...
...
libcaf_net/caf/net/tcp_stream_socket.cpp
View file @
b3478445
...
@@ -93,9 +93,8 @@ bool ip_connect(stream_socket fd, std::string host, uint16_t port,
...
@@ -93,9 +93,8 @@ bool ip_connect(stream_socket fd, std::string host, uint16_t port,
<<
CAF_ARG
(
fd
.
id
)
<<
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
)
<<
CAF_ARG
(
fd
.
id
)
<<
CAF_ARG
(
host
)
<<
CAF_ARG
(
port
)
<<
CAF_ARG
(
timeout
));
<<
CAF_ARG
(
timeout
));
static_assert
(
Family
==
AF_INET
||
Family
==
AF_INET6
,
"invalid family"
);
static_assert
(
Family
==
AF_INET
||
Family
==
AF_INET6
,
"invalid family"
);
using
sockaddr_type
=
using
sockaddr_type
typename
std
::
conditional
<
Family
==
AF_INET
,
sockaddr_in
,
=
std
::
conditional_t
<
Family
==
AF_INET
,
sockaddr_in
,
sockaddr_in6
>
;
sockaddr_in6
>::
type
;
sockaddr_type
sa
;
sockaddr_type
sa
;
memset
(
&
sa
,
0
,
sizeof
(
sockaddr_type
));
memset
(
&
sa
,
0
,
sizeof
(
sockaddr_type
));
if
(
inet_pton
(
Family
,
host
.
c_str
(),
&
detail
::
addr_of
(
sa
))
==
1
)
{
if
(
inet_pton
(
Family
,
host
.
c_str
(),
&
detail
::
addr_of
(
sa
))
==
1
)
{
...
...
libcaf_test/caf/test/dsl.hpp
View file @
b3478445
...
@@ -37,13 +37,13 @@ bool cmp_one(const caf::message& x, const T& y) {
...
@@ -37,13 +37,13 @@ bool cmp_one(const caf::message& x, const T& y) {
}
}
template
<
size_t
I
,
class
...
Ts
>
template
<
size_t
I
,
class
...
Ts
>
typename
std
::
enable_if
<
(
I
==
sizeof
...(
Ts
)),
bool
>::
type
std
::
enable_if_t
<
(
I
==
sizeof
...(
Ts
)),
bool
>
msg_cmp_rec
(
const
caf
::
message
&
,
const
std
::
tuple
<
Ts
...
>&
)
{
msg_cmp_rec
(
const
caf
::
message
&
,
const
std
::
tuple
<
Ts
...
>&
)
{
return
true
;
return
true
;
}
}
template
<
size_t
I
,
class
...
Ts
>
template
<
size_t
I
,
class
...
Ts
>
typename
std
::
enable_if
<
(
I
<
sizeof
...(
Ts
)),
bool
>::
type
std
::
enable_if_t
<
(
I
<
sizeof
...(
Ts
)),
bool
>
msg_cmp_rec
(
const
caf
::
message
&
x
,
const
std
::
tuple
<
Ts
...
>&
ys
)
{
msg_cmp_rec
(
const
caf
::
message
&
x
,
const
std
::
tuple
<
Ts
...
>&
ys
)
{
return
cmp_one
<
I
>
(
x
,
std
::
get
<
I
>
(
ys
))
&&
msg_cmp_rec
<
I
+
1
>
(
x
,
ys
);
return
cmp_one
<
I
>
(
x
,
std
::
get
<
I
>
(
ys
))
&&
msg_cmp_rec
<
I
+
1
>
(
x
,
ys
);
}
}
...
@@ -840,7 +840,7 @@ public:
...
@@ -840,7 +840,7 @@ public:
/// Sends a request to `hdl`, then calls `run()`, and finally fetches and
/// Sends a request to `hdl`, then calls `run()`, and finally fetches and
/// returns the result.
/// returns the result.
template
<
class
T
,
class
...
Ts
,
class
Handle
,
class
...
Us
>
template
<
class
T
,
class
...
Ts
,
class
Handle
,
class
...
Us
>
typename
std
::
conditional
<
sizeof
...(
Ts
)
==
0
,
T
,
std
::
tuple
<
T
,
Ts
...
>>::
type
std
::
conditional_t
<
sizeof
...(
Ts
)
==
0
,
T
,
std
::
tuple
<
T
,
Ts
...
>>
request
(
Handle
hdl
,
Us
...
args
)
{
request
(
Handle
hdl
,
Us
...
args
)
{
auto
res_hdl
=
self
->
request
(
hdl
,
caf
::
infinite
,
std
::
move
(
args
)...);
auto
res_hdl
=
self
->
request
(
hdl
,
caf
::
infinite
,
std
::
move
(
args
)...);
run
();
run
();
...
...
libcaf_test/caf/test/unit_test.hpp
View file @
b3478445
...
@@ -95,7 +95,7 @@ struct equality_operator {
...
@@ -95,7 +95,7 @@ struct equality_operator {
}
}
template
<
class
T
,
class
U
,
template
<
class
T
,
class
U
,
typename
std
::
enable_if
<!
detail
::
is_comparable_v
<
T
,
U
>
>::
type
=
0
>
std
::
enable_if_t
<!
detail
::
is_comparable_v
<
T
,
U
>
>
=
0
>
bool
operator
()(
const
T
&
,
const
U
&
)
const
{
bool
operator
()(
const
T
&
,
const
U
&
)
const
{
return
default_value
;
return
default_value
;
}
}
...
@@ -105,10 +105,10 @@ struct inequality_operator {
...
@@ -105,10 +105,10 @@ struct inequality_operator {
static
constexpr
bool
default_value
=
true
;
static
constexpr
bool
default_value
=
true
;
template
<
class
T
,
class
U
,
template
<
class
T
,
class
U
,
typename
std
::
enable_if
<
std
::
enable_if_t
<
(
std
::
is_floating_point_v
<
T
>
(
std
::
is_floating_point_v
<
T
>
||
std
::
is_floating_point_v
<
U
>
)
&&
detail
::
is_comparable_v
<
T
,
U
>
,
||
std
::
is_floating_point_v
<
U
>
)
&&
detail
::
is_comparable_v
<
T
,
U
>
,
int
>
::
type
int
>
=
0
>
=
0
>
bool
operator
()(
const
T
&
x
,
const
U
&
y
)
const
{
bool
operator
()(
const
T
&
x
,
const
U
&
y
)
const
{
equality_operator
f
;
equality_operator
f
;
...
@@ -116,17 +116,17 @@ struct inequality_operator {
...
@@ -116,17 +116,17 @@ struct inequality_operator {
}
}
template
<
class
T
,
class
U
,
template
<
class
T
,
class
U
,
typename
std
::
enable_if
<!
std
::
is_floating_point_v
<
T
>
std
::
enable_if_t
<!
std
::
is_floating_point_v
<
T
>
&&
!
std
::
is_floating_point_v
<
U
>
&&
!
std
::
is_floating_point_v
<
U
>
&&
detail
::
is_comparable_v
<
T
,
U
>
,
&&
detail
::
is_comparable_v
<
T
,
U
>
,
int
>::
type
int
>
=
0
>
=
0
>
bool
operator
()(
const
T
&
x
,
const
U
&
y
)
const
{
bool
operator
()(
const
T
&
x
,
const
U
&
y
)
const
{
return
x
!=
y
;
return
x
!=
y
;
}
}
template
<
class
T
,
class
U
,
template
<
class
T
,
class
U
,
typename
std
::
enable_if
<!
detail
::
is_comparable_v
<
T
,
U
>
>::
type
=
0
>
std
::
enable_if_t
<!
detail
::
is_comparable_v
<
T
,
U
>
>
=
0
>
bool
operator
()(
const
T
&
,
const
U
&
)
const
{
bool
operator
()(
const
T
&
,
const
U
&
)
const
{
return
default_value
;
return
default_value
;
}
}
...
@@ -290,11 +290,10 @@ public:
...
@@ -290,11 +290,10 @@ public:
return
y
;
return
y
;
}
}
};
};
using
fwd
=
using
fwd
=
std
::
conditional_t
<
std
::
is_same_v
<
char
,
T
>
typename
std
::
conditional
<
std
::
is_same_v
<
char
,
T
>
||
std
::
is_convertible_v
<
T
,
std
::
string
>
||
std
::
is_convertible_v
<
T
,
std
::
string
>
||
std
::
is_same_v
<
caf
::
term
,
T
>
,
||
std
::
is_same_v
<
caf
::
term
,
T
>
,
simple_fwd_t
,
deep_to_string_t
>
;
simple_fwd_t
,
deep_to_string_t
>::
type
;
fwd
f
;
fwd
f
;
auto
y
=
f
(
x
);
auto
y
=
f
(
x
);
if
(
lvl
<=
level_console_
)
if
(
lvl
<=
level_console_
)
...
...
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