typedef list WCSocketList;

magician21cn 2004-11-05 05:20:29
typedef list<CWinClSocket*> WCSocketList;

好像使用了队列,可是我没见过“<>”运算符,我F12了一下,
结果
// list standard header

class list {
protected:
struct _Node;
friend struct _Node;
typedef _POINTER_X(_Node, _A) _Nodeptr;
struct _Node {
_Nodeptr _Next, _Prev;
_Ty _Value;
};
struct _Acc;
friend struct _Acc;
struct _Acc {
typedef _REFERENCE_X(_Nodeptr, _A) _Nodepref;
typedef _A::reference _Vref;
static _Nodepref _Next(_Nodeptr _P)
{return ((_Nodepref)(*_P)._Next); }
static _Nodepref _Prev(_Nodeptr _P)
{return ((_Nodepref)(*_P)._Prev); }
static _Vref _Value(_Nodeptr _P)
{return ((_Vref)(*_P)._Value); }
};
public:
typedef list<_Ty, _A> _Myt;
typedef _A allocator_type;
typedef _A::size_type size_type;
typedef _A::difference_type difference_type;
typedef _A::pointer _Tptr;
typedef _A::const_pointer _Ctptr;
typedef _A::reference reference;
typedef _A::const_reference const_reference;
typedef _A::value_type value_type;
// CLASS const_iterator
class iterator;
class const_iterator;
friend class const_iterator;
class const_iterator : public _Bidit<_Ty, difference_type> {
public:
const_iterator()
{}
const_iterator(_Nodeptr _P)
: _Ptr(_P) {}
const_iterator(const iterator& _X)
: _Ptr(_X._Ptr) {}
const_reference operator*() const
{return (_Acc::_Value(_Ptr)); }
_Ctptr operator->() const
{return (&**this); }
const_iterator& operator++()
{_Ptr = _Acc::_Next(_Ptr);
return (*this); }
const_iterator operator++(int)
{const_iterator _Tmp = *this;
++*this;
return (_Tmp); }
const_iterator& operator--()
{_Ptr = _Acc::_Prev(_Ptr);
return (*this); }
const_iterator operator--(int)
{const_iterator _Tmp = *this;
--*this;
return (_Tmp); }
bool operator==(const const_iterator& _X) const
{return (_Ptr == _X._Ptr); }
bool operator!=(const const_iterator& _X) const
{return (!(*this == _X)); }
_Nodeptr _Mynode() const
{return (_Ptr); }
protected:
_Nodeptr _Ptr;
};
// CLASS iterator


是不是可以解释一下啊!什么意思?怎么使用?

...全文
149 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
oyljerry 2004-11-06
  • 打赏
  • 举报
回复
列表,看STL
konista 2004-11-06
  • 打赏
  • 举报
回复
标准模版库中的list
erehw 2004-11-06
  • 打赏
  • 举报
回复
回家去看c++ prime之类的去了。
---这是忠告。

15,466

社区成员

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

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