List:MySQL++« Previous MessageNext Message »
From:Dustin Moore Date:April 3 2008 4:22am
Subject:conversion from ‘mysqlpp::Query’
to ‘bool’ is ambiguous
View as plain text  
I need some help (again).  I have bit of code were I build an update
statement from SSQLS objects and execute.  Now I should be able to
evaluate the Query object in an logical statement to determine if an
error occurred, but I am getting a compile error about ambiguity.  


	mysqlpp::Query query = con->query();

	query.update(oldUnit, newUnit);
				
	query.execute();

	if(query)
  	  return true;


g++ -I/usr/include/mysql -I/usr/local/include/mysql++ -O0 -g3 -Wall -c
-fmessage-length=0 `pkg-config --cflags gtkmm-2.4` `pkg-config --cflags
libglademm-2.4` -MMD -MP -MF"DataInterface/DataInterface.d"
-MT"DataInterface/DataInterface.d" -o"DataInterface/DataInterface.o"
"../DataInterface/DataInterface.cpp"
../DataInterface/DataInterface.cpp: In member function ‘bool
DataInterface::update(Unit&)’:
../DataInterface/DataInterface.cpp:100: error: conversion from
‘mysqlpp::Query’ to ‘bool’ is ambiguous
/usr/local/include/mysql++/query.h:257: note: candidates are:
mysqlpp::Query::operator bool mysqlpp::Query::*() const
/usr/include/c++/4.1.3/bits/basic_ios.h:107: note:
std::basic_ios<_CharT, _Traits>::operator void*() const [with _CharT =
char, _Traits = std::char_traits<char>]
make: *** [DataInterface/DataInterface.o] Error 1


As a side note, I tried to use query.affected_rows() to determine a
successful update, but the function returned a very large
number(garbage) instead of -1 or 0, which would make more sense in
context.


Any help will be greatly appreciated,

Dustin Moore





Thread
conversion from ‘mysqlpp::Query’to ‘bool’ is ambiguousDustin Moore3 Apr
  • Re: conversion from ‘mysqlpp::Query’ to ‘bool’ is ambiguousWarren Young4 Apr
    • Re: conversion from‘mysqlpp::Query’ to‘bool’ is ambiguousDustin Moore4 Apr
      • Re: conversion from ‘mysqlpp::Query’ to ‘bool’ is ambiguousWarren Young8 Apr
        • Re: conversion from‘mysqlpp::Query’ to‘bool’ is ambiguousDustin Moore11 Apr