List:MySQL++« Previous MessageNext Message »
From:MERE2639 Date:April 26 2005 11:40am
Subject:Fix for VC++ insert()
View as plain text  
I have found a fix to the SQLQuerry::insert() problem for VC++ 7.1

You need to use an explicit cast... 

(static_cast<std::stringstream&>(*this)) 

So the method will look like....

template <class T> SQLQuery& insert(const T &v) {
reset();
(static_cast<std::stringstream&>(*this)) << "INSERT INTO " <<
v.table() << " 
(" << v.field_list()
 << ") VALUES (" << v.value_list() << ")";
return *this;
} 
Here is a link to a very good explanation of the bug and work around...

http://groups-beta.google.com/group/microsoft.public.vc.stl/browse_thread/thre
ad/9a68d84644e64f15/32829a8b52fcc42b?q=stringstream+operator%3C%3C+bug&rnum=24
&hl=en#32829a8b52fcc42b

Thread
Fix for VC++ insert()MERE263926 Apr
  • Re: Fix for VC++ insert()Warren Young26 Apr