16 Feb
2018
16 Feb
'18
6:54 a.m.
On 16/02/2018 05:24, Andy wrote:
How can I write something similar, but database iterator. I want get information from mySQL. The simplest way is add everything returning by select to vector of vector of string. But I prefer database iterator. How it write? How is in general directory_iterator as a iterator model?
http://en.cppreference.com/w/cpp/language/range-for Essentially you need to return something that can have begin and end called on it (either as free functions via ADL or as members). And those need to return something that behaves like an iterator. The rest is up to you.