List:MySQL++« Previous MessageNext Message »
From:Adrian Cornish Date:February 16 2011 2:57pm
Subject:Suggested patch for query class
View as plain text  
Hi Warren, List

Here is a small patch for consideration for the query class to allow
the multi insert/replace to work with other STL containers like
std::set,std::list


Adrian Cornish

===================================================================
--- lib/query.h (revision 2685)
+++ lib/query.h (working copy)
@@ -1009,7 +1009,7 @@
                               
first->field_list() << ") VALUES (" <<
                               
first->value_list() << ')';

-              
Iter it = first + 1;
+               Iter it = ++first;
               
while (it != last) {
                       
MYSQLPP_QUERY_THISPTR << ",(" <<
it->value_list() << ')';
                        ++it;
@@ -1153,7 +1153,7 @@
                                first->field_list() << ") VALUES (" <<
                               
first->value_list() << ')';

-               Iter it = first + 1;
+              
Iter it = ++first;
               
while (it != last) {
                        MYSQLPP_QUERY_THISPTR
<< ",(" <<
it->value_list() << ')';
                       
++it;
Thread
Suggested patch for query classAdrian Cornish16 Feb
  • Re: Suggested patch for query classWarren Young19 Feb
    • Re: Suggested patch for query classAdrian Cornish19 Feb