Skip to content

Commit

Permalink
Workaround clang bug
Browse files Browse the repository at this point in the history
Clang < 15 has a bug in c++-20 mode where using the `std::basic_string` constructor taking a pointer and size leads to an undefined symbol `M_construct` when used with Unicode char types

Avoid this by using the range constructor.
  • Loading branch information
Flamefire committed Jan 4, 2025
1 parent 547d8e0 commit be8a50f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/boost/core/detail/string_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ template<class Ch> class basic_string_view

template<class A> operator std::basic_string<Ch, std::char_traits<Ch>, A>() const
{
return std::basic_string<Ch, std::char_traits<Ch>, A>( data(), size() );
return std::basic_string<Ch, std::char_traits<Ch>, A>( begin(), end() );
}

#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
Expand Down

0 comments on commit be8a50f

Please sign in to comment.