List:MySQL++« Previous MessageNext Message »
From:<alan.alvarez Date:March 20 2006 10:50pm
Subject:Re: Row::at() doesn't take const int?
View as plain text  
Though the below code compiles I'm getting the follwoig error from the compiler:

SqlManager.cpp:167: error: ambiguous overload for 'operator[]' in 'l_row[0]'
/usr/local/include/mysql++/row.h:114: note: candidates are: const mysqlpp::ColData
mysqlpp::Row::operator[](const char*) const
/usr/local/include/mysql++/row.h:126: note:                 const mysqlpp::ColData
mysqlpp::Row::operator[](unsigned int) const

Here's the code for line 167:
        return l_row[0];

so I'm forced to do the following:
        unsigned int l_tmp = 0;
        return l_row[l_tmp];

and this compiles fine.

Respectfully,
Alan Alvarez.

----- Original Message -----
From: Warren Young <mysqlpp@stripped>
Date: Monday, March 20, 2006 9:19 pm
Subject: Re: Row::at() doesn't take const int?

> alan.alvarez@stripped wrote:
> > Doing something like Row[1] will produce a compile-time error.
> 
> Are you saying that this code won't compile:
> 
> 
> #include <iostream>
> 
> void foo(int bar)
> {
>         std::cout << bar << std::endl;
> }
> 
> int main()
> {
>         foo(42);
>         return 0;
> }
> 
> 
> ?  If so, please give platform and compiler details.
> 
> -- 
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:    
> http://lists.mysql.com/plusplus?unsub=1
Thread
Row::at() doesn't take const int?alan.alvarez18 Mar
  • Re: Row::at() doesn't take const int?Warren Young20 Mar
Re: Row::at() doesn't take const int?alan.alvarez20 Mar
  • Re: Row::at() doesn't take const int?Pedro LamarĂ£o20 Mar
  • Re: Row::at() doesn't take const int?Warren Young20 Mar
  • Re: Row::at() doesn't take const int?Johannes Schaub21 Mar
    • Re: Row::at() doesn't take const int?Warren Young21 Mar
Re: Row::at() doesn't take const int?alan.alvarez20 Mar
  • Re: Row::at() doesn't take const int?Pedro LamarĂ£o21 Mar
  • Re: Row::at() doesn't take const int?Warren Young21 Mar