Open ethouris opened 4 months ago
gcc issues a warning:
warning: declaration of 'data' shadows a member of 'zmq::message_t' [-Wshadow]
It's issued by this constructor declaration:
template< class Char, size_t N, typename = typename std::enable_if<detail::is_char_type<Char>::value>::type> ZMQ_DEPRECATED("from 4.7.0, use constructors taking iterators, (pointer, size) " "or strings instead") explicit message_t(const Char (&data)[N]) : message_t(detail::ranges::begin(data), detail::ranges::end(data)) { } template<class Range, typename = typename std::enable_if< detail::is_range<Range>::value && ZMQ_IS_TRIVIALLY_COPYABLE(detail::range_value_t<Range>) && !detail::is_char_type<detail::range_value_t<Range>>::value && !std::is_same<Range, message_t>::value>::type> explicit message_t(const Range &rng) : message_t(detail::ranges::begin(rng), detail::ranges::end(rng)) { }
It actually doesn't matter if this is deprecated - this problem is reported regardless whether this constructor is in use or not.
It's easy to fix - just use a different name than data - which is simultaneously a name of the method in message_t.
data
message_t
gcc issues a warning:
It's issued by this constructor declaration:
It actually doesn't matter if this is deprecated - this problem is reported regardless whether this constructor is in use or not.
It's easy to fix - just use a different name than
data
- which is simultaneously a name of the method inmessage_t
.