For example, std::vector<int&> vec_int;
this seems to be invalid in c++. Why is this invalid?
STL containers need to be able to construct objects with default constructor. You cannot do that with a reference. A reference is guaranteed to be valid, therefore it always has to be initialized with assignment.
You need to use a pointer instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With