From: Warren Young Date: February 15 2008 6:33am Subject: Re: minor compile-time issue with mysqlpp::null List-Archive: http://lists.mysql.com/plusplus/7463 Message-Id: <47B53236.6000106@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Andrej van der Zee wrote: > First of all, thanks for this release (candidate)! I > expected more effort for upgrading my project to > mysqlpp 3.0, but it was done without pain in a few > hours! Thanks for the report. > Where volume is the SSQLS struct: > > sql_create_complete_5(volume, 1, 5, > mysqlpp::sql_bigint_unsigned, _volume_id, > "volume_id", > mysqlpp::sql_smallint_unsigned, _session_id, > "session_id", > mysqlpp::Null, _msr_id, > "msr_id", > mysqlpp::Null, > _report_id, "report_id", > mysqlpp::sql_varchar, _name, "name" > ); I see you're already using new MySQL++ features. Or, were you using the Waba Null-for-SSQLS patch against v2.0? > error: passing ‘const mysqlpp::null_type’ as ‘this’ > argument of ‘mysqlpp::null_type::operator Type() [with > Type = unsigned int]’ discards qualifiers > > Note that the following construct works perfectly > fine: > > volume vol(volume_id, session_id, mysqlpp::null, > report_id, name); It's clear what it wants. You just have to declare null_type::operator Type() as const. There's no reason for it to be any other way. Good thing you caught it when you did, though: the fix breaks the ABI, so it might not have been possible to fix it after release.