高阶c++

模板就是宏。模板能不能再往一步?

http://perilla.codeplex.com/

 

enhanced c++ template grammar:

rule 1:

c++ identifier include :
const name
variable name
class name
struct name
function name
namespace
code block name (new)
expression name (new) 

c++ original temple include:
class template
function template
and template parameter can only be type name or const

enhanced temple include all kind of identifier above and template parameters can be all of identifier above.

rule 2:
AST reflection can be accessed in the template.


rule 3:
identifier can be operate as string, and transfer each other.

rule 4:
some check can be done at pre-compile stage.

rule 5:
alias is used for simply the identifier. 

posted @ 2014-11-19 19:56  高树岭软件实验室  阅读(194)  评论(0编辑  收藏  举报