Why are scoped threads included in the standard library?
When I first heard about scoped threads I took a look at them in the documentation and thought it was a neat way of sharing state across threads without dynamic memory allocations. My naive guess on how they worked was that the ScopedJoinHandle instances must join the parent thread when dropped, but then I later heard that this is the way it was once implemented but they had to remove it because people could mess things up by leaking values so that they wouldn’t be dropped.
It turns out that this thing actually creates a dynamic memory allocation internally to wait on the spawned threads when the callback function returns. Now scoped threads make zero sense to me because you might as well just create your own explicit dynamic memory allocation for this shared state. Scoped threads seem to have no real advantage in the way I see it. What are some typical use cases?