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.

There is also the option to test for an existing facet before replacing
it. On the other hand I am wondering whether it's in fact good to define
our own, so that there is no surprise of locale-specific behaviour that
change with the weather and the time of day.


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.)

going from string to char * to string again can be
a lossy conversion.

Right, I'll keep that in mind.


To me the most important part (the first patch) looks very promising. Very
nice work!

Thank you

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...).

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?

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.

Guillaume

Reply via email to