Merge pull request #183 from Flamefire/warning

Avoid `-Wzero-as-null-pointer-constant` warning in string_view ctor
This commit is contained in:
Peter Dimov 2025-01-05 17:25:14 +02:00 committed by GitHub
commit 3e147e4ced
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -378,7 +378,7 @@ public:
}
template<class End> BOOST_CXX14_CONSTEXPR basic_string_view( Ch const* first, End last,
typename boost::enable_if<boost::core::detail::is_same<End, Ch const*> >::type* = 0 ) BOOST_NOEXCEPT: p_( first ), n_( static_cast<size_type>( last - first ) )
typename boost::enable_if<boost::core::detail::is_same<End, Ch const*>, int >::type = 0 ) BOOST_NOEXCEPT: p_( first ), n_( static_cast<size_type>( last - first ) )
{
BOOST_ASSERT( last - first >= 0 );
}
@ -396,7 +396,7 @@ public:
#endif
template<class Ch2> basic_string_view( boost::basic_string_view<Ch2, std::char_traits<Ch2> > const& str,
typename boost::enable_if<boost::core::detail::is_same<Ch, Ch2> >::type* = 0 ) BOOST_NOEXCEPT: p_( str.data() ), n_( str.size() )
typename boost::enable_if<boost::core::detail::is_same<Ch, Ch2>, int >::type = 0 ) BOOST_NOEXCEPT: p_( str.data() ), n_( str.size() )
{
}