From b04058e8c103a9afe223b202360de3da0eb918a1 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 15 Dec 2014 23:57:56 +0000 Subject: Implement LWG 2217 - operator==(sub_match, string) slices on embedded '\0's llvm-svn: 224292 --- libcxx/include/regex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libcxx/include/regex') diff --git a/libcxx/include/regex b/libcxx/include/regex index 5e1c37c64e8..690213a978d 100644 --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -4926,7 +4926,7 @@ bool operator==(const basic_string::value_type, _ST, _SA>& __x, const sub_match<_BiIter>& __y) { - return __y.compare(__x.c_str()) == 0; + return __y.compare(typename sub_match<_BiIter>::string_type(__x.data(), __x.size())) == 0; } template @@ -4944,7 +4944,7 @@ bool operator<(const basic_string::value_type, _ST, _SA>& __x, const sub_match<_BiIter>& __y) { - return __y.compare(__x.c_str()) > 0; + return __y.compare(typename sub_match<_BiIter>::string_type(__x.data(), __x.size())) > 0; } template @@ -4979,7 +4979,7 @@ bool operator==(const sub_match<_BiIter>& __x, const basic_string::value_type, _ST, _SA>& __y) { - return __x.compare(__y.c_str()) == 0; + return __x.compare(typename sub_match<_BiIter>::string_type(__y.data(), __y.size())) == 0; } template @@ -4997,7 +4997,7 @@ bool operator<(const sub_match<_BiIter>& __x, const basic_string::value_type, _ST, _SA>& __y) { - return __x.compare(__y.c_str()) < 0; + return __x.compare(typename sub_match<_BiIter>::string_type(__y.data(), __y.size())) < 0; } template -- cgit v1.2.3