Rewrote the comments in the libraries under 'includes' in English (excluding those inside folders)
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
"""ctraits — 编译时类型特征库
|
||||
"""ctraits — Compile-time type trait library
|
||||
|
||||
提供编译时类型判断函数,不纳入运行时编译。
|
||||
所有函数仅在编译时求值,可与 c.CIf 等编译时条件配合使用。
|
||||
Provides compile-time type predicates with no runtime code generated.
|
||||
All functions are evaluated exclusively at compile time and can be combined with conditional compilation constructs such as c.CIf.
|
||||
"""
|
||||
import t
|
||||
|
||||
|
||||
def isptr(x: t.CType) -> bool:
|
||||
"""编译时判断 x 的类型是否为指针类型。
|
||||
"""Compile-time predicate to determine whether the type of x is a pointer.
|
||||
|
||||
返回 True 如果 x 是指针(ptr_count > 0),否则返回 False。
|
||||
可与 c.CIf 配合使用实现条件编译。
|
||||
Returns True if x is a pointer type (ptr_count > 0); otherwise returns False.
|
||||
Can be used alongside c.CIf to implement conditional compilation.
|
||||
|
||||
示例:
|
||||
Example:
|
||||
if c.CIf(ctraits.isptr(my_var)):
|
||||
# 仅当 my_var 是指针类型时编译此分支
|
||||
# This branch compiles only when my_var is a pointer type
|
||||
...
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
Reference in New Issue
Block a user