>>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Reading the documentation in lyxstring.h: "it is written to be
Angus> a drop in replacement for STL string"

Angus> which suggests that the configure option
Angus> "--with-included-string" is just that --- an option. It is not,
Angus> however. Configuring lyx (1.1.5 CVS) with "configure
Angus> --without-included-string" leads to the following error:

Lyxstring is written to have a standard conformant string object on
systems where STL strings are not good enough (for example, they do
not have the clear() method required for the standard). The configure
script tries to compile a short example program (using clear() in
particular) and decides to use lyxstring when STL string is not good
enough. 

Angus> There is some inconsistency here. Either lyxstring is meant to
Angus> be a drop in replacement for STL string, in which case both
Angus> configure options should work, Or it isn't, in which case, the
Angus> configure option should be removed.

It is just that your string implementation is not good enough...

However, I had another nasty idea about these string problems: What
about faking STL string with lyxstring when for the STL headers which
require the <string> header?

I explain. LString.h could start like

#ifndef LSTRING_H
#define LSTRING_H 

#ifndef USE_INCLUDED_STRING
#include <string>
using std::string;
#else
#ifdef __STRING__
#error The <string> header has been included before LString.h
#else
#define __STRING__
#endif
#include "support/lyxstring.h"
typedef lyxstring string;
#endif
#endif

This way, any time the real <string> header is included, it will not
load due to the fact that __STRING__ is already defined (if other
implementation use other defines, we could provide them). The downside
is that LString.h should be included before any STL header (we could
force that by including LString.h in config.h...).

I did not do it yet because I do not have much time now, but if Lars
does not strongly objects, I think we should do that. It would also
simplify a bit of the code with stringstreams.

Opinions?

JMarc

Reply via email to