You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
456 B
29 lines
456 B
#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;
|
|
}
|