List:MySQL++« Previous MessageNext Message »
From:Sebastián Salazar Molina. Date:February 25 2009 4:13pm
Subject:Newbie Row question
View as plain text  
I have this code:

try {

	mysqlpp::Row actual = *fila;
	string out;
	return out = actual[f];

} catch (const mysqlpp::Exception &e) {
...
}

Where *fila is a pointer to a UseQueryResult fetch_row, maybe i'm so wrong and 
this code is so bad, but when I change out to int, it compile fine, when I 
use string, i can't compile:

seba@VF-1S:~/sources/GiftCard/src/switch/libs$ LC_ALL=C g++ -c -g3 
mysql_op.cpp -I/usr/include/mysql -I/usr/include/mysql++
mysql_op.cpp: In member function 'std::string MySQL::qGetString(int)':
mysql_op.cpp:602: error: ambiguous overload for 'operator=' in 'out = 
actual.mysqlpp::Row::operator[](f)'
/usr/lib/gcc/i486-slackware-linux/4.2.4/../../../../include/c++/4.2.4/bits/basic_string.h:498:

note: candidates are: std::basic_string<_CharT, _Traits, _Alloc>& 
std::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with 
_CharT = char, _Traits = std::char_traits<char>, _Alloc = 
std::allocator<char>]
/usr/lib/gcc/i486-slackware-linux/4.2.4/../../../../include/c++/4.2.4/bits/basic_string.h:509:

note:                 std::basic_string<_CharT, _Traits, _Alloc>& 
std::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = 
char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]

Thread
Newbie Row questionSebastián Salazar Molina.25 Feb
  • Re: Newbie Row questionWarren Young25 Feb
    • Re: Newbie Row questionSebastián Salazar Molina.25 Feb
    • Re: Newbie Row questionRobert Simmons25 Feb
      • Re: Newbie Row questionWarren Young25 Feb