Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C++ has lots of so-called "value types" and this would just be another. box<T> is basically a vector<T> that is constrained to always have a size of 1. Both internally store a pointer to the heap and implement value semantics for the pointed-to object(s).


And yet nobody use calls a vector of 1 a pointer.

The question is not about the utility of box<T>, i am sure there are cases where such a structure would be need.

But box<T> is not a "pointer" in the C++ sense same as an array/vector of 1 is not a pointer.

The authors is needlessly complicating things and mixing concept there are pretty orthogonal. And i think this is the result of trying to fit box<T> which is not a pointer inside a taxonomy of pointers...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: