Re: [Patch] regex_iterator and regex_token_iterator implementation

2013-07-23 Thread Jonathan Wakely
On 23 July 2013 10:18, Tim Shen wrote: > > Are other parts ok? Could you please look at them? In regex_token_iterator::_M_init the for loop could be replaced with either for (auto __i : subs) or a call to std::find, which wouldn't need the cast to int, but that's just stylistic and a matter of tas

Re: [Patch] regex_iterator and regex_token_iterator implementation

2013-07-23 Thread Tim Shen
On Mon, Jul 22, 2013 at 6:10 PM, Jonathan Wakely wrote: > They're not specified by the standard, it says > > // these members are shown for exposition only: > > Which means the names are used only for the purposes of describing the > semantics of the class, they are not normative requirements. See

Re: [Patch] regex_iterator and regex_token_iterator implementation

2013-07-22 Thread Jonathan Wakely
On 22 July 2013 06:13, Tim Shen wrote: > > Actually, in code before this patch, private members in class > regex_iterator are indeed start without double or single underscore. > It's because the standard (28.12, n3376) specifies them, though they > are private. IMHO, they are part of standard, so I

Re: [Patch] regex_iterator and regex_token_iterator implementation

2013-07-21 Thread Paolo Carlini
Hi, >Great. This is the fixed version. Patch is Ok with me but before committing please give a chance to Jon and other interested parties to have a look. Two more general comments: when you opencode more than a few lines don't hesitate to add comments too (remember that the new code must be

Re: [Patch] regex_iterator and regex_token_iterator implementation

2013-07-21 Thread Tim Shen
On Mon, Jul 22, 2013 at 1:29 PM, Paolo Carlini wrote: > Definitely. For the usual reason that if somebody in user code has a macro > with the same name before including the header the code is busted. Of course > _M_ or _S_ (vs _uppercase) is our specific convention for data members and > statis

Re: [Patch] regex_iterator and regex_token_iterator implementation

2013-07-21 Thread Paolo Carlini
Hi, >Should I change them all to "_M_" or "__" format, and why? Definitely. For the usual reason that if somebody in user code has a macro with the same name before including the header the code is busted. Of course _M_ or _S_ (vs _uppercase) is our specific convention for data members and st

Re: [Patch] regex_iterator and regex_token_iterator implementation

2013-07-21 Thread Tim Shen
On Mon, Jul 22, 2013 at 9:12 AM, Paolo Carlini wrote: > Also you are wrongly "un-uglyfying" many names, eg: > > - position_iterator __position; > - const value_type* __result; > - value_type__suffix; > - std::size_t __n; > - std::vector __subs; > > > Remembe

Re: [Patch] regex_iterator and regex_token_iterator implementation

2013-07-21 Thread Paolo Carlini
On 07/22/2013 02:47 AM, Tim Shen wrote: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57513 is already in the testsuite and can passed(even before this patch?). To fully test it, a fully regex_search implementation is required. I'm working on a (damning) backtracking engine for it. A couple of com