Guest User

Untitled

a guest
Dec 15th, 2011
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.     ShapeContainer::ShapeContainer( const ShapeContainer & other ){
  3.         for(int i=0; i<(int)other.m_vect.size(); i++){
  4.             m_vect.push_back(other.m_vect[i]->clone());
  5.         }
  6.  
  7.                 auto begin = other.m_vect.begin();
  8.                 auto end = other.m_vect.end();
  9.                 std::transform(begin, end, std::back_inserter(m_vect), [](ShapePtr const& p)
  10.                 { return p.clone(); });
  11.  
  12.                 for(auto&& p: other.m_vect) {
  13.                     m_vect.push_back(p.clone();
  14.                 }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment