#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; }