Quantcast

Proposal to remove all duplicated std::string versus const char* methods

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

Proposal to remove all duplicated std::string versus const char* methods

Noel O'Boyle
Administrator
Hi there,

As part of an API cleanup, I propose the removal of all std::string
accepting methods that have duplicate const char* methods.

Here's an example from OBElementTable:

      int   GetAtomicNum(const char *, int &iso);
      int   GetAtomicNum(std::string name, int &iso);

(I note in passing that the std::string version does a needless copy.)
IMO, we should get rid of them simply because they are convenience
functions. Actually, this isn't even a convenience function - it
doesn't do anything for the caller beyond sticking .c_str() at the end
of the variable name.

Regards,
- Noel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
Loading...