diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2014-12-15 23:57:56 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2014-12-15 23:57:56 +0000 |
| commit | b04058e8c103a9afe223b202360de3da0eb918a1 (patch) | |
| tree | 1d92c8a4a18d6710447d1fad3d9515c57e370ae0 /libcxx/include/regex | |
| parent | 8210281d13dec1141f52abf9af8fca913cc0e9b9 (diff) | |
| download | bcm5719-llvm-b04058e8c103a9afe223b202360de3da0eb918a1.tar.gz bcm5719-llvm-b04058e8c103a9afe223b202360de3da0eb918a1.zip | |
Implement LWG 2217 - operator==(sub_match, string) slices on embedded '\0's
llvm-svn: 224292
Diffstat (limited to 'libcxx/include/regex')
| -rw-r--r-- | libcxx/include/regex | 8 |
1 files changed, 4 insertions, 4 deletions
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<typename iterator_traits<_BiIter>::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 <class _BiIter, class _ST, class _SA> @@ -4944,7 +4944,7 @@ bool operator<(const basic_string<typename iterator_traits<_BiIter>::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 <class _BiIter, class _ST, class _SA> @@ -4979,7 +4979,7 @@ bool operator==(const sub_match<_BiIter>& __x, const basic_string<typename iterator_traits<_BiIter>::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 <class _BiIter, class _ST, class _SA> @@ -4997,7 +4997,7 @@ bool operator<(const sub_match<_BiIter>& __x, const basic_string<typename iterator_traits<_BiIter>::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 <class _BiIter, class _ST, class _SA> |

