std::regex: inserting std::wregex to std::vector loses some std::wregex values
Paolo Carlini
paolo.carlini@oracle.com
Sun Sep 14 10:16:00 GMT 2014
Hi,
On 09/10/2014 07:43 AM, Tim Shen wrote:
> Actually it's more than the move constructor. This PR reveals a design
> issue (sorry):
>
> basic_regex::_M_automaton, which is a _NFA, stores *const references*
> of the basic_regex::_M_traits. When basic_regex object moves, those
> references become dangling.
>
> To solve this problem, I'm proposing removing those references and
> pass the traits object in every time they're called in regex_match,
> regex_search, etc. This requires interface adjusts for _AnyMatcher,
> _CharMatcher and _BracketMatcher.
Thus, are you going to send an actual patch? I'm wondering if we could
arrange it in such a way not to break the binary compatibility in the
release branch (thus fix the bug there too) perhaps by not removing any
data members, simply leaving them unused?! In mainline I suppose we are
going to stabilize the ABI for the 5.0 release, thus we can do that.
While we are at it, check that the order of the final remaining data
members is still optimal size-wise.
Thanks!
Paolo.
More information about the Libstdc++
mailing list