https://hackernoon.com/value-ptr-the-missing-c-smart-pointer...
https://buckaroo.pm/blog/value-ptr-the-missing-smart-ptr
People have been writing pointer-like value semantic wrappers for type-erasure for decades.
https://hackernoon.com/value-ptr-the-missing-c-smart-pointer...
https://buckaroo.pm/blog/value-ptr-the-missing-smart-ptr
People have been writing pointer-like value semantic wrappers for type-erasure for decades.
Indeed it's exactly the same idea (and I think `value_ptr` is actually a better name than `box`).
I've googled before writing the blog post and haven't found literature about this (but I was mostly googling stuff around "box" or "deep shared ptr").
Thank you for the link! Kinda glad it's more widespread than what I though actually, it means we can think about making an official proposal.
Granted, Java has 'references' instead of pointers, but they're close enough that the concept of boxing is basically the same.
No mainstream language that I am aware of uses the term "Box", while they almost all have something similar in concept, if not identical.
Python, Ruby, and JavaScript all have exclusively boxed values. "Everything is an object".
I'm not sure what languages you use but that pretty dramatically covers most of the mainstream (top 10 at least).
Rust uses it in their standard library[0]. Haskell uses it[1]. Lisp seems to have originated the concept in the form of box diagrams[2]. F# uses it [3].
I think it might be a functional programming thing.
[0] https://doc.rust-lang.org/std/boxed/struct.Box.html [1] https://downloads.haskell.org/~ghc/6.12.1/docs/html/users_gu... [2] https://www.gnu.org/software/emacs/manual/html_node/elisp/Bo... [3] https://fsharpforfunandprofit.com/posts/cli-types/
A Proposal for the World's Dumbest Smart Pointer, v4 - Open Standards https://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4282.p...