List:MySQL++« Previous MessageNext Message »
From:Brad Hubbard Date:December 4 2008 8:26am
Subject:Re: Problem with Null string type
View as plain text  
Hi again Warren,

Warren Young wrote:
>
> Yes, you're right, that works. I was confused. The compiler is 
> complaining about operator=(), not operator Type&().
>
> Which one is line 74 in your excerpt? Can you cut it down some, 
> ideally to just one line that shows the problem?
>
individual is defined as before.

1
2 #include <iostream>
3 #include <vector>
4
5 #include <mysql++/mysql++.h>
6
7 #include "individual_SSQLS.h"
8
9 int main()
10 {
11 mysqlpp::Connection conn( false );
12
13 if( conn.connect ( "cassandra", "localhost", "cassandra", "hfc10cups" ) )
14 {
15 mysqlpp::Query query = conn.query( "SELECT individualID, firstName, 
surname, phoneNumber, mobileNumber, emailAddress from individual order 
by individualID" );
16 std::vector<individual> res;
17
18 query.storein( res );
19
20 std::vector<individual>::iterator it;
21 for( it = res.begin(); it != res.end(); ++it )
22 {
23 mysqlpp::sql_char &mob = it->mobileNumber;
24 std::cout<<mob<<std::endl;
25 }
26
27 }
28
29 return EXIT_SUCCESS;
30 }

[brad@rskikr scratch]$ g++ main.cpp -o main -I/usr/include/mysql -lmysqlpp
/usr/local/include/mysql++/null.h: In member function 
‘mysqlpp::Null<Type, Behavior>::operator Type&() [with Type = 
std::basic_string<char, std::char_traits<char>, std::allocator<char> >, 
Behavior = mysqlpp::NullIsNull]’:
main.cpp:23: instantiated from here
/usr/local/include/mysql++/null.h:229: error: ambiguous overload for 
‘operator=’ in ‘((mysqlpp::Null<std::basic_string<char, 
std::char_traits<char>, std::allocator<char> >, 
mysqlpp::NullIsNull>*)this)->mysqlpp::Null<std::basic_string<char, 
std::char_traits<char>, std::allocator<char> >, 
mysqlpp::NullIsNull>::data = mysqlpp::NullIsNull::null_is()’
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:485:

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

note: 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/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:504:

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>]


Thanks again,
Brad

Thread
Problem with Null string typeBrad Hubbard3 Dec
  • Re: Problem with Null string typeWarren Young3 Dec
    • Re: Problem with Null string typeBrad Hubbard3 Dec
      • Re: Problem with Null string typeWarren Young3 Dec
        • Re: Problem with Null string typeBrad Hubbard4 Dec
          • Re: Problem with Null string typeBrad Hubbard4 Dec
          • Re: Problem with Null string typeWarren Young4 Dec
            • Re: Problem with Null string typeBrad Hubbard5 Dec
              • Re: Problem with Null string typeWarren Young5 Dec
                • Re: Problem with Null string typeBrad Hubbard6 Dec
Re: Problem with Null string typeWarren Young6 Dec
  • Re: Problem with Null string typeBrad Hubbard6 Dec
    • execute failedbsingh8 Dec
      • Re: execute failedWarren Young8 Dec