List:MySQL++« Previous MessageNext Message »
From:Pedro Lamarão Date:March 21 2006 3:09pm
Subject:Re: Row::at() doesn't take const int?
View as plain text  
alan.alvarez@stripped escreveu:
> 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];
>   
A simpler workaround would be:

    return l_row[ static_cast<unsigned>(0) ];

There is no resolution to this situation in ISO C++.
I think current practice would refactor the (char const*) overload to a
member function.

-- 
Pedro Lamarão
Desenvolvimento

Intersix Technologies S.A.
SP: (55 11 3803-9300)
RJ: (55 21 3852-3240)
www.intersix.com.br

Your Security is our Business


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