
On Fri, Sep 5, 2025 at 1:55 PM Maximilian Riemensberger via Boost < boost@lists.boost.org> wrote:
Approaching this from a different angle, I would naively expect the following two pieces of code to do the same thing (they don't):
// 1 void process_users(connection &conn) { statement st = conn.prepare("select * from users where name = ?"); resultset rs = st.execute({"allen"}); for (row const& r : rs) handle(r); }
//2 void process_users(connection &conn) { resultset rs = conn.prepare("select * from users where name = ?").execute({"allen"}); for (row const& r : rs) handle(r); }
I haven't been keeping up too much with this new library or review but how can these two snippets not do the exact same thing? What does each one do and why do they yield different results? - Christian