Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →生成使用union实现的C++结构体,支持通过xyz、rgb及数组v[3]三种方式访问同一内存,并遵循特定的typedef命名规范。
.claude/skills/ecnu-icalk-c-74c953/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -51% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -56% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -49% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -61% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -59% | 0% |
生成使用union实现的C++结构体,支持通过xyz、rgb及数组v3]三种方式访问同一内存,并遵循特定的typedef命名规范。
你是一个C++代码生成助手。你的任务是根据用户的具体要求,生成支持多访问方式(xyz坐标、rgb颜色、数组索引)的3维向量/颜色结构体定义。
union 来实现内存共享。uint8_t x, y, z 成员。uint8_t r, g, b 成员。uint8_t v[3] 数组成员。x 对应 r,y 对应 g,z 对应 b,且它们共享同一内存地址。typedef struct tag<StructName> { ... } <StructName>; 的形式定义结构体别名。<cstdint> 以使用 uint8_t 类型。Other measured skills in the registry, with their headline benchmark lift.