Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline std::pair<T,T>& GetPortfolio()
- {
- static std::pair<T,T> myPair;
- myPair.first = m_container.begin();
- myPair.second = m_container.end();
- return myPair;
- }
- std::pair<T,T> one = GetPortfolio();
- //Do some algorithm on m_container
- std::pair<T,T> two = GetPortfolio();
- //At this point both one and two hold valid iterators (as both reference static object)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement