From 2002c50870a66514c01922202c7297feb47dfb78 Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 7 Nov 2024 19:15:34 +0100 Subject: [PATCH] tools - just add a c++ playground file --- .gitignore | 1 + tools/test_cxx.cc | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tools/test_cxx.cc diff --git a/.gitignore b/.gitignore index a94fe8f..94e8e9a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /build.conf build/ +/tools/a.out diff --git a/tools/test_cxx.cc b/tools/test_cxx.cc new file mode 100644 index 0000000..ba74a36 --- /dev/null +++ b/tools/test_cxx.cc @@ -0,0 +1,29 @@ +#include + +template struct Supplier { + char data[5]{ 'h', 'e', 'l', 'l', 'o' }; + uint8_t pos{ 0 }; + + char next() + { + pos++; + if (pos >= SIZE) { + return -34; + } + + return data[pos]; + } +}; + +int main() +{ + std::cout << "BEGIN" << std::endl; + Supplier<5> sup{}; + + + while (char c = true) { + std::cout << c; + } + + std::cout << "END" << std::endl; +} \ No newline at end of file