An element of the vector in func1 incoming func2, if only one element, just call a function func2, more than 12345 any combination can get data at func2 If Func1 { Func2 (& amp; V [0]);//1 Func2 (& amp; V [1]);//1 } Call func2 twice into two elements in the vector, func2 way 3, 5 only can have the data, the last call way four elements can normal If Func1 { Func2 (& amp; [0]) (v);//2 Func2 (& amp; [1] (v));//2 } Can normal visit func2 of 4, 5, 3 only the last call to normal access Fun2 is thread function, at the same time perform
The vector & amp; To remove with a certain element of address what's the problem? Why the second element after the address, the first element of Pointers can't be able to visit In the two threads func2 variables should be of no effect, so why not use Pointers
CodePudding user response:
correction: method 5 references and probabilistic normal visit , actual or abnormal Take the address is the vector of elements, only the last take address can be normal access to the element at a time, why