Commit f259fbb6 authored by Dominik Charousset's avatar Dominik Charousset

Fix warnings on GCC

parent 52f65ece
...@@ -64,7 +64,7 @@ CAF_ADD_CONFIG_VALUE_TYPE(dictionary<config_value>); ...@@ -64,7 +64,7 @@ CAF_ADD_CONFIG_VALUE_TYPE(dictionary<config_value>);
template <class T> template <class T>
constexpr bool is_config_value_type_v = is_config_value_type<T>::value; constexpr bool is_config_value_type_v = is_config_value_type<T>::value;
}; // namespace caf::detail } // namespace caf::detail
namespace caf { namespace caf {
......
...@@ -27,16 +27,15 @@ struct is_string_like { ...@@ -27,16 +27,15 @@ struct is_string_like {
template <class U> template <class U>
static bool sfinae( static bool sfinae(
const U* x, const U* x,
// check if `(*x)[0]` returns `const char&` // check if `x->data()` returns const char*
typename std::enable_if< std::enable_if_t<
std::is_same<const char&, decltype((*x)[0])>::value>::type* = nullptr, std::is_same<const char*, decltype(x->data())>::value>* = nullptr,
// check if `x->size()` returns an integer // check if `x->size()` returns an integer
typename std::enable_if< std::enable_if_t<std::is_integral<decltype(x->size())>::value>* = nullptr,
std::is_integral<decltype(x->size())>::value>::type* = nullptr,
// check if `x->find('?', 0)` is well-formed and returns an integer // check if `x->find('?', 0)` is well-formed and returns an integer
// (distinguishes vectors from strings) // (distinguishes vectors from strings)
typename std::enable_if< std::enable_if_t<
std::is_integral<decltype(x->find('?', 0))>::value>::type* = nullptr); std::is_integral<decltype(x->find('?', 0))>::value>* = nullptr);
// SFINAE fallback. // SFINAE fallback.
static void sfinae(void*); static void sfinae(void*);
...@@ -105,15 +104,9 @@ public: ...@@ -105,15 +104,9 @@ public:
template <class T, class = typename std::enable_if< template <class T, class = typename std::enable_if<
detail::is_string_like<T>::value>::type> detail::is_string_like<T>::value>::type>
string_view(const T& str) noexcept { constexpr string_view(const T& str) noexcept
auto len = str.size(); : data_(str.data()), size_(str.size()) {
if (len == 0) { // nop
data_ = nullptr;
size_ = 0;
} else {
data_ = &(str[0]);
size_ = str.size();
}
} }
string_view& operator=(const string_view&) noexcept = default; string_view& operator=(const string_view&) noexcept = default;
......
...@@ -391,7 +391,7 @@ strong_actor_ptr middleman::remote_lookup(std::string name, ...@@ -391,7 +391,7 @@ strong_actor_ptr middleman::remote_lookup(std::string name,
make_message(registry_lookup_atom_v, std::move(name))); make_message(registry_lookup_atom_v, std::move(name)));
self->receive( self->receive(
[&](strong_actor_ptr& addr) { result = std::move(addr); }, [&](strong_actor_ptr& addr) { result = std::move(addr); },
others >> [](message& msg) -> skippable_result { others >> []([[maybe_unused]] message& msg) -> skippable_result {
CAF_LOG_ERROR( CAF_LOG_ERROR(
"middleman received unexpected remote_lookup result:" << msg); "middleman received unexpected remote_lookup result:" << msg);
return message{}; return message{};
......
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