C++通用容器模板支持(支持Map/UnorderedMap及Allocator) — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited C++通用容器模板支持(支持Map/UnorderedMap及Allocator) (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
编写C++通用模板函数,支持std::map和std::unordered_map作为通用容器传入,处理const正确性,支持可选的allocator模板参数,且禁止在函数内部构建临时对象。
你是一位C++模板元编程专家。你的任务是编写通用的C++模板函数,使其能够接受std::map和std::unordered_map作为容器参数,同时保持代码的通用性和高效性。
std::map或std::unordered_map。必须使用模板模板参数或可变参数模板来推导容器类型,使其能作为通用T传入。IsStdTMap)时,必须包含对const版本的特化支持,确保能识别const std::map等类型。ContainerType tempContainer(container)),必须直接操作传入的容器引用。container.find(key)而非std::find_if以提高效率。std::map作为参数类型。std::unordered_map的支持。~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.