靠~~MFC的容器难用死啦

rickerliang 2007-01-18 11:23:47
MFC的CList之类的,真别扭啊,简直就是反人类啊
我是stl的忠实拥护者,但在公司不能用stl,靠,只能用MFC的容器,我日tmd,MFC的容器我不能接受啊~~~救命~~!!
...全文
950 31 打赏 收藏 转发到动态 举报
写回复
用AI写文章
31 条回复
切换为时间正序
请发表友善的回复…
发表回复
zcy21111 2011-04-06
  • 打赏
  • 举报
回复
没有这么难把··
yuewanwan1988 2011-03-30
  • 打赏
  • 举报
回复
呵呵,不知道,现在都还没怎么用,也不是很清楚,要看看。。。
rickerliang 2007-01-25
  • 打赏
  • 举报
回复
故意这么弄不就是风格么,hoho
kimryo 2007-01-24
  • 打赏
  • 举报
回复
hoho 这是P.J. Plauger的风格
==========================

不是的~他们是故意这么弄的~
rickerliang 2007-01-24
  • 打赏
  • 举报
回复
hoho 这是P.J. Plauger的风格
Featured 2007-01-23
  • 打赏
  • 举报
回复
哈哈
crystal_heart 2007-01-23
  • 打赏
  • 举报
回复
VC 的 STL 烂在哪里? 摘抄一段下来以供欣赏,VC2003的 map

template<class _Kty,
class _Ty,
class _Pr,
class _Alloc> inline
void swap(map<_Kty, _Ty, _Pr, _Alloc>& _Left,
map<_Kty, _Ty, _Pr, _Alloc>& _Right)
{ // swap _Left and _Right maps
_Left.swap(_Right);
}

// TEMPLATE CLASS multimap
template<class _Kty,
class _Ty,
class _Pr = less<_Kty>,
class _Alloc = allocator<pair<const _Kty, _Ty> > >
class multimap
: public _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, true> >
{ // ordered red-black tree of {key, mapped} values, non-unique keys
public:
typedef multimap<_Kty, _Ty, _Pr, _Alloc> _Myt;
typedef _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, true> > _Mybase;
typedef _Kty key_type;
typedef _Ty mapped_type;
typedef _Ty referent_type; // retained
typedef _Pr key_compare;
typedef typename _Mybase::value_compare value_compare;
typedef typename _Mybase::allocator_type allocator_type;
typedef typename _Mybase::size_type size_type;
typedef typename _Mybase::difference_type difference_type;
typedef typename _Mybase::pointer pointer;
typedef typename _Mybase::const_pointer const_pointer;
typedef typename _Mybase::reference reference;
typedef typename _Mybase::const_reference const_reference;
typedef typename _Mybase::iterator iterator;
typedef typename _Mybase::const_iterator const_iterator;
typedef typename _Mybase::reverse_iterator reverse_iterator;
typedef typename _Mybase::const_reverse_iterator
const_reverse_iterator;
typedef typename _Mybase::value_type value_type;

multimap()
: _Mybase(key_compare(), allocator_type())
{ // construct empty map from defaults
}

explicit multimap(const key_compare& _Pred)
: _Mybase(_Pred, allocator_type())
{ // construct empty map from comparator
}
multimap(const key_compare& _Pred, const allocator_type& _Al)
: _Mybase(_Pred, _Al)
{ // construct empty map from comparator and allocator
}

template<class _Iter>
multimap(_Iter _First, _Iter _Last)
: _Mybase(key_compare(), allocator_type())
{ // construct map from [_First, _Last), defaults
for (; _First != _Last; ++_First)
insert(*_First);
}

template<class _Iter>
multimap(_Iter _First, _Iter _Last,
const key_compare& _Pred)
: _Mybase(_Pred, allocator_type())
{ // construct map from [_First, _Last), comparator
for (; _First != _Last; ++_First)
insert(*_First);
}

template<class _Iter>
multimap(_Iter _First, _Iter _Last,
const key_compare& _Pred, const allocator_type& _Al)
: _Mybase(_Pred, _Al)
{ // construct map from [_First, _Last), comparator, and allocator
for (; _First != _Last; ++_First)
insert(*_First);
}

iterator insert(const value_type& _Val)
{ // insert a {key, mapped} value
return (_Mybase::insert(_Val).first);
}

iterator insert(iterator _Where, const value_type& _Val)
{ // insert a {key, mapped} value, with hint
return (_Mybase::insert(_Where, _Val));
}

template<class _Iter>
void insert(_Iter _First, _Iter _Last)
{ // insert [_First, _Last), arbitrary iterators
for (; _First != _Last; ++_First)
insert(*_First);
}
};


rickerliang 2007-01-22
  • 打赏
  • 举报
回复
其实MFC容器最令人恶心的使那个POSITION和GetNext、GetAt之类的东西,别扭的很
跟STL的Iterator相比简直就是瞑王星跟太阳的区别

STL烂的是哪个版本的STL?
vc7.1之前的都很烂
Sangel 2007-01-21
  • 打赏
  • 举报
回复
mfc很久没用了,,大多数用atl,偶尔stl
Writer 2007-01-21
  • 打赏
  • 举报
回复
VS2005的STL还可以, 不知楼上几位说MS STL烂的是哪个版本的STL? 具体表现在哪些地方?
wd_6532 2007-01-21
  • 打赏
  • 举报
回复
vc自带的stl不能用于正轨项目。可能会死人吧。
crystal_heart 2007-01-20
  • 打赏
  • 举报
回复
不相信的话,可以去翻翻看VC带的STL,跟看天书一个样。

如果一定要用STL的话,就自己去找一套好用的。
crystal_heart 2007-01-20
  • 打赏
  • 举报
回复
公认的MS对STL的支持最烂,不用MS的STL也是有道理的。
femalelover 2007-01-20
  • 打赏
  • 举报
回复
STL号称30年来最好的库.
DarknessTM 2007-01-20
  • 打赏
  • 举报
回复
MFC的容器也不错,尤其是和自己的MFC类对象还是很和的来的
dadi0189 2007-01-20
  • 打赏
  • 举报
回复
STL的确不错,MFC好些类我是从来不用的,比如容器类和CSocket类等,能直接用API就用API,能用STL就用STL,MFC只用作框架.
rickerliang 2007-01-20
  • 打赏
  • 举报
回复
不知道ls在说啥,是混分么?
hoho ^_^
Writer 2007-01-19
  • 打赏
  • 举报
回复
只能怪你公司的领导菜菜,通用移值性,性能好的STL不用,却要把自己梆在MFC上。

同情+可怜ING?

最后问一句, 到底为什么不让用STL??
蒋晟 2007-01-19
  • 打赏
  • 举报
回复
MFC的容器就是多了调试支持和序列化而已,而且已经不会有功能上的更新了。建议新代码还是使用STL。
rickerliang 2007-01-19
  • 打赏
  • 举报
回复
ATL的确是个好东西
加载更多回复(11)

1,649

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 非技术类
社区管理员
  • 非技术类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧