List:MySQL++« Previous MessageNext Message »
From:Mark Merendino Date:April 25 2005 8:17pm
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_threa
d/thread/9a68d84644e64f15/32829a8b52fcc42b?q=stringstream+operator%3C%3C
+bug&rnum=24&hl=en#32829a8b52fcc42b
 

Thread
Fix for VC++ insert()Mark Merendino27 Apr