dbTalk Databases Forums  

Minor patch to null.h

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Minor patch to null.h in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve Roberts
 
Posts: n/a

Default Minor patch to null.h - 03-16-2005 , 12:02 AM






------_=_NextPart_001_01C529ED.C0EE0475
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Our organization changed OS version and compiler (from GCC 3.2.2 to GCC =
3.2.3). As part of the move, the CM powers-that-be tightened the code =
requirements such that compiles fail on any warning. As a result, our =
code was choking on a line in null.h where the operator () function of =
class null_type was not returning a value (throws BadNullConversion as =
it should). The included patch is what we used to fix the problem in =
our little world.

This is against 1.7.26; we haven't updated yet. However I just checked =
and the patch should work against the latest code.

Anyway, here's the diff, humbly submitted...:

--- lib/null.h 2005-03-15 21:25:23.000000000 -0800
+++ lib/null.h.new 2005-03-15 21:25:09.000000000 -0800
@@ -11,7 +11,7 @@

class null_type {
public:
- template <class Type> operator Type () {throw BadNullConversion();}
+ template <class Type> operator Type () {if (1) throw =
BadNullConversion();else return Type();}
};

//:

------_=_NextPart_001_01C529ED.C0EE0475--

Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Minor patch to null.h - 03-16-2005 , 07:49 PM






Steve Roberts wrote:
Quote:
- template <class Type> operator Type () {throw BadNullConversion();}
+ template <class Type> operator Type () {if (1) throw BadNullConversion();else return Type();}
Ugh. Try this instead:

template <class Type> operator Type ()
{
throw BadNullConversion();
return Type();
}

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.