page =
url = https://quuxplusone.github.io/blog
arthur o'dwyer – stuff mostly about c++
hidden-friend-idiom library-design llvm ranges war-stories
Eventually I’ll write up a full “libc++ beginner’s guide to writing niebloids.” For now, this is just a quick note to explain one particular quirk. The shape of a libc++ niebloid and/or CPO is:
namespace std::ranges { namespace __iter_swap { struct __fn { auto operator()(~~~) const { ~~~ } }; } inline namespace __cpo { inline constexpr auto iter_swap = __iter_swap::__fn{}; } }
Why do we have that extra
inline namespace __cpo
?
argument-dependent-lookup hidden-friend-idiom c++-style operator-spaceship stl-classic