Performance of resizing std::vector

The claim that unique_ptr performs as well as a raw pointer after optimization mostly applies only to the basic operations on a single pointer, such as creation, dereferencing, assignment of a single pointer and deletion. Those operations are defined simply enough that an optimizing compiler can usually make the required transformations such that the resulting … Read more

Vector of shared pointers , memory problems after clearing the vector

you have two copies of shared_ptr<A> in this case, one is the sharedptr variable and the other as an element in the vector. do this instead test.push_back(std::move(sharedptr)); note now the original sharedptr has it’s internal moved and no longer usable. The other thing is don’t do anything at all, this is a perfectly valid usage … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)