原帖由 福瑞哈哥 于 2007-5-27 20:17 发表
記得以前有一個全macro的list.h和rbtree.h,可惜現在找不到了。
原帖由 xhl 于 2007-5-28 14:49 发表
我喜欢用BSD 的 queue.h tree.h 等,
虽然全是macro写的,调试不太方便,但总比自己写省心。
原帖由 duanjigang 于 2007-5-28 15:32 发表
以前也尝试过这么写过,不过最后发现初始化和繁杂的参数实在令人烦恼,干脆就改用C++风格了
STL还是不错
原帖由 flw2 于 2007-5-28 18:48 发表
c能用stl吗?
原帖由 converse 于 2008-4-11 15:53 发表
比如container_of宏的改造:
从
#define container_of(ptr, type, member) ( { \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,memb ...
原帖由 converse 于 2008-4-11 15:53 发表
比如container_of宏的改造:
从
#define container_of(ptr, type, member) ( { \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,memb ...
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |