Monthly Archives: November 2004

刚写的程序中犯的一个低级错误。。。。

typedef ::std::vector< int > IntArray; … IntArray theInts; … IntArray::iterator it1, it2; …. ::std::swap( it1, it2 );// error!, should be ::std::swap( *it1, *it2 );   很早以前曾犯的另一个错误: IntArray theInts; … int* g_pTheInt; … g_pTheInt = &( *it ) or it;//无效,::std::vector会reallocate。。。   … Continue reading

Posted in 技术 | Leave a comment