In my program I have a STL set.
set myStrings;
To improve the efficiency of my code I changed it to hold, only pointers. (I d
As Containers store objects and references are not objects. In case you are at c++ 11, you can use std::reference_wrapper to wrap things to assignable objects.
http://en.cppreference.com/w/cpp/utility/functional/reference_wrapper
std::reference_wrapper is a class template that wraps a reference in a copyable, assignable object. It is frequently used as a mechanism to store references inside standard containers (like std::vector) which cannot normally hold references.