Fix for VC++ insert() -
04-26-2005
, 06:05 PM
------_=_NextPart_001_01C549D3.CB30019F
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
I have found a fix to the SQLQuerry::insert() problem for VC++ 7.1
=20
You need to use an explicit cast...=20
=20
(static_cast<std::stringstream&>(*this))=20
=20
So the method will look like....
=20
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;
}=20
Here is a link to a very good explanation of the bug and work around...
=20
http://groups-beta.google.com/group/...l/browse_threa
d/thread/9a68d84644e64f15/32829a8b52fcc42b?q=3Dstringstream+operator%3C%3=
C
+bug&rnum=3D24&hl=3Den#32829a8b52fcc42b
=20
------_=_NextPart_001_01C549D3.CB30019F-- |