On Thu, 24 May 2012 22:31:29 +0100 Neil Morgenstern 
<[email protected]> wrote:

NM> Let's fix this properly. Get rid of these raw pointers and use
NM> vector<char>. Ensure it is bound properly too.

 I don't think the code is really going to be simpler with vector<char>.
And there is no better way to ensure that it's bound properly, as you don't
really store strings in this vector (but also e.g. TIMESTAMP_STRUCT), you'd
need to use memcpy() or reinterpret_cast<> anyhow. SQLBindParameter() is
inherently type-unsafe and this code reflects it.

 I'd consider using some smart pointer class automatically deleting the
buffer but I don't see SOCI using any smart pointers right now and it's not
worth to add another dependency just for this code.

 Regards,
VZ

Attachment: pgpv2npGDumco.pgp
Description: PGP signature

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to