Boost有一整套测试工具,基本上可以说它们是用于验证表达式的宏。
Boost has a whole host of test tools, which are basically macros used to validate expressions.
如果表达式不是常量,就调用另一个宏函数把值向上取整到2的幂。
Otherwise, if the expression is not a constant, another macro function is called to round up the value to a power of two.
您将学到 Lambda表达式、递归和宏。
接下来,for宏获取一个表达式来生成一个新的序列。
Next, the for macro takes an expression it USES to generate a new sequence.
使用宏 YYLLOC_DEFAULT(请参看Bison文档 中默认的定义),Bison可以计算出某个表达式的位置。
Together with the macro YYLLOC_DEFAULT (see the Bison documentation for the default definition), Bison calculates the location of an expression.
在表达式中合并宏的问题使得编写宏非常困难。
The problem of combining macros with expressions makes macro writing fairly difficult. For example, let's say you had the following macro called MIN that returns the smaller of two values
在这个宏执行时,它按照以下形式将my - if表达式与模板进行匹配(换句话说,将宏调用与宏定义模式进行匹配)。
When this macro executes, it will match the my-if expression up to the template like this (in other words, matching a macro invocation to a macro definition pattern).
表达式可以使用在常数值、命令的退出代码、字符串、宏和文件系统路径上使用的运算符。
Expressions can use operators that act on constant values, exit codes from commands, strings, macros, and file-system paths.
空宏和未定义的宏都展开为空字符串,但定义为空字符串的宏被视为是在预处理表达式中定义的。
Both null and undefined macros expand to null strings, but a macro defined as a null string is considered defined in preprocessing expressions.
空宏和未定义的宏都展开为空字符串,但定义为空字符串的宏被视为是在预处理表达式中定义的。
Both null and undefined macros expand to null strings, but a macro defined as a null string is considered defined in preprocessing expressions.
应用推荐