2004年6月10日

在 C 语言中实现模板函数的方法(续)

摘要: 在 C 语言中实现模板函数的方法(续):/* 定义一个宏,用来连接两个标识符:*/#define MAKE_NAME(className, methodName) calssName##__##methodName/* 模板源文件:template.c* 必须重定义的宏:TheClass* 其它需要重定义的宏(如对一个搜索树的实现,需要比较元素或键值大小的宏)* */Int MAKE_NAME(TheClass, Method1) (int param1, int param2){ …. Return 0;}Int MAKE_NAME(TheClass, Method2) (int param 阅读全文

posted @ 2004-06-10 17:03 能发波 阅读(129) 评论(0) 推荐(0)

导航