dbTalk Databases Forums  

Small patch

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


Discuss Small patch in the mailing.database.mysql-plusplus forum.



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

Default Small patch - 05-01-2005 , 04:02 AM






Hello,

I've found a small buglet in coldata.h, the type() method should be
const, but isn't. If you use something like row[i].type().sql_name(),
you get an 'passing this...discards qualifiers' error. That can be fixed
by adding 'const' to type(). Quite trivial...

Erwin

--- mysql++-1.7.34-orig/lib/coldata.h 2005-04-30 13:32:15.000000000 +0200
+++ mysql++-1.7.34/lib/coldata.h 2005-05-01 10:53:17.675023239 +0200
@@ -79,7 +79,7 @@
ColData_Tmpl() { }

/// \brief Get this object's current MySQL type.
- mysql_type_info type() { return _type; }
+ mysql_type_info type() const { return _type; }

/// \brief Returns true if data of this type should be quoted,
//false
/// otherwise.

--
erwin (AT) leastwanted (DOT) nl

--
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
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Small patch - 05-02-2005 , 11:22 AM






Erwin wrote:

Quote:
I've found a small buglet in coldata.h, the type() method should be
const,
Applied. Thanks.

In future, you don't need to justify this type of patch. If a method
clearly doesn't modify the contents of the class's internals, it should
be const, no question. Unless it's overridden by a subclass method that
does modify things, I suppose...

--
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.