This sort of facility is the reason why C++ iostreams (technically, std::ios_base) support a primitive array type and static index allocator, via members iword/pword and xalloc. It is not often used, but where used it would be hard to do anything else.
It is quite common for a stream object to thread a call chain from top to bottom, for independent reasons. So, ability to stick on other context has saved bacon fairly often, over the decades.
Comments
This sort of facility is the reason why C++ iostreams (technically, std::ios_base) support a primitive array type and static index allocator, via members iword/pword and xalloc. It is not often used, but where used it would be hard to do anything else.
https://en.cppreference.com/w/cpp/io/ios_base
It is quite common for a stream object to thread a call chain from top to bottom, for independent reasons. So, ability to stick on other context has saved bacon fairly often, over the decades.