This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch] Support embedded zeros in sub_match comparisons (DR 2217)


2014-11-13 23:30 GMT+01:00 Tim Shen <timshen@google.com>:
> On Thu, Nov 13, 2014 at 2:11 PM, Daniel Krügler
> <daniel.kruegler@gmail.com> wrote:
>> +      typedef typename sub_match<_Bi_iter>::string_type string_type;
>
> Use _String_type instead of string_type? I'm not 100% sure of this.

I thought about this first, but withdraw that for two reasons: The
name string_type is not protected (it is an official typedef of
sub_match) and we use exactly the same approach elsewhere, e.g. see
around line 1318, 1346, 1398, 1426:

  template<typename _Bi_iter>
    inline bool
    operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
           const sub_match<_Bi_iter>& __rhs)
    {
      typedef typename sub_match<_Bi_iter>::string_type string_type;
      return __rhs.compare(string_type(1, __lhs)) == 0;
    }

So I followed for consistency reasons.

- Daniel


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