Topic: Defect Report: Unclear which members of match_results should be used in comparison [re] (N2284).
Author: foo@bar.com ("foobar")
Date: Thu, 7 Jun 2007 16:49:31 GMT Raw View
Nozomu Katoo wrote:
> Dear C++ committee,
>
> In "28.4 Header <regex> synopsis [re.syn]" of N2284, two template
> functions are declared here:
>
> // 28.10, class template match_results:
> <snip>
>
> // match_results comparisons
> template <class BidirectionalIterator, class Allocator>
> bool operator== (const match_results<BidirectionalIterator,
> Allocator>& m1, const
> match_results<BidirectionalIterator, Allocator>& m2);
>
> template <class BidirectionalIterator, class Allocator>
> bool operator!= (const match_results<BidirectionalIterator,
> Allocator>& m1, const
> match_results<BidirectionalIterator, Allocator>& m2);
>
> // 28.10.6, match_results swap:
>
> But the details of these two bool operator functions (i.e., which
> members of match_results should be used in comparison) are not
> described in any following sections.
That looks like a bug: operator== should return true only if the two object
refer to the same match - ie if one object was constructed as a copy of the
other.
John.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]