05 2012 档案

(转)SGI STL中list的sort函数实现
摘要:sgi stl中list的sort()函数内容如下:[cpp] view plaincopy//list不能使用STL算法sort(),必须使用自己的sort()memberfunction,//因为STL算法sort()只接受RamdonAccessIterator.//本函式采用quicksort.template<classT,classAlloc>voidlist<T,Alloc>::sort(){//以下判断,如果是空白串行,或仅有一个元素,就不做任何动作。if(node->next==node||link_type(node->next)-> 阅读全文

posted @ 2012-05-15 11:58 i活着 阅读(372) 评论(0) 推荐(0)

导航