[Open Babel] const correctness

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Open Babel] const correctness

Jens Auer
Is there nay reason why string references used as parameters, eg in
OBMol::HasData(string&) is not declared as a const string& ? Since I try
to enforce const correctness, I always have to do a const_cast when
using such methods from OpenBabel.

Considering the const correctness in general, I recognized that at least
OBMol::HasData(), which does not manipulate the object, is not marked as
const.
--
Jens Auer
Life Science Informatics
B-IT Intl. Center for Information Technology
Rheinische Friedrich-Wilhelms-University Bonn
Görresstraße 13
D-53113 Bonn
phone: +49 (228) 2699 314
email: [hidden email]



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Open Babel] const correctness

Geoffrey Hutchison

On Nov 23, 2005, at 4:13 AM, Jens Auer wrote:

> Is there nay reason why string references used as parameters, eg in
> OBMol::HasData(string&) is not declared as a const string& ? Since  
> I try
> to enforce const correctness, I always have to do a const_cast when
> using such methods from OpenBabel.

The only reason is historical. The original codebase did not do much  
in the way of enforcing "const" parameters. Most of the active  
developers have been adding these as we go, but have not hit every  
method.

If you'd like to submit a patch (or multiple patches over time) to  
correct these, it would be most welcome.

Cheers,
-Geoff


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Loading...