Passing vectors by reference

前端 未结 3 678
野性不改
野性不改 2021-02-01 05:24

If I have a vector of objects in one class which I want to change in another, I would try and pass all the information by reference.

What exactly do I need to pass by re

3条回答
  •  渐次进展
    2021-02-01 05:41

    vector& is a syntax error. vector is invalid, because a vector's value type must be assignable. vector& blah is a syntax error.

    A reference to a vector is vector&.

    提交回复
    热议问题