stings.hpp

James Lee <[email protected]>
Newsgroups gmane.comp.gnu.aspell.devel
Message-ID <[email protected]>
Hello,

I'm having problems with strings.hpp. Class String is now
(last few 0.60) declared as:

  class String : public OStream

In previous versions (0.50.5) it is:

  class String : public std::string, public OStream

This means that previously a call to operator== was serviced
by the std::sting class but now there is no operator defined
within the class.  Running a simple test program[1] through
ddd shows that gcc will implicitly type cast to a ParmString
then call operator==(ParmString s1, const char * s2).

Although by reading the comments I can see that this will give
the desire result I can't see from the coding why it should be.
It's also inefficient, even inlined.  More importantly the Sun
Forte compiler (Sun 1 Studio 8) doesn't assume the type cast
to ParmString.  If I provide the operator== methods in
string.hpp the Sun CC works but g++ finds an ambiguity.

Can the String classes be rationalised?  Why isn't the
std::string class used? Why don't the other string classes
inherit from String?



James Lee.




Note 1. Simple test program:

#include <string.hpp>

int
main(
	int argc,
	char argv[])
{
	acommon::String aaa = "aaa";

	if (aaa == "bbb") {
		exit(1);
	}

	exit(0);
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.