mirror of git://gcc.gnu.org/git/gcc.git
Avoid creation of unnecessary basic_string objects by using a simplified string_view type and performing comparisons on that type instead. A temporary basic_string object is still used when the sub_match's iterators are not contiguous, in order to get an object that the __string_view can reference. * include/bits/regex.h (sub_match::operator string_type): Call str(). (sub_match::compare): Use _M_str() instead of str(). (sub_match::_M_compare): New public function. (sub_match::__string_view): New helper type. (sub_match::_M_str): New overloaded functions to avoid creating a string_type object when not needed. (operator==, operator!=, operator<, operator>, operator<=, operator>=): Use sub_match::_M_compare instead of creating string_type objects. Fix Doxygen comments. * include/bits/regex_compiler.h (__has_contiguous_iter): Remove. (__is_contiguous_normal_iter): Rename to __is_contiguous_iter and simplify. (__enable_if_contiguous_iter, __disable_if_contiguous_iter): Use __enable_if_t. * include/std/type_traits (__enable_if_t): Define for C++11. * testsuite/28_regex/sub_match/compare.cc: New. * testsuite/util/testsuite_iterators.h (remove_cv): Add transformation trait. (input_iterator_wrapper): Use remove_cv for value_type argument of std::iterator base class. From-SVN: r262318 |
||
|---|---|---|
| .. | ||
| common_type | ||
| debug | ||
| exception | ||
| hash_fn | ||
| io | ||
| native_type | ||
| performance | ||
| regression | ||
| statistic | ||
| thread | ||
| replacement_memory_operators.h | ||
| specfun_testcase.h | ||
| testsuite_abi.cc | ||
| testsuite_abi.h | ||
| testsuite_abi_check.cc | ||
| testsuite_allocator.cc | ||
| testsuite_allocator.h | ||
| testsuite_api.h | ||
| testsuite_character.cc | ||
| testsuite_character.h | ||
| testsuite_common_types.h | ||
| testsuite_container_traits.h | ||
| testsuite_containergen.h | ||
| testsuite_containers.h | ||
| testsuite_counter_type.h | ||
| testsuite_error.h | ||
| testsuite_fs.h | ||
| testsuite_greedy_ops.h | ||
| testsuite_hooks.cc | ||
| testsuite_hooks.h | ||
| testsuite_io.h | ||
| testsuite_iterators.h | ||
| testsuite_new_operators.h | ||
| testsuite_performance.h | ||
| testsuite_random.h | ||
| testsuite_regex.h | ||
| testsuite_rng.h | ||
| testsuite_rvalref.h | ||
| testsuite_shared.cc | ||
| testsuite_tr1.h | ||