Skip to content

Commit a5a9369

Browse files
committed
Added hash value for boost::basic_string_view for older version of boost.
1 parent 13d5192 commit a5a9369

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/mqtt/string_view.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ using string_view = boost::string_view;
4040
template<class CharT, class Traits = std::char_traits<CharT> >
4141
using basic_string_view = boost::basic_string_view<CharT, Traits>;
4242

43+
#if BOOST_VERSION < 106900
44+
template <class charT, class traits>
45+
std::size_t hash_value(basic_string_view<charT, traits> s) {
46+
return boost::hash_range(s.begin(), s.end());
47+
}
48+
#endif // BOOST_VERSION < 106900
49+
}
50+
4351
} // namespace MQTT_NS
4452

4553
#else // BOOST_VERSION >= 106100

0 commit comments

Comments
 (0)