From 2ba1d2f7b6f3e1f50251508972d80a1ba8993331 Mon Sep 17 00:00:00 2001 From: portersky <24420859+portersky@users.noreply.github.com> Date: Mon, 15 Jun 2026 04:31:04 +0200 Subject: [PATCH] fix: use C syntax in tdd skill examples auto trailing return types are C++ only. Split header and\nimplementation examples into C and C++ variants. --- .pi/skills/tdd/SKILL.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.pi/skills/tdd/SKILL.md b/.pi/skills/tdd/SKILL.md index 9f0b2af..c78e0ce 100644 --- a/.pi/skills/tdd/SKILL.md +++ b/.pi/skills/tdd/SKILL.md @@ -38,10 +38,21 @@ before the implementation was missing. Create `/.h` with the public prototype(s). +C: + ```c #pragma once #include +int fn_name(int arg); +``` + +C++: + +```cpp +#pragma once +#include + auto fn_name(int arg) -> int; ``` @@ -122,9 +133,21 @@ list(APPEND TEST_TARGETS test_) Create `/.c` with a dummy return: +C: + ```c #include "/.h" +int fn_name(int arg) { + return 0; +} +``` + +C++: + +```cpp +#include "/.h" + auto fn_name(int arg) -> int { return 0; }