This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: basic regex implementation


On 9 June 2010 21:10, Stephen M. Webb wrote:
> This is a first pass for a C++0x regex implementation. ?Very basic
> functionality only (BREs only, no backrefs, no character classes), not
> production code yet, still not caught up to n3090. ?Looking for feedback
> before I put more effort in.

Some comments from a *very* brief look at the parts I'm already familiar with...

I like the debugging stuff guarded by SMW_NDEBUG, it would be a shame
to lose that.  Maybe it could be polished so it could be kept in the
final version, at least when _GLIBCXX_DEBUG is defined.

AFAICT there is no fix needed for threading issues w.r.t
__unmatched_sub, initialisation of local statics is reentrant with GCC
(as required by C++0x). That's why I used a local static not a global
static.

The std:: qualifiers could be removed, the code is already in namespace std.


A comment on the C++0x regex spec, rather than your implementation:
It's my understanding that users are not supposed to instantiate
sub_match objects, or at least shouldn't need to, as doing so results
in an uninitialised "matched" member. I intend to file an NB comment
suggesting a deleted default constructor.  There could be a private
constructor which is used internally by the library.  If you have any
comments on that point I'd be glad to hear them.

Thanks again.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]