3 messages in com.mysql.lists.plusplusFix for VC++ insert()
FromSent OnAttachments
Mark Merendino25 Apr 2005 13:17 
MERE...@aol.com26 Apr 2005 04:40 
Warren Young26 Apr 2005 13:59 
Subject:Fix for VC++ insert()
From:Mark Merendino (Mark@cnt.com)
Date:04/25/2005 01:17:01 PM
List:com.mysql.lists.plusplus

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