gcc/libstdc++-v3/include
Jonathan Wakely e112d53aca Optimize std::sub_match comparisons using string_view-like type
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
2018-07-02 21:31:11 +01:00
..
backward P0935R0 Eradicating unnecessarily explicit default constructors 2018-06-14 15:12:24 +01:00
bits Optimize std::sub_match comparisons using string_view-like type 2018-07-02 21:31:11 +01:00
c Update copyright years. 2018-01-03 11:03:58 +01:00
c_compatibility Update copyright years. 2018-01-03 11:03:58 +01:00
c_global PR libstdc++/85729 add linkage specifications to headers 2018-05-10 13:35:45 +01:00
c_std Update copyright years. 2018-01-03 11:03:58 +01:00
debug stl_vector.h (struct _Vector_base<>::_Vector_impl_data): New. 2018-06-27 20:23:20 +00:00
decimal Update copyright years. 2018-01-03 11:03:58 +01:00
experimental Add experimental::sample and experimental::shuffle from N4531 2018-06-25 17:23:49 +01:00
ext LWG 3035. std::allocator's constructors should be constexpr 2018-06-18 16:47:07 +01:00
parallel Update copyright years. 2018-01-03 11:03:58 +01:00
precompiled P0754R2 <version> header 2018-06-18 17:42:11 +01:00
profile Update copyright years. 2018-01-03 11:03:58 +01:00
std Optimize std::sub_match comparisons using string_view-like type 2018-07-02 21:31:11 +01:00
tr1 PR libstdc++/83140 - assoc_legendre returns negated value when m is odd 2018-05-10 13:59:52 +00:00
tr2 Update copyright years. 2018-01-03 11:03:58 +01:00
Makefile.am P0754R2 <version> header 2018-06-18 17:42:11 +01:00
Makefile.in P0754R2 <version> header 2018-06-18 17:42:11 +01:00