Behavior of Boost static assertions.
Boost静态断言的行为。
In addition, static assertions don't generate any code.
此外,静态断言不生成任何代码。
Static assertions build on this basic concept, except that static assertions are valid only at compile time.
静态断言建立在这个基本概念之上,只不过静态断言仅在编译时有效。
You can use static assertions in global scope and inside namespaces, function bodies, or class declarations.
可以在全局范围以及在名称空间、函数体或类声明内使用静态断言。
While using static assertions, always remember that the expression being checked must be evaluable at compile time.
一定要记住,在使用静态断言时,检查的表达式在编译时必须是可计算的。
You can use Boost static assertions in a class, function, or namespace scope; you can also use them with templates.
您可以在类、函数或命名空间范围中使用Boost静态断言;还可以与模板一起使用它们。
Some of these features—like static assertions—first made their appearance in GCC version 4.3, while lambda functions first appeared with the 4.5 release.
其中一些特性(比如静态断言)是在GCC 4.3 中首次出现的,而lambda函数是在 GCC 4.5 中首次出现的。
Normally static assertions when used inside a class or function template, will not be instantiated until the template in which it is used is instantiated.
通常静态断言在类或模板函数中使用时,模板实例后,静态断言才能在实例的模板中实例。
Assumptions are similar to assertions at runtime, but differ during static verification.
假定与运行时断言相似,不同之处在于静态检验的方式。
Assumptions are similar to assertions at runtime, but differ during static verification.
假定与运行时断言相似,不同之处在于静态检验的方式。
应用推荐