Commit ba671c7c authored by Shariar Azad Riday's avatar Shariar Azad Riday

refactor is_pointer<>::value to is_pointer_v<>

parent cd8363aa
......@@ -71,7 +71,7 @@ public:
}
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 {
return x.get();
}
......@@ -89,7 +89,7 @@ public:
}
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 {
return (*this)(x.get());
}
......@@ -107,7 +107,7 @@ public:
}
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 {
return x.get();
}
......@@ -148,10 +148,10 @@ T actor_cast(U&& what) {
using from_type =
typename std::remove_const<typename std::remove_reference<U>::type>::type;
// 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;
// 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;
// calculate x and y
constexpr int x = to_raw ? 0 : (to_weak ? 2 : 1);
......
......@@ -124,7 +124,7 @@ public:
using arg_types = typename trait::arg_types;
using res_type = typename trait::result_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;
using tuple_type = decltype(std::make_tuple(detail::spawn_fwd<Ts>(xs)...));
using helper = init_fun_factory_helper<Base, F, tuple_type, rets, selfptr>;
......
......@@ -221,7 +221,7 @@ public:
if constexpr (std::is_same_v<std::nullptr_t, T>) {
return "null";
} 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)
return "null";
}
......
......@@ -165,7 +165,7 @@ public:
line_builder();
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) {
if (!str_.empty())
str_ += " ";
......
......@@ -206,7 +206,7 @@ inline message make_message() {
template <class... Ts>
message make_message(Ts&&... xs) {
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 constexpr size_t data_size
= sizeof(message_data) + (padded_size_v<strip_and_convert_t<Ts>> + ...);
......
......@@ -164,8 +164,7 @@ public:
return *this;
}
template <class T,
class E = caf::detail::enable_if_t<!std::is_pointer<T>::value>>
template <class T, class E = caf::detail::enable_if_t<!std::is_pointer_v<T>>>
caf_handle& operator=(const T& x) {
set(x);
return *this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment