This commit is contained in:
2026-05-26 15:01:50 +02:00
parent 6a948ffe9f
commit a645291f8b
55 changed files with 1337 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
// Fragment A
template <typename T> T podwoj(T x) { return x + x; }
podwoj(2, 3); // funkcja przyjmuje jeden argument a jest wywołana z dwoma
// Fragment B
template <typename T> T iloczyn(T a, T b);
// definicja w innym pliku .cpp - kod się nie linkuje
// Fragment C
template <typename T> T wiekszy(T a, T b) { return a > b ? a : b; }
wiekszy("abc", 5); // musi być dwa razy ten sam typ danych, a nie dwa różne