Thanks anon , Thanks CornedBee,
I have got more clearity now.
I am trying now the dangerous part,
std::vector<A*> ptr_vec;
A a; //local instance
ptr_vec.push_back(&a); //store address
Type: Posts; User: Jack_learn_cpp
Thanks anon , Thanks CornedBee,
I have got more clearity now.
I am trying now the dangerous part,
std::vector<A*> ptr_vec;
A a; //local instance
ptr_vec.push_back(&a); //store address
Thanks for the code snippet. This cleared my confusion.
By stepping out, I mean, to see where copy is made by the vector. Here is were object is made, and this leads to invoke copy contructor of...
Thanks anon.
If vector makes a copy to what it points to, then it must be calling its contructor. Then I must be able to walk through its contructor (by putting a break point in the contructor of...
Hi All,
Please look at the code below.
In set() fucntion, I am building a vector test_values. In this, I am pushing local block values. Which goes out of scope when function exits.
When...