[odb-users] Odd behaviour with odb::result<T> container

Boris Kolpackov boris at codesynthesis.com
Mon Jun 15 11:45:46 EDT 2015


Hi Sean,

Sean Clarke <sean.clarke at sec-consulting.co.uk> writes:

> If I remove that initial dummy for loop iterating over the container then
> the accumulate function works fine.

Result iterator is an input iterator (Section 4.4, "Query Result") which
means you can iterate over it only once. Think of it as a stream (which
in many database systems it is; the server sends the rows as we consume
them). While this one-pass semantics is implied by input iterator, I've
added an explicit note to the ODB manual to this effect.

Boris



More information about the odb-users mailing list