摘要
类复合是通过模板元编程技术在C++的编译期由指定的类型序列和细粒度的template parameters来创建类结构的编程技术,它的基本构想是以类型序列作为代码生成机制,驱动编译器在编译期自动生成代码.在对类型成员的访问方法上,通过显式的类型成员限定来访问类型成员value的方法,容易产生歧义.本文通过索引确定类型成员,从而进一步访问类型成员value的方法,解决了模棱两可(歧义)的现象.
Class composition is a programming technique that specified type sequences and fine-grained tem-plate parameters create class structures through the template metaprogramming technique at compiling time in C++.The basic idea is to take type sequences as the code generation mechanism and drive the compiler to auto-matically generate code at compiling time.Ambiguity will occure when accessing the type members by explicit type member's identification.We provide a way to specify type members by indexing and then accessing values of type members to resolve the ambiguity problem.
出处
《湖南师范大学自然科学学报》
CAS
北大核心
2014年第5期90-94,共5页
Journal of Natural Science of Hunan Normal University
基金
湖北省教育科学"十一五"专项资助重点课题(2009A091)
关键词
类复合
函数实参推导
基类链
class composition
function argument deduction
base class chain