page = arthur o'dwyer – stuff mostly about c++
url = https://quuxplusone.github.io/blog
path
convertible to
string_view
?: a war story
concepts llvm overload-resolution pitfalls template-metaprogramming war-stories
This story comes from the libc++ review implementing P1989 “Range constructor for std::string_view 2: Constrain Harder” (Corentin Jabot, March 2021). That paper made
implicitly convertible-from basically any contiguous range of characters. Which, to be clear, is probably a good thing. But it turned up a really interesting interaction in libc++’s
filesystem::path
. Somehow, enabling this constructor template in the
<string_view>
header caused libc++’s
to stop being a
range
!