Browse Source

tools - just add a c++ playground file

master
heck 8 months ago
parent
commit
2002c50870
  1. 1
      .gitignore
  2. 29
      tools/test_cxx.cc

1
.gitignore

@ -2,3 +2,4 @@
/build.conf
build/
/tools/a.out

29
tools/test_cxx.cc

@ -0,0 +1,29 @@
#include <iostream>
template<unsigned int SIZE> 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;
}
Loading…
Cancel
Save