|
|
Choosing A Webhost: |
Re: [patch] row::operator[] - template version: msg#00072db.mysql.c++
On Sun, Sep 18, 2005 at 12:30:49PM -0400, pps wrote: > >I'd be interested in what kind of errors the above patch could cause. > > I don't remember, but I really had to redo it :) > > >I suppose the template/non-template could confuse some compilers. If so, > >we could get rid of non-template members completely, and make a > >specialization > >for the const char * version. That should work. > > The problem is that there's no such thing as partial template > specialization for members. If you have two templates with the same > signature, there's good chance a wrong template gets selected (resulting > in compile error or worse, wrong code being executed). For control of > instantiation of templates SFINAE (substitution-failure-is-not-an-error) > principle used. enable_if exploits this thing. Thanks for the detailed email. I had to read up on this to fully understand it. Google's cache came in handy, as the most informative site didn't respond: http://tinyurl.com/cemw6 But as you noted elsewhere in your email, we are not using this in a templated class, so the only problem is that the template may match more types than it should, for the integer case. The good news is that the integer template case just calls row::at(), which only has an integer argument. If I understand SFINAE correctly, if the integer doesn't fit with at(), the template won't be considered. It will fail with non-integer arguments in any case, which is fine. :-) I don't know off hand, without testing, which style will produce the clearest error messages for the user. > >Could you run a test compile and let us know, on WinXP? > > I don't know how to compile it !!! :) > I'll look around for the patch on the list to be able to compile it, or > I'll create my own project files from zero... The development site is: https://gna.org/projects/mysqlpp/ You can grab the latest makemake.bat file here: http://svn.gna.org/viewcvs/mysqlpp/trunk/ - Chris -- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=gcdmc-plusplus@xxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [patch] row::operator[] - template version, pps |
|---|---|
| Next by Date: | test, please ignore, Chris Frey |
| Previous by Thread: | Re: [patch] row::operator[] - template version, pps |
| Next by Thread: | Re: [patch] row::operator[] - template version, pps |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |