gcc/libstdc++-v3/include/experimental
Jonathan Wakely 584d52b088 libstdc++: Refactor filesystem::path string conversions
This simplifies the logic of converting Source arguments and pairs of
InputIterator arguments into the native string format. For any input
that is a contiguous range of path::value_type (or char8_t for POSIX)
a string view can be created and the conversion can be done directly,
with no intermediate allocation. Previously some cases created a
basic_string unnecessarily, for example construction from a pair of
path::string_type::iterators, or a pair of non-const value_type*
pointers.

	* include/bits/fs_path.h (__detail::_S_range_begin)
	(__detail::_S_range_end, path::_S_string_from_iter): Replace with
	overloaded function template __detail::__effective_range.
	(__detail::__effective_range): New overloaded function template to
	create a basic_string or basic_string_view for an effective range.
	(__detail::__value_type_is_char): Use __detail::__effective_range.
	Do not use remove_const on value type.
	(__detail::__value_type_is_char_or_char8_t): Likewise.
	(path::path(const Source&, format))
	(path::path(const Source&, const locale&))
	(path::operator/=(const Source&), path::append(const Source&))
	(path::concat(const Source&)): Use __detail::__effective_range.
	(path::_S_to_string(InputIterator, InputIterator)): New function
	template to create a string view if possible, or string otherwise.
	(path::_S_convert): Add overloads that convert a string returned
	by __detail::__effective_range. Use if-constexpr to inline conversion
	logic from all overloads of _Cvt::_S_convert.
	(path::_S_convert_loc): Add overload that converts a string. Use
	_S_to_string to avoid allocation when possible.
	(path::_Cvt): Remove.
	(path::operator+=(CharT)): Remove indirection through path::concat.
	* include/experimental/bits/fs_path.h (path::_S_convert_loc): Add
	overload for non-const pointers, to avoid constructing a std::string.
	* src/c++17/fs_path.cc (path::_S_convert_loc): Replace conditional
	compilation with call to _S_convert.
2020-05-23 09:40:16 +01:00
..
bits libstdc++: Refactor filesystem::path string conversions 2020-05-23 09:40:16 +01:00
algorithm Update copyright years. 2020-01-01 12:51:42 +01:00
any Update copyright years. 2020-01-01 12:51:42 +01:00
array Update copyright years. 2020-01-01 12:51:42 +01:00
buffer libstdc++: Use 'using' for types in Networking TS headers 2020-05-21 00:59:55 +01:00
chrono Update copyright years. 2020-01-01 12:51:42 +01:00
deque Update copyright years. 2020-01-01 12:51:42 +01:00
executor libstdc++: Fix net::basic_socket::close(error_code&) 2020-05-21 00:59:55 +01:00
filesystem Update copyright years. 2020-01-01 12:51:42 +01:00
forward_list Update copyright years. 2020-01-01 12:51:42 +01:00
functional Update copyright years. 2020-01-01 12:51:42 +01:00
internet libstdc++: Fix net::basic_socket::close(error_code&) 2020-05-21 00:59:55 +01:00
io_context Update copyright years. 2020-01-01 12:51:42 +01:00
iterator Update copyright years. 2020-01-01 12:51:42 +01:00
list Update copyright years. 2020-01-01 12:51:42 +01:00
map Update copyright years. 2020-01-01 12:51:42 +01:00
memory Update copyright years. 2020-01-01 12:51:42 +01:00
memory_resource x86-vxworks malloc aligns to 8 bytes like solaris 2020-05-13 04:49:00 -03:00
net Update copyright years. 2020-01-01 12:51:42 +01:00
netfwd Update copyright years. 2020-01-01 12:51:42 +01:00
numeric Update copyright years. 2020-01-01 12:51:42 +01:00
optional Update copyright years. 2020-01-01 12:51:42 +01:00
propagate_const Update copyright years. 2020-01-01 12:51:42 +01:00
random Update copyright years. 2020-01-01 12:51:42 +01:00
ratio Update copyright years. 2020-01-01 12:51:42 +01:00
regex Update copyright years. 2020-01-01 12:51:42 +01:00
set Update copyright years. 2020-01-01 12:51:42 +01:00
socket libstdc++: Use macro for nodiscard attribute 2020-05-21 01:03:27 +01:00
source_location Update copyright years. 2020-01-01 12:51:42 +01:00
string Update copyright years. 2020-01-01 12:51:42 +01:00
string_view libstdc++: enable_view has false positives (LWG 3326) 2020-02-24 12:15:05 +00:00
system_error Update copyright years. 2020-01-01 12:51:42 +01:00
timer libstdc++: Use 'using' for types in Networking TS headers 2020-05-21 00:59:55 +01:00
tuple Update copyright years. 2020-01-01 12:51:42 +01:00
type_traits libstdc++: Fix testsuite failures and warnings due to is_pod deprecation 2020-01-09 21:31:50 +00:00
unordered_map Update copyright years. 2020-01-01 12:51:42 +01:00
unordered_set Update copyright years. 2020-01-01 12:51:42 +01:00
utility Update copyright years. 2020-01-01 12:51:42 +01:00
vector Update copyright years. 2020-01-01 12:51:42 +01:00