Guillaume Munch wrote:

> Le 22/08/2016 à 20:56, Georg Baum a écrit :
>> Guillaume Munch wrote:
>>
>>> This is not the final version
>>> of the patch however because there is one big disappointment: the C++11
>>> standard does not require several facets (including ctype<char32_t>)
>>> that are necessary to use stringstreams of char32_t. So these need to be
>>> defined by hand.
>>
>> Which is not a problem IMHO. Our own facets work, and the implementation
>> is confined to one file which nobody needs to look at (unless he wants
>> to).
> 
> I was not sure because they were guarded by
>    #ifdef !defined(USE_WCHAR_T) && defined(__GNUC__)
> and I was fearing it could have become dead code with the time.

This combination is used on mingw and cygwin, so I am pretty confident that 
it works.

>> AFAIK we do currently not need string literals in combination with
>> trivstring, so I do not see an advantage of replacing it with something
>> else, especially looking at 4. IMHO we should simply keep trivstring
>> until we can require gcc 5.1.
> 
> The point is to remove the need for trivdocstring entirely, so that we
> can already use docstring knowing it is thread-safe. This might not
> change the existing code, but could simplify the future one. (In fact I
> was unaware of trivstring and these threading issues until last week --
> It's good to simplify the situation.)

I would like it more simple as well, but it seems this is not easily 
possible without a C++11 compliant std::string.

>> Is there anything besides the facets that you think is not ready?
> 
> * There could remain some bogus documentation and workarounds that
> escaped me (I could remove ones that were easy to find).
> 
> * Other problems that would only appear at runtime (I learnt about
> facets the hard way...).

Of course we would need some good testing, but it is good to know that there 
are currently no further known problems. Regarding the documentation I am 
not aware of anything else either.

>> The only thing I would do differently is the replacement of
>> empty_string() and empty_docstring(): Those were introduced to avoid
>> including <string>. Since <string> is now required, it would be better to
>> initialize the default arguments with docstring() or std::string().
> 
> There is not much a difference from what I did, other than matters of
> taste, is there?

There is an additional conversion from char * to std::string. I was once 
told that this is less efficient (here on the LyX mailing list, but I forgot 
who wrote that), but I never tested that myself.

>> And in a second step we should
>> get rid of strfwd.h completely, the name would be wrong for all compilers
>> then.
> 
> I can also try to keep docstring forward-declared.

This does not work with clang and libc++ AFAIK. I never liked the current 
mixture of forward declaration or full include depending on the used 
compiler (can lead to compile errors). Therefore using the full includesd 
for all compilers is good IMHO.


Georg

Reply via email to