The *Impl is not the key point for this example, code readers could ignore this.
| 123 | // The *Impl is not the key point for this example, code readers |
| 124 | // could ignore this. |
| 125 | Lazy<uint64_t> CountCharFileCoroImpl(const FileName &File, char c) { |
| 126 | uint64_t Ret = 0; |
| 127 | std::ifstream infile(File); |
| 128 | std::string line; |
| 129 | while (std::getline(infile, line)) |
| 130 | Ret += std::count(line.begin(), line.end(), c); |
| 131 | co_return Ret; |
| 132 | } |
| 133 | |
| 134 | Lazy<uint64_t> CountCharInFilesCoro(const std::vector<FileName> &Files, |
| 135 | char c) { |
no test coverage detected