Skip to content

Commit

Permalink
Merge pull request #183 from Flamefire/warning
Browse files Browse the repository at this point in the history
Avoid `-Wzero-as-null-pointer-constant` warning in string_view ctor
  • Loading branch information
pdimov authored Jan 5, 2025
2 parents 749b634 + 1222948 commit 3e147e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/boost/core/detail/string_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ template<class Ch> class basic_string_view
}

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 );
}
Expand All @@ -396,7 +396,7 @@ template<class Ch> class basic_string_view
#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() )
{
}

Expand Down

0 comments on commit 3e147e4

Please sign in to comment.