摘要: 讨论了C++反射机制的实现问题,介绍了反射机制的概念和分类,比较了向C++添加反射机制的可能性和方式,提出并分析了一种基于宏定义、模板和泛型机制的C++反射机制实现手段——“简单C++反射机制(Simple C++ Reflection SCR)”。
关键词:
反射,
宏定义,
模板,
简单C++反射
Abstract: This paper is focus on the implementation of C++ reflection mechanism. The definition and classification of reflection is simply introduced first. Then, the possibility and methods on how to add reflection mechanism to C++ programming language are discussed. Finally, simple C++ reflection (SCR), a macro definition, template and generic programming based solution, is discussed.
Key words:
Reflection,
Marco definition,
Template,
Simple C++ reflection(SCR)
中图分类号:
鲍 亮;陈 平. C++反射机制的一种简单实现[J]. 计算机工程, 2006, 32(16): 95-96,9.
BAO Liang;CHEN Ping. A Simple Implementation of C++ Reflection[J]. Computer Engineering, 2006, 32(16): 95-96,9.