读书人

靠~MFC的容器难用死啦解决方案

发布时间: 2012-01-19 00:22:27 作者: rapoo

靠~~MFC的容器难用死啦
MFC的CList之类的,真别扭啊,简直就是反人类啊
我是stl的忠实拥护者,但在公司不能用stl,靠,只能用MFC的容器,我日tmd,MFC的容器我不能接受啊~~~救命~~!!

[解决办法]
友情帮顶!!!
[解决办法]
只能怪你公司的领导菜菜,通用移值性,性能好的STL不用,却要把自己梆在MFC上。

同情+可怜ING?

最后问一句, 到底为什么不让用STL??
[解决办法]
反人类。。。暴寒。。。-_-!...
[解决办法]
我都素自己写这些~
[解决办法]
~@_@~
[解决办法]
MFC的容器也没你说的那么差吧!
[解决办法]
LZ对MFC的容器有偏见,虽然不如stl,可也不能如此BS。。
[解决办法]
MFC的还行吧,但我不常用
[解决办法]
MFC的容器就是多了调试支持和序列化而已,而且已经不会有功能上的更新了。建议新代码还是使用STL。
[解决办法]
反人类 这个词用得好!
[解决办法]
stl导出类??`````。。上次用STL做类型库的时候好象还是上个世纪。。现在一直用Atl做动态库。
[解决办法]
公认的MS对STL的支持最烂,不用MS的STL也是有道理的。
[解决办法]
STL的确不错,MFC好些类我是从来不用的,比如容器类和CSocket类等,能直接用API就用API,能用STL就用STL,MFC只用作框架.
[解决办法]
MFC的容器也不错,尤其是和自己的MFC类对象还是很和的来的
[解决办法]
STL号称30年来最好的库.
[解决办法]
vc自带的stl不能用于正轨项目。可能会死人吧。
[解决办法]
VS2005的STL还可以, 不知楼上几位说MS STL烂的是哪个版本的STL? 具体表现在哪些地方?
[解决办法]
mfc很久没用了,,大多数用atl,偶尔stl
[解决办法]
哈哈
[解决办法]
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);
}
};


读书人网 >VC/MFC

热点推荐