vi 发帖数: 309 | 1 看STL list node的定义:
struct _List_node_base
{
_List_node_base* _M_next; ///< Self-explanatory
_List_node_base* _M_prev; ///< Self-explanatory
static void
swap(_List_node_base& __x, _List_node_base& __y);
void
transfer(_List_node_base * const __first,
_List_node_base * const __last);
void
reverse();
void
hook(_List_node_base * const __position);
void
unhook();
};
template
struct _List_node : public _List_node |
d***q 发帖数: 1119 | 2 第一个 似乎没必要用 PRIVATE+friend
node的结构简单
【在 vi 的大作中提到】 : 看STL list node的定义: : struct _List_node_base : { : _List_node_base* _M_next; ///< Self-explanatory : _List_node_base* _M_prev; ///< Self-explanatory : static void : swap(_List_node_base& __x, _List_node_base& __y); : void : transfer(_List_node_base * const __first, : _List_node_base * const __last);
|
vi 发帖数: 309 | 3
结构简单与否,data member总要private吧?
难道不是C++的规则之一吗?谢谢!
【在 d***q 的大作中提到】 : 第一个 似乎没必要用 PRIVATE+friend : node的结构简单
|
t****t 发帖数: 6806 | 4 not necessary.
【在 vi 的大作中提到】 : : 结构简单与否,data member总要private吧? : 难道不是C++的规则之一吗?谢谢!
|
vi 发帖数: 309 | 5
谢谢,请你顺便看一下其他问题,比如reverse(), transfer()等等是做什么用的?
【在 t****t 的大作中提到】 : not necessary.
|
d***q 发帖数: 1119 | 6 不一定的。。而且对于用户来说
这个东西基本上也是
不可见得。。
【在 vi 的大作中提到】 : : 谢谢,请你顺便看一下其他问题,比如reverse(), transfer()等等是做什么用的?
|
s*****r 发帖数: 773 | 7 源代码哪儿弄到的?
【在 vi 的大作中提到】 : 看STL list node的定义: : struct _List_node_base : { : _List_node_base* _M_next; ///< Self-explanatory : _List_node_base* _M_prev; ///< Self-explanatory : static void : swap(_List_node_base& __x, _List_node_base& __y); : void : transfer(_List_node_base * const __first, : _List_node_base * const __last);
|