From 0b43d984905f07c59e3236d98d4e27409aba3cda Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 17 Jan 2025 16:23:24 +0100 Subject: More stuff with templates --- templates/std_array.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 templates/std_array.cpp (limited to 'templates/std_array.cpp') diff --git a/templates/std_array.cpp b/templates/std_array.cpp new file mode 100644 index 0000000..8044cb2 --- /dev/null +++ b/templates/std_array.cpp @@ -0,0 +1,16 @@ +#include +#include + +int main() { + std::array a {1.0, 1.1, 1.2}; + std::cout << "Capacity of a: " << a.size() << std::endl; + + a[3] = 1.3; + a[4] = 1.4; + + for (auto x : a) + std::cout << x << " "; + std::cout << std::endl; + + return 0; +} -- cgit v1.3