List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:August 24 2004 5:21pm
Subject:Re: RELEASE: v1.7.13
View as plain text  
Bryan W. Headley wrote:
>
> you're referring to MysqlRow::operator[](const char*), right?

Yes.  There were also std::string and int overloads.

The problem comes up when you say:

	bla = row[0];

Which overload does it call?  You can convert 0 to all four types, so 
g++ rightfully said "I give up".  I therefore removed three of the 
overloads (all but size_type, which is the only one the library itself 
requires) and added MysqlRow::lookup_by_name() to replace the 
functionality provided by the char* and string overloads.

By the way, if someone wants lookup_by_name() overloaded for std::string 
as well as const char*, let me know.  I only stopped with const char* 
because that was the minimum change that would allow the examples to 
compile.

I should point out that this problem is most acute with 0 as the 
argument to operator[].  When you use a different number, you rule out 
the const char* overload.  When you use a variable, you rule out all but 
one, if the variable is of the right type.  Therefore, it's quite 
possible for the old code to compile on recent g++'s without this 
change, depending on how you actually used the library.  It happens that 
the SQLSS code uses bare constants, including 0, so all custom SQL macro 
users hit this problem.  If you never built the examples and you don't 
use the SQLSS stuff, you might never have seen this problem.

> -    NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,vector<bool>)
> +    NAME##_cus_value_list (const NAME *o, cchar *d, Manip m 
> ,vector<bool> *i)

That's indeed the change I applied to my working copy.  It will be in 
version .14, which may be out soon.  I'm working on other things which 
may also go into that release, and I don't know how long it will take.
Thread
RELEASE: v1.7.13Warren Young24 Aug
Re: RELEASE: v1.7.13Warren Young24 Aug
Re: RELEASE: v1.7.13Warren Young24 Aug
Re: RELEASE: v1.7.13Warren Young24 Aug