From: Warren Young Date: May 18 2010 12:53am Subject: Re: Detecting errors executing SQL queries List-Archive: http://lists.mysql.com/plusplus/8949 Message-Id: <4BF1E503.5000409@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 6/10/2009 2:54 AM, Warren Young wrote: > Martin Dubuc wrote: >> I expected that the !query would work, but the >> compiler must do something special because the !query doesn't work. > > This behavior is very weird. It must be going through some other > conversion path, perhaps one inherited from std::ostream. For the archives, it was due to basic_ios::operator!(). MySQL++ 3.1 overrides this with Query::operator!(), which fixes this. Incidentally, this works in MySQL++ 3.0: if (query) { ... It's because that calls Query::operator void*() instead of basic_ios::operator!().