Hi!
Just wanted to know if there is an easy and non memory heavy way of returning a set container that cannot alter the original container (or a reference to it or pointer, you get the idea)
1 2 3 4 5
//The elements I want to create a get function for
std::set<Order> m_SellOrders, m_BuyOrders;
// current prototype
std::set<Order> getSellOrders(){return std::set<Order> temp = m_SellOrders;};
but I'm guessing the prototype is kinda heavy on memory, any tips?
int x;
int copy = x; //a copy of x, can be modified independently of x
constint c_int = x; //a copy of x, can't be modified, independent of x
int& ref_int = x; //alias to x, meaning this is basically a different way to refer to x
constint& cref_int = x; //alias to x, cannot be modified, but if x changes it will change