Tag: hidden
Be careful with hidden cost of std::vector for user defined objects
While creating and using std::vector with user defined classes we needs some special care otherwise it can hamper the performance of our application. [showads ad=inside_post] Let’s learn by example, Suppose we have an Item Class, Advertisements class Item { public: static int m_ConstructorCalledCount; static int m_DestCalledCount; static int m_CopyConstructorCalledCount; Item() { m_ConstructorCalledCount++; } ~Item() { …
Be careful with hidden cost of std::vector for user defined objectsRead More