diff --git a/libcxx/include/__errc b/libcxx/include/__errc --- a/libcxx/include/__errc +++ b/libcxx/include/__errc @@ -10,96 +10,6 @@ #ifndef _LIBCPP___ERRC #define _LIBCPP___ERRC -/* - system_error synopsis - -namespace std -{ - -enum class errc -{ - address_family_not_supported, // EAFNOSUPPORT - address_in_use, // EADDRINUSE - address_not_available, // EADDRNOTAVAIL - already_connected, // EISCONN - argument_list_too_long, // E2BIG - argument_out_of_domain, // EDOM - bad_address, // EFAULT - bad_file_descriptor, // EBADF - bad_message, // EBADMSG - broken_pipe, // EPIPE - connection_aborted, // ECONNABORTED - connection_already_in_progress, // EALREADY - connection_refused, // ECONNREFUSED - connection_reset, // ECONNRESET - cross_device_link, // EXDEV - destination_address_required, // EDESTADDRREQ - device_or_resource_busy, // EBUSY - directory_not_empty, // ENOTEMPTY - executable_format_error, // ENOEXEC - file_exists, // EEXIST - file_too_large, // EFBIG - filename_too_long, // ENAMETOOLONG - function_not_supported, // ENOSYS - host_unreachable, // EHOSTUNREACH - identifier_removed, // EIDRM - illegal_byte_sequence, // EILSEQ - inappropriate_io_control_operation, // ENOTTY - interrupted, // EINTR - invalid_argument, // EINVAL - invalid_seek, // ESPIPE - io_error, // EIO - is_a_directory, // EISDIR - message_size, // EMSGSIZE - network_down, // ENETDOWN - network_reset, // ENETRESET - network_unreachable, // ENETUNREACH - no_buffer_space, // ENOBUFS - no_child_process, // ECHILD - no_link, // ENOLINK - no_lock_available, // ENOLCK - no_message_available, // ENODATA - no_message, // ENOMSG - no_protocol_option, // ENOPROTOOPT - no_space_on_device, // ENOSPC - no_stream_resources, // ENOSR - no_such_device_or_address, // ENXIO - no_such_device, // ENODEV - no_such_file_or_directory, // ENOENT - no_such_process, // ESRCH - not_a_directory, // ENOTDIR - not_a_socket, // ENOTSOCK - not_a_stream, // ENOSTR - not_connected, // ENOTCONN - not_enough_memory, // ENOMEM - not_supported, // ENOTSUP - operation_canceled, // ECANCELED - operation_in_progress, // EINPROGRESS - operation_not_permitted, // EPERM - operation_not_supported, // EOPNOTSUPP - operation_would_block, // EWOULDBLOCK - owner_dead, // EOWNERDEAD - permission_denied, // EACCES - protocol_error, // EPROTO - protocol_not_supported, // EPROTONOSUPPORT - read_only_file_system, // EROFS - resource_deadlock_would_occur, // EDEADLK - resource_unavailable_try_again, // EAGAIN - result_out_of_range, // ERANGE - state_not_recoverable, // ENOTRECOVERABLE - stream_timeout, // ETIME - text_file_busy, // ETXTBSY - timed_out, // ETIMEDOUT - too_many_files_open_in_system, // ENFILE - too_many_files_open, // EMFILE - too_many_links, // EMLINK - too_many_symbolic_link_levels, // ELOOP - value_too_large, // EOVERFLOW - wrong_protocol_type // EPROTOTYPE -}; - -*/ - #include <__config> #include diff --git a/libcxx/include/__node_handle b/libcxx/include/__node_handle --- a/libcxx/include/__node_handle +++ b/libcxx/include/__node_handle @@ -10,54 +10,6 @@ #ifndef _LIBCPP___NODE_HANDLE #define _LIBCPP___NODE_HANDLE -/* - -template -class node-handle { -public: - using value_type = see below; // not present for map containers - using key_type = see below; // not present for set containers - using mapped_type = see below; // not present for set containers - using allocator_type = see below; - -private: - using container_node_type = unspecified; // exposition only - using ator_traits = allocator_traits; // exposition only - - typename ator_traits::template - rebind_traits::pointer ptr_; // exposition only - optional alloc_; // exposition only - -public: - // [container.node.cons], constructors, copy, and assignment - constexpr node-handle() noexcept : ptr_(), alloc_() {} - node-handle(node-handle&&) noexcept; - node-handle& operator=(node-handle&&); - - // [container.node.dtor], destructor - ~node-handle(); - - // [container.node.observers], observers - value_type& value() const; // not present for map containers - key_type& key() const; // not present for set containers - mapped_type& mapped() const; // not present for set containers - - allocator_type get_allocator() const; - explicit operator bool() const noexcept; - [[nodiscard]] bool empty() const noexcept; // nodiscard since C++20 - - // [container.node.modifiers], modifiers - void swap(node-handle&) - noexcept(ator_traits::propagate_on_container_swap::value || - ator_traits::is_always_equal::value); - - friend void swap(node-handle& x, node-handle& y) noexcept(noexcept(x.swap(y))) { - x.swap(y); - } -}; - -*/ - #include <__assert> #include <__config> #include <__memory/allocator_traits.h> diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -10,1711 +10,6 @@ #ifndef _LIBCPP_ALGORITHM #define _LIBCPP_ALGORITHM -/* - algorithm synopsis - -#include - -namespace std -{ - -namespace ranges { - - // [algorithms.results], algorithm result types - template - struct in_fun_result; // since C++20 - - template - struct in_in_result; // since C++20 - - template - struct in_out_result; // since C++20 - - template - struct in_in_out_result; // since C++20 - - template - struct in_out_out_result; // since C++20 - - template - struct min_max_result; // since C++20 - - template - struct in_found_result; // since C++20 - - template S, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> // since C++20 - constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {}); - - template, Proj>> Comp = ranges::less> // since C++20 - constexpr borrowed_iterator_t min_element(R&& r, Comp comp = {}, Proj proj = {}); - - template S, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> - constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = ranges::less> - constexpr borrowed_iterator_t ranges::max_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template - using mismatch_result = in_in_result; - - template S1, input_iterator I2, sentinel_for<_I2> S2, - class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires indirectly_comparable - constexpr mismatch_result<_I1, _I2> // since C++20 - mismatch()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) - - template - requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> - constexpr mismatch_result, borrowed_iterator_t> - mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) // since C++20 - - requires indirect_binary_predicate, const T*> - constexpr I find(I first, S last, const T& value, Proj proj = {}); // since C++20 - - template - requires indirect_binary_predicate, Proj>, const T*> - constexpr borrowed_iterator_t - find(R&& r, const T& value, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - constexpr borrowed_iterator_t - find_if(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - constexpr borrowed_iterator_t - find_if_not(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template> Comp = ranges::less> - constexpr const T& min(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 - - template> Comp = ranges::less> - constexpr T min(initializer_list r, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = ranges::less> - requires indirectly_copyable_storable, range_value_t*> - constexpr range_value_t - min(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template> Comp = ranges::less> - constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 - - template> Comp = ranges::less> - constexpr T max(initializer_list r, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = ranges::less> - requires indirectly_copyable_storable, range_value_t*> - constexpr range_value_t - max(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template - using unary_transform_result = in_out_result; // since C++20 - - template - using binary_transform_result = in_in_out_result; // since C++20 - - template S, weakly_incrementable O, - copy_constructible F, class Proj = identity> - requires indirectly_writable>> - constexpr ranges::unary_transform_result - transform(I first1, S last1, O result, F op, Proj proj = {}); // since C++20 - - template - requires indirectly_writable, Proj>>> - constexpr ranges::unary_transform_result, O> - transform(R&& r, O result, F op, Proj proj = {}); // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - weakly_incrementable O, copy_constructible F, class Proj1 = identity, - class Proj2 = identity> - requires indirectly_writable, - projected>> - constexpr ranges::binary_transform_result - transform(I1 first1, S1 last1, I2 first2, S2 last2, O result, - F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - requires indirectly_writable, Proj1>, - projected, Proj2>>> - constexpr ranges::binary_transform_result, borrowed_iterator_t, O> - transform(R1&& r1, R2&& r2, O result, - F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S, class T, class Proj = identity> - requires indirect_binary_predicate, const T*> - constexpr iter_difference_t - count(I first, S last, const T& value, Proj proj = {}); // since C++20 - - template - requires indirect_binary_predicate, Proj>, const T*> - constexpr range_difference_t - count(R&& r, const T& value, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr iter_difference_t - count_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - constexpr range_difference_t - count_if(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template - using minmax_result = min_max_result; - - template> Comp = ranges::less> - constexpr ranges::minmax_result - minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); // since C++20 - - template> Comp = ranges::less> - constexpr ranges::minmax_result - minmax(initializer_list r, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = ranges::less> - requires indirectly_copyable_storable, range_value_t*> - constexpr ranges::minmax_result> - minmax(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template - using minmax_element_result = min_max_result; - - template S, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> - constexpr ranges::minmax_element_result - minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = ranges::less> - constexpr ranges::minmax_element_result> - minmax_element(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template - using copy_result = in_out_result; // since C++20 - - template - using copy_n_result = in_out_result; // since C++20 - - template - using copy_if_result = in_out_result; // since C++20 - - template - using copy_backward_result = in_out_result; // since C++20 - - template S, weakly_incrementable O> - requires indirectly_copyable - constexpr ranges::copy_result ranges::copy(I first, S last, O result); // since C++20 - - template - requires indirectly_copyable, O> - constexpr ranges::copy_result, O> ranges::copy(R&& r, O result); // since C++20 - - template - requires indirectly_copyable - constexpr ranges::copy_n_result - ranges::copy_n(I first, iter_difference_t n, O result); // since C++20 - - template S, weakly_incrementable O, class Proj = identity, - indirect_unary_predicate> Pred> - requires indirectly_copyable - constexpr ranges::copy_if_result - ranges::copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - requires indirectly_copyable, O> - constexpr ranges::copy_if_result, O> - ranges::copy_if(R&& r, O result, Pred pred, Proj proj = {}); // since C++20 - - template S1, bidirectional_iterator I2> - requires indirectly_copyable - constexpr ranges::copy_backward_result - ranges::copy_backward(I1 first, S1 last, I2 result); // since C++20 - - template - requires indirectly_copyable, I> - constexpr ranges::copy_backward_result, I> - ranges::copy_backward(R&& r, I result); // since C++20 - - template - using for_each_result = in_fun_result; // since C++20 - - template S, class Proj = identity, - indirectly_unary_invocable> Fun> - constexpr ranges::for_each_result - ranges::for_each(I first, S last, Fun f, Proj proj = {}); // since C++20 - - template, Proj>> Fun> - constexpr ranges::for_each_result, Fun> - ranges::for_each(R&& r, Fun f, Proj proj = {}); // since C++20 - - template> Fun> - constexpr ranges::for_each_n_result - ranges::for_each_n(I first, iter_difference_t n, Fun f, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr bool ranges::is_partitioned(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - constexpr bool ranges::is_partitioned(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - constexpr I - ranges::push_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - constexpr borrowed_iterator_t - ranges::push_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - constexpr I - ranges::pop_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - constexpr borrowed_iterator_t - ranges::pop_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - constexpr I - ranges::make_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - constexpr borrowed_iterator_t - ranges::make_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - constexpr I - ranges::sort_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - constexpr borrowed_iterator_t - ranges::sort_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> - constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = ranges::less> - constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> - constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = ranges::less> - constexpr borrowed_iterator_t - is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S> - requires permutable - constexpr I ranges::reverse(I first, S last); // since C++20 - - template - requires permutable> - constexpr borrowed_iterator_t ranges::reverse(R&& r); // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - constexpr I - ranges::sort(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - constexpr borrowed_iterator_t - ranges::sort(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - I ranges::stable_sort(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - borrowed_iterator_t - ranges::stable_sort(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - constexpr I - ranges::partial_sort(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - constexpr borrowed_iterator_t - ranges::partial_sort(R&& r, iterator_t middle, Comp comp = {}, Proj proj = {}); // since C++20 - - template O, sentinel_for S> - constexpr O ranges::fill(O first, S last, const T& value); // since C++20 - - template R> - constexpr borrowed_iterator_t ranges::fill(R&& r, const T& value); // since C++20 - - template O> - constexpr O ranges::fill_n(O first, iter_difference_t n, const T& value); // since C++20 - - template S, copy_constructible F> - requires invocable && indirectly_writable> - constexpr O generate(O first, S last, F gen); // since C++20 - - template - requires invocable && output_range> - constexpr borrowed_iterator_t generate(R&& r, F gen); // since C++20 - - template - requires invocable && indirectly_writable> - constexpr O generate_n(O first, iter_difference_t n, F gen); // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires indirectly_comparable - constexpr bool ranges::equal(I1 first1, S1 last1, I2 first2, S2 last2, - Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> - constexpr bool ranges::equal(R1&& r1, R2&& r2, Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr bool ranges::any_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template S1, - random_access_iterator I2, sentinel_for S2, - class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires indirectly_copyable && sortable && - indirect_strict_weak_order, projected> - constexpr partial_sort_copy_result - partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last, - Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - requires indirectly_copyable, iterator_t> && - sortable, Comp, Proj2> && - indirect_strict_weak_order, Proj1>, - projected, Proj2>> - constexpr partial_sort_copy_result, borrowed_iterator_t> - partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> - constexpr bool ranges::is_sorted(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = ranges::less> - constexpr bool ranges::is_sorted(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> - constexpr I ranges::is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = ranges::less> - constexpr borrowed_iterator_t - ranges::is_sorted_until(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - constexpr I - ranges::nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - constexpr borrowed_iterator_t - ranges::nth_element(R&& r, iterator_t nth, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class T, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> // since C++20 - constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); - - template, Proj>> Comp = - ranges::less> - constexpr borrowed_iterator_t - upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class T, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> - constexpr I lower_bound(I first, S last, const T& value, Comp comp = {}, - Proj proj = {}); // since C++20 - template, Proj>> Comp = - ranges::less> - constexpr borrowed_iterator_t - lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 - - template S, class T, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> - constexpr bool binary_search(I first, S last, const T& value, Comp comp = {}, - Proj proj = {}); // since C++20 - - template, Proj>> Comp = - ranges::less> - constexpr bool binary_search(R&& r, const T& value, Comp comp = {}, - Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr subrange - partition(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - requires permutable> - constexpr borrowed_subrange_t - partition(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - requires permutable - subrange stable_partition(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - requires permutable> - borrowed_subrange_t stable_partition(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template S1, forward_iterator I2, sentinel_for S2, - class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires indirectly_comparable - constexpr I1 ranges::find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, - Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> - constexpr borrowed_iterator_t - ranges::find_first_of(R1&& r1, R2&& r2, - Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S, class Proj = identity, - indirect_binary_predicate, - projected> Pred = ranges::equal_to> - constexpr I ranges::adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); // since C++20 - - template, Proj>, - projected, Proj>> Pred = ranges::equal_to> - constexpr borrowed_iterator_t ranges::adjacent_find(R&& r, Pred pred = {}, Proj proj = {}); // since C++20 - - template S, class T1, class T2, class Proj = identity> - requires indirectly_writable && - indirect_binary_predicate, const T1*> - constexpr I - ranges::replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {}); // since C++20 - - template - requires indirectly_writable, const T2&> && - indirect_binary_predicate, Proj>, const T1*> - constexpr borrowed_iterator_t - ranges::replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {}); // since C++20 - - template S, class T, class Proj = identity, - indirect_unary_predicate> Pred> - requires indirectly_writable - constexpr I ranges::replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - requires indirectly_writable, const T&> - constexpr borrowed_iterator_t - ranges::replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {}); // since C++20 - - template> Comp = ranges::less> - constexpr const T& - ranges::clamp(const T& v, const T& lo, const T& hi, Comp comp = {}, Proj proj = {}); // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - class Proj1 = identity, class Proj2 = identity, - indirect_strict_weak_order, - projected> Comp = ranges::less> - constexpr bool - ranges::lexicographical_compare(I1 first1, S1 last1, I2 first2, S2 last2, - Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template, Proj1>, - projected, Proj2>> Comp = ranges::less> - constexpr bool - ranges::lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S1, bidirectional_iterator I2> - requires indirectly_movable - constexpr ranges::move_backward_result - ranges::move_backward(I1 first, S1 last, I2 result); // since C++20 - - template - requires indirectly_movable, I> - constexpr ranges::move_backward_result, I> - ranges::move_backward(R&& r, I result); // since C++20 - - template S, weakly_incrementable O> - requires indirectly_movable - constexpr ranges::move_result - ranges::move(I first, S last, O result); // since C++20 - - template - requires indirectly_movable, O> - constexpr ranges::move_result, O> - ranges::move(R&& r, O result); // since C++20 - - template - using partition_copy_result = in_out_out_result; // since C++20 - - template S, - weakly_incrementable O1, weakly_incrementable O2, - class Proj = identity, indirect_unary_predicate> Pred> - requires indirectly_copyable && indirectly_copyable - constexpr partition_copy_result - partition_copy(I first, S last, O1 out_true, O2 out_false, Pred pred, - Proj proj = {}); // since C++20 - - template, Proj>> Pred> - requires indirectly_copyable, O1> && - indirectly_copyable, O2> - constexpr partition_copy_result, O1, O2> - partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr I partition_point(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - constexpr borrowed_iterator_t - partition_point(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template - using merge_result = in_in_out_result; // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, - class Proj2 = identity> - requires mergeable - constexpr merge_result - merge(I1 first1, S1 last1, I2 first2, S2 last2, O result, - Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - requires mergeable, iterator_t, O, Comp, Proj1, Proj2> - constexpr merge_result, borrowed_iterator_t, O> - merge(R1&& r1, R2&& r2, O result, - Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S, class T, class Proj = identity> - requires indirect_binary_predicate, const T*> - constexpr subrange ranges::remove(I first, S last, const T& value, Proj proj = {}); // since C++20 - - template - requires permutable> && - indirect_binary_predicate, Proj>, const T*> - constexpr borrowed_subrange_t - ranges::remove(R&& r, const T& value, Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_unary_predicate> Pred> - constexpr subrange ranges::remove_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - requires permutable> - constexpr borrowed_subrange_t - ranges::remove_if(R&& r, Pred pred, Proj proj = {}); // since C++20 - - template - using set_difference_result = in_out_result; // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - weakly_incrementable O, class Comp = ranges::less, - class Proj1 = identity, class Proj2 = identity> - requires mergeable - constexpr set_difference_result - set_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, - Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - requires mergeable, iterator_t, O, Comp, Proj1, Proj2> - constexpr set_difference_result, O> - set_difference(R1&& r1, R2&& r2, O result, - Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - using set_intersection_result = in_in_out_result; // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - weakly_incrementable O, class Comp = ranges::less, - class Proj1 = identity, class Proj2 = identity> - requires mergeable - constexpr set_intersection_result - set_intersection(I1 first1, S1 last1, I2 first2, S2 last2, O result, - Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - weakly_incrementable O, class Comp = ranges::less, - class Proj1 = identity, class Proj2 = identity> - requires mergeable - constexpr set_intersection_result, borrowed_iterator_t, O> - set_intersection(R1&& r1, R2&& r2, O result, - Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - using reverse_copy_result = in_out_result<_InIter, _OutIter>; // since C++20 - - template S, weakly_incrementable O> - requires indirectly_copyable - constexpr ranges::reverse_copy_result - ranges::reverse_copy(I first, S last, O result); // since C++20 - - template - requires indirectly_copyable, O> - constexpr ranges::reverse_copy_result, O> - ranges::reverse_copy(R&& r, O result); // since C++20 - - template S> - constexpr subrange rotate(I first, I middle, S last); // since C++20 - - template - requires permutable> - constexpr borrowed_subrange_t rotate(R&& r, iterator_t middle); // since C++20 - - template - using rotate_copy_result = in_out_result<_InIter, _OutIter>; // since C++20 - - template S, weakly_incrementable O> - requires indirectly_copyable - constexpr ranges::rotate_copy_result - ranges::rotate_copy(I first, I middle, S last, O result); // since C++20 - - template - requires indirectly_copyable, O> - constexpr ranges::rotate_copy_result, O> - ranges::rotate_copy(R&& r, iterator_t middle, O result); // since C++20 - - template S, weakly_incrementable O, class Gen> - requires (forward_iterator || random_access_iterator) && - indirectly_copyable && - uniform_random_bit_generator> - O sample(I first, S last, O out, iter_difference_t n, Gen&& g); // since C++20 - - template - requires (forward_range || random_access_iterator) && - indirectly_copyable, O> && - uniform_random_bit_generator> - O sample(R&& r, O out, range_difference_t n, Gen&& g); // since C++20 - - template S, class Gen> - requires permutable && - uniform_random_bit_generator> - I shuffle(I first, S last, Gen&& g); // since C++20 - - template - requires permutable> && - uniform_random_bit_generator> - borrowed_iterator_t shuffle(R&& r, Gen&& g); // since C++20 - - template S1, forward_iterator I2, - sentinel_for S2, class Proj1 = identity, class Proj2 = identity, - indirect_equivalence_relation, - projected> Pred = ranges::equal_to> - constexpr bool ranges::is_permutation(I1 first1, S1 last1, I2 first2, S2 last2, - Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template, Proj1>, - projected, Proj2>> Pred = ranges::equal_to> - constexpr bool ranges::is_permutation(R1&& r1, R2&& r2, Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S1, forward_iterator I2, - sentinel_for S2, class Pred = ranges::equal_to, - class Proj1 = identity, class Proj2 = identity> - requires indirectly_comparable - constexpr subrange - ranges::search(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> - constexpr borrowed_subrange_t - ranges::search(R1&& r1, R2&& r2, Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S, class T, - class Pred = ranges::equal_to, class Proj = identity> - requires indirectly_comparable - constexpr subrange - ranges::search_n(I first, S last, iter_difference_t count, - const T& value, Pred pred = {}, Proj proj = {}); // since C++20 - - template - requires indirectly_comparable, const T*, Pred, Proj> - constexpr borrowed_subrange_t - ranges::search_n(R&& r, range_difference_t count, - const T& value, Pred pred = {}, Proj proj = {}); // since C++20 - - template S1, forward_iterator I2, sentinel_for S2, - class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires indirectly_comparable - constexpr subrange - ranges::find_end(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> - constexpr borrowed_subrange_t - ranges::find_end(R1&& r1, R2&& r2, Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - using set_symmetric_difference_result = in_in_out_result; // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - weakly_incrementable O, class Comp = ranges::less, - class Proj1 = identity, class Proj2 = identity> - requires mergeable - constexpr set_symmetric_difference_result - set_symmetric_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, - Comp comp = {}, Proj1 proj1 = {}, - Proj2 proj2 = {}); // since C++20 - - template - requires mergeable, iterator_t, O, Comp, Proj1, Proj2> - constexpr set_symmetric_difference_result, - borrowed_iterator_t, O> - set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S, class T, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> - constexpr subrange - equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> Comp = - ranges::less> - constexpr borrowed_subrange_t - equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // since C++20 - - template - using set_union_result = in_in_out_result; // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - weakly_incrementable O, class Comp = ranges::less, - class Proj1 = identity, class Proj2 = identity> - requires mergeable - constexpr set_union_result - set_union(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template - requires mergeable, iterator_t, O, Comp, Proj1, Proj2> - constexpr set_union_result, borrowed_iterator_t, O> - set_union(R1&& r1, R2&& r2, O result, Comp comp = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S1, input_iterator I2, sentinel_for S2, - class Proj1 = identity, class Proj2 = identity, - indirect_strict_weak_order, projected> Comp = - ranges::less> - constexpr bool includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template, Proj1>, - projected, Proj2>> Comp = ranges::less> - constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - borrowed_iterator_t - inplace_merge(R&& r, iterator_t middle, Comp comp = {}, - Proj proj = {}); // since C++20 - - template S, class Proj = identity, - indirect_equivalence_relation> C = ranges::equal_to> - constexpr subrange unique(I first, S last, C comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> C = ranges::equal_to> - requires permutable> - constexpr borrowed_subrange_t - unique(R&& r, C comp = {}, Proj proj = {}); // since C++20 - - template S, weakly_incrementable O, class Proj = identity, - indirect_equivalence_relation> C = ranges::equal_to> - requires indirectly_copyable && - (forward_iterator || - (input_iterator && same_as, iter_value_t>) || - indirectly_copyable_storable) - constexpr unique_copy_result - unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); // since C++20 - - template, Proj>> C = ranges::equal_to> - requires indirectly_copyable, O> && - (forward_iterator> || - (input_iterator && same_as, iter_value_t>) || - indirectly_copyable_storable, O>) - constexpr unique_copy_result, O> - unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); // since C++20 - - template - using remove_copy_result = in_out_result; // since C++20 - - template S, weakly_incrementable O, class T, - class Proj = identity> - indirect_binary_predicate, const T*> - constexpr remove_copy_result - remove_copy(I first, S last, O result, const T& value, Proj proj = {}); // since C++20 - - template - requires indirectly_copyable, O> && - indirect_binary_predicate, Proj>, const T*> - constexpr remove_copy_result, O> - remove_copy(R&& r, O result, const T& value, Proj proj = {}); // since C++20 - - template - using remove_copy_if_result = in_out_result; // since C++20 - - template S, weakly_incrementable O, - class Proj = identity, indirect_unary_predicate> Pred> - requires indirectly_copyable - constexpr remove_copy_if_result - remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); // since C++20 - - template, Proj>> Pred> - requires indirectly_copyable, O> - constexpr remove_copy_if_result, O> - remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); // since C++20 - - template - using replace_copy_result = in_out_result; // since C++20 - - template S, class T1, class T2, - output_iterator O, class Proj = identity> - requires indirectly_copyable && - indirect_binary_predicate, const T1*> - constexpr replace_copy_result - replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value, - Proj proj = {}); // since C++20 - - template O, - class Proj = identity> - requires indirectly_copyable, O> && - indirect_binary_predicate, Proj>, const T1*> - constexpr replace_copy_result, O> - replace_copy(R&& r, O result, const T1& old_value, const T2& new_value, - Proj proj = {}); // since C++20 - - template - using replace_copy_if_result = in_out_result; // since C++20 - - template S, class T, output_iterator O, - class Proj = identity, indirect_unary_predicate> Pred> - requires indirectly_copyable - constexpr replace_copy_if_result - replace_copy_if(I first, S last, O result, Pred pred, const T& new_value, - Proj proj = {}); // since C++20 - - template O, class Proj = identity, - indirect_unary_predicate, Proj>> Pred> - requires indirectly_copyable, O> - constexpr replace_copy_if_result, O> - replace_copy_if(R&& r, O result, Pred pred, const T& new_value, - Proj proj = {}); // since C++20 - - template - using prev_permutation_result = in_found_result; // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - constexpr ranges::prev_permutation_result - ranges::prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - constexpr ranges::prev_permutation_result> - ranges::prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - - template - using next_permutation_result = in_found_result; // since C++20 - - template S, class Comp = ranges::less, - class Proj = identity> - requires sortable - constexpr ranges::next_permutation_result - ranges::next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); // since C++20 - - template - requires sortable, Comp, Proj> - constexpr ranges::next_permutation_result> - ranges::next_permutation(R&& r, Comp comp = {}, Proj proj = {}); // since C++20 - -} - -template - constexpr bool // constexpr in C++20 - all_of(InputIterator first, InputIterator last, Predicate pred); - -template - constexpr bool // constexpr in C++20 - any_of(InputIterator first, InputIterator last, Predicate pred); - -template - constexpr bool // constexpr in C++20 - none_of(InputIterator first, InputIterator last, Predicate pred); - -template - constexpr Function // constexpr in C++20 - for_each(InputIterator first, InputIterator last, Function f); - -template - constexpr InputIterator // constexpr in C++20 - for_each_n(InputIterator first, Size n, Function f); // C++17 - -template - constexpr InputIterator // constexpr in C++20 - find(InputIterator first, InputIterator last, const T& value); - -template - constexpr InputIterator // constexpr in C++20 - find_if(InputIterator first, InputIterator last, Predicate pred); - -template - constexpr InputIterator // constexpr in C++20 - find_if_not(InputIterator first, InputIterator last, Predicate pred); - -template - constexpr ForwardIterator1 // constexpr in C++20 - find_end(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2, ForwardIterator2 last2); - -template - constexpr ForwardIterator1 // constexpr in C++20 - find_end(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); - -template - constexpr ForwardIterator1 // constexpr in C++20 - find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2, ForwardIterator2 last2); - -template - constexpr ForwardIterator1 // constexpr in C++20 - find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); - -template - constexpr ForwardIterator // constexpr in C++20 - adjacent_find(ForwardIterator first, ForwardIterator last); - -template - constexpr ForwardIterator // constexpr in C++20 - adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); - -template - constexpr typename iterator_traits::difference_type // constexpr in C++20 - count(InputIterator first, InputIterator last, const T& value); - -template - constexpr typename iterator_traits::difference_type // constexpr in C++20 - count_if(InputIterator first, InputIterator last, Predicate pred); - -template - constexpr pair // constexpr in C++20 - mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); - -template - constexpr pair // constexpr in C++20 - mismatch(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2); // **C++14** - -template - constexpr pair // constexpr in C++20 - mismatch(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, BinaryPredicate pred); - -template - constexpr pair // constexpr in C++20 - mismatch(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, - BinaryPredicate pred); // **C++14** - -template - constexpr bool // constexpr in C++20 - equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); - -template - constexpr bool // constexpr in C++20 - equal(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2); // **C++14** - -template - constexpr bool // constexpr in C++20 - equal(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, BinaryPredicate pred); - -template - constexpr bool // constexpr in C++20 - equal(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, - BinaryPredicate pred); // **C++14** - -template - constexpr bool // constexpr in C++20 - is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2); - -template - constexpr bool // constexpr in C++20 - is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2, ForwardIterator2 last2); // **C++14** - -template - constexpr bool // constexpr in C++20 - is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2, BinaryPredicate pred); - -template - constexpr bool // constexpr in C++20 - is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2, ForwardIterator2 last2, - BinaryPredicate pred); // **C++14** - -template - constexpr ForwardIterator1 // constexpr in C++20 - search(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2, ForwardIterator2 last2); - -template - constexpr ForwardIterator1 // constexpr in C++20 - search(ForwardIterator1 first1, ForwardIterator1 last1, - ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); - -template - constexpr ForwardIterator // constexpr in C++20 - search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); - -template - constexpr ForwardIterator // constexpr in C++20 - search_n(ForwardIterator first, ForwardIterator last, - Size count, const T& value, BinaryPredicate pred); - -template - constexpr OutputIterator // constexpr in C++20 - copy(InputIterator first, InputIterator last, OutputIterator result); - -template - constexpr OutputIterator // constexpr in C++20 - copy_if(InputIterator first, InputIterator last, - OutputIterator result, Predicate pred); - -template - constexpr OutputIterator // constexpr in C++20 - copy_n(InputIterator first, Size n, OutputIterator result); - -template - constexpr BidirectionalIterator2 // constexpr in C++20 - copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, - BidirectionalIterator2 result); - -// [alg.move], move -template - constexpr OutputIterator move(InputIterator first, InputIterator last, - OutputIterator result); - -template - constexpr BidirectionalIterator2 - move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, - BidirectionalIterator2 result); - -template - constexpr ForwardIterator2 // constexpr in C++20 - swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); - -namespace ranges { - template - using swap_ranges_result = in_in_result; - -template S1, input_iterator I2, sentinel_for S2> - requires indirectly_swappable - constexpr ranges::swap_ranges_result - swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2); - -template - requires indirectly_swappable, iterator_t> - constexpr ranges::swap_ranges_result, borrowed_iterator_t> - swap_ranges(R1&& r1, R2&& r2); -} - -template - constexpr void // constexpr in C++20 - iter_swap(ForwardIterator1 a, ForwardIterator2 b); - -template - constexpr OutputIterator // constexpr in C++20 - transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op); - -template - constexpr OutputIterator // constexpr in C++20 - transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, - OutputIterator result, BinaryOperation binary_op); - -template - constexpr void // constexpr in C++20 - replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value); - -template - constexpr void // constexpr in C++20 - replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value); - -template - constexpr OutputIterator // constexpr in C++20 - replace_copy(InputIterator first, InputIterator last, OutputIterator result, - const T& old_value, const T& new_value); - -template - constexpr OutputIterator // constexpr in C++20 - replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value); - -template - constexpr void // constexpr in C++20 - fill(ForwardIterator first, ForwardIterator last, const T& value); - -template - constexpr OutputIterator // constexpr in C++20 - fill_n(OutputIterator first, Size n, const T& value); - -template - constexpr void // constexpr in C++20 - generate(ForwardIterator first, ForwardIterator last, Generator gen); - -template - constexpr OutputIterator // constexpr in C++20 - generate_n(OutputIterator first, Size n, Generator gen); - -template - constexpr ForwardIterator // constexpr in C++20 - remove(ForwardIterator first, ForwardIterator last, const T& value); - -template - constexpr ForwardIterator // constexpr in C++20 - remove_if(ForwardIterator first, ForwardIterator last, Predicate pred); - -template - constexpr OutputIterator // constexpr in C++20 - remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); - -template - constexpr OutputIterator // constexpr in C++20 - remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); - -template - constexpr ForwardIterator // constexpr in C++20 - unique(ForwardIterator first, ForwardIterator last); - -template - constexpr ForwardIterator // constexpr in C++20 - unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); - -template - constexpr OutputIterator // constexpr in C++20 - unique_copy(InputIterator first, InputIterator last, OutputIterator result); - -template - constexpr OutputIterator // constexpr in C++20 - unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred); - -template - constexpr void // constexpr in C++20 - reverse(BidirectionalIterator first, BidirectionalIterator last); - -template - constexpr OutputIterator // constexpr in C++20 - reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); - -template - constexpr ForwardIterator // constexpr in C++20 - rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last); - -template - constexpr OutputIterator // constexpr in C++20 - rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result); - -template - void - random_shuffle(RandomAccessIterator first, RandomAccessIterator last); // deprecated in C++14, removed in C++17 - -template - void - random_shuffle(RandomAccessIterator first, RandomAccessIterator last, - RandomNumberGenerator& rand); // deprecated in C++14, removed in C++17 - -template - SampleIterator sample(PopulationIterator first, PopulationIterator last, - SampleIterator out, Distance n, - UniformRandomBitGenerator&& g); // C++17 - -template - void shuffle(RandomAccessIterator first, RandomAccessIterator last, - UniformRandomNumberGenerator&& g); - -template - constexpr ForwardIterator - shift_left(ForwardIterator first, ForwardIterator last, - typename iterator_traits::difference_type n); // C++20 - -template - constexpr ForwardIterator - shift_right(ForwardIterator first, ForwardIterator last, - typename iterator_traits::difference_type n); // C++20 - -template - constexpr bool // constexpr in C++20 - is_partitioned(InputIterator first, InputIterator last, Predicate pred); - -template - constexpr ForwardIterator // constexpr in C++20 - partition(ForwardIterator first, ForwardIterator last, Predicate pred); - -template - constexpr pair // constexpr in C++20 - partition_copy(InputIterator first, InputIterator last, - OutputIterator1 out_true, OutputIterator2 out_false, - Predicate pred); - -template - ForwardIterator - stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred); - -template - constexpr ForwardIterator // constexpr in C++20 - partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); - -template - constexpr bool // constexpr in C++20 - is_sorted(ForwardIterator first, ForwardIterator last); - -template - constexpr bool // constexpr in C++20 - is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); - -template - constexpr ForwardIterator // constexpr in C++20 - is_sorted_until(ForwardIterator first, ForwardIterator last); - -template - constexpr ForwardIterator // constexpr in C++20 - is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); - -template - constexpr void // constexpr in C++20 - sort(RandomAccessIterator first, RandomAccessIterator last); - -template - constexpr void // constexpr in C++20 - sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); - -template - void - stable_sort(RandomAccessIterator first, RandomAccessIterator last); - -template - void - stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); - -template - constexpr void // constexpr in C++20 - partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last); - -template - constexpr void // constexpr in C++20 - partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); - -template - constexpr RandomAccessIterator // constexpr in C++20 - partial_sort_copy(InputIterator first, InputIterator last, - RandomAccessIterator result_first, RandomAccessIterator result_last); - -template - constexpr RandomAccessIterator // constexpr in C++20 - partial_sort_copy(InputIterator first, InputIterator last, - RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp); - -template - constexpr void // constexpr in C++20 - nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last); - -template - constexpr void // constexpr in C++20 - nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); - -template - constexpr ForwardIterator // constexpr in C++20 - lower_bound(ForwardIterator first, ForwardIterator last, const T& value); - -template - constexpr ForwardIterator // constexpr in C++20 - lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); - -template - constexpr ForwardIterator // constexpr in C++20 - upper_bound(ForwardIterator first, ForwardIterator last, const T& value); - -template - constexpr ForwardIterator // constexpr in C++20 - upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); - -template - constexpr pair // constexpr in C++20 - equal_range(ForwardIterator first, ForwardIterator last, const T& value); - -template - constexpr pair // constexpr in C++20 - equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); - -template - constexpr bool // constexpr in C++20 - binary_search(ForwardIterator first, ForwardIterator last, const T& value); - -template - constexpr bool // constexpr in C++20 - binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); - -template - constexpr OutputIterator // constexpr in C++20 - merge(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result); - -template - constexpr OutputIterator // constexpr in C++20 - merge(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); - -template - void - inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last); - -template - void - inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp); - -template - constexpr bool // constexpr in C++20 - includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); - -template - constexpr bool // constexpr in C++20 - includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); - -template - constexpr OutputIterator // constexpr in C++20 - set_union(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result); - -template - constexpr OutputIterator // constexpr in C++20 - set_union(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); - -template - constexpr OutputIterator // constexpr in C++20 - set_intersection(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result); - -template - constexpr OutputIterator // constexpr in C++20 - set_intersection(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); - -template - constexpr OutputIterator // constexpr in C++20 - set_difference(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result); - -template - constexpr OutputIterator // constexpr in C++20 - set_difference(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); - -template - constexpr OutputIterator // constexpr in C++20 - set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result); - -template - constexpr OutputIterator // constexpr in C++20 - set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); - -template - constexpr void // constexpr in C++20 - push_heap(RandomAccessIterator first, RandomAccessIterator last); - -template - constexpr void // constexpr in C++20 - push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); - -template - constexpr void // constexpr in C++20 - pop_heap(RandomAccessIterator first, RandomAccessIterator last); - -template - constexpr void // constexpr in C++20 - pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); - -template - constexpr void // constexpr in C++20 - make_heap(RandomAccessIterator first, RandomAccessIterator last); - -template - constexpr void // constexpr in C++20 - make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); - -template - constexpr void // constexpr in C++20 - sort_heap(RandomAccessIterator first, RandomAccessIterator last); - -template - constexpr void // constexpr in C++20 - sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); - -template - constexpr bool // constexpr in C++20 - is_heap(RandomAccessIterator first, RandomAccessiterator last); - -template - constexpr bool // constexpr in C++20 - is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp); - -template - constexpr RandomAccessIterator // constexpr in C++20 - is_heap_until(RandomAccessIterator first, RandomAccessiterator last); - -template - constexpr RandomAccessIterator // constexpr in C++20 - is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); - -template - constexpr ForwardIterator // constexpr in C++14 - min_element(ForwardIterator first, ForwardIterator last); - -template - constexpr ForwardIterator // constexpr in C++14 - min_element(ForwardIterator first, ForwardIterator last, Compare comp); - -template - constexpr const T& // constexpr in C++14 - min(const T& a, const T& b); - -template - constexpr const T& // constexpr in C++14 - min(const T& a, const T& b, Compare comp); - -template - constexpr T // constexpr in C++14 - min(initializer_list t); - -template - constexpr T // constexpr in C++14 - min(initializer_list t, Compare comp); - -template - constexpr const T& clamp(const T& v, const T& lo, const T& hi); // C++17 - -template - constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp); // C++17 - -template - constexpr ForwardIterator // constexpr in C++14 - max_element(ForwardIterator first, ForwardIterator last); - -template - constexpr ForwardIterator // constexpr in C++14 - max_element(ForwardIterator first, ForwardIterator last, Compare comp); - -template - constexpr const T& // constexpr in C++14 - max(const T& a, const T& b); - -template - constexpr const T& // constexpr in C++14 - max(const T& a, const T& b, Compare comp); - -template - constexpr T // constexpr in C++14 - max(initializer_list t); - -template - constexpr T // constexpr in C++14 - max(initializer_list t, Compare comp); - -template - constexpr pair // constexpr in C++14 - minmax_element(ForwardIterator first, ForwardIterator last); - -template - constexpr pair // constexpr in C++14 - minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); - -template - constexpr pair // constexpr in C++14 - minmax(const T& a, const T& b); - -template - constexpr pair // constexpr in C++14 - minmax(const T& a, const T& b, Compare comp); - -template - constexpr pair // constexpr in C++14 - minmax(initializer_list t); - -template - constexpr pair // constexpr in C++14 - minmax(initializer_list t, Compare comp); - -template - constexpr bool // constexpr in C++20 - lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); - -template - constexpr bool // constexpr in C++20 - lexicographical_compare(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, Compare comp); - -template - constexpr auto - lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, - Cmp comp) - -> decltype(comp(*b1, *b2)); // since C++20 - -template - constexpr auto - lexicographical_compare_three_way(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2); // since C++20 - -template - constexpr bool // constexpr in C++20 - next_permutation(BidirectionalIterator first, BidirectionalIterator last); - -template - constexpr bool // constexpr in C++20 - next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); - -template - constexpr bool // constexpr in C++20 - prev_permutation(BidirectionalIterator first, BidirectionalIterator last); - -template - constexpr bool // constexpr in C++20 - prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__debug> diff --git a/libcxx/include/any b/libcxx/include/any --- a/libcxx/include/any +++ b/libcxx/include/any @@ -10,76 +10,6 @@ #ifndef _LIBCPP_ANY #define _LIBCPP_ANY -/* - any synopsis - -namespace std { - - class bad_any_cast : public bad_cast - { - public: - virtual const char* what() const noexcept; - }; - - class any - { - public: - - // 6.3.1 any construct/destruct - any() noexcept; - - any(const any& other); - any(any&& other) noexcept; - - template - any(ValueType&& value); - - ~any(); - - // 6.3.2 any assignments - any& operator=(const any& rhs); - any& operator=(any&& rhs) noexcept; - - template - any& operator=(ValueType&& rhs); - - // 6.3.3 any modifiers - template - decay_t& emplace(Args&&... args); - template - decay_t& emplace(initializer_list, Args&&...); - void reset() noexcept; - void swap(any& rhs) noexcept; - - // 6.3.4 any observers - bool has_value() const noexcept; - const type_info& type() const noexcept; - }; - - // 6.4 Non-member functions - void swap(any& x, any& y) noexcept; - - template - any make_any(Args&& ...args); - template - any make_any(initializer_list, Args&& ...args); - - template - ValueType any_cast(const any& operand); - template - ValueType any_cast(any& operand); - template - ValueType any_cast(any&& operand); - - template - const ValueType* any_cast(const any* operand) noexcept; - template - ValueType* any_cast(any* operand) noexcept; - -} // namespace std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__availability> #include <__config> diff --git a/libcxx/include/array b/libcxx/include/array --- a/libcxx/include/array +++ b/libcxx/include/array @@ -10,104 +10,6 @@ #ifndef _LIBCPP_ARRAY #define _LIBCPP_ARRAY -/* - array synopsis - -namespace std -{ -template -struct array -{ - // types: - typedef T & reference; - typedef const T & const_reference; - typedef implementation defined iterator; - typedef implementation defined const_iterator; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef T* pointer; - typedef const T* const_pointer; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - - // No explicit construct/copy/destroy for aggregate type - void fill(const T& u); // constexpr in C++20 - void swap(array& a) noexcept(is_nothrow_swappable_v); // constexpr in C++20 - - // iterators: - iterator begin() noexcept; // constexpr in C++17 - const_iterator begin() const noexcept; // constexpr in C++17 - iterator end() noexcept; // constexpr in C++17 - const_iterator end() const noexcept; // constexpr in C++17 - - reverse_iterator rbegin() noexcept; // constexpr in C++17 - const_reverse_iterator rbegin() const noexcept; // constexpr in C++17 - reverse_iterator rend() noexcept; // constexpr in C++17 - const_reverse_iterator rend() const noexcept; // constexpr in C++17 - - const_iterator cbegin() const noexcept; // constexpr in C++17 - const_iterator cend() const noexcept; // constexpr in C++17 - const_reverse_iterator crbegin() const noexcept; // constexpr in C++17 - const_reverse_iterator crend() const noexcept; // constexpr in C++17 - - // capacity: - constexpr size_type size() const noexcept; - constexpr size_type max_size() const noexcept; - constexpr bool empty() const noexcept; - - // element access: - reference operator[](size_type n); // constexpr in C++17 - const_reference operator[](size_type n) const; // constexpr in C++14 - reference at(size_type n); // constexpr in C++17 - const_reference at(size_type n) const; // constexpr in C++14 - - reference front(); // constexpr in C++17 - const_reference front() const; // constexpr in C++14 - reference back(); // constexpr in C++17 - const_reference back() const; // constexpr in C++14 - - T* data() noexcept; // constexpr in C++17 - const T* data() const noexcept; // constexpr in C++17 -}; - -template - array(T, U...) -> array; // C++17 - -template - bool operator==(const array& x, const array& y); // constexpr in C++20 -template - bool operator!=(const array& x, const array& y); // constexpr in C++20 -template - bool operator<(const array& x, const array& y); // constexpr in C++20 -template - bool operator>(const array& x, const array& y); // constexpr in C++20 -template - bool operator<=(const array& x, const array& y); // constexpr in C++20 -template - bool operator>=(const array& x, const array& y); // constexpr in C++20 - -template - void swap(array& x, array& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20 - -template - constexpr array, N> to_array(T (&a)[N]); // C++20 -template - constexpr array, N> to_array(T (&&a)[N]); // C++20 - -template struct tuple_size; -template struct tuple_element; -template struct tuple_size>; -template struct tuple_element>; -template T& get(array&) noexcept; // constexpr in C++14 -template const T& get(const array&) noexcept; // constexpr in C++14 -template T&& get(array&&) noexcept; // constexpr in C++14 -template const T&& get(const array&&) noexcept; // constexpr in C++14 - -} // std - -*/ - #include <__algorithm/equal.h> #include <__algorithm/fill_n.h> #include <__algorithm/lexicographical_compare.h> diff --git a/libcxx/include/atomic b/libcxx/include/atomic --- a/libcxx/include/atomic +++ b/libcxx/include/atomic @@ -10,514 +10,6 @@ #ifndef _LIBCPP_ATOMIC #define _LIBCPP_ATOMIC -/* - atomic synopsis - -namespace std -{ - -// feature test macro [version.syn] - -#define __cpp_lib_atomic_is_always_lock_free -#define __cpp_lib_atomic_flag_test -#define __cpp_lib_atomic_lock_free_type_aliases -#define __cpp_lib_atomic_wait - - // order and consistency - - enum memory_order: unspecified // enum class in C++20 - { - relaxed, - consume, // load-consume - acquire, // load-acquire - release, // store-release - acq_rel, // store-release load-acquire - seq_cst // store-release load-acquire - }; - - inline constexpr auto memory_order_relaxed = memory_order::relaxed; - inline constexpr auto memory_order_consume = memory_order::consume; - inline constexpr auto memory_order_acquire = memory_order::acquire; - inline constexpr auto memory_order_release = memory_order::release; - inline constexpr auto memory_order_acq_rel = memory_order::acq_rel; - inline constexpr auto memory_order_seq_cst = memory_order::seq_cst; - -template T kill_dependency(T y) noexcept; - -// lock-free property - -#define ATOMIC_BOOL_LOCK_FREE unspecified -#define ATOMIC_CHAR_LOCK_FREE unspecified -#define ATOMIC_CHAR8_T_LOCK_FREE unspecified // C++20 -#define ATOMIC_CHAR16_T_LOCK_FREE unspecified -#define ATOMIC_CHAR32_T_LOCK_FREE unspecified -#define ATOMIC_WCHAR_T_LOCK_FREE unspecified -#define ATOMIC_SHORT_LOCK_FREE unspecified -#define ATOMIC_INT_LOCK_FREE unspecified -#define ATOMIC_LONG_LOCK_FREE unspecified -#define ATOMIC_LLONG_LOCK_FREE unspecified -#define ATOMIC_POINTER_LOCK_FREE unspecified - -template -struct atomic -{ - using value_type = T; - - static constexpr bool is_always_lock_free; - bool is_lock_free() const volatile noexcept; - bool is_lock_free() const noexcept; - - atomic() noexcept = default; // until C++20 - constexpr atomic() noexcept(is_nothrow_default_constructible_v); // since C++20 - constexpr atomic(T desr) noexcept; - atomic(const atomic&) = delete; - atomic& operator=(const atomic&) = delete; - atomic& operator=(const atomic&) volatile = delete; - - T load(memory_order m = memory_order_seq_cst) const volatile noexcept; - T load(memory_order m = memory_order_seq_cst) const noexcept; - operator T() const volatile noexcept; - operator T() const noexcept; - void store(T desr, memory_order m = memory_order_seq_cst) volatile noexcept; - void store(T desr, memory_order m = memory_order_seq_cst) noexcept; - T operator=(T) volatile noexcept; - T operator=(T) noexcept; - - T exchange(T desr, memory_order m = memory_order_seq_cst) volatile noexcept; - T exchange(T desr, memory_order m = memory_order_seq_cst) noexcept; - bool compare_exchange_weak(T& expc, T desr, - memory_order s, memory_order f) volatile noexcept; - bool compare_exchange_weak(T& expc, T desr, memory_order s, memory_order f) noexcept; - bool compare_exchange_strong(T& expc, T desr, - memory_order s, memory_order f) volatile noexcept; - bool compare_exchange_strong(T& expc, T desr, - memory_order s, memory_order f) noexcept; - bool compare_exchange_weak(T& expc, T desr, - memory_order m = memory_order_seq_cst) volatile noexcept; - bool compare_exchange_weak(T& expc, T desr, - memory_order m = memory_order_seq_cst) noexcept; - bool compare_exchange_strong(T& expc, T desr, - memory_order m = memory_order_seq_cst) volatile noexcept; - bool compare_exchange_strong(T& expc, T desr, - memory_order m = memory_order_seq_cst) noexcept; - - void wait(T, memory_order = memory_order::seq_cst) const volatile noexcept; - void wait(T, memory_order = memory_order::seq_cst) const noexcept; - void notify_one() volatile noexcept; - void notify_one() noexcept; - void notify_all() volatile noexcept; - void notify_all() noexcept; -}; - -template <> -struct atomic -{ - using value_type = integral; - using difference_type = value_type; - - static constexpr bool is_always_lock_free; - bool is_lock_free() const volatile noexcept; - bool is_lock_free() const noexcept; - - atomic() noexcept = default; - constexpr atomic(integral desr) noexcept; - atomic(const atomic&) = delete; - atomic& operator=(const atomic&) = delete; - atomic& operator=(const atomic&) volatile = delete; - - integral load(memory_order m = memory_order_seq_cst) const volatile noexcept; - integral load(memory_order m = memory_order_seq_cst) const noexcept; - operator integral() const volatile noexcept; - operator integral() const noexcept; - void store(integral desr, memory_order m = memory_order_seq_cst) volatile noexcept; - void store(integral desr, memory_order m = memory_order_seq_cst) noexcept; - integral operator=(integral desr) volatile noexcept; - integral operator=(integral desr) noexcept; - - integral exchange(integral desr, - memory_order m = memory_order_seq_cst) volatile noexcept; - integral exchange(integral desr, memory_order m = memory_order_seq_cst) noexcept; - bool compare_exchange_weak(integral& expc, integral desr, - memory_order s, memory_order f) volatile noexcept; - bool compare_exchange_weak(integral& expc, integral desr, - memory_order s, memory_order f) noexcept; - bool compare_exchange_strong(integral& expc, integral desr, - memory_order s, memory_order f) volatile noexcept; - bool compare_exchange_strong(integral& expc, integral desr, - memory_order s, memory_order f) noexcept; - bool compare_exchange_weak(integral& expc, integral desr, - memory_order m = memory_order_seq_cst) volatile noexcept; - bool compare_exchange_weak(integral& expc, integral desr, - memory_order m = memory_order_seq_cst) noexcept; - bool compare_exchange_strong(integral& expc, integral desr, - memory_order m = memory_order_seq_cst) volatile noexcept; - bool compare_exchange_strong(integral& expc, integral desr, - memory_order m = memory_order_seq_cst) noexcept; - - integral fetch_add(integral op, memory_order m = memory_order_seq_cst) volatile noexcept; - integral fetch_add(integral op, memory_order m = memory_order_seq_cst) noexcept; - integral fetch_sub(integral op, memory_order m = memory_order_seq_cst) volatile noexcept; - integral fetch_sub(integral op, memory_order m = memory_order_seq_cst) noexcept; - integral fetch_and(integral op, memory_order m = memory_order_seq_cst) volatile noexcept; - integral fetch_and(integral op, memory_order m = memory_order_seq_cst) noexcept; - integral fetch_or(integral op, memory_order m = memory_order_seq_cst) volatile noexcept; - integral fetch_or(integral op, memory_order m = memory_order_seq_cst) noexcept; - integral fetch_xor(integral op, memory_order m = memory_order_seq_cst) volatile noexcept; - integral fetch_xor(integral op, memory_order m = memory_order_seq_cst) noexcept; - - integral operator++(int) volatile noexcept; - integral operator++(int) noexcept; - integral operator--(int) volatile noexcept; - integral operator--(int) noexcept; - integral operator++() volatile noexcept; - integral operator++() noexcept; - integral operator--() volatile noexcept; - integral operator--() noexcept; - integral operator+=(integral op) volatile noexcept; - integral operator+=(integral op) noexcept; - integral operator-=(integral op) volatile noexcept; - integral operator-=(integral op) noexcept; - integral operator&=(integral op) volatile noexcept; - integral operator&=(integral op) noexcept; - integral operator|=(integral op) volatile noexcept; - integral operator|=(integral op) noexcept; - integral operator^=(integral op) volatile noexcept; - integral operator^=(integral op) noexcept; - - void wait(integral, memory_order = memory_order::seq_cst) const volatile noexcept; - void wait(integral, memory_order = memory_order::seq_cst) const noexcept; - void notify_one() volatile noexcept; - void notify_one() noexcept; - void notify_all() volatile noexcept; - void notify_all() noexcept; -}; - -template -struct atomic -{ - using value_type = T*; - using difference_type = ptrdiff_t; - - static constexpr bool is_always_lock_free; - bool is_lock_free() const volatile noexcept; - bool is_lock_free() const noexcept; - - atomic() noexcept = default; // until C++20 - constexpr atomic() noexcept; // since C++20 - constexpr atomic(T* desr) noexcept; - atomic(const atomic&) = delete; - atomic& operator=(const atomic&) = delete; - atomic& operator=(const atomic&) volatile = delete; - - T* load(memory_order m = memory_order_seq_cst) const volatile noexcept; - T* load(memory_order m = memory_order_seq_cst) const noexcept; - operator T*() const volatile noexcept; - operator T*() const noexcept; - void store(T* desr, memory_order m = memory_order_seq_cst) volatile noexcept; - void store(T* desr, memory_order m = memory_order_seq_cst) noexcept; - T* operator=(T*) volatile noexcept; - T* operator=(T*) noexcept; - - T* exchange(T* desr, memory_order m = memory_order_seq_cst) volatile noexcept; - T* exchange(T* desr, memory_order m = memory_order_seq_cst) noexcept; - bool compare_exchange_weak(T*& expc, T* desr, - memory_order s, memory_order f) volatile noexcept; - bool compare_exchange_weak(T*& expc, T* desr, - memory_order s, memory_order f) noexcept; - bool compare_exchange_strong(T*& expc, T* desr, - memory_order s, memory_order f) volatile noexcept; - bool compare_exchange_strong(T*& expc, T* desr, - memory_order s, memory_order f) noexcept; - bool compare_exchange_weak(T*& expc, T* desr, - memory_order m = memory_order_seq_cst) volatile noexcept; - bool compare_exchange_weak(T*& expc, T* desr, - memory_order m = memory_order_seq_cst) noexcept; - bool compare_exchange_strong(T*& expc, T* desr, - memory_order m = memory_order_seq_cst) volatile noexcept; - bool compare_exchange_strong(T*& expc, T* desr, - memory_order m = memory_order_seq_cst) noexcept; - T* fetch_add(ptrdiff_t op, memory_order m = memory_order_seq_cst) volatile noexcept; - T* fetch_add(ptrdiff_t op, memory_order m = memory_order_seq_cst) noexcept; - T* fetch_sub(ptrdiff_t op, memory_order m = memory_order_seq_cst) volatile noexcept; - T* fetch_sub(ptrdiff_t op, memory_order m = memory_order_seq_cst) noexcept; - - T* operator++(int) volatile noexcept; - T* operator++(int) noexcept; - T* operator--(int) volatile noexcept; - T* operator--(int) noexcept; - T* operator++() volatile noexcept; - T* operator++() noexcept; - T* operator--() volatile noexcept; - T* operator--() noexcept; - T* operator+=(ptrdiff_t op) volatile noexcept; - T* operator+=(ptrdiff_t op) noexcept; - T* operator-=(ptrdiff_t op) volatile noexcept; - T* operator-=(ptrdiff_t op) noexcept; - - void wait(T*, memory_order = memory_order::seq_cst) const volatile noexcept; - void wait(T*, memory_order = memory_order::seq_cst) const noexcept; - void notify_one() volatile noexcept; - void notify_one() noexcept; - void notify_all() volatile noexcept; - void notify_all() noexcept; -}; - - -// [atomics.nonmembers], non-member functions -template - bool atomic_is_lock_free(const volatile atomic*) noexcept; -template - bool atomic_is_lock_free(const atomic*) noexcept; -template - void atomic_store(volatile atomic*, atomic::value_type) noexcept; -template - void atomic_store(atomic*, atomic::value_type) noexcept; -template - void atomic_store_explicit(volatile atomic*, atomic::value_type, - memory_order) noexcept; -template - void atomic_store_explicit(atomic*, atomic::value_type, - memory_order) noexcept; -template - T atomic_load(const volatile atomic*) noexcept; -template - T atomic_load(const atomic*) noexcept; -template - T atomic_load_explicit(const volatile atomic*, memory_order) noexcept; -template - T atomic_load_explicit(const atomic*, memory_order) noexcept; -template - T atomic_exchange(volatile atomic*, atomic::value_type) noexcept; -template - T atomic_exchange(atomic*, atomic::value_type) noexcept; -template - T atomic_exchange_explicit(volatile atomic*, atomic::value_type, - memory_order) noexcept; -template - T atomic_exchange_explicit(atomic*, atomic::value_type, - memory_order) noexcept; -template - bool atomic_compare_exchange_weak(volatile atomic*, atomic::value_type*, - atomic::value_type) noexcept; -template - bool atomic_compare_exchange_weak(atomic*, atomic::value_type*, - atomic::value_type) noexcept; -template - bool atomic_compare_exchange_strong(volatile atomic*, atomic::value_type*, - atomic::value_type) noexcept; -template - bool atomic_compare_exchange_strong(atomic*, atomic::value_type*, - atomic::value_type) noexcept; -template - bool atomic_compare_exchange_weak_explicit(volatile atomic*, atomic::value_type*, - atomic::value_type, - memory_order, memory_order) noexcept; -template - bool atomic_compare_exchange_weak_explicit(atomic*, atomic::value_type*, - atomic::value_type, - memory_order, memory_order) noexcept; -template - bool atomic_compare_exchange_strong_explicit(volatile atomic*, atomic::value_type*, - atomic::value_type, - memory_order, memory_order) noexcept; -template - bool atomic_compare_exchange_strong_explicit(atomic*, atomic::value_type*, - atomic::value_type, - memory_order, memory_order) noexcept; - -template - T atomic_fetch_add(volatile atomic*, atomic::difference_type) noexcept; -template - T atomic_fetch_add(atomic*, atomic::difference_type) noexcept; -template - T atomic_fetch_add_explicit(volatile atomic*, atomic::difference_type, - memory_order) noexcept; -template - T atomic_fetch_add_explicit(atomic*, atomic::difference_type, - memory_order) noexcept; -template - T atomic_fetch_sub(volatile atomic*, atomic::difference_type) noexcept; -template - T atomic_fetch_sub(atomic*, atomic::difference_type) noexcept; -template - T atomic_fetch_sub_explicit(volatile atomic*, atomic::difference_type, - memory_order) noexcept; -template - T atomic_fetch_sub_explicit(atomic*, atomic::difference_type, - memory_order) noexcept; -template - T atomic_fetch_and(volatile atomic*, atomic::value_type) noexcept; -template - T atomic_fetch_and(atomic*, atomic::value_type) noexcept; -template - T atomic_fetch_and_explicit(volatile atomic*, atomic::value_type, - memory_order) noexcept; -template - T atomic_fetch_and_explicit(atomic*, atomic::value_type, - memory_order) noexcept; -template - T atomic_fetch_or(volatile atomic*, atomic::value_type) noexcept; -template - T atomic_fetch_or(atomic*, atomic::value_type) noexcept; -template - T atomic_fetch_or_explicit(volatile atomic*, atomic::value_type, - memory_order) noexcept; -template - T atomic_fetch_or_explicit(atomic*, atomic::value_type, - memory_order) noexcept; -template - T atomic_fetch_xor(volatile atomic*, atomic::value_type) noexcept; -template - T atomic_fetch_xor(atomic*, atomic::value_type) noexcept; -template - T atomic_fetch_xor_explicit(volatile atomic*, atomic::value_type, - memory_order) noexcept; -template - T atomic_fetch_xor_explicit(atomic*, atomic::value_type, - memory_order) noexcept; - -template - void atomic_wait(const volatile atomic*, atomic::value_type) noexcept; -template - void atomic_wait(const atomic*, atomic::value_type) noexcept; -template - void atomic_wait_explicit(const volatile atomic*, atomic::value_type, - memory_order) noexcept; -template - void atomic_wait_explicit(const atomic*, atomic::value_type, - memory_order) noexcept; -template - void atomic_notify_one(volatile atomic*) noexcept; -template - void atomic_notify_one(atomic*) noexcept; -template - void atomic_notify_all(volatile atomic*) noexcept; -template - void atomic_notify_all(atomic*) noexcept; - -// Atomics for standard typedef types - -typedef atomic atomic_bool; -typedef atomic atomic_char; -typedef atomic atomic_schar; -typedef atomic atomic_uchar; -typedef atomic atomic_short; -typedef atomic atomic_ushort; -typedef atomic atomic_int; -typedef atomic atomic_uint; -typedef atomic atomic_long; -typedef atomic atomic_ulong; -typedef atomic atomic_llong; -typedef atomic atomic_ullong; -typedef atomic atomic_char8_t; // C++20 -typedef atomic atomic_char16_t; -typedef atomic atomic_char32_t; -typedef atomic atomic_wchar_t; - -typedef atomic atomic_int_least8_t; -typedef atomic atomic_uint_least8_t; -typedef atomic atomic_int_least16_t; -typedef atomic atomic_uint_least16_t; -typedef atomic atomic_int_least32_t; -typedef atomic atomic_uint_least32_t; -typedef atomic atomic_int_least64_t; -typedef atomic atomic_uint_least64_t; - -typedef atomic atomic_int_fast8_t; -typedef atomic atomic_uint_fast8_t; -typedef atomic atomic_int_fast16_t; -typedef atomic atomic_uint_fast16_t; -typedef atomic atomic_int_fast32_t; -typedef atomic atomic_uint_fast32_t; -typedef atomic atomic_int_fast64_t; -typedef atomic atomic_uint_fast64_t; - -typedef atomic atomic_int8_t; -typedef atomic atomic_uint8_t; -typedef atomic atomic_int16_t; -typedef atomic atomic_uint16_t; -typedef atomic atomic_int32_t; -typedef atomic atomic_uint32_t; -typedef atomic atomic_int64_t; -typedef atomic atomic_uint64_t; - -typedef atomic atomic_intptr_t; -typedef atomic atomic_uintptr_t; -typedef atomic atomic_size_t; -typedef atomic atomic_ptrdiff_t; -typedef atomic atomic_intmax_t; -typedef atomic atomic_uintmax_t; - -// flag type and operations - -typedef struct atomic_flag -{ - atomic_flag() noexcept = default; // until C++20 - constexpr atomic_flag() noexcept; // since C++20 - atomic_flag(const atomic_flag&) = delete; - atomic_flag& operator=(const atomic_flag&) = delete; - atomic_flag& operator=(const atomic_flag&) volatile = delete; - - bool test(memory_order m = memory_order_seq_cst) volatile noexcept; - bool test(memory_order m = memory_order_seq_cst) noexcept; - bool test_and_set(memory_order m = memory_order_seq_cst) volatile noexcept; - bool test_and_set(memory_order m = memory_order_seq_cst) noexcept; - void clear(memory_order m = memory_order_seq_cst) volatile noexcept; - void clear(memory_order m = memory_order_seq_cst) noexcept; - - void wait(bool, memory_order = memory_order::seq_cst) const volatile noexcept; - void wait(bool, memory_order = memory_order::seq_cst) const noexcept; - void notify_one() volatile noexcept; - void notify_one() noexcept; - void notify_all() volatile noexcept; - void notify_all() noexcept; -} atomic_flag; - -bool atomic_flag_test(volatile atomic_flag* obj) noexcept; -bool atomic_flag_test(atomic_flag* obj) noexcept; -bool atomic_flag_test_explicit(volatile atomic_flag* obj, - memory_order m) noexcept; -bool atomic_flag_test_explicit(atomic_flag* obj, memory_order m) noexcept; -bool atomic_flag_test_and_set(volatile atomic_flag* obj) noexcept; -bool atomic_flag_test_and_set(atomic_flag* obj) noexcept; -bool atomic_flag_test_and_set_explicit(volatile atomic_flag* obj, - memory_order m) noexcept; -bool atomic_flag_test_and_set_explicit(atomic_flag* obj, memory_order m) noexcept; -void atomic_flag_clear(volatile atomic_flag* obj) noexcept; -void atomic_flag_clear(atomic_flag* obj) noexcept; -void atomic_flag_clear_explicit(volatile atomic_flag* obj, memory_order m) noexcept; -void atomic_flag_clear_explicit(atomic_flag* obj, memory_order m) noexcept; - -void atomic_wait(const volatile atomic_flag* obj, T old) noexcept; -void atomic_wait(const atomic_flag* obj, T old) noexcept; -void atomic_wait_explicit(const volatile atomic_flag* obj, T old, memory_order m) noexcept; -void atomic_wait_explicit(const atomic_flag* obj, T old, memory_order m) noexcept; -void atomic_one(volatile atomic_flag* obj) noexcept; -void atomic_one(atomic_flag* obj) noexcept; -void atomic_all(volatile atomic_flag* obj) noexcept; -void atomic_all(atomic_flag* obj) noexcept; - -// fences - -void atomic_thread_fence(memory_order m) noexcept; -void atomic_signal_fence(memory_order m) noexcept; - -// deprecated - -template - void atomic_init(volatile atomic* obj, atomic::value_type desr) noexcept; - -template - void atomic_init(atomic* obj, atomic::value_type desr) noexcept; - -#define ATOMIC_VAR_INIT(value) see below - -#define ATOMIC_FLAG_INIT see below - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__atomic/aliases.h> #include <__atomic/atomic.h> diff --git a/libcxx/include/barrier b/libcxx/include/barrier --- a/libcxx/include/barrier +++ b/libcxx/include/barrier @@ -10,41 +10,6 @@ #ifndef _LIBCPP_BARRIER #define _LIBCPP_BARRIER -/* - barrier synopsis - -namespace std -{ - - template - class barrier - { - public: - using arrival_token = see below; - - static constexpr ptrdiff_t max() noexcept; - - constexpr explicit barrier(ptrdiff_t phase_count, - CompletionFunction f = CompletionFunction()); - ~barrier(); - - barrier(const barrier&) = delete; - barrier& operator=(const barrier&) = delete; - - [[nodiscard]] arrival_token arrive(ptrdiff_t update = 1); - void wait(arrival_token&& arrival) const; - - void arrive_and_wait(); - void arrive_and_drop(); - - private: - CompletionFunction completion; // exposition only - }; - -} - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__atomic/atomic_base.h> #include <__atomic/memory_order.h> diff --git a/libcxx/include/bit b/libcxx/include/bit --- a/libcxx/include/bit +++ b/libcxx/include/bit @@ -10,57 +10,6 @@ #ifndef _LIBCPP_BIT #define _LIBCPP_BIT -/* - bit synopsis - -namespace std { - // [bit.cast], bit_cast - template - constexpr To bit_cast(const From& from) noexcept; // C++20 - - // [bit.byteswap], byteswap - template - constexpr T byteswap(T value) noexcept; // C++23 - - // [bit.pow.two], integral powers of 2 - template - constexpr bool has_single_bit(T x) noexcept; // C++20 - template - constexpr T bit_ceil(T x); // C++20 - template - constexpr T bit_floor(T x) noexcept; // C++20 - template - constexpr int bit_width(T x) noexcept; // C++20 - - // [bit.rotate], rotating - template - constexpr T rotl(T x, unsigned int s) noexcept; // C++20 - template - constexpr T rotr(T x, unsigned int s) noexcept; // C++20 - - // [bit.count], counting - template - constexpr int countl_zero(T x) noexcept; // C++20 - template - constexpr int countl_one(T x) noexcept; // C++20 - template - constexpr int countr_zero(T x) noexcept; // C++20 - template - constexpr int countr_one(T x) noexcept; // C++20 - template - constexpr int popcount(T x) noexcept; // C++20 - - // [bit.endian], endian - enum class endian { - little = see below, // C++20 - big = see below, // C++20 - native = see below // C++20 - }; - -} // namespace std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__bit/bit_cast.h> #include <__bit/bit_ceil.h> diff --git a/libcxx/include/bitset b/libcxx/include/bitset --- a/libcxx/include/bitset +++ b/libcxx/include/bitset @@ -10,108 +10,6 @@ #ifndef _LIBCPP_BITSET #define _LIBCPP_BITSET -/* - bitset synopsis - -namespace std -{ - -namespace std { - -template -class bitset -{ -public: - // bit reference: - class reference - { - friend class bitset; - reference() noexcept; - public: - ~reference() noexcept; - reference& operator=(bool x) noexcept; // for b[i] = x; - reference& operator=(const reference&) noexcept; // for b[i] = b[j]; - bool operator~() const noexcept; // flips the bit - operator bool() const noexcept; // for x = b[i]; - reference& flip() noexcept; // for b[i].flip(); - }; - - // 23.3.5.1 constructors: - constexpr bitset() noexcept; - constexpr bitset(unsigned long long val) noexcept; - template - explicit bitset(const charT* str, - typename basic_string::size_type n = basic_string::npos, - charT zero = charT('0'), charT one = charT('1')); // constexpr since C++23 - template - explicit bitset(const basic_string& str, - typename basic_string::size_type pos = 0, - typename basic_string::size_type n = - basic_string::npos, - charT zero = charT('0'), charT one = charT('1')); // constexpr since C++23 - - // 23.3.5.2 bitset operations: - bitset& operator&=(const bitset& rhs) noexcept; // constexpr since C++23 - bitset& operator|=(const bitset& rhs) noexcept; // constexpr since C++23 - bitset& operator^=(const bitset& rhs) noexcept; // constexpr since C++23 - bitset& operator<<=(size_t pos) noexcept; // constexpr since C++23 - bitset& operator>>=(size_t pos) noexcept; // constexpr since C++23 - bitset& set() noexcept; // constexpr since C++23 - bitset& set(size_t pos, bool val = true); // constexpr since C++23 - bitset& reset() noexcept; // constexpr since C++23 - bitset& reset(size_t pos); // constexpr since C++23 - bitset operator~() const noexcept; // constexpr since C++23 - bitset& flip() noexcept; // constexpr since C++23 - bitset& flip(size_t pos); // constexpr since C++23 - - // element access: - constexpr bool operator[](size_t pos) const; - reference operator[](size_t pos); // constexpr since C++23 - unsigned long to_ulong() const; // constexpr since C++23 - unsigned long long to_ullong() const; // constexpr since C++23 - template // constexpr since C++23 - basic_string to_string(charT zero = charT('0'), charT one = charT('1')) const; - template // constexpr since C++23 - basic_string > to_string(charT zero = charT('0'), charT one = charT('1')) const; - template // constexpr since C++23 - basic_string, allocator > to_string(charT zero = charT('0'), charT one = charT('1')) const; - basic_string, allocator > to_string(char zero = '0', char one = '1') const; // constexpr since C++23 - size_t count() const noexcept; // constexpr since C++23 - constexpr size_t size() const noexcept; // constexpr since C++23 - bool operator==(const bitset& rhs) const noexcept; // constexpr since C++23 - bool operator!=(const bitset& rhs) const noexcept; // constexpr since C++23 - bool test(size_t pos) const; // constexpr since C++23 - bool all() const noexcept; // constexpr since C++23 - bool any() const noexcept; // constexpr since C++23 - bool none() const noexcept; // constexpr since C++23 - bitset operator<<(size_t pos) const noexcept; // constexpr since C++23 - bitset operator>>(size_t pos) const noexcept; // constexpr since C++23 -}; - -// 23.3.5.3 bitset operators: -template -bitset operator&(const bitset&, const bitset&) noexcept; // constexpr since C++23 - -template -bitset operator|(const bitset&, const bitset&) noexcept; // constexpr since C++23 - -template -bitset operator^(const bitset&, const bitset&) noexcept; // constexpr since C++23 - -template -basic_istream& -operator>>(basic_istream& is, bitset& x); - -template -basic_ostream& -operator<<(basic_ostream& os, const bitset& x); - -template struct hash>; - -} // std - -*/ - #include <__algorithm/fill.h> #include <__assert> // all public C++ headers provide the assertion handler #include <__bit_reference> diff --git a/libcxx/include/cassert b/libcxx/include/cassert --- a/libcxx/include/cassert +++ b/libcxx/include/cassert @@ -7,15 +7,6 @@ // //===----------------------------------------------------------------------===// -/* - cassert synopsis - -Macros: - - assert - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/ccomplex b/libcxx/include/ccomplex --- a/libcxx/include/ccomplex +++ b/libcxx/include/ccomplex @@ -10,13 +10,6 @@ #ifndef _LIBCPP_CCOMPLEX #define _LIBCPP_CCOMPLEX -/* - ccomplex synopsis - -#include - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include diff --git a/libcxx/include/cctype b/libcxx/include/cctype --- a/libcxx/include/cctype +++ b/libcxx/include/cctype @@ -10,30 +10,6 @@ #ifndef _LIBCPP_CCTYPE #define _LIBCPP_CCTYPE -/* - cctype synopsis - -namespace std -{ - -int isalnum(int c); -int isalpha(int c); -int isblank(int c); // C99 -int iscntrl(int c); -int isdigit(int c); -int isgraph(int c); -int islower(int c); -int isprint(int c); -int ispunct(int c); -int isspace(int c); -int isupper(int c); -int isxdigit(int c); -int tolower(int c); -int toupper(int c); - -} // std -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cerrno b/libcxx/include/cerrno --- a/libcxx/include/cerrno +++ b/libcxx/include/cerrno @@ -10,18 +10,6 @@ #ifndef _LIBCPP_CERRNO #define _LIBCPP_CERRNO -/* - cerrno synopsis - -Macros: - - EDOM - EILSEQ // C99 - ERANGE - errno - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cfenv b/libcxx/include/cfenv --- a/libcxx/include/cfenv +++ b/libcxx/include/cfenv @@ -10,48 +10,6 @@ #ifndef _LIBCPP_CFENV #define _LIBCPP_CFENV -/* - cfenv synopsis - -This entire header is C99 / C++0X - -Macros: - - FE_DIVBYZERO - FE_INEXACT - FE_INVALID - FE_OVERFLOW - FE_UNDERFLOW - FE_ALL_EXCEPT - FE_DOWNWARD - FE_TONEAREST - FE_TOWARDZERO - FE_UPWARD - FE_DFL_ENV - -namespace std -{ - -Types: - - fenv_t - fexcept_t - -int feclearexcept(int excepts); -int fegetexceptflag(fexcept_t* flagp, int excepts); -int feraiseexcept(int excepts); -int fesetexceptflag(const fexcept_t* flagp, int excepts); -int fetestexcept(int excepts); -int fegetround(); -int fesetround(int round); -int fegetenv(fenv_t* envp); -int feholdexcept(fenv_t* envp); -int fesetenv(const fenv_t* envp); -int feupdateenv(const fenv_t* envp); - -} // std -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cfloat b/libcxx/include/cfloat --- a/libcxx/include/cfloat +++ b/libcxx/include/cfloat @@ -10,65 +10,6 @@ #ifndef _LIBCPP_CFLOAT #define _LIBCPP_CFLOAT -/* - cfloat synopsis - -Macros: - - FLT_ROUNDS - FLT_EVAL_METHOD // C99 - FLT_RADIX - - FLT_HAS_SUBNORM // C11 - DBL_HAS_SUBNORM // C11 - LDBL_HAS_SUBNORM // C11 - - FLT_MANT_DIG - DBL_MANT_DIG - LDBL_MANT_DIG - - DECIMAL_DIG // C99 - FLT_DECIMAL_DIG // C11 - DBL_DECIMAL_DIG // C11 - LDBL_DECIMAL_DIG // C11 - - FLT_DIG - DBL_DIG - LDBL_DIG - - FLT_MIN_EXP - DBL_MIN_EXP - LDBL_MIN_EXP - - FLT_MIN_10_EXP - DBL_MIN_10_EXP - LDBL_MIN_10_EXP - - FLT_MAX_EXP - DBL_MAX_EXP - LDBL_MAX_EXP - - FLT_MAX_10_EXP - DBL_MAX_10_EXP - LDBL_MAX_10_EXP - - FLT_MAX - DBL_MAX - LDBL_MAX - - FLT_EPSILON - DBL_EPSILON - LDBL_EPSILON - - FLT_MIN - DBL_MIN - LDBL_MIN - - FLT_TRUE_MIN // C11 - DBL_TRUE_MIN // C11 - LDBL_TRUE_MIN // C11 -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/charconv b/libcxx/include/charconv --- a/libcxx/include/charconv +++ b/libcxx/include/charconv @@ -10,63 +10,6 @@ #ifndef _LIBCPP_CHARCONV #define _LIBCPP_CHARCONV -/* - charconv synopsis - -namespace std { - - // floating-point format for primitive numerical conversion - enum class chars_format { - scientific = unspecified, - fixed = unspecified, - hex = unspecified, - general = fixed | scientific - }; - - // 23.20.2, primitive numerical output conversion - struct to_chars_result { - char* ptr; - errc ec; - friend bool operator==(const to_chars_result&, const to_chars_result&) = default; // since C++20 - }; - - constexpr to_chars_result to_chars(char* first, char* last, see below value, - int base = 10); // constexpr since C++23 - to_chars_result to_chars(char* first, char* last, bool value, - int base = 10) = delete; - - to_chars_result to_chars(char* first, char* last, float value); - to_chars_result to_chars(char* first, char* last, double value); - to_chars_result to_chars(char* first, char* last, long double value); - - to_chars_result to_chars(char* first, char* last, float value, - chars_format fmt); - to_chars_result to_chars(char* first, char* last, double value, - chars_format fmt); - to_chars_result to_chars(char* first, char* last, long double value, - chars_format fmt); - - to_chars_result to_chars(char* first, char* last, float value, - chars_format fmt, int precision); - to_chars_result to_chars(char* first, char* last, double value, - chars_format fmt, int precision); - to_chars_result to_chars(char* first, char* last, long double value, - chars_format fmt, int precision); - - // 23.20.3, primitive numerical input conversion - struct from_chars_result { - const char* ptr; - errc ec; - friend bool operator==(const from_chars_result&, const from_chars_result&) = default; // since C++20 - }; - - constexpr from_chars_result from_chars(const char* first, const char* last, - see below& value, int base = 10); // constexpr since C++23 - -} // namespace std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__charconv/chars_format.h> #include <__charconv/from_chars_integral.h> diff --git a/libcxx/include/chrono b/libcxx/include/chrono --- a/libcxx/include/chrono +++ b/libcxx/include/chrono @@ -10,746 +10,6 @@ #ifndef _LIBCPP_CHRONO #define _LIBCPP_CHRONO -/* - chrono synopsis - -#include // C++20 - -namespace std -{ -namespace chrono -{ - -template -constexpr -ToDuration -duration_cast(const duration& fd); - -template struct treat_as_floating_point : is_floating_point {}; - -template inline constexpr bool treat_as_floating_point_v - = treat_as_floating_point::value; // C++17 - -template -struct duration_values -{ -public: - static constexpr Rep zero(); // noexcept in C++20 - static constexpr Rep max(); // noexcept in C++20 - static constexpr Rep min(); // noexcept in C++20 -}; - -// duration - -template > -class duration -{ - static_assert(!__is_duration::value, "A duration representation can not be a duration"); - static_assert(__is_ratio::value, "Second template parameter of duration must be a std::ratio"); - static_assert(Period::num > 0, "duration period must be positive"); -public: - typedef Rep rep; - typedef typename _Period::type period; - - constexpr duration() = default; - template - constexpr explicit duration(const Rep2& r, - typename enable_if - < - is_convertible::value && - (treat_as_floating_point::value || - !treat_as_floating_point::value && !treat_as_floating_point::value) - >::type* = 0); - - // conversions - template - constexpr duration(const duration& d, - typename enable_if - < - treat_as_floating_point::value || - ratio_divide::type::den == 1 - >::type* = 0); - - // observer - - constexpr rep count() const; - - // arithmetic - - constexpr common_type::type operator+() const; - constexpr common_type::type operator-() const; - constexpr duration& operator++(); // constexpr in C++17 - constexpr duration operator++(int); // constexpr in C++17 - constexpr duration& operator--(); // constexpr in C++17 - constexpr duration operator--(int); // constexpr in C++17 - - constexpr duration& operator+=(const duration& d); // constexpr in C++17 - constexpr duration& operator-=(const duration& d); // constexpr in C++17 - - duration& operator*=(const rep& rhs); // constexpr in C++17 - duration& operator/=(const rep& rhs); // constexpr in C++17 - duration& operator%=(const rep& rhs); // constexpr in C++17 - duration& operator%=(const duration& rhs); // constexpr in C++17 - - // special values - - static constexpr duration zero(); // noexcept in C++20 - static constexpr duration min(); // noexcept in C++20 - static constexpr duration max(); // noexcept in C++20 -}; - -typedef duration nanoseconds; -typedef duration microseconds; -typedef duration milliseconds; -typedef duration seconds; -typedef duration< long, ratio< 60> > minutes; -typedef duration< long, ratio<3600> > hours; - -template -class time_point -{ -public: - typedef Clock clock; - typedef Duration duration; - typedef typename duration::rep rep; - typedef typename duration::period period; -private: - duration d_; // exposition only - -public: - time_point(); // has value "epoch" // constexpr in C++14 - explicit time_point(const duration& d); // same as time_point() + d // constexpr in C++14 - - // conversions - template - time_point(const time_point& t); // constexpr in C++14 - - // observer - - duration time_since_epoch() const; // constexpr in C++14 - - // arithmetic - - time_point& operator+=(const duration& d); // constexpr in C++17 - time_point& operator-=(const duration& d); // constexpr in C++17 - - // special values - - static constexpr time_point min(); // noexcept in C++20 - static constexpr time_point max(); // noexcept in C++20 -}; - -} // chrono - -// common_type traits -template - struct common_type, chrono::duration>; - -template - struct common_type, chrono::time_point>; - -namespace chrono { - -// duration arithmetic -template - constexpr - typename common_type, duration>::type - operator+(const duration& lhs, const duration& rhs); -template - constexpr - typename common_type, duration>::type - operator-(const duration& lhs, const duration& rhs); -template - constexpr - duration::type, Period> - operator*(const duration& d, const Rep2& s); -template - constexpr - duration::type, Period> - operator*(const Rep1& s, const duration& d); -template - constexpr - duration::type, Period> - operator/(const duration& d, const Rep2& s); -template - constexpr - typename common_type::type - operator/(const duration& lhs, const duration& rhs); - -// duration comparisons -template - constexpr - bool operator==(const duration& lhs, const duration& rhs); -template - constexpr - bool operator!=(const duration& lhs, const duration& rhs); // removed in C++20 -template - constexpr - bool operator< (const duration& lhs, const duration& rhs); -template - constexpr - bool operator<=(const duration& lhs, const duration& rhs); -template - constexpr - bool operator> (const duration& lhs, const duration& rhs); -template - constexpr - bool operator>=(const duration& lhs, const duration& rhs); -template - requires three_way_comparable - constexpr auto operator<=>(const duration& lhs, - const duration& rhs); // since C++20 - -// duration_cast -template - ToDuration duration_cast(const duration& d); - -template - constexpr ToDuration floor(const duration& d); // C++17 -template - constexpr ToDuration ceil(const duration& d); // C++17 -template - constexpr ToDuration round(const duration& d); // C++17 - -// duration I/O -template // C++20 - basic_ostream& - operator<<(basic_ostream& os, - const duration& d); - -// time_point arithmetic (all constexpr in C++14) -template - time_point>::type> - operator+(const time_point& lhs, const duration& rhs); -template - time_point, Duration2>::type> - operator+(const duration& lhs, const time_point& rhs); -template - time_point>::type> - operator-(const time_point& lhs, const duration& rhs); -template - typename common_type::type - operator-(const time_point& lhs, const time_point& rhs); - -// time_point comparisons (all constexpr in C++14) -template - bool operator==(const time_point& lhs, const time_point& rhs); -template - bool operator!=(const time_point& lhs, const time_point& rhs); -template - bool operator< (const time_point& lhs, const time_point& rhs); -template - bool operator<=(const time_point& lhs, const time_point& rhs); -template - bool operator> (const time_point& lhs, const time_point& rhs); -template - bool operator>=(const time_point& lhs, const time_point& rhs); - -// time_point_cast (constexpr in C++14) - -template - time_point time_point_cast(const time_point& t); - -template - constexpr time_point - floor(const time_point& tp); // C++17 - -template - constexpr time_point - ceil(const time_point& tp); // C++17 - -template - constexpr time_point - round(const time_point& tp); // C++17 - -template - constexpr duration abs(duration d); // C++17 - -// Clocks - -class system_clock -{ -public: - typedef microseconds duration; - typedef duration::rep rep; - typedef duration::period period; - typedef chrono::time_point time_point; - static const bool is_steady = false; // constexpr in C++14 - - static time_point now() noexcept; - static time_t to_time_t (const time_point& __t) noexcept; - static time_point from_time_t(time_t __t) noexcept; -}; - -template - using sys_time = time_point; // C++20 -using sys_seconds = sys_time; // C++20 -using sys_days = sys_time; // C++20 - -class file_clock // C++20 -{ -public: - typedef see-below rep; - typedef nano period; - typedef chrono::duration duration; - typedef chrono::time_point time_point; - static constexpr bool is_steady = false; - - static time_point now() noexcept; - - template - static sys_time to_sys(const file_time&); - - template - static file_time from_sys(const sys_time&); -}; - -template - using file_time = time_point; // C++20 - -class steady_clock -{ -public: - typedef nanoseconds duration; - typedef duration::rep rep; - typedef duration::period period; - typedef chrono::time_point time_point; - static const bool is_steady = true; // constexpr in C++14 - - static time_point now() noexcept; -}; - -typedef steady_clock high_resolution_clock; - -// 25.7.8, local time // C++20 -struct local_t {}; -template - using local_time = time_point; -using local_seconds = local_time; -using local_days = local_time; - -// 25.8.2, class last_spec // C++20 -struct last_spec; - -// 25.8.3, class day // C++20 - -class day; -constexpr bool operator==(const day& x, const day& y) noexcept; -constexpr strong_ordering operator<=>(const day& x, const day& y) noexcept; -constexpr day operator+(const day& x, const days& y) noexcept; -constexpr day operator+(const days& x, const day& y) noexcept; -constexpr day operator-(const day& x, const days& y) noexcept; -constexpr days operator-(const day& x, const day& y) noexcept; -template - basic_ostream& - operator<<(basic_ostream& os, const day& d); - -// 25.8.4, class month // C++20 -class month; -constexpr bool operator==(const month& x, const month& y) noexcept; -constexpr strong_ordering operator<=>(const month& x, const month& y) noexcept; - -constexpr month operator+(const month& x, const months& y) noexcept; -constexpr month operator+(const months& x, const month& y) noexcept; -constexpr month operator-(const month& x, const months& y) noexcept; -constexpr months operator-(const month& x, const month& y) noexcept; -template - basic_ostream& - operator<<(basic_ostream& os, const month& m); - -// 25.8.5, class year // C++20 -class year; -constexpr bool operator==(const year& x, const year& y) noexcept; -constexpr strong_ordering operator<=>(const year& x, const year& y) noexcept; - -constexpr year operator+(const year& x, const years& y) noexcept; -constexpr year operator+(const years& x, const year& y) noexcept; -constexpr year operator-(const year& x, const years& y) noexcept; -constexpr years operator-(const year& x, const year& y) noexcept; -template - basic_ostream& - operator<<(basic_ostream& os, const year& y); - -// 25.8.6, class weekday // C++20 -class weekday; - -constexpr bool operator==(const weekday& x, const weekday& y) noexcept; -constexpr bool operator!=(const weekday& x, const weekday& y) noexcept; -constexpr weekday operator+(const weekday& x, const days& y) noexcept; -constexpr weekday operator+(const days& x, const weekday& y) noexcept; -constexpr weekday operator-(const weekday& x, const days& y) noexcept; -constexpr days operator-(const weekday& x, const weekday& y) noexcept; -template - basic_ostream& - operator<<(basic_ostream& os, const weekday& wd); - -// 25.8.7, class weekday_indexed // C++20 - -class weekday_indexed; -constexpr bool operator==(const weekday_indexed& x, const weekday_indexed& y) noexcept; -constexpr bool operator!=(const weekday_indexed& x, const weekday_indexed& y) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const weekday_indexed& wdi); - -// 25.8.8, class weekday_last // C++20 -class weekday_last; - -constexpr bool operator==(const weekday_last& x, const weekday_last& y) noexcept; -constexpr bool operator!=(const weekday_last& x, const weekday_last& y) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const weekday_last& wdl); - -// 25.8.9, class month_day // C++20 -class month_day; - -constexpr bool operator==(const month_day& x, const month_day& y) noexcept; -constexpr strong_ordering operator<=>(const month_day& x, const month_day& y) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const month_day& md); - -// 25.8.10, class month_day_last // C++20 -class month_day_last; - -constexpr bool operator==(const month_day_last& x, const month_day_last& y) noexcept; -constexpr strong_ordering operator<=>(const month_day_last& x, const month_day_last& y) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const month_day_last& mdl); - -// 25.8.11, class month_weekday // C++20 -class month_weekday; - -constexpr bool operator==(const month_weekday& x, const month_weekday& y) noexcept; -constexpr bool operator!=(const month_weekday& x, const month_weekday& y) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const month_weekday& mwd); - -// 25.8.12, class month_weekday_last // C++20 -class month_weekday_last; - -constexpr bool operator==(const month_weekday_last& x, const month_weekday_last& y) noexcept; -constexpr bool operator!=(const month_weekday_last& x, const month_weekday_last& y) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const month_weekday_last& mwdl); - - -// 25.8.13, class year_month // C++20 -class year_month; - -constexpr bool operator==(const year_month& x, const year_month& y) noexcept; -constexpr strong_ordering operator<=>(const year_month& x, const year_month& y) noexcept; - -constexpr year_month operator+(const year_month& ym, const months& dm) noexcept; -constexpr year_month operator+(const months& dm, const year_month& ym) noexcept; -constexpr year_month operator-(const year_month& ym, const months& dm) noexcept; -constexpr months operator-(const year_month& x, const year_month& y) noexcept; -constexpr year_month operator+(const year_month& ym, const years& dy) noexcept; -constexpr year_month operator+(const years& dy, const year_month& ym) noexcept; -constexpr year_month operator-(const year_month& ym, const years& dy) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const year_month& ym); - -// 25.8.14, class year_month_day class // C++20 -year_month_day; - -constexpr bool operator==(const year_month_day& x, const year_month_day& y) noexcept; -constexpr strong_ordering operator<=>(const year_month_day& x, const year_month_day& y) noexcept; - -constexpr year_month_day operator+(const year_month_day& ymd, const months& dm) noexcept; -constexpr year_month_day operator+(const months& dm, const year_month_day& ymd) noexcept; -constexpr year_month_day operator+(const year_month_day& ymd, const years& dy) noexcept; -constexpr year_month_day operator+(const years& dy, const year_month_day& ymd) noexcept; -constexpr year_month_day operator-(const year_month_day& ymd, const months& dm) noexcept; -constexpr year_month_day operator-(const year_month_day& ymd, const years& dy) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const year_month_day& ymd); - -// 25.8.15, class year_month_day_last // C++20 -class year_month_day_last; - -constexpr bool operator==(const year_month_day_last& x, const year_month_day_last& y) noexcept; -constexpr strong_ordering operator<=>(const year_month_day_last_day& x, const year_month_day_last_day& y) noexcept; - -constexpr year_month_day_last - operator+(const year_month_day_last& ymdl, const months& dm) noexcept; -constexpr year_month_day_last - operator+(const months& dm, const year_month_day_last& ymdl) noexcept; -constexpr year_month_day_last - operator+(const year_month_day_last& ymdl, const years& dy) noexcept; -constexpr year_month_day_last - operator+(const years& dy, const year_month_day_last& ymdl) noexcept; -constexpr year_month_day_last - operator-(const year_month_day_last& ymdl, const months& dm) noexcept; -constexpr year_month_day_last - operator-(const year_month_day_last& ymdl, const years& dy) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const year_month_day_last& ymdl); - -// 25.8.16, class year_month_weekday // C++20 -class year_month_weekday; - -constexpr bool operator==(const year_month_weekday& x, - const year_month_weekday& y) noexcept; -constexpr bool operator!=(const year_month_weekday& x, - const year_month_weekday& y) noexcept; - -constexpr year_month_weekday - operator+(const year_month_weekday& ymwd, const months& dm) noexcept; -constexpr year_month_weekday - operator+(const months& dm, const year_month_weekday& ymwd) noexcept; -constexpr year_month_weekday - operator+(const year_month_weekday& ymwd, const years& dy) noexcept; -constexpr year_month_weekday - operator+(const years& dy, const year_month_weekday& ymwd) noexcept; -constexpr year_month_weekday - operator-(const year_month_weekday& ymwd, const months& dm) noexcept; -constexpr year_month_weekday - operator-(const year_month_weekday& ymwd, const years& dy) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const year_month_weekday& ymwd); - -// 25.8.17, class year_month_weekday_last // C++20 -class year_month_weekday_last; - -constexpr bool operator==(const year_month_weekday_last& x, - const year_month_weekday_last& y) noexcept; -constexpr bool operator!=(const year_month_weekday_last& x, - const year_month_weekday_last& y) noexcept; -constexpr year_month_weekday_last - operator+(const year_month_weekday_last& ymwdl, const months& dm) noexcept; -constexpr year_month_weekday_last - operator+(const months& dm, const year_month_weekday_last& ymwdl) noexcept; -constexpr year_month_weekday_last - operator+(const year_month_weekday_last& ymwdl, const years& dy) noexcept; -constexpr year_month_weekday_last - operator+(const years& dy, const year_month_weekday_last& ymwdl) noexcept; -constexpr year_month_weekday_last - operator-(const year_month_weekday_last& ymwdl, const months& dm) noexcept; -constexpr year_month_weekday_last - operator-(const year_month_weekday_last& ymwdl, const years& dy) noexcept; - -template - basic_ostream& - operator<<(basic_ostream& os, const year_month_weekday_last& ymwdl); - -// 25.8.18, civil calendar conventional syntax operators // C++20 -constexpr year_month - operator/(const year& y, const month& m) noexcept; -constexpr year_month - operator/(const year& y, int m) noexcept; -constexpr month_day - operator/(const month& m, const day& d) noexcept; -constexpr month_day - operator/(const month& m, int d) noexcept; -constexpr month_day - operator/(int m, const day& d) noexcept; -constexpr month_day - operator/(const day& d, const month& m) noexcept; -constexpr month_day - operator/(const day& d, int m) noexcept; -constexpr month_day_last - operator/(const month& m, last_spec) noexcept; -constexpr month_day_last - operator/(int m, last_spec) noexcept; -constexpr month_day_last - operator/(last_spec, const month& m) noexcept; -constexpr month_day_last - operator/(last_spec, int m) noexcept; -constexpr month_weekday - operator/(const month& m, const weekday_indexed& wdi) noexcept; -constexpr month_weekday - operator/(int m, const weekday_indexed& wdi) noexcept; -constexpr month_weekday - operator/(const weekday_indexed& wdi, const month& m) noexcept; -constexpr month_weekday - operator/(const weekday_indexed& wdi, int m) noexcept; -constexpr month_weekday_last - operator/(const month& m, const weekday_last& wdl) noexcept; -constexpr month_weekday_last - operator/(int m, const weekday_last& wdl) noexcept; -constexpr month_weekday_last - operator/(const weekday_last& wdl, const month& m) noexcept; -constexpr month_weekday_last - operator/(const weekday_last& wdl, int m) noexcept; -constexpr year_month_day - operator/(const year_month& ym, const day& d) noexcept; -constexpr year_month_day - operator/(const year_month& ym, int d) noexcept; -constexpr year_month_day - operator/(const year& y, const month_day& md) noexcept; -constexpr year_month_day - operator/(int y, const month_day& md) noexcept; -constexpr year_month_day - operator/(const month_day& md, const year& y) noexcept; -constexpr year_month_day - operator/(const month_day& md, int y) noexcept; -constexpr year_month_day_last - operator/(const year_month& ym, last_spec) noexcept; -constexpr year_month_day_last - operator/(const year& y, const month_day_last& mdl) noexcept; -constexpr year_month_day_last - operator/(int y, const month_day_last& mdl) noexcept; -constexpr year_month_day_last - operator/(const month_day_last& mdl, const year& y) noexcept; -constexpr year_month_day_last - operator/(const month_day_last& mdl, int y) noexcept; -constexpr year_month_weekday - operator/(const year_month& ym, const weekday_indexed& wdi) noexcept; -constexpr year_month_weekday - operator/(const year& y, const month_weekday& mwd) noexcept; -constexpr year_month_weekday - operator/(int y, const month_weekday& mwd) noexcept; -constexpr year_month_weekday - operator/(const month_weekday& mwd, const year& y) noexcept; -constexpr year_month_weekday - operator/(const month_weekday& mwd, int y) noexcept; -constexpr year_month_weekday_last - operator/(const year_month& ym, const weekday_last& wdl) noexcept; -constexpr year_month_weekday_last - operator/(const year& y, const month_weekday_last& mwdl) noexcept; -constexpr year_month_weekday_last - operator/(int y, const month_weekday_last& mwdl) noexcept; -constexpr year_month_weekday_last - operator/(const month_weekday_last& mwdl, const year& y) noexcept; -constexpr year_month_weekday_last - operator/(const month_weekday_last& mwdl, int y) noexcept; - -// 26.9, class template hh_mm_ss -template -class hh_mm_ss -{ - bool is_neg; // exposition only - chrono::hours h; // exposition only - chrono::minutes m; // exposition only - chrono::seconds s; // exposition only - precision ss; // exposition only - -public: - static unsigned constexpr fractional_width = see below; - using precision = see below; - - constexpr hh_mm_ss() noexcept : hh_mm_ss{Duration::zero()} {} - constexpr explicit hh_mm_ss(Duration d) noexcept; - - constexpr bool is_negative() const noexcept; - constexpr chrono::hours hours() const noexcept; - constexpr chrono::minutes minutes() const noexcept; - constexpr chrono::seconds seconds() const noexcept; - constexpr precision subseconds() const noexcept; - - constexpr explicit operator precision() const noexcept; - constexpr precision to_duration() const noexcept; -}; - -template - basic_ostream& - operator<<(basic_ostream& os, const hh_mm_ss& hms); // C++20 - -// 26.10, 12/24 hour functions -constexpr bool is_am(hours const& h) noexcept; -constexpr bool is_pm(hours const& h) noexcept; -constexpr hours make12(const hours& h) noexcept; -constexpr hours make24(const hours& h, bool is_pm) noexcept; - -// 25.10.5, class time_zone // C++20 -enum class choose {earliest, latest}; -class time_zone; -bool operator==(const time_zone& x, const time_zone& y) noexcept; -bool operator!=(const time_zone& x, const time_zone& y) noexcept; -bool operator<(const time_zone& x, const time_zone& y) noexcept; -bool operator>(const time_zone& x, const time_zone& y) noexcept; -bool operator<=(const time_zone& x, const time_zone& y) noexcept; -bool operator>=(const time_zone& x, const time_zone& y) noexcept; -} // chrono - -namespace std { - template - struct formatter, charT>; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template struct formatter; // C++20 - template - struct formatter>, charT>; // C++20 -} // namespace std - -namespace chrono { -// calendrical constants -inline constexpr last_spec last{}; // C++20 -inline constexpr chrono::weekday Sunday{0}; // C++20 -inline constexpr chrono::weekday Monday{1}; // C++20 -inline constexpr chrono::weekday Tuesday{2}; // C++20 -inline constexpr chrono::weekday Wednesday{3}; // C++20 -inline constexpr chrono::weekday Thursday{4}; // C++20 -inline constexpr chrono::weekday Friday{5}; // C++20 -inline constexpr chrono::weekday Saturday{6}; // C++20 - -inline constexpr chrono::month January{1}; // C++20 -inline constexpr chrono::month February{2}; // C++20 -inline constexpr chrono::month March{3}; // C++20 -inline constexpr chrono::month April{4}; // C++20 -inline constexpr chrono::month May{5}; // C++20 -inline constexpr chrono::month June{6}; // C++20 -inline constexpr chrono::month July{7}; // C++20 -inline constexpr chrono::month August{8}; // C++20 -inline constexpr chrono::month September{9}; // C++20 -inline constexpr chrono::month October{10}; // C++20 -inline constexpr chrono::month November{11}; // C++20 -inline constexpr chrono::month December{12}; // C++20 -} // chrono - -inline namespace literals { - inline namespace chrono_literals { -constexpr chrono::hours operator ""h(unsigned long long); // C++14 -constexpr chrono::duration> operator ""h(long double); // C++14 -constexpr chrono::minutes operator ""min(unsigned long long); // C++14 -constexpr chrono::duration> operator ""min(long double); // C++14 -constexpr chrono::seconds operator ""s(unsigned long long); // C++14 -constexpr chrono::duration operator ""s(long double); // C++14 -constexpr chrono::milliseconds operator ""ms(unsigned long long); // C++14 -constexpr chrono::duration operator ""ms(long double); // C++14 -constexpr chrono::microseconds operator ""us(unsigned long long); // C++14 -constexpr chrono::duration operator ""us(long double); // C++14 -constexpr chrono::nanoseconds operator ""ns(unsigned long long); // C++14 -constexpr chrono::duration operator ""ns(long double); // C++14 -constexpr chrono::day operator ""d(unsigned long long d) noexcept; // C++20 -constexpr chrono::year operator ""y(unsigned long long y) noexcept; // C++20 -} // chrono_literals -} // literals - -} // std -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__chrono/calendar.h> #include <__chrono/convert_to_timespec.h> diff --git a/libcxx/include/cinttypes b/libcxx/include/cinttypes --- a/libcxx/include/cinttypes +++ b/libcxx/include/cinttypes @@ -10,230 +10,6 @@ #ifndef _LIBCPP_CINTTYPES #define _LIBCPP_CINTTYPES -/* - cinttypes synopsis - -This entire header is C99 / C++0X - -#include // includes - -Macros: - - PRId8 - PRId16 - PRId32 - PRId64 - - PRIdLEAST8 - PRIdLEAST16 - PRIdLEAST32 - PRIdLEAST64 - - PRIdFAST8 - PRIdFAST16 - PRIdFAST32 - PRIdFAST64 - - PRIdMAX - PRIdPTR - - PRIi8 - PRIi16 - PRIi32 - PRIi64 - - PRIiLEAST8 - PRIiLEAST16 - PRIiLEAST32 - PRIiLEAST64 - - PRIiFAST8 - PRIiFAST16 - PRIiFAST32 - PRIiFAST64 - - PRIiMAX - PRIiPTR - - PRIo8 - PRIo16 - PRIo32 - PRIo64 - - PRIoLEAST8 - PRIoLEAST16 - PRIoLEAST32 - PRIoLEAST64 - - PRIoFAST8 - PRIoFAST16 - PRIoFAST32 - PRIoFAST64 - - PRIoMAX - PRIoPTR - - PRIu8 - PRIu16 - PRIu32 - PRIu64 - - PRIuLEAST8 - PRIuLEAST16 - PRIuLEAST32 - PRIuLEAST64 - - PRIuFAST8 - PRIuFAST16 - PRIuFAST32 - PRIuFAST64 - - PRIuMAX - PRIuPTR - - PRIx8 - PRIx16 - PRIx32 - PRIx64 - - PRIxLEAST8 - PRIxLEAST16 - PRIxLEAST32 - PRIxLEAST64 - - PRIxFAST8 - PRIxFAST16 - PRIxFAST32 - PRIxFAST64 - - PRIxMAX - PRIxPTR - - PRIX8 - PRIX16 - PRIX32 - PRIX64 - - PRIXLEAST8 - PRIXLEAST16 - PRIXLEAST32 - PRIXLEAST64 - - PRIXFAST8 - PRIXFAST16 - PRIXFAST32 - PRIXFAST64 - - PRIXMAX - PRIXPTR - - SCNd8 - SCNd16 - SCNd32 - SCNd64 - - SCNdLEAST8 - SCNdLEAST16 - SCNdLEAST32 - SCNdLEAST64 - - SCNdFAST8 - SCNdFAST16 - SCNdFAST32 - SCNdFAST64 - - SCNdMAX - SCNdPTR - - SCNi8 - SCNi16 - SCNi32 - SCNi64 - - SCNiLEAST8 - SCNiLEAST16 - SCNiLEAST32 - SCNiLEAST64 - - SCNiFAST8 - SCNiFAST16 - SCNiFAST32 - SCNiFAST64 - - SCNiMAX - SCNiPTR - - SCNo8 - SCNo16 - SCNo32 - SCNo64 - - SCNoLEAST8 - SCNoLEAST16 - SCNoLEAST32 - SCNoLEAST64 - - SCNoFAST8 - SCNoFAST16 - SCNoFAST32 - SCNoFAST64 - - SCNoMAX - SCNoPTR - - SCNu8 - SCNu16 - SCNu32 - SCNu64 - - SCNuLEAST8 - SCNuLEAST16 - SCNuLEAST32 - SCNuLEAST64 - - SCNuFAST8 - SCNuFAST16 - SCNuFAST32 - SCNuFAST64 - - SCNuMAX - SCNuPTR - - SCNx8 - SCNx16 - SCNx32 - SCNx64 - - SCNxLEAST8 - SCNxLEAST16 - SCNxLEAST32 - SCNxLEAST64 - - SCNxFAST8 - SCNxFAST16 - SCNxFAST32 - SCNxFAST64 - - SCNxMAX - SCNxPTR - -namespace std -{ - -Types: - - imaxdiv_t - -intmax_t imaxabs(intmax_t j); -imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); -intmax_t strtoimax(const char* restrict nptr, char** restrict endptr, int base); -uintmax_t strtoumax(const char* restrict nptr, char** restrict endptr, int base); -intmax_t wcstoimax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); -uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); - -} // std -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/ciso646 b/libcxx/include/ciso646 --- a/libcxx/include/ciso646 +++ b/libcxx/include/ciso646 @@ -10,11 +10,6 @@ #ifndef _LIBCPP_CISO646 #define _LIBCPP_CISO646 -/* - ciso646 synopsis - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/climits b/libcxx/include/climits --- a/libcxx/include/climits +++ b/libcxx/include/climits @@ -10,33 +10,6 @@ #ifndef _LIBCPP_CLIMITS #define _LIBCPP_CLIMITS -/* - climits synopsis - -Macros: - - CHAR_BIT - SCHAR_MIN - SCHAR_MAX - UCHAR_MAX - CHAR_MIN - CHAR_MAX - MB_LEN_MAX - SHRT_MIN - SHRT_MAX - USHRT_MAX - INT_MIN - INT_MAX - UINT_MAX - LONG_MIN - LONG_MAX - ULONG_MAX - LLONG_MIN // C99 - LLONG_MAX // C99 - ULLONG_MAX // C99 - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/clocale b/libcxx/include/clocale --- a/libcxx/include/clocale +++ b/libcxx/include/clocale @@ -10,30 +10,6 @@ #ifndef _LIBCPP_CLOCALE #define _LIBCPP_CLOCALE -/* - clocale synopsis - -Macros: - - LC_ALL - LC_COLLATE - LC_CTYPE - LC_MONETARY - LC_NUMERIC - LC_TIME - NULL - -namespace std -{ - -struct lconv; -char* setlocale(int category, const char* locale); -lconv* localeconv(); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cmath b/libcxx/include/cmath --- a/libcxx/include/cmath +++ b/libcxx/include/cmath @@ -10,300 +10,6 @@ #ifndef _LIBCPP_CMATH #define _LIBCPP_CMATH -/* - cmath synopsis - -Macros: - - HUGE_VAL - HUGE_VALF // C99 - HUGE_VALL // C99 - INFINITY // C99 - NAN // C99 - FP_INFINITE // C99 - FP_NAN // C99 - FP_NORMAL // C99 - FP_SUBNORMAL // C99 - FP_ZERO // C99 - FP_FAST_FMA // C99 - FP_FAST_FMAF // C99 - FP_FAST_FMAL // C99 - FP_ILOGB0 // C99 - FP_ILOGBNAN // C99 - MATH_ERRNO // C99 - MATH_ERREXCEPT // C99 - math_errhandling // C99 - -namespace std -{ - -Types: - - float_t // C99 - double_t // C99 - -// C90 - -floating_point abs(floating_point x); - -floating_point acos (arithmetic x); -float acosf(float x); -long double acosl(long double x); - -floating_point asin (arithmetic x); -float asinf(float x); -long double asinl(long double x); - -floating_point atan (arithmetic x); -float atanf(float x); -long double atanl(long double x); - -floating_point atan2 (arithmetic y, arithmetic x); -float atan2f(float y, float x); -long double atan2l(long double y, long double x); - -floating_point ceil (arithmetic x); -float ceilf(float x); -long double ceill(long double x); - -floating_point cos (arithmetic x); -float cosf(float x); -long double cosl(long double x); - -floating_point cosh (arithmetic x); -float coshf(float x); -long double coshl(long double x); - -floating_point exp (arithmetic x); -float expf(float x); -long double expl(long double x); - -floating_point fabs (arithmetic x); -float fabsf(float x); -long double fabsl(long double x); - -floating_point floor (arithmetic x); -float floorf(float x); -long double floorl(long double x); - -floating_point fmod (arithmetic x, arithmetic y); -float fmodf(float x, float y); -long double fmodl(long double x, long double y); - -floating_point frexp (arithmetic value, int* exp); -float frexpf(float value, int* exp); -long double frexpl(long double value, int* exp); - -floating_point ldexp (arithmetic value, int exp); -float ldexpf(float value, int exp); -long double ldexpl(long double value, int exp); - -floating_point log (arithmetic x); -float logf(float x); -long double logl(long double x); - -floating_point log10 (arithmetic x); -float log10f(float x); -long double log10l(long double x); - -floating_point modf (floating_point value, floating_point* iptr); -float modff(float value, float* iptr); -long double modfl(long double value, long double* iptr); - -floating_point pow (arithmetic x, arithmetic y); -float powf(float x, float y); -long double powl(long double x, long double y); - -floating_point sin (arithmetic x); -float sinf(float x); -long double sinl(long double x); - -floating_point sinh (arithmetic x); -float sinhf(float x); -long double sinhl(long double x); - -floating_point sqrt (arithmetic x); -float sqrtf(float x); -long double sqrtl(long double x); - -floating_point tan (arithmetic x); -float tanf(float x); -long double tanl(long double x); - -floating_point tanh (arithmetic x); -float tanhf(float x); -long double tanhl(long double x); - -// C99 - -bool signbit(arithmetic x); - -int fpclassify(arithmetic x); - -bool isfinite(arithmetic x); -bool isinf(arithmetic x); -bool isnan(arithmetic x); -bool isnormal(arithmetic x); - -bool isgreater(arithmetic x, arithmetic y); -bool isgreaterequal(arithmetic x, arithmetic y); -bool isless(arithmetic x, arithmetic y); -bool islessequal(arithmetic x, arithmetic y); -bool islessgreater(arithmetic x, arithmetic y); -bool isunordered(arithmetic x, arithmetic y); - -floating_point acosh (arithmetic x); -float acoshf(float x); -long double acoshl(long double x); - -floating_point asinh (arithmetic x); -float asinhf(float x); -long double asinhl(long double x); - -floating_point atanh (arithmetic x); -float atanhf(float x); -long double atanhl(long double x); - -floating_point cbrt (arithmetic x); -float cbrtf(float x); -long double cbrtl(long double x); - -floating_point copysign (arithmetic x, arithmetic y); -float copysignf(float x, float y); -long double copysignl(long double x, long double y); - -floating_point erf (arithmetic x); -float erff(float x); -long double erfl(long double x); - -floating_point erfc (arithmetic x); -float erfcf(float x); -long double erfcl(long double x); - -floating_point exp2 (arithmetic x); -float exp2f(float x); -long double exp2l(long double x); - -floating_point expm1 (arithmetic x); -float expm1f(float x); -long double expm1l(long double x); - -floating_point fdim (arithmetic x, arithmetic y); -float fdimf(float x, float y); -long double fdiml(long double x, long double y); - -floating_point fma (arithmetic x, arithmetic y, arithmetic z); -float fmaf(float x, float y, float z); -long double fmal(long double x, long double y, long double z); - -floating_point fmax (arithmetic x, arithmetic y); -float fmaxf(float x, float y); -long double fmaxl(long double x, long double y); - -floating_point fmin (arithmetic x, arithmetic y); -float fminf(float x, float y); -long double fminl(long double x, long double y); - -floating_point hypot (arithmetic x, arithmetic y); -float hypotf(float x, float y); -long double hypotl(long double x, long double y); - -double hypot(double x, double y, double z); // C++17 -float hypot(float x, float y, float z); // C++17 -long double hypot(long double x, long double y, long double z); // C++17 - -int ilogb (arithmetic x); -int ilogbf(float x); -int ilogbl(long double x); - -floating_point lgamma (arithmetic x); -float lgammaf(float x); -long double lgammal(long double x); - -long long llrint (arithmetic x); -long long llrintf(float x); -long long llrintl(long double x); - -long long llround (arithmetic x); -long long llroundf(float x); -long long llroundl(long double x); - -floating_point log1p (arithmetic x); -float log1pf(float x); -long double log1pl(long double x); - -floating_point log2 (arithmetic x); -float log2f(float x); -long double log2l(long double x); - -floating_point logb (arithmetic x); -float logbf(float x); -long double logbl(long double x); - -long lrint (arithmetic x); -long lrintf(float x); -long lrintl(long double x); - -long lround (arithmetic x); -long lroundf(float x); -long lroundl(long double x); - -double nan (const char* str); -float nanf(const char* str); -long double nanl(const char* str); - -floating_point nearbyint (arithmetic x); -float nearbyintf(float x); -long double nearbyintl(long double x); - -floating_point nextafter (arithmetic x, arithmetic y); -float nextafterf(float x, float y); -long double nextafterl(long double x, long double y); - -floating_point nexttoward (arithmetic x, long double y); -float nexttowardf(float x, long double y); -long double nexttowardl(long double x, long double y); - -floating_point remainder (arithmetic x, arithmetic y); -float remainderf(float x, float y); -long double remainderl(long double x, long double y); - -floating_point remquo (arithmetic x, arithmetic y, int* pquo); -float remquof(float x, float y, int* pquo); -long double remquol(long double x, long double y, int* pquo); - -floating_point rint (arithmetic x); -float rintf(float x); -long double rintl(long double x); - -floating_point round (arithmetic x); -float roundf(float x); -long double roundl(long double x); - -floating_point scalbln (arithmetic x, long ex); -float scalblnf(float x, long ex); -long double scalblnl(long double x, long ex); - -floating_point scalbn (arithmetic x, int ex); -float scalbnf(float x, int ex); -long double scalbnl(long double x, int ex); - -floating_point tgamma (arithmetic x); -float tgammaf(float x); -long double tgammal(long double x); - -floating_point trunc (arithmetic x); -float truncf(float x); -long double truncl(long double x); - -constexpr float lerp(float a, float b, float t) noexcept; // C++20 -constexpr double lerp(double a, double b, double t) noexcept; // C++20 -constexpr long double lerp(long double a, long double b, long double t) noexcept; // C++20 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__type_traits/enable_if.h> diff --git a/libcxx/include/codecvt b/libcxx/include/codecvt --- a/libcxx/include/codecvt +++ b/libcxx/include/codecvt @@ -10,50 +10,6 @@ #ifndef _LIBCPP_CODECVT #define _LIBCPP_CODECVT -/* - codecvt synopsis - -namespace std -{ - -enum codecvt_mode -{ - consume_header = 4, - generate_header = 2, - little_endian = 1 -}; - -template -class codecvt_utf8 - : public codecvt -{ - explicit codecvt_utf8(size_t refs = 0); - ~codecvt_utf8(); -}; - -template -class codecvt_utf16 - : public codecvt -{ - explicit codecvt_utf16(size_t refs = 0); - ~codecvt_utf16(); -}; - -template -class codecvt_utf8_utf16 - : public codecvt -{ - explicit codecvt_utf8_utf16(size_t refs = 0); - ~codecvt_utf8_utf16(); -}; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__locale> diff --git a/libcxx/include/compare b/libcxx/include/compare --- a/libcxx/include/compare +++ b/libcxx/include/compare @@ -10,136 +10,6 @@ #ifndef _LIBCPP_COMPARE #define _LIBCPP_COMPARE -/* - compare synopsis - -namespace std { - // [cmp.categories], comparison category types - class partial_ordering; - class weak_ordering; - class strong_ordering; - - // named comparison functions - constexpr bool is_eq (partial_ordering cmp) noexcept { return cmp == 0; } - constexpr bool is_neq (partial_ordering cmp) noexcept { return cmp != 0; } - constexpr bool is_lt (partial_ordering cmp) noexcept { return cmp < 0; } - constexpr bool is_lteq(partial_ordering cmp) noexcept { return cmp <= 0; } - constexpr bool is_gt (partial_ordering cmp) noexcept { return cmp > 0; } - constexpr bool is_gteq(partial_ordering cmp) noexcept { return cmp >= 0; } - - // [cmp.common], common comparison category type - template - struct common_comparison_category { - using type = see below; - }; - template - using common_comparison_category_t = typename common_comparison_category::type; - - // [cmp.concept], concept three_way_comparable - template - concept three_way_comparable = see below; - template - concept three_way_comparable_with = see below; - - // [cmp.result], result of three-way comparison - template struct compare_three_way_result; - - template - using compare_three_way_result_t = typename compare_three_way_result::type; - - // [comparisons.three.way], class compare_three_way - struct compare_three_way; // C++20 - - // [cmp.alg], comparison algorithms - inline namespace unspecified { - inline constexpr unspecified strong_order = unspecified; - inline constexpr unspecified weak_order = unspecified; - inline constexpr unspecified partial_order = unspecified; - inline constexpr unspecified compare_strong_order_fallback = unspecified; - inline constexpr unspecified compare_weak_order_fallback = unspecified; - inline constexpr unspecified compare_partial_order_fallback = unspecified; - } - - // [cmp.partialord], Class partial_ordering - class partial_ordering { - public: - // valid values - static const partial_ordering less; - static const partial_ordering equivalent; - static const partial_ordering greater; - static const partial_ordering unordered; - - // comparisons - friend constexpr bool operator==(partial_ordering v, unspecified) noexcept; - friend constexpr bool operator==(partial_ordering v, partial_ordering w) noexcept = default; - friend constexpr bool operator< (partial_ordering v, unspecified) noexcept; - friend constexpr bool operator> (partial_ordering v, unspecified) noexcept; - friend constexpr bool operator<=(partial_ordering v, unspecified) noexcept; - friend constexpr bool operator>=(partial_ordering v, unspecified) noexcept; - friend constexpr bool operator< (unspecified, partial_ordering v) noexcept; - friend constexpr bool operator> (unspecified, partial_ordering v) noexcept; - friend constexpr bool operator<=(unspecified, partial_ordering v) noexcept; - friend constexpr bool operator>=(unspecified, partial_ordering v) noexcept; - friend constexpr partial_ordering operator<=>(partial_ordering v, unspecified) noexcept; - friend constexpr partial_ordering operator<=>(unspecified, partial_ordering v) noexcept; - }; - - // [cmp.weakord], Class weak_ordering - class weak_ordering { - public: - // valid values - static const weak_ordering less; - static const weak_ordering equivalent; - static const weak_ordering greater; - - // conversions - constexpr operator partial_ordering() const noexcept; - - // comparisons - friend constexpr bool operator==(weak_ordering v, unspecified) noexcept; - friend constexpr bool operator==(weak_ordering v, weak_ordering w) noexcept = default; - friend constexpr bool operator< (weak_ordering v, unspecified) noexcept; - friend constexpr bool operator> (weak_ordering v, unspecified) noexcept; - friend constexpr bool operator<=(weak_ordering v, unspecified) noexcept; - friend constexpr bool operator>=(weak_ordering v, unspecified) noexcept; - friend constexpr bool operator< (unspecified, weak_ordering v) noexcept; - friend constexpr bool operator> (unspecified, weak_ordering v) noexcept; - friend constexpr bool operator<=(unspecified, weak_ordering v) noexcept; - friend constexpr bool operator>=(unspecified, weak_ordering v) noexcept; - friend constexpr weak_ordering operator<=>(weak_ordering v, unspecified) noexcept; - friend constexpr weak_ordering operator<=>(unspecified, weak_ordering v) noexcept; - }; - - // [cmp.strongord], Class strong_ordering - class strong_ordering { - public: - // valid values - static const strong_ordering less; - static const strong_ordering equal; - static const strong_ordering equivalent; - static const strong_ordering greater; - - // conversions - constexpr operator partial_ordering() const noexcept; - constexpr operator weak_ordering() const noexcept; - - // comparisons - friend constexpr bool operator==(strong_ordering v, unspecified) noexcept; - friend constexpr bool operator==(strong_ordering v, strong_ordering w) noexcept = default; - friend constexpr bool operator< (strong_ordering v, unspecified) noexcept; - friend constexpr bool operator> (strong_ordering v, unspecified) noexcept; - friend constexpr bool operator<=(strong_ordering v, unspecified) noexcept; - friend constexpr bool operator>=(strong_ordering v, unspecified) noexcept; - friend constexpr bool operator< (unspecified, strong_ordering v) noexcept; - friend constexpr bool operator> (unspecified, strong_ordering v) noexcept; - friend constexpr bool operator<=(unspecified, strong_ordering v) noexcept; - friend constexpr bool operator>=(unspecified, strong_ordering v) noexcept; - friend constexpr strong_ordering operator<=>(strong_ordering v, unspecified) noexcept; - friend constexpr strong_ordering operator<=>(unspecified, strong_ordering v) noexcept; - }; -} -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__compare/common_comparison_category.h> #include <__compare/compare_partial_order_fallback.h> diff --git a/libcxx/include/complex b/libcxx/include/complex --- a/libcxx/include/complex +++ b/libcxx/include/complex @@ -10,227 +10,6 @@ #ifndef _LIBCPP_COMPLEX #define _LIBCPP_COMPLEX -/* - complex synopsis - -namespace std -{ - -template -class complex -{ -public: - typedef T value_type; - - complex(const T& re = T(), const T& im = T()); // constexpr in C++14 - complex(const complex&); // constexpr in C++14 - template complex(const complex&); // constexpr in C++14 - - T real() const; // constexpr in C++14 - T imag() const; // constexpr in C++14 - - void real(T); // constexpr in C++20 - void imag(T); // constexpr in C++20 - - complex& operator= (const T&); // constexpr in C++20 - complex& operator+=(const T&); // constexpr in C++20 - complex& operator-=(const T&); // constexpr in C++20 - complex& operator*=(const T&); // constexpr in C++20 - complex& operator/=(const T&); // constexpr in C++20 - - complex& operator=(const complex&); // constexpr in C++20 - template complex& operator= (const complex&); // constexpr in C++20 - template complex& operator+=(const complex&); // constexpr in C++20 - template complex& operator-=(const complex&); // constexpr in C++20 - template complex& operator*=(const complex&); // constexpr in C++20 - template complex& operator/=(const complex&); // constexpr in C++20 -}; - -template<> -class complex -{ -public: - typedef float value_type; - - constexpr complex(float re = 0.0f, float im = 0.0f); - explicit constexpr complex(const complex&); - explicit constexpr complex(const complex&); - - constexpr float real() const; - void real(float); // constexpr in C++20 - constexpr float imag() const; - void imag(float); // constexpr in C++20 - - complex& operator= (float); // constexpr in C++20 - complex& operator+=(float); // constexpr in C++20 - complex& operator-=(float); // constexpr in C++20 - complex& operator*=(float); // constexpr in C++20 - complex& operator/=(float); // constexpr in C++20 - - complex& operator=(const complex&); // constexpr in C++20 - template complex& operator= (const complex&); // constexpr in C++20 - template complex& operator+=(const complex&); // constexpr in C++20 - template complex& operator-=(const complex&); // constexpr in C++20 - template complex& operator*=(const complex&); // constexpr in C++20 - template complex& operator/=(const complex&); // constexpr in C++20 -}; - -template<> -class complex -{ -public: - typedef double value_type; - - constexpr complex(double re = 0.0, double im = 0.0); - constexpr complex(const complex&); - explicit constexpr complex(const complex&); - - constexpr double real() const; - void real(double); // constexpr in C++20 - constexpr double imag() const; - void imag(double); // constexpr in C++20 - - complex& operator= (double); // constexpr in C++20 - complex& operator+=(double); // constexpr in C++20 - complex& operator-=(double); // constexpr in C++20 - complex& operator*=(double); // constexpr in C++20 - complex& operator/=(double); // constexpr in C++20 - complex& operator=(const complex&); // constexpr in C++20 - - template complex& operator= (const complex&); // constexpr in C++20 - template complex& operator+=(const complex&); // constexpr in C++20 - template complex& operator-=(const complex&); // constexpr in C++20 - template complex& operator*=(const complex&); // constexpr in C++20 - template complex& operator/=(const complex&); // constexpr in C++20 -}; - -template<> -class complex -{ -public: - typedef long double value_type; - - constexpr complex(long double re = 0.0L, long double im = 0.0L); - constexpr complex(const complex&); - constexpr complex(const complex&); - - constexpr long double real() const; - void real(long double); // constexpr in C++20 - constexpr long double imag() const; - void imag(long double); // constexpr in C++20 - - complex& operator=(const complex&); // constexpr in C++20 - complex& operator= (long double); // constexpr in C++20 - complex& operator+=(long double); // constexpr in C++20 - complex& operator-=(long double); // constexpr in C++20 - complex& operator*=(long double); // constexpr in C++20 - complex& operator/=(long double); // constexpr in C++20 - - template complex& operator= (const complex&); // constexpr in C++20 - template complex& operator+=(const complex&); // constexpr in C++20 - template complex& operator-=(const complex&); // constexpr in C++20 - template complex& operator*=(const complex&); // constexpr in C++20 - template complex& operator/=(const complex&); // constexpr in C++20 -}; - -// 26.3.6 operators: -template complex operator+(const complex&, const complex&); // constexpr in C++20 -template complex operator+(const complex&, const T&); // constexpr in C++20 -template complex operator+(const T&, const complex&); // constexpr in C++20 -template complex operator-(const complex&, const complex&); // constexpr in C++20 -template complex operator-(const complex&, const T&); // constexpr in C++20 -template complex operator-(const T&, const complex&); // constexpr in C++20 -template complex operator*(const complex&, const complex&); // constexpr in C++20 -template complex operator*(const complex&, const T&); // constexpr in C++20 -template complex operator*(const T&, const complex&); // constexpr in C++20 -template complex operator/(const complex&, const complex&); // constexpr in C++20 -template complex operator/(const complex&, const T&); // constexpr in C++20 -template complex operator/(const T&, const complex&); // constexpr in C++20 -template complex operator+(const complex&); // constexpr in C++20 -template complex operator-(const complex&); // constexpr in C++20 -template bool operator==(const complex&, const complex&); // constexpr in C++14 -template bool operator==(const complex&, const T&); // constexpr in C++14 -template bool operator==(const T&, const complex&); // constexpr in C++14 -template bool operator!=(const complex&, const complex&); // constexpr in C++14 -template bool operator!=(const complex&, const T&); // constexpr in C++14 -template bool operator!=(const T&, const complex&); // constexpr in C++14 - -template - basic_istream& - operator>>(basic_istream&, complex&); -template - basic_ostream& - operator<<(basic_ostream&, const complex&); - -// 26.3.7 values: - -template T real(const complex&); // constexpr in C++14 - long double real(long double); // constexpr in C++14 - double real(double); // constexpr in C++14 -template double real(T); // constexpr in C++14 - float real(float); // constexpr in C++14 - -template T imag(const complex&); // constexpr in C++14 - long double imag(long double); // constexpr in C++14 - double imag(double); // constexpr in C++14 -template double imag(T); // constexpr in C++14 - float imag(float); // constexpr in C++14 - -template T abs(const complex&); - -template T arg(const complex&); - long double arg(long double); - double arg(double); -template double arg(T); - float arg(float); - -template T norm(const complex&); // constexpr in C++20 - long double norm(long double); // constexpr in C++20 - double norm(double); // constexpr in C++20 -template double norm(T); // constexpr in C++20 - float norm(float); // constexpr in C++20 - -template complex conj(const complex&); // constexpr in C++20 - complex conj(long double); // constexpr in C++20 - complex conj(double); // constexpr in C++20 -template complex conj(T); // constexpr in C++20 - complex conj(float); // constexpr in C++20 - -template complex proj(const complex&); - complex proj(long double); - complex proj(double); -template complex proj(T); - complex proj(float); - -template complex polar(const T&, const T& = T()); - -// 26.3.8 transcendentals: -template complex acos(const complex&); -template complex asin(const complex&); -template complex atan(const complex&); -template complex acosh(const complex&); -template complex asinh(const complex&); -template complex atanh(const complex&); -template complex cos (const complex&); -template complex cosh (const complex&); -template complex exp (const complex&); -template complex log (const complex&); -template complex log10(const complex&); - -template complex pow(const complex&, const T&); -template complex pow(const complex&, const complex&); -template complex pow(const T&, const complex&); - -template complex sin (const complex&); -template complex sinh (const complex&); -template complex sqrt (const complex&); -template complex tan (const complex&); -template complex tanh (const complex&); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include diff --git a/libcxx/include/complex.h b/libcxx/include/complex.h --- a/libcxx/include/complex.h +++ b/libcxx/include/complex.h @@ -10,13 +10,6 @@ #ifndef _LIBCPP_COMPLEX_H #define _LIBCPP_COMPLEX_H -/* - complex.h synopsis - -#include - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/concepts b/libcxx/include/concepts --- a/libcxx/include/concepts +++ b/libcxx/include/concepts @@ -10,125 +10,6 @@ #ifndef _LIBCPP_CONCEPTS #define _LIBCPP_CONCEPTS -/* - concepts synopsis -namespace std { - // [concepts.lang], language-related concepts - // [concept.same], concept same_as - template - concept same_as = see below; - - // [concept.derived], concept derived_from - template - concept derived_from = see below; - - // [concept.convertible], concept convertible_to - template - concept convertible_to = see below; - - // [concept.commonref], concept common_reference_with - template - concept common_reference_with = see below; - - // [concept.common], concept common_with - template - concept common_with = see below; - - // [concepts.arithmetic], arithmetic concepts - template - concept integral = see below; - template - concept signed_integral = see below; - template - concept unsigned_integral = see below; - template - concept floating_point = see below; - - // [concept.assignable], concept assignable_from - template - concept assignable_from = see below; - - // [concept.swappable], concept swappable - namespace ranges { - inline namespace unspecified { - inline constexpr unspecified swap = unspecified; - } - } - template - concept swappable = see below; - template - concept swappable_with = see below; - - // [concept.destructible], concept destructible - template - concept destructible = see below; - - // [concept.constructible], concept constructible_from - template - concept constructible_from = see below; - - // [concept.default.init], concept default_initializable - template - concept default_initializable = see below; - - // [concept.moveconstructible], concept move_constructible - template - concept move_constructible = see below; - - // [concept.copyconstructible], concept copy_constructible - template - concept copy_constructible = see below; - - // [concept.equalitycomparable], concept equality_comparable - template - concept equality_comparable = see below; - template - concept equality_comparable_with = see below; - - // [concept.totallyordered], concept totally_ordered - template - concept totally_ordered = see below; - template - concept totally_ordered_with = see below; - - // [concepts.object], object concepts - template - concept movable = see below; - template - concept copyable = see below; - template - concept semiregular = see below; - template - concept regular = see below; - - // [concepts.callable], callable concepts - // [concept.invocable], concept invocable - template - concept invocable = see below; - - // [concept.regularinvocable], concept regular_invocable - template - concept regular_invocable = see below; - - // [concept.predicate], concept predicate - template - concept predicate = see below; - - // [concept.relation], concept relation - template - concept relation = see below; - - // [concept.equiv], concept equivalence_relation - template - concept equivalence_relation = see below; - - // [concept.strictweakorder], concept strict_weak_order - template - concept strict_weak_order = see below; -} - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__concepts/arithmetic.h> #include <__concepts/assignable.h> diff --git a/libcxx/include/condition_variable b/libcxx/include/condition_variable --- a/libcxx/include/condition_variable +++ b/libcxx/include/condition_variable @@ -10,102 +10,6 @@ #ifndef _LIBCPP_CONDITION_VARIABLE #define _LIBCPP_CONDITION_VARIABLE -/* - condition_variable synopsis - -namespace std -{ - -enum class cv_status { no_timeout, timeout }; - -class condition_variable -{ -public: - condition_variable(); - ~condition_variable(); - - condition_variable(const condition_variable&) = delete; - condition_variable& operator=(const condition_variable&) = delete; - - void notify_one() noexcept; - void notify_all() noexcept; - - void wait(unique_lock& lock); - template - void wait(unique_lock& lock, Predicate pred); - - template - cv_status - wait_until(unique_lock& lock, - const chrono::time_point& abs_time); - - template - bool - wait_until(unique_lock& lock, - const chrono::time_point& abs_time, - Predicate pred); - - template - cv_status - wait_for(unique_lock& lock, - const chrono::duration& rel_time); - - template - bool - wait_for(unique_lock& lock, - const chrono::duration& rel_time, - Predicate pred); - - typedef pthread_cond_t* native_handle_type; - native_handle_type native_handle(); -}; - -void notify_all_at_thread_exit(condition_variable& cond, unique_lock lk); - -class condition_variable_any -{ -public: - condition_variable_any(); - ~condition_variable_any(); - - condition_variable_any(const condition_variable_any&) = delete; - condition_variable_any& operator=(const condition_variable_any&) = delete; - - void notify_one() noexcept; - void notify_all() noexcept; - - template - void wait(Lock& lock); - template - void wait(Lock& lock, Predicate pred); - - template - cv_status - wait_until(Lock& lock, - const chrono::time_point& abs_time); - - template - bool - wait_until(Lock& lock, - const chrono::time_point& abs_time, - Predicate pred); - - template - cv_status - wait_for(Lock& lock, - const chrono::duration& rel_time); - - template - bool - wait_for(Lock& lock, - const chrono::duration& rel_time, - Predicate pred); -}; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__chrono/duration.h> #include <__chrono/steady_clock.h> diff --git a/libcxx/include/coroutine b/libcxx/include/coroutine --- a/libcxx/include/coroutine +++ b/libcxx/include/coroutine @@ -10,34 +10,6 @@ #ifndef _LIBCPP_COROUTINE #define _LIBCPP_COROUTINE -/** - coroutine synopsis - -namespace std { -// [coroutine.traits] -template - struct coroutine_traits; -// [coroutine.handle] -template - struct coroutine_handle; -// [coroutine.handle.compare] -constexpr bool operator==(coroutine_handle<> x, coroutine_handle<> y) noexcept; -constexpr strong_ordering operator<=>(coroutine_handle<> x, coroutine_handle<> y) noexcept; -// [coroutine.handle.hash] -template struct hash; -template struct hash>; -// [coroutine.noop] -struct noop_coroutine_promise; -template<> struct coroutine_handle; -using noop_coroutine_handle = coroutine_handle; -noop_coroutine_handle noop_coroutine() noexcept; -// [coroutine.trivial.awaitables] -struct suspend_never; -struct suspend_always; -} // namespace std - - */ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__coroutine/coroutine_handle.h> diff --git a/libcxx/include/csetjmp b/libcxx/include/csetjmp --- a/libcxx/include/csetjmp +++ b/libcxx/include/csetjmp @@ -10,26 +10,6 @@ #ifndef _LIBCPP_CSETJMP #define _LIBCPP_CSETJMP -/* - csetjmp synopsis - -Macros: - - setjmp - -namespace std -{ - -Types: - - jmp_buf - -void longjmp(jmp_buf env, int val); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/csignal b/libcxx/include/csignal --- a/libcxx/include/csignal +++ b/libcxx/include/csignal @@ -10,35 +10,6 @@ #ifndef _LIBCPP_CSIGNAL #define _LIBCPP_CSIGNAL -/* - csignal synopsis - -Macros: - - SIG_DFL - SIG_ERR - SIG_IGN - SIGABRT - SIGFPE - SIGILL - SIGINT - SIGSEGV - SIGTERM - -namespace std -{ - -Types: - - sig_atomic_t - -void (*signal(int sig, void (*func)(int)))(int); -int raise(int sig); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cstdarg b/libcxx/include/cstdarg --- a/libcxx/include/cstdarg +++ b/libcxx/include/cstdarg @@ -10,27 +10,6 @@ #ifndef _LIBCPP_CSTDARG #define _LIBCPP_CSTDARG -/* - cstdarg synopsis - -Macros: - - type va_arg(va_list ap, type); - void va_copy(va_list dest, va_list src); // C99 - void va_end(va_list ap); - void va_start(va_list ap, parmN); - -namespace std -{ - -Types: - - va_list - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cstdbool b/libcxx/include/cstdbool --- a/libcxx/include/cstdbool +++ b/libcxx/include/cstdbool @@ -10,15 +10,6 @@ #ifndef _LIBCPP_CSTDBOOL #define _LIBCPP_CSTDBOOL -/* - cstdbool synopsis - -Macros: - - __bool_true_false_are_defined - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef --- a/libcxx/include/cstddef +++ b/libcxx/include/cstddef @@ -10,29 +10,6 @@ #ifndef _LIBCPP_CSTDDEF #define _LIBCPP_CSTDDEF -/* - cstddef synopsis - -Macros: - - offsetof(type,member-designator) - NULL - -namespace std -{ - -Types: - - ptrdiff_t - size_t - max_align_t // C++11 - nullptr_t - byte // C++17 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__type_traits/enable_if.h> diff --git a/libcxx/include/cstdint b/libcxx/include/cstdint --- a/libcxx/include/cstdint +++ b/libcxx/include/cstdint @@ -10,136 +10,6 @@ #ifndef _LIBCPP_CSTDINT #define _LIBCPP_CSTDINT -/* - cstdint synopsis - -Macros: - - INT8_MIN - INT16_MIN - INT32_MIN - INT64_MIN - - INT8_MAX - INT16_MAX - INT32_MAX - INT64_MAX - - UINT8_MAX - UINT16_MAX - UINT32_MAX - UINT64_MAX - - INT_LEAST8_MIN - INT_LEAST16_MIN - INT_LEAST32_MIN - INT_LEAST64_MIN - - INT_LEAST8_MAX - INT_LEAST16_MAX - INT_LEAST32_MAX - INT_LEAST64_MAX - - UINT_LEAST8_MAX - UINT_LEAST16_MAX - UINT_LEAST32_MAX - UINT_LEAST64_MAX - - INT_FAST8_MIN - INT_FAST16_MIN - INT_FAST32_MIN - INT_FAST64_MIN - - INT_FAST8_MAX - INT_FAST16_MAX - INT_FAST32_MAX - INT_FAST64_MAX - - UINT_FAST8_MAX - UINT_FAST16_MAX - UINT_FAST32_MAX - UINT_FAST64_MAX - - INTPTR_MIN - INTPTR_MAX - UINTPTR_MAX - - INTMAX_MIN - INTMAX_MAX - - UINTMAX_MAX - - PTRDIFF_MIN - PTRDIFF_MAX - - SIG_ATOMIC_MIN - SIG_ATOMIC_MAX - - SIZE_MAX - - WCHAR_MIN - WCHAR_MAX - - WINT_MIN - WINT_MAX - - INT8_C(value) - INT16_C(value) - INT32_C(value) - INT64_C(value) - - UINT8_C(value) - UINT16_C(value) - UINT32_C(value) - UINT64_C(value) - - INTMAX_C(value) - UINTMAX_C(value) - -namespace std -{ - -Types: - - int8_t - int16_t - int32_t - int64_t - - uint8_t - uint16_t - uint32_t - uint64_t - - int_least8_t - int_least16_t - int_least32_t - int_least64_t - - uint_least8_t - uint_least16_t - uint_least32_t - uint_least64_t - - int_fast8_t - int_fast16_t - int_fast32_t - int_fast64_t - - uint_fast8_t - uint_fast16_t - uint_fast32_t - uint_fast64_t - - intptr_t - uintptr_t - - intmax_t - uintmax_t - -} // std -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cstdio b/libcxx/include/cstdio --- a/libcxx/include/cstdio +++ b/libcxx/include/cstdio @@ -10,91 +10,6 @@ #ifndef _LIBCPP_CSTDIO #define _LIBCPP_CSTDIO -/* - cstdio synopsis - -Macros: - - BUFSIZ - EOF - FILENAME_MAX - FOPEN_MAX - L_tmpnam - NULL - SEEK_CUR - SEEK_END - SEEK_SET - TMP_MAX - _IOFBF - _IOLBF - _IONBF - stderr - stdin - stdout - -namespace std -{ - -Types: - -FILE -fpos_t -size_t - -int remove(const char* filename); -int rename(const char* old, const char* new); -FILE* tmpfile(void); -char* tmpnam(char* s); -int fclose(FILE* stream); -int fflush(FILE* stream); -FILE* fopen(const char* restrict filename, const char* restrict mode); -FILE* freopen(const char* restrict filename, const char * restrict mode, - FILE * restrict stream); -void setbuf(FILE* restrict stream, char* restrict buf); -int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size); -int fprintf(FILE* restrict stream, const char* restrict format, ...); -int fscanf(FILE* restrict stream, const char * restrict format, ...); -int printf(const char* restrict format, ...); -int scanf(const char* restrict format, ...); -int snprintf(char* restrict s, size_t n, const char* restrict format, ...); // C99 -int sprintf(char* restrict s, const char* restrict format, ...); -int sscanf(const char* restrict s, const char* restrict format, ...); -int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg); -int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg); // C99 -int vprintf(const char* restrict format, va_list arg); -int vscanf(const char* restrict format, va_list arg); // C99 -int vsnprintf(char* restrict s, size_t n, const char* restrict format, // C99 - va_list arg); -int vsprintf(char* restrict s, const char* restrict format, va_list arg); -int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99 -int fgetc(FILE* stream); -char* fgets(char* restrict s, int n, FILE* restrict stream); -int fputc(int c, FILE* stream); -int fputs(const char* restrict s, FILE* restrict stream); -int getc(FILE* stream); -int getchar(void); -char* gets(char* s); // removed in C++14 -int putc(int c, FILE* stream); -int putchar(int c); -int puts(const char* s); -int ungetc(int c, FILE* stream); -size_t fread(void* restrict ptr, size_t size, size_t nmemb, - FILE* restrict stream); -size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb, - FILE* restrict stream); -int fgetpos(FILE* restrict stream, fpos_t* restrict pos); -int fseek(FILE* stream, long offset, int whence); -int fsetpos(FILE*stream, const fpos_t* pos); -long ftell(FILE* stream); -void rewind(FILE* stream); -void clearerr(FILE* stream); -int feof(FILE* stream); -int ferror(FILE* stream); -void perror(const char* s); - -} // std -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib --- a/libcxx/include/cstdlib +++ b/libcxx/include/cstdlib @@ -10,77 +10,6 @@ #ifndef _LIBCPP_CSTDLIB #define _LIBCPP_CSTDLIB -/* - cstdlib synopsis - -Macros: - - EXIT_FAILURE - EXIT_SUCCESS - MB_CUR_MAX - NULL - RAND_MAX - -namespace std -{ - -Types: - - size_t - div_t - ldiv_t - lldiv_t // C99 - -double atof (const char* nptr); -int atoi (const char* nptr); -long atol (const char* nptr); -long long atoll(const char* nptr); // C99 -double strtod (const char* restrict nptr, char** restrict endptr); -float strtof (const char* restrict nptr, char** restrict endptr); // C99 -long double strtold (const char* restrict nptr, char** restrict endptr); // C99 -long strtol (const char* restrict nptr, char** restrict endptr, int base); -long long strtoll (const char* restrict nptr, char** restrict endptr, int base); // C99 -unsigned long strtoul (const char* restrict nptr, char** restrict endptr, int base); -unsigned long long strtoull(const char* restrict nptr, char** restrict endptr, int base); // C99 -int rand(void); -void srand(unsigned int seed); -void* calloc(size_t nmemb, size_t size); -void free(void* ptr); -void* malloc(size_t size); -void* realloc(void* ptr, size_t size); -void abort(void); -int atexit(void (*func)(void)); -void exit(int status); -void _Exit(int status); -char* getenv(const char* name); -int system(const char* string); -void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); -void qsort(void* base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); -int abs( int j); -long abs( long j); -long long abs(long long j); // C++0X -long labs( long j); -long long llabs(long long j); // C99 -div_t div( int numer, int denom); -ldiv_t div( long numer, long denom); -lldiv_t div(long long numer, long long denom); // C++0X -ldiv_t ldiv( long numer, long denom); -lldiv_t lldiv(long long numer, long long denom); // C99 -int mblen(const char* s, size_t n); -int mbtowc(wchar_t* restrict pwc, const char* restrict s, size_t n); -int wctomb(char* s, wchar_t wchar); -size_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n); -size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n); -int at_quick_exit(void (*func)(void)) // C++11 -void quick_exit(int status); // C++11 -void *aligned_alloc(size_t alignment, size_t size); // C11 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cstring b/libcxx/include/cstring --- a/libcxx/include/cstring +++ b/libcxx/include/cstring @@ -10,52 +10,6 @@ #ifndef _LIBCPP_CSTRING #define _LIBCPP_CSTRING -/* - cstring synopsis - -Macros: - - NULL - -namespace std -{ - -Types: - - size_t - -void* memcpy(void* restrict s1, const void* restrict s2, size_t n); -void* memmove(void* s1, const void* s2, size_t n); -char* strcpy (char* restrict s1, const char* restrict s2); -char* strncpy(char* restrict s1, const char* restrict s2, size_t n); -char* strcat (char* restrict s1, const char* restrict s2); -char* strncat(char* restrict s1, const char* restrict s2, size_t n); -int memcmp(const void* s1, const void* s2, size_t n); -int strcmp (const char* s1, const char* s2); -int strncmp(const char* s1, const char* s2, size_t n); -int strcoll(const char* s1, const char* s2); -size_t strxfrm(char* restrict s1, const char* restrict s2, size_t n); -const void* memchr(const void* s, int c, size_t n); - void* memchr( void* s, int c, size_t n); -const char* strchr(const char* s, int c); - char* strchr( char* s, int c); -size_t strcspn(const char* s1, const char* s2); -const char* strpbrk(const char* s1, const char* s2); - char* strpbrk( char* s1, const char* s2); -const char* strrchr(const char* s, int c); - char* strrchr( char* s, int c); -size_t strspn(const char* s1, const char* s2); -const char* strstr(const char* s1, const char* s2); - char* strstr( char* s1, const char* s2); -char* strtok(char* restrict s1, const char* restrict s2); -void* memset(void* s, int c, size_t n); -char* strerror(int errnum); -size_t strlen(const char* s); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__type_traits/is_constant_evaluated.h> diff --git a/libcxx/include/ctgmath b/libcxx/include/ctgmath --- a/libcxx/include/ctgmath +++ b/libcxx/include/ctgmath @@ -10,14 +10,6 @@ #ifndef _LIBCPP_CTGMATH #define _LIBCPP_CTGMATH -/* - ctgmath synopsis - -#include -#include - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include #include diff --git a/libcxx/include/ctime b/libcxx/include/ctime --- a/libcxx/include/ctime +++ b/libcxx/include/ctime @@ -10,41 +10,6 @@ #ifndef _LIBCPP_CTIME #define _LIBCPP_CTIME -/* - ctime synopsis - -Macros: - - NULL - CLOCKS_PER_SEC - TIME_UTC // C++17 - -namespace std -{ - -Types: - - clock_t - size_t - time_t - tm - timespec // C++17 - -clock_t clock(); -double difftime(time_t time1, time_t time0); -time_t mktime(tm* timeptr); -time_t time(time_t* timer); -char* asctime(const tm* timeptr); -char* ctime(const time_t* timer); -tm* gmtime(const time_t* timer); -tm* localtime(const time_t* timer); -size_t strftime(char* restrict s, size_t maxsize, const char* restrict format, - const tm* restrict timeptr); -int timespec_get( struct timespec *ts, int base); // C++17 -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/ctype.h b/libcxx/include/ctype.h --- a/libcxx/include/ctype.h +++ b/libcxx/include/ctype.h @@ -10,25 +10,6 @@ #ifndef _LIBCPP_CTYPE_H #define _LIBCPP_CTYPE_H -/* - ctype.h synopsis - -int isalnum(int c); -int isalpha(int c); -int isblank(int c); // C99 -int iscntrl(int c); -int isdigit(int c); -int isgraph(int c); -int islower(int c); -int isprint(int c); -int ispunct(int c); -int isspace(int c); -int isupper(int c); -int isxdigit(int c); -int tolower(int c); -int toupper(int c); -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/cuchar b/libcxx/include/cuchar --- a/libcxx/include/cuchar +++ b/libcxx/include/cuchar @@ -10,32 +10,6 @@ #ifndef _LIBCPP_CUCHAR #define _LIBCPP_CUCHAR -/* - cuchar synopsis // since C++11 - -Macros: - - __STDC_UTF_16__ - __STDC_UTF_32__ - -namespace std { - -Types: - - mbstate_t - size_t - -size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps); // since C++20 -size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps); // since C++20 -size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps); -size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps); -size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps); -size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/cwchar b/libcxx/include/cwchar --- a/libcxx/include/cwchar +++ b/libcxx/include/cwchar @@ -10,98 +10,6 @@ #ifndef _LIBCPP_CWCHAR #define _LIBCPP_CWCHAR -/* - cwchar synopsis - -Macros: - - NULL - WCHAR_MAX - WCHAR_MIN - WEOF - -namespace std -{ - -Types: - - mbstate_t - size_t - tm - wint_t - -int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...); -int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...); -int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...); -int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...); -int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); -int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); // C99 -int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg); -int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); // C99 -int vwprintf(const wchar_t* restrict format, va_list arg); -int vwscanf(const wchar_t* restrict format, va_list arg); // C99 -int wprintf(const wchar_t* restrict format, ...); -int wscanf(const wchar_t* restrict format, ...); -wint_t fgetwc(FILE* stream); -wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream); -wint_t fputwc(wchar_t c, FILE* stream); -int fputws(const wchar_t* restrict s, FILE* restrict stream); -int fwide(FILE* stream, int mode); -wint_t getwc(FILE* stream); -wint_t getwchar(); -wint_t putwc(wchar_t c, FILE* stream); -wint_t putwchar(wchar_t c); -wint_t ungetwc(wint_t c, FILE* stream); -double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr); -float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 -long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 -long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); -long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 -unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); -unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 -wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2); -wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2); -wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -int wcscmp(const wchar_t* s1, const wchar_t* s2); -int wcscoll(const wchar_t* s1, const wchar_t* s2); -int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); -size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -const wchar_t* wcschr(const wchar_t* s, wchar_t c); - wchar_t* wcschr( wchar_t* s, wchar_t c); -size_t wcscspn(const wchar_t* s1, const wchar_t* s2); -size_t wcslen(const wchar_t* s); -const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); - wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2); -const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); - wchar_t* wcsrchr( wchar_t* s, wchar_t c); -size_t wcsspn(const wchar_t* s1, const wchar_t* s2); -const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); - wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2); -wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr); -const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); - wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n); -int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); -wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); -size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, - const tm* restrict timeptr); -wint_t btowc(int c); -int wctob(wint_t c); -int mbsinit(const mbstate_t* ps); -size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps); -size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps); -size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps); -size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, - mbstate_t* restrict ps); -size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, - mbstate_t* restrict ps); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__type_traits/is_constant_evaluated.h> diff --git a/libcxx/include/cwctype b/libcxx/include/cwctype --- a/libcxx/include/cwctype +++ b/libcxx/include/cwctype @@ -10,45 +10,6 @@ #ifndef _LIBCPP_CWCTYPE #define _LIBCPP_CWCTYPE -/* - cwctype synopsis - -Macros: - - WEOF - -namespace std -{ - -Types: - - wint_t - wctrans_t - wctype_t - -int iswalnum(wint_t wc); -int iswalpha(wint_t wc); -int iswblank(wint_t wc); // C99 -int iswcntrl(wint_t wc); -int iswdigit(wint_t wc); -int iswgraph(wint_t wc); -int iswlower(wint_t wc); -int iswprint(wint_t wc); -int iswpunct(wint_t wc); -int iswspace(wint_t wc); -int iswupper(wint_t wc); -int iswxdigit(wint_t wc); -int iswctype(wint_t wc, wctype_t desc); -wctype_t wctype(const char* property); -wint_t towlower(wint_t wc); -wint_t towupper(wint_t wc); -wint_t towctrans(wint_t wc, wctrans_t desc); -wctrans_t wctrans(const char* property); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include diff --git a/libcxx/include/deque b/libcxx/include/deque --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -10,159 +10,6 @@ #ifndef _LIBCPP_DEQUE #define _LIBCPP_DEQUE -/* - deque synopsis - -namespace std -{ - -template > -class deque -{ -public: - // types: - typedef T value_type; - typedef Allocator allocator_type; - - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef typename allocator_type::size_type size_type; - typedef typename allocator_type::difference_type difference_type; - - typedef typename allocator_type::pointer pointer; - typedef typename allocator_type::const_pointer const_pointer; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - - // construct/copy/destroy: - deque() noexcept(is_nothrow_default_constructible::value); - explicit deque(const allocator_type& a); - explicit deque(size_type n); - explicit deque(size_type n, const allocator_type& a); // C++14 - deque(size_type n, const value_type& v); - deque(size_type n, const value_type& v, const allocator_type& a); - template - deque(InputIterator f, InputIterator l); - template - deque(InputIterator f, InputIterator l, const allocator_type& a); - deque(const deque& c); - deque(deque&& c) - noexcept(is_nothrow_move_constructible::value); - deque(initializer_list il, const Allocator& a = allocator_type()); - deque(const deque& c, const allocator_type& a); - deque(deque&& c, const allocator_type& a); - ~deque(); - - deque& operator=(const deque& c); - deque& operator=(deque&& c) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value); - deque& operator=(initializer_list il); - - template - void assign(InputIterator f, InputIterator l); - void assign(size_type n, const value_type& v); - void assign(initializer_list il); - - allocator_type get_allocator() const noexcept; - - // iterators: - - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - - reverse_iterator rbegin() noexcept; - const_reverse_iterator rbegin() const noexcept; - reverse_iterator rend() noexcept; - const_reverse_iterator rend() const noexcept; - - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - // capacity: - size_type size() const noexcept; - size_type max_size() const noexcept; - void resize(size_type n); - void resize(size_type n, const value_type& v); - void shrink_to_fit(); - bool empty() const noexcept; - - // element access: - reference operator[](size_type i); - const_reference operator[](size_type i) const; - reference at(size_type i); - const_reference at(size_type i) const; - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - - // modifiers: - void push_front(const value_type& v); - void push_front(value_type&& v); - void push_back(const value_type& v); - void push_back(value_type&& v); - template reference emplace_front(Args&&... args); // reference in C++17 - template reference emplace_back(Args&&... args); // reference in C++17 - template iterator emplace(const_iterator p, Args&&... args); - iterator insert(const_iterator p, const value_type& v); - iterator insert(const_iterator p, value_type&& v); - iterator insert(const_iterator p, size_type n, const value_type& v); - template - iterator insert(const_iterator p, InputIterator f, InputIterator l); - iterator insert(const_iterator p, initializer_list il); - void pop_front(); - void pop_back(); - iterator erase(const_iterator p); - iterator erase(const_iterator f, const_iterator l); - void swap(deque& c) - noexcept(allocator_traits::is_always_equal::value); // C++17 - void clear() noexcept; -}; - -template ::value_type>> - deque(InputIterator, InputIterator, Allocator = Allocator()) - -> deque::value_type, Allocator>; // C++17 - -template - bool operator==(const deque& x, const deque& y); -template - bool operator< (const deque& x, const deque& y); // removed in C++20 -template - bool operator!=(const deque& x, const deque& y); // removed in C++20 -template - bool operator> (const deque& x, const deque& y); // removed in C++20 -template - bool operator>=(const deque& x, const deque& y); // removed in C++20 -template - bool operator<=(const deque& x, const deque& y); // removed in C++20 -template - synth-three-way-result operator<=>(const deque& x, - const deque& y); // since C++20 - -// specialized algorithms: -template - void swap(deque& x, deque& y) - noexcept(noexcept(x.swap(y))); - -template - typename deque::size_type - erase(deque& c, const U& value); // C++20 -template - typename deque::size_type - erase_if(deque& c, Predicate pred); // C++20 - -} // std - -*/ - #include <__algorithm/copy.h> #include <__algorithm/copy_backward.h> #include <__algorithm/equal.h> diff --git a/libcxx/include/errno.h b/libcxx/include/errno.h --- a/libcxx/include/errno.h +++ b/libcxx/include/errno.h @@ -10,18 +10,6 @@ #ifndef _LIBCPP_ERRNO_H #define _LIBCPP_ERRNO_H -/* - errno.h synopsis - -Macros: - - EDOM - EILSEQ // C99 - ERANGE - errno - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/exception b/libcxx/include/exception --- a/libcxx/include/exception +++ b/libcxx/include/exception @@ -10,72 +10,6 @@ #ifndef _LIBCPP_EXCEPTION #define _LIBCPP_EXCEPTION -/* - exception synopsis - -namespace std -{ - -class exception -{ -public: - exception() noexcept; - exception(const exception&) noexcept; - exception& operator=(const exception&) noexcept; - virtual ~exception() noexcept; - virtual const char* what() const noexcept; -}; - -class bad_exception - : public exception -{ -public: - bad_exception() noexcept; - bad_exception(const bad_exception&) noexcept; - bad_exception& operator=(const bad_exception&) noexcept; - virtual ~bad_exception() noexcept; - virtual const char* what() const noexcept; -}; - -typedef void (*unexpected_handler)(); -unexpected_handler set_unexpected(unexpected_handler f ) noexcept; -unexpected_handler get_unexpected() noexcept; -[[noreturn]] void unexpected(); - -typedef void (*terminate_handler)(); -terminate_handler set_terminate(terminate_handler f ) noexcept; -terminate_handler get_terminate() noexcept; -[[noreturn]] void terminate() noexcept; - -bool uncaught_exception() noexcept; -int uncaught_exceptions() noexcept; // C++17 - -typedef unspecified exception_ptr; - -exception_ptr current_exception() noexcept; -void rethrow_exception [[noreturn]] (exception_ptr p); -template exception_ptr make_exception_ptr(E e) noexcept; - -class nested_exception -{ -public: - nested_exception() noexcept; - nested_exception(const nested_exception&) noexcept = default; - nested_exception& operator=(const nested_exception&) noexcept = default; - virtual ~nested_exception() = default; - - // access functions - [[noreturn]] void rethrow_nested() const; - exception_ptr nested_ptr() const noexcept; -}; - -template [[noreturn]] void throw_with_nested(T&& t); -template void rethrow_if_nested(const E& e); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__exception/exception.h> diff --git a/libcxx/include/expected b/libcxx/include/expected --- a/libcxx/include/expected +++ b/libcxx/include/expected @@ -10,34 +10,6 @@ #ifndef _LIBCPP_EXPECTED #define _LIBCPP_EXPECTED -/* - Header synopsis - -namespace std { - // [expected.unexpected], class template unexpected - template class unexpected; - - // [expected.bad], class template bad_expected_access - template class bad_expected_access; - - // [expected.bad.void], specialization for void - template<> class bad_expected_access; - - // in-place construction of unexpected values - struct unexpect_t { - explicit unexpect_t() = default; - }; - inline constexpr unexpect_t unexpect{}; - - // [expected.expected], class template expected - template class expected; - - // [expected.void], partial specialization of expected for void types - template requires is_void_v class expected; -} - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__expected/bad_expected_access.h> @@ -51,4 +23,3 @@ #endif #endif // _LIBCPP_EXPECTED - diff --git a/libcxx/include/fenv.h b/libcxx/include/fenv.h --- a/libcxx/include/fenv.h +++ b/libcxx/include/fenv.h @@ -10,46 +10,6 @@ #ifndef _LIBCPP_FENV_H #define _LIBCPP_FENV_H - -/* - fenv.h synopsis - -This entire header is C99 / C++0X - -Macros: - - FE_DIVBYZERO - FE_INEXACT - FE_INVALID - FE_OVERFLOW - FE_UNDERFLOW - FE_ALL_EXCEPT - FE_DOWNWARD - FE_TONEAREST - FE_TOWARDZERO - FE_UPWARD - FE_DFL_ENV - -Types: - - fenv_t - fexcept_t - -int feclearexcept(int excepts); -int fegetexceptflag(fexcept_t* flagp, int excepts); -int feraiseexcept(int excepts); -int fesetexceptflag(const fexcept_t* flagp, int excepts); -int fetestexcept(int excepts); -int fegetround(); -int fesetround(int round); -int fegetenv(fenv_t* envp); -int feholdexcept(fenv_t* envp); -int fesetenv(const fenv_t* envp); -int feupdateenv(const fenv_t* envp); - - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/filesystem b/libcxx/include/filesystem --- a/libcxx/include/filesystem +++ b/libcxx/include/filesystem @@ -10,428 +10,6 @@ #ifndef _LIBCPP_FILESYSTEM #define _LIBCPP_FILESYSTEM -/* - filesystem synopsis - - namespace std::filesystem { - - // `class path` from http://eel.is/c++draft/fs.class.path.general#6 - class path { - public: - using value_type = see below; - using string_type = basic_string; - static constexpr value_type preferred_separator = see below; - - enum format; - - path() noexcept; - path(const path& p); - path(path&& p) noexcept; - path(string_type&& source, format fmt = auto_format); - template - path(const Source& source, format fmt = auto_format); - template - path(InputIterator first, InputIterator last, format fmt = auto_format); - template - path(const Source& source, const locale& loc, format fmt = auto_format); - template - path(InputIterator first, InputIterator last, const locale& loc, format fmt = auto_format); - ~path(); - - path& operator=(const path& p); - path& operator=(path&& p) noexcept; - path& operator=(string_type&& source); - path& assign(string_type&& source); - template - path& operator=(const Source& source); - template - path& assign(const Source& source); - template - path& assign(InputIterator first, InputIterator last); - - path& operator/=(const path& p); - template - path& operator/=(const Source& source); - template - path& append(const Source& source); - template - path& append(InputIterator first, InputIterator last); - - path& operator+=(const path& x); - path& operator+=(const string_type& x); - path& operator+=(basic_string_view x); - path& operator+=(const value_type* x); - path& operator+=(value_type x); - template - path& operator+=(const Source& x); - template - path& operator+=(EcharT x); - template - path& concat(const Source& x); - template - path& concat(InputIterator first, InputIterator last); - - void clear() noexcept; - path& make_preferred(); - path& remove_filename(); - path& replace_filename(const path& replacement); - path& replace_extension(const path& replacement = path()); - void swap(path& rhs) noexcept; - - friend bool operator==(const path& lhs, const path& rhs) noexcept; - friend bool operator!=(const path& lhs, const path& rhs) noexcept; // removed in C++20 - friend bool operator< (const path& lhs, const path& rhs) noexcept; // removed in C++20 - friend bool operator<=(const path& lhs, const path& rhs) noexcept; // removed in C++20 - friend bool operator> (const path& lhs, const path& rhs) noexcept; // removed in C++20 - friend bool operator>=(const path& lhs, const path& rhs) noexcept; // removed in C++20 - friend strong_ordering operator<=>(const path& lhs, const path& rhs) noexcept; // C++20 - - friend path operator/(const path& lhs, const path& rhs); - - const string_type& native() const noexcept; - const value_type* c_str() const noexcept; - operator string_type() const; - - template, - class Allocator = allocator> - basic_string - string(const Allocator& a = Allocator()) const; - std::string string() const; - std::wstring wstring() const; - std::u8string u8string() const; - std::u16string u16string() const; - std::u32string u32string() const; - - template, - class Allocator = allocator> - basic_string - generic_string(const Allocator& a = Allocator()) const; - std::string generic_string() const; - std::wstring generic_wstring() const; - std::u8string generic_u8string() const; - std::u16string generic_u16string() const; - std::u32string generic_u32string() const; - - int compare(const path& p) const noexcept; - int compare(const string_type& s) const; - int compare(basic_string_view s) const; - int compare(const value_type* s) const; - - path root_name() const; - path root_directory() const; - path root_path() const; - path relative_path() const; - path parent_path() const; - path filename() const; - path stem() const; - path extension() const; - - [[nodiscard]] bool empty() const noexcept; - bool has_root_name() const; - bool has_root_directory() const; - bool has_root_path() const; - bool has_relative_path() const; - bool has_parent_path() const; - bool has_filename() const; - bool has_stem() const; - bool has_extension() const; - bool is_absolute() const; - bool is_relative() const; - - path lexically_normal() const; - path lexically_relative(const path& base) const; - path lexically_proximate(const path& base) const; - - class iterator; - using const_iterator = iterator; - - iterator begin() const; - iterator end() const; - - template - friend basic_ostream& - operator<<(basic_ostream& os, const path& p); - template - friend basic_istream& - operator>>(basic_istream& is, path& p); - }; - - void swap(path& lhs, path& rhs) noexcept; - size_t hash_value(const path& p) noexcept; - - // [fs.path.hash], hash support - template<> struct hash; - - template - path u8path(const Source& source); - template - path u8path(InputIterator first, InputIterator last); - - class filesystem_error; - - class directory_entry { - public: - directory_entry() noexcept = default; - directory_entry(const directory_entry&) = default; - directory_entry(directory_entry&&) noexcept = default; - explicit directory_entry(const filesystem::path& p); - directory_entry(const filesystem::path& p, error_code& ec); - ~directory_entry(); - - directory_entry& operator=(const directory_entry&) = default; - directory_entry& operator=(directory_entry&&) noexcept = default; - - void assign(const filesystem::path& p); - void assign(const filesystem::path& p, error_code& ec); - void replace_filename(const filesystem::path& p); - void replace_filename(const filesystem::path& p, error_code& ec); - void refresh(); - void refresh(error_code& ec) noexcept; - - const filesystem::path& path() const noexcept; - operator const filesystem::path&() const noexcept; - bool exists() const; - bool exists(error_code& ec) const noexcept; - bool is_block_file() const; - bool is_block_file(error_code& ec) const noexcept; - bool is_character_file() const; - bool is_character_file(error_code& ec) const noexcept; - bool is_directory() const; - bool is_directory(error_code& ec) const noexcept; - bool is_fifo() const; - bool is_fifo(error_code& ec) const noexcept; - bool is_other() const; - bool is_other(error_code& ec) const noexcept; - bool is_regular_file() const; - bool is_regular_file(error_code& ec) const noexcept; - bool is_socket() const; - bool is_socket(error_code& ec) const noexcept; - bool is_symlink() const; - bool is_symlink(error_code& ec) const noexcept; - uintmax_t file_size() const; - uintmax_t file_size(error_code& ec) const noexcept; - uintmax_t hard_link_count() const; - uintmax_t hard_link_count(error_code& ec) const noexcept; - file_time_type last_write_time() const; - file_time_type last_write_time(error_code& ec) const noexcept; - file_status status() const; - file_status status(error_code& ec) const noexcept; - file_status symlink_status() const; - file_status symlink_status(error_code& ec) const noexcept; - - bool operator==(const directory_entry& rhs) const noexcept; - bool operator!=(const directory_entry& rhs) const noexcept; // removed in C++20 - bool operator< (const directory_entry& rhs) const noexcept; // removed in C++20 - bool operator<=(const directory_entry& rhs) const noexcept; // removed in C++20 - bool operator> (const directory_entry& rhs) const noexcept; // removed in C++20 - bool operator>=(const directory_entry& rhs) const noexcept; // removed in C++20 - strong_ordering operator<=>(const directory_entry& rhs) const noexcept; // since C++20 - - template - friend basic_ostream& - operator<<(basic_ostream& os, const directory_entry& d); - - private: - filesystem::path pathobject; // exposition only - friend class directory_iterator; // exposition only - }; - - class directory_iterator; - - // enable directory_iterator range-based for statements - directory_iterator begin(directory_iterator iter) noexcept; - directory_iterator end(directory_iterator) noexcept; - - class recursive_directory_iterator; - - // enable recursive_directory_iterator range-based for statements - recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept; - recursive_directory_iterator end(recursive_directory_iterator) noexcept; - - class file_status; - - struct space_info - { - uintmax_t capacity; - uintmax_t free; - uintmax_t available; - - friend bool operator==(const space_info&, const space_info&) = default; // C++20 - }; - - enum class file_type; - enum class perms; - enum class perm_options; - enum class copy_options; - enum class directory_options; - - typedef chrono::time_point file_time_type; - - // operational functions - - path absolute(const path& p); - path absolute(const path& p, error_code &ec); - - path canonical(const path& p); - path canonical(const path& p, error_code& ec); - - void copy(const path& from, const path& to); - void copy(const path& from, const path& to, error_code& ec); - void copy(const path& from, const path& to, copy_options options); - void copy(const path& from, const path& to, copy_options options, - error_code& ec); - - bool copy_file(const path& from, const path& to); - bool copy_file(const path& from, const path& to, error_code& ec); - bool copy_file(const path& from, const path& to, copy_options option); - bool copy_file(const path& from, const path& to, copy_options option, - error_code& ec); - - void copy_symlink(const path& existing_symlink, const path& new_symlink); - void copy_symlink(const path& existing_symlink, const path& new_symlink, - error_code& ec) noexcept; - - bool create_directories(const path& p); - bool create_directories(const path& p, error_code& ec); - - bool create_directory(const path& p); - bool create_directory(const path& p, error_code& ec) noexcept; - - bool create_directory(const path& p, const path& attributes); - bool create_directory(const path& p, const path& attributes, - error_code& ec) noexcept; - - void create_directory_symlink(const path& to, const path& new_symlink); - void create_directory_symlink(const path& to, const path& new_symlink, - error_code& ec) noexcept; - - void create_hard_link(const path& to, const path& new_hard_link); - void create_hard_link(const path& to, const path& new_hard_link, - error_code& ec) noexcept; - - void create_symlink(const path& to, const path& new_symlink); - void create_symlink(const path& to, const path& new_symlink, - error_code& ec) noexcept; - - path current_path(); - path current_path(error_code& ec); - void current_path(const path& p); - void current_path(const path& p, error_code& ec) noexcept; - - bool exists(file_status s) noexcept; - bool exists(const path& p); - bool exists(const path& p, error_code& ec) noexcept; - - bool equivalent(const path& p1, const path& p2); - bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept; - - uintmax_t file_size(const path& p); - uintmax_t file_size(const path& p, error_code& ec) noexcept; - - uintmax_t hard_link_count(const path& p); - uintmax_t hard_link_count(const path& p, error_code& ec) noexcept; - - bool is_block_file(file_status s) noexcept; - bool is_block_file(const path& p); - bool is_block_file(const path& p, error_code& ec) noexcept; - - bool is_character_file(file_status s) noexcept; - bool is_character_file(const path& p); - bool is_character_file(const path& p, error_code& ec) noexcept; - - bool is_directory(file_status s) noexcept; - bool is_directory(const path& p); - bool is_directory(const path& p, error_code& ec) noexcept; - - bool is_empty(const path& p); - bool is_empty(const path& p, error_code& ec) noexcept; - - bool is_fifo(file_status s) noexcept; - bool is_fifo(const path& p); - bool is_fifo(const path& p, error_code& ec) noexcept; - - bool is_other(file_status s) noexcept; - bool is_other(const path& p); - bool is_other(const path& p, error_code& ec) noexcept; - - bool is_regular_file(file_status s) noexcept; - bool is_regular_file(const path& p); - bool is_regular_file(const path& p, error_code& ec) noexcept; - - bool is_socket(file_status s) noexcept; - bool is_socket(const path& p); - bool is_socket(const path& p, error_code& ec) noexcept; - - bool is_symlink(file_status s) noexcept; - bool is_symlink(const path& p); - bool is_symlink(const path& p, error_code& ec) noexcept; - - file_time_type last_write_time(const path& p); - file_time_type last_write_time(const path& p, error_code& ec) noexcept; - void last_write_time(const path& p, file_time_type new_time); - void last_write_time(const path& p, file_time_type new_time, - error_code& ec) noexcept; - - void permissions(const path& p, perms prms, - perm_options opts=perm_options::replace); - void permissions(const path& p, perms prms, error_code& ec) noexcept; - void permissions(const path& p, perms prms, perm_options opts, - error_code& ec); - - path proximate(const path& p, error_code& ec); - path proximate(const path& p, const path& base = current_path()); - path proximate(const path& p, const path& base, error_code &ec); - - path read_symlink(const path& p); - path read_symlink(const path& p, error_code& ec); - - path relative(const path& p, error_code& ec); - path relative(const path& p, const path& base=current_path()); - path relative(const path& p, const path& base, error_code& ec); - - bool remove(const path& p); - bool remove(const path& p, error_code& ec) noexcept; - - uintmax_t remove_all(const path& p); - uintmax_t remove_all(const path& p, error_code& ec); - - void rename(const path& from, const path& to); - void rename(const path& from, const path& to, error_code& ec) noexcept; - - void resize_file(const path& p, uintmax_t size); - void resize_file(const path& p, uintmax_t size, error_code& ec) noexcept; - - space_info space(const path& p); - space_info space(const path& p, error_code& ec) noexcept; - - file_status status(const path& p); - file_status status(const path& p, error_code& ec) noexcept; - - bool status_known(file_status s) noexcept; - - file_status symlink_status(const path& p); - file_status symlink_status(const path& p, error_code& ec) noexcept; - - path temp_directory_path(); - path temp_directory_path(error_code& ec); - - path weakly_canonical(path const& p); - path weakly_canonical(path const& p, error_code& ec); - -} // namespace std::filesystem - -template <> -inline constexpr bool std::ranges::enable_borrowed_range = true; -template <> -inline constexpr bool std::ranges::enable_borrowed_range = true; - -template <> -inline constexpr bool std::ranges::enable_view = true; -template <> -inline constexpr bool std::ranges::enable_view = true; - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__filesystem/copy_options.h> diff --git a/libcxx/include/float.h b/libcxx/include/float.h --- a/libcxx/include/float.h +++ b/libcxx/include/float.h @@ -10,66 +10,6 @@ #ifndef _LIBCPP_FLOAT_H #define _LIBCPP_FLOAT_H -/* - float.h synopsis - -Macros: - - FLT_ROUNDS - FLT_EVAL_METHOD // C99 - FLT_RADIX - - FLT_MANT_DIG - DBL_MANT_DIG - LDBL_MANT_DIG - - FLT_HAS_SUBNORM // C11 - DBL_HAS_SUBNORM // C11 - LDBL_HAS_SUBNORM // C11 - - DECIMAL_DIG // C99 - FLT_DECIMAL_DIG // C11 - DBL_DECIMAL_DIG // C11 - LDBL_DECIMAL_DIG // C11 - - FLT_DIG - DBL_DIG - LDBL_DIG - - FLT_MIN_EXP - DBL_MIN_EXP - LDBL_MIN_EXP - - FLT_MIN_10_EXP - DBL_MIN_10_EXP - LDBL_MIN_10_EXP - - FLT_MAX_EXP - DBL_MAX_EXP - LDBL_MAX_EXP - - FLT_MAX_10_EXP - DBL_MAX_10_EXP - LDBL_MAX_10_EXP - - FLT_MAX - DBL_MAX - LDBL_MAX - - FLT_EPSILON - DBL_EPSILON - LDBL_EPSILON - - FLT_MIN - DBL_MIN - LDBL_MIN - - FLT_TRUE_MIN // C11 - DBL_TRUE_MIN // C11 - LDBL_TRUE_MIN // C11 - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/format b/libcxx/include/format --- a/libcxx/include/format +++ b/libcxx/include/format @@ -10,165 +10,6 @@ #ifndef _LIBCPP_FORMAT #define _LIBCPP_FORMAT -/* - -namespace std { - // [format.context], class template basic_format_context - template class basic_format_context; - using format_context = basic_format_context; - using wformat_context = basic_format_context; - - // [format.args], class template basic_format_args - template class basic_format_args; - using format_args = basic_format_args; - using wformat_args = basic_format_args; - - // [format.fmt.string], class template basic_format_string - template - struct basic_format_string { // since C++23, exposition only before C++23 - private: - basic_string_view str; // exposition only - - public: - template consteval basic_format_string(const T& s); - - constexpr basic_string_view get() const noexcept { return str; } - }; - template - using format_string = // since C++23, exposition only before C++23 - basic_format_string...>; - template - using wformat_string = // since C++23, exposition only before C++23 - basic_format_string...>; - - // [format.functions], formatting functions - template - string format(format-string fmt, Args&&... args); - template - wstring format(wformat-string fmt, Args&&... args); - template - string format(const locale& loc, format-string fmt, Args&&... args); - template - wstring format(const locale& loc, wformat-string fmt, Args&&... args); - - string vformat(string_view fmt, format_args args); - wstring vformat(wstring_view fmt, wformat_args args); - string vformat(const locale& loc, string_view fmt, format_args args); - wstring vformat(const locale& loc, wstring_view fmt, wformat_args args); - - template - Out format_to(Out out, format-string fmt, Args&&... args); - template - Out format_to(Out out, wformat-string fmt, Args&&... args); - template - Out format_to(Out out, const locale& loc, format-string fmt, Args&&... args); - template - Out format_to(Out out, const locale& loc, wformat-string fmt, Args&&... args); - - template - Out vformat_to(Out out, string_view fmt, format_args args); - template - Out vformat_to(Out out, wstring_view fmt, wformat_args args); - template - Out vformat_to(Out out, const locale& loc, string_view fmt, - format_args char> args); - template - Out vformat_to(Out out, const locale& loc, wstring_view fmt, - wformat_args args); - - template struct format_to_n_result { - Out out; - iter_difference_t size; - }; - template - format_to_n_result format_to_n(Out out, iter_difference_t n, - format-string fmt, Args&&... args); - template - format_to_n_result format_to_n(Out out, iter_difference_t n, - wformat-string fmt, Args&&... args); - template - format_to_n_result format_to_n(Out out, iter_difference_t n, - const locale& loc, format-string fmt, - Args&&... args); - template - format_to_n_result format_to_n(Out out, iter_difference_t n, - const locale& loc, wformat-string fmt, - Args&&... args); - - template - size_t formatted_size(format-string fmt, Args&&... args); - template - size_t formatted_size(wformat-string fmt, Args&&... args); - template - size_t formatted_size(const locale& loc, format-string fmt, Args&&... args); - template - size_t formatted_size(const locale& loc, wformat-string fmt, Args&&... args); - - // [format.formatter], formatter - template struct formatter; - - // [format.parse.ctx], class template basic_format_parse_context - template class basic_format_parse_context; - using format_parse_context = basic_format_parse_context; - using wformat_parse_context = basic_format_parse_context; - - // [format.range], formatting of ranges - // [format.range.fmtkind], variable template format_kind - enum class range_format { // since C++23 - disabled, - map, - set, - sequence, - string, - debug_string - }; - - template - constexpr unspecified format_kind = unspecified; // since C++23 - - template - requires same_as> - constexpr range_format format_kind = see below; // since C++23 - - // [format.range.formatter], class template range_formatter - template - requires same_as, T> && formattable - class range_formatter; // since C++23 - - // [format.range.fmtdef], class template range-default-formatter - template - struct range-default-formatter; // exposition only, since C++23 - - // [format.range.fmtmap], [format.range.fmtset], [format.range.fmtstr], - // specializations for maps, sets, and strings - template - requires (format_kind != range_format::disabled) && - formattable, charT> - struct formatter : range-default-formatter, R, charT> { }; // since C++23 - - // [format.arguments], arguments - // [format.arg], class template basic_format_arg - template class basic_format_arg; - - template - see below visit_format_arg(Visitor&& vis, basic_format_arg arg); - - // [format.arg.store], class template format-arg-store - template struct format-arg-store; // exposition only - - template - format-arg-store - make_format_args(Args&&... args); - template - format-arg-store - make_wformat_args(Args&&... args); - - // [format.error], class format_error - class format_error; -} - -*/ - #include <__assert> // all public C++ headers provide the assertion handler // Make sure all feature-test macros are available. #include diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -10,179 +10,6 @@ #ifndef _LIBCPP_FORWARD_LIST #define _LIBCPP_FORWARD_LIST -/* - forward_list synopsis - -namespace std -{ - -template > -class forward_list -{ -public: - typedef T value_type; - typedef Allocator allocator_type; - - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename allocator_traits::pointer pointer; - typedef typename allocator_traits::const_pointer const_pointer; - typedef typename allocator_traits::size_type size_type; - typedef typename allocator_traits::difference_type difference_type; - - typedef
iterator; - typedef
const_iterator; - - forward_list() - noexcept(is_nothrow_default_constructible::value); - explicit forward_list(const allocator_type& a); - explicit forward_list(size_type n); - explicit forward_list(size_type n, const allocator_type& a); // C++14 - forward_list(size_type n, const value_type& v); - forward_list(size_type n, const value_type& v, const allocator_type& a); - template - forward_list(InputIterator first, InputIterator last); - template - forward_list(InputIterator first, InputIterator last, const allocator_type& a); - forward_list(const forward_list& x); - forward_list(const forward_list& x, const allocator_type& a); - forward_list(forward_list&& x) - noexcept(is_nothrow_move_constructible::value); - forward_list(forward_list&& x, const allocator_type& a); - forward_list(initializer_list il); - forward_list(initializer_list il, const allocator_type& a); - - ~forward_list(); - - forward_list& operator=(const forward_list& x); - forward_list& operator=(forward_list&& x) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value); - forward_list& operator=(initializer_list il); - - template - void assign(InputIterator first, InputIterator last); - void assign(size_type n, const value_type& v); - void assign(initializer_list il); - - allocator_type get_allocator() const noexcept; - - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - - iterator before_begin() noexcept; - const_iterator before_begin() const noexcept; - const_iterator cbefore_begin() const noexcept; - - bool empty() const noexcept; - size_type max_size() const noexcept; - - reference front(); - const_reference front() const; - - template reference emplace_front(Args&&... args); // reference in C++17 - void push_front(const value_type& v); - void push_front(value_type&& v); - - void pop_front(); - - template - iterator emplace_after(const_iterator p, Args&&... args); - iterator insert_after(const_iterator p, const value_type& v); - iterator insert_after(const_iterator p, value_type&& v); - iterator insert_after(const_iterator p, size_type n, const value_type& v); - template - iterator insert_after(const_iterator p, - InputIterator first, InputIterator last); - iterator insert_after(const_iterator p, initializer_list il); - - iterator erase_after(const_iterator p); - iterator erase_after(const_iterator first, const_iterator last); - - void swap(forward_list& x) - noexcept(allocator_traits::is_always_equal::value); // C++17 - - void resize(size_type n); - void resize(size_type n, const value_type& v); - void clear() noexcept; - - void splice_after(const_iterator p, forward_list& x); - void splice_after(const_iterator p, forward_list&& x); - void splice_after(const_iterator p, forward_list& x, const_iterator i); - void splice_after(const_iterator p, forward_list&& x, const_iterator i); - void splice_after(const_iterator p, forward_list& x, - const_iterator first, const_iterator last); - void splice_after(const_iterator p, forward_list&& x, - const_iterator first, const_iterator last); - size_type remove(const value_type& v); // void before C++20 - template - size_type remove_if(Predicate pred); // void before C++20 - size_type unique(); // void before C++20 - template - size_type unique(BinaryPredicate binary_pred); // void before C++20 - void merge(forward_list& x); - void merge(forward_list&& x); - template void merge(forward_list& x, Compare comp); - template void merge(forward_list&& x, Compare comp); - void sort(); - template void sort(Compare comp); - void reverse() noexcept; -}; - - -template ::value_type>> - forward_list(InputIterator, InputIterator, Allocator = Allocator()) - -> forward_list::value_type, Allocator>; // C++17 - -template - bool operator==(const forward_list& x, - const forward_list& y); - -template - bool operator< (const forward_list& x, - const forward_list& y); // removed in C++20 - -template - bool operator!=(const forward_list& x, - const forward_list& y); // removed in C++20 - -template - bool operator> (const forward_list& x, - const forward_list& y); // removed in C++20 - -template - bool operator>=(const forward_list& x, - const forward_list& y); // removed in C++20 - -template - bool operator<=(const forward_list& x, - const forward_list& y); // removed in C++20 - -template - synth-three-way-result operator<=>(const forward_list& x, - const forward_list& y); // since C++20 - -template - void swap(forward_list& x, forward_list& y) - noexcept(noexcept(x.swap(y))); - -template - typename forward_list::size_type - erase(forward_list& c, const U& value); // C++20 -template - typename forward_list::size_type - erase_if(forward_list& c, Predicate pred); // C++20 - -} // std - -*/ - #include <__algorithm/comp.h> #include <__algorithm/lexicographical_compare.h> #include <__algorithm/lexicographical_compare_three_way.h> diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -10,175 +10,6 @@ #ifndef _LIBCPP_FSTREAM #define _LIBCPP_FSTREAM -/* - fstream synopsis - -template > -class basic_filebuf - : public basic_streambuf -{ -public: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // 27.9.1.2 Constructors/destructor: - basic_filebuf(); - basic_filebuf(basic_filebuf&& rhs); - virtual ~basic_filebuf(); - - // 27.9.1.3 Assign/swap: - basic_filebuf& operator=(basic_filebuf&& rhs); - void swap(basic_filebuf& rhs); - - // 27.9.1.4 Members: - bool is_open() const; - basic_filebuf* open(const char* s, ios_base::openmode mode); - basic_filebuf* open(const string& s, ios_base::openmode mode); - basic_filebuf* open(const filesystem::path& p, ios_base::openmode mode); // C++17 - basic_filebuf* close(); - -protected: - // 27.9.1.5 Overridden virtual functions: - virtual streamsize showmanyc(); - virtual int_type underflow(); - virtual int_type uflow(); - virtual int_type pbackfail(int_type c = traits_type::eof()); - virtual int_type overflow (int_type c = traits_type::eof()); - virtual basic_streambuf* setbuf(char_type* s, streamsize n); - virtual pos_type seekoff(off_type off, ios_base::seekdir way, - ios_base::openmode which = ios_base::in | ios_base::out); - virtual pos_type seekpos(pos_type sp, - ios_base::openmode which = ios_base::in | ios_base::out); - virtual int sync(); - virtual void imbue(const locale& loc); -}; - -template - void - swap(basic_filebuf& x, basic_filebuf& y); - -typedef basic_filebuf filebuf; -typedef basic_filebuf wfilebuf; - -template > -class basic_ifstream - : public basic_istream -{ -public: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - basic_ifstream(); - explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in); - explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in); - explicit basic_ifstream(const filesystem::path& p, - ios_base::openmode mode = ios_base::in); // C++17 - basic_ifstream(basic_ifstream&& rhs); - - basic_ifstream& operator=(basic_ifstream&& rhs); - void swap(basic_ifstream& rhs); - - basic_filebuf* rdbuf() const; - bool is_open() const; - void open(const char* s, ios_base::openmode mode = ios_base::in); - void open(const string& s, ios_base::openmode mode = ios_base::in); - void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in); // C++17 - - void close(); -}; - -template - void - swap(basic_ifstream& x, basic_ifstream& y); - -typedef basic_ifstream ifstream; -typedef basic_ifstream wifstream; - -template > -class basic_ofstream - : public basic_ostream -{ -public: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - basic_ofstream(); - explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out); - explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out); - explicit basic_ofstream(const filesystem::path& p, - ios_base::openmode mode = ios_base::out); // C++17 - basic_ofstream(basic_ofstream&& rhs); - - basic_ofstream& operator=(basic_ofstream&& rhs); - void swap(basic_ofstream& rhs); - - basic_filebuf* rdbuf() const; - bool is_open() const; - void open(const char* s, ios_base::openmode mode = ios_base::out); - void open(const string& s, ios_base::openmode mode = ios_base::out); - void open(const filesystem::path& p, - ios_base::openmode mode = ios_base::out); // C++17 - - void close(); -}; - -template - void - swap(basic_ofstream& x, basic_ofstream& y); - -typedef basic_ofstream ofstream; -typedef basic_ofstream wofstream; - -template > -class basic_fstream - : public basic_iostream -{ -public: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - basic_fstream(); - explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out); - explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out); - explicit basic_fstream(const filesystem::path& p, - ios_base::openmode mode = ios_base::in|ios_base::out); C++17 - basic_fstream(basic_fstream&& rhs); - - basic_fstream& operator=(basic_fstream&& rhs); - void swap(basic_fstream& rhs); - - basic_filebuf* rdbuf() const; - bool is_open() const; - void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out); - void open(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out); - void open(const filesystem::path& s, - ios_base::openmode mode = ios_base::in|ios_base::out); // C++17 - - void close(); -}; - -template - void swap(basic_fstream& x, basic_fstream& y); - -typedef basic_fstream fstream; -typedef basic_fstream wfstream; - -} // std - -*/ - #include <__algorithm/max.h> #include <__assert> // all public C++ headers provide the assertion handler #include <__availability> diff --git a/libcxx/include/functional b/libcxx/include/functional --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -10,508 +10,6 @@ #ifndef _LIBCPP_FUNCTIONAL #define _LIBCPP_FUNCTIONAL -/* - functional synopsis - -namespace std -{ - -template -struct unary_function -{ - typedef Arg argument_type; - typedef Result result_type; -}; - -template -struct binary_function -{ - typedef Arg1 first_argument_type; - typedef Arg2 second_argument_type; - typedef Result result_type; -}; - -template -class reference_wrapper - : public unary_function // if wrapping a unary functor - : public binary_function // if wraping a binary functor -{ -public: - // types - typedef T type; - typedef see below result_type; // Not always defined - - // construct/copy/destroy - template - constexpr reference_wrapper(U&&); // constexpr since C++20 - constexpr reference_wrapper(const reference_wrapper& x) noexcept; // constexpr since C++20 - - // assignment - constexpr reference_wrapper& - operator=(const reference_wrapper& x) noexcept; // constexpr since C++20 - - // access - constexpr operator T& () const noexcept; // constexpr since C++20 - constexpr T& get() const noexcept; // constexpr since C++20 - - // invoke - template - constexpr typename result_of::type // constexpr since C++20 - operator() (ArgTypes&&...) const - noexcept(is_nothrow_invocable_v); // noexcept since C++17 -}; - -template - reference_wrapper(T&) -> reference_wrapper; - -template reference_wrapper ref(T& t) noexcept; -template void ref(const T&& t) = delete; -template reference_wrapper ref(reference_wrappert) noexcept; - -template reference_wrapper cref(const T& t) noexcept; -template void cref(const T&& t) = delete; -template reference_wrapper cref(reference_wrapper t) noexcept; - -template struct unwrap_reference; // since C++20 -template struct unwrap_ref_decay : unwrap_reference> { }; // since C++20 -template using unwrap_reference_t = typename unwrap_reference::type; // since C++20 -template using unwrap_ref_decay_t = typename unwrap_ref_decay::type; // since C++20 - -template // in C++14 -struct plus { - T operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct minus { - T operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct multiplies { - T operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct divides { - T operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct modulus { - T operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct negate { - T operator()(const T& x) const; -}; - -template // in C++14 -struct equal_to { - bool operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct not_equal_to { - bool operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct greater { - bool operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct less { - bool operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct greater_equal { - bool operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct less_equal { - bool operator()(const T& x, const T& y) const; -}; - -// [comparisons.three.way], class compare_three_way -struct compare_three_way; - -template // in C++14 -struct logical_and { - bool operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct logical_or { - bool operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct logical_not { - bool operator()(const T& x) const; -}; - -template // in C++14 -struct bit_and { - T operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct bit_or { - T operator()(const T& x, const T& y) const; -}; - -template // in C++14 -struct bit_xor { - T operator()(const T& x, const T& y) const; -}; - -template // C++14 -struct bit_not { - T operator()(const T& x) const; -}; - -struct identity; // C++20 - -template -class unary_negate // deprecated in C++17, removed in C++20 - : public unary_function -{ -public: - explicit unary_negate(const Predicate& pred); - bool operator()(const typename Predicate::argument_type& x) const; -}; - -template // deprecated in C++17, removed in C++20 -unary_negate not1(const Predicate& pred); - -template -class binary_negate // deprecated in C++17, removed in C++20 - : public binary_function -{ -public: - explicit binary_negate(const Predicate& pred); - bool operator()(const typename Predicate::first_argument_type& x, - const typename Predicate::second_argument_type& y) const; -}; - -template // deprecated in C++17, removed in C++20 -binary_negate not2(const Predicate& pred); - -template -constexpr unspecified not_fn(F&& f); // C++17, constexpr in C++20 - -template struct is_bind_expression; -template struct is_placeholder; - - // See C++14 20.9.9, Function object binders -template inline constexpr bool is_bind_expression_v - = is_bind_expression::value; // C++17 -template inline constexpr int is_placeholder_v - = is_placeholder::value; // C++17 - - -template - constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20 -template - constexpr unspecified bind(Fn&&, BoundArgs&&...); // constexpr in C++20 - -// [func.invoke] -template - constexpr // constexpr in C++20 - invoke_result_t invoke(F&& f, Args&&... args) // C++17 - noexcept(is_nothrow_invocable_v); - -template - constexpr R invoke_r(F&& f, Args&&... args) // C++23 - noexcept(is_nothrow_invocable_r_v); - -namespace placeholders { - // M is the implementation-defined number of placeholders - extern unspecified _1; - extern unspecified _2; - . - . - . - extern unspecified _Mp; -} - -template -class binder1st // deprecated in C++11, removed in C++17 - : public unary_function -{ -protected: - Operation op; - typename Operation::first_argument_type value; -public: - binder1st(const Operation& x, const typename Operation::first_argument_type y); - typename Operation::result_type operator()( typename Operation::second_argument_type& x) const; - typename Operation::result_type operator()(const typename Operation::second_argument_type& x) const; -}; - -template -binder1st bind1st(const Operation& op, const T& x); // deprecated in C++11, removed in C++17 - -template -class binder2nd // deprecated in C++11, removed in C++17 - : public unary_function -{ -protected: - Operation op; - typename Operation::second_argument_type value; -public: - binder2nd(const Operation& x, const typename Operation::second_argument_type y); - typename Operation::result_type operator()( typename Operation::first_argument_type& x) const; - typename Operation::result_type operator()(const typename Operation::first_argument_type& x) const; -}; - -template -binder2nd bind2nd(const Operation& op, const T& x); // deprecated in C++11, removed in C++17 - -template // deprecated in C++11, removed in C++17 -class pointer_to_unary_function : public unary_function -{ -public: - explicit pointer_to_unary_function(Result (*f)(Arg)); - Result operator()(Arg x) const; -}; - -template -pointer_to_unary_function ptr_fun(Result (*f)(Arg)); // deprecated in C++11, removed in C++17 - -template // deprecated in C++11, removed in C++17 -class pointer_to_binary_function : public binary_function -{ -public: - explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2)); - Result operator()(Arg1 x, Arg2 y) const; -}; - -template -pointer_to_binary_function ptr_fun(Result (*f)(Arg1,Arg2)); // deprecated in C++11, removed in C++17 - -template // deprecated in C++11, removed in C++17 -class mem_fun_t : public unary_function -{ -public: - explicit mem_fun_t(S (T::*p)()); - S operator()(T* p) const; -}; - -template -class mem_fun1_t : public binary_function // deprecated in C++11, removed in C++17 -{ -public: - explicit mem_fun1_t(S (T::*p)(A)); - S operator()(T* p, A x) const; -}; - -template mem_fun_t mem_fun(S (T::*f)()); // deprecated in C++11, removed in C++17 -template mem_fun1_t mem_fun(S (T::*f)(A)); // deprecated in C++11, removed in C++17 - -template -class mem_fun_ref_t : public unary_function // deprecated in C++11, removed in C++17 -{ -public: - explicit mem_fun_ref_t(S (T::*p)()); - S operator()(T& p) const; -}; - -template -class mem_fun1_ref_t : public binary_function // deprecated in C++11, removed in C++17 -{ -public: - explicit mem_fun1_ref_t(S (T::*p)(A)); - S operator()(T& p, A x) const; -}; - -template -mem_fun_ref_t mem_fun_ref(S (T::*f)()); // deprecated in C++11, removed in C++17 -template -mem_fun1_ref_t mem_fun_ref(S (T::*f)(A)); // deprecated in C++11, removed in C++17 - -template -class const_mem_fun_t : public unary_function // deprecated in C++11, removed in C++17 -{ -public: - explicit const_mem_fun_t(S (T::*p)() const); - S operator()(const T* p) const; -}; - -template -class const_mem_fun1_t : public binary_function // deprecated in C++11, removed in C++17 -{ -public: - explicit const_mem_fun1_t(S (T::*p)(A) const); - S operator()(const T* p, A x) const; -}; - -template -const_mem_fun_t mem_fun(S (T::*f)() const); // deprecated in C++11, removed in C++17 -template -const_mem_fun1_t mem_fun(S (T::*f)(A) const); // deprecated in C++11, removed in C++17 - -template -class const_mem_fun_ref_t : public unary_function // deprecated in C++11, removed in C++17 -{ -public: - explicit const_mem_fun_ref_t(S (T::*p)() const); - S operator()(const T& p) const; -}; - -template -class const_mem_fun1_ref_t : public binary_function // deprecated in C++11, removed in C++17 -{ -public: - explicit const_mem_fun1_ref_t(S (T::*p)(A) const); - S operator()(const T& p, A x) const; -}; - -template -const_mem_fun_ref_t mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17 -template -const_mem_fun1_ref_t mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17 - -template constexpr unspecified mem_fn(R T::*); // constexpr in C++20 - -class bad_function_call - : public exception -{ -}; - -template class function; // undefined - -template -class function - : public unary_function // iff sizeof...(ArgTypes) == 1 and - // ArgTypes contains T1 - : public binary_function // iff sizeof...(ArgTypes) == 2 and - // ArgTypes contains T1 and T2 -{ -public: - typedef R result_type; - - // construct/copy/destroy: - function() noexcept; - function(nullptr_t) noexcept; - function(const function&); - function(function&&) noexcept; - template - function(F); - template - function(allocator_arg_t, const Alloc&) noexcept; // removed in C++17 - template - function(allocator_arg_t, const Alloc&, nullptr_t) noexcept; // removed in C++17 - template - function(allocator_arg_t, const Alloc&, const function&); // removed in C++17 - template - function(allocator_arg_t, const Alloc&, function&&); // removed in C++17 - template - function(allocator_arg_t, const Alloc&, F); // removed in C++17 - - function& operator=(const function&); - function& operator=(function&&) noexcept; - function& operator=(nullptr_t) noexcept; - template - function& operator=(F&&); - template - function& operator=(reference_wrapper) noexcept; - - ~function(); - - // function modifiers: - void swap(function&) noexcept; - template - void assign(F&&, const Alloc&); // Removed in C++17 - - // function capacity: - explicit operator bool() const noexcept; - - // function invocation: - R operator()(ArgTypes...) const; - - // function target access: - const std::type_info& target_type() const noexcept; - template T* target() noexcept; - template const T* target() const noexcept; -}; - -// Deduction guides -template -function(R(*)(Args...)) -> function; // since C++17 - -template -function(F) -> function; // since C++17 - -// Null pointer comparisons: -template - bool operator==(const function&, nullptr_t) noexcept; - -template - bool operator==(nullptr_t, const function&) noexcept; - -template - bool operator!=(const function&, nullptr_t) noexcept; - -template - bool operator!=(nullptr_t, const function&) noexcept; - -// specialized algorithms: -template - void swap(function&, function&) noexcept; - -template struct hash; - -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; // since C++20 -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; -template <> struct hash; - -template <> struct hash; -template <> struct hash; -template <> struct hash; - -template struct hash; -template <> struct hash; // C++17 - -namespace ranges { - // [range.cmp], concept-constrained comparisons - struct equal_to; - struct not_equal_to; - struct greater; - struct less; - struct greater_equal; - struct less_equal; -} - -} // std - -POLICY: For non-variadic implementations, the number of arguments is limited - to 3. It is hoped that the need for non-variadic implementations - will be minimal. - -*/ - #include <__algorithm/search.h> #include <__assert> // all public C++ headers provide the assertion handler #include <__compare/compare_three_way.h> diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -10,357 +10,6 @@ #ifndef _LIBCPP_FUTURE #define _LIBCPP_FUTURE -/* - future synopsis - -namespace std -{ - -enum class future_errc -{ - future_already_retrieved = 1, - promise_already_satisfied, - no_state, - broken_promise -}; - -enum class launch -{ - async = 1, - deferred = 2, - any = async | deferred -}; - -enum class future_status -{ - ready, - timeout, - deferred -}; - -template <> struct is_error_code_enum : public true_type { }; -error_code make_error_code(future_errc e) noexcept; -error_condition make_error_condition(future_errc e) noexcept; - -const error_category& future_category() noexcept; - -class future_error - : public logic_error -{ -public: - future_error(error_code ec); // exposition only - explicit future_error(future_errc); // C++17 - const error_code& code() const noexcept; - const char* what() const noexcept; -}; - -template -class promise -{ -public: - promise(); - template - promise(allocator_arg_t, const Allocator& a); - promise(promise&& rhs) noexcept; - promise(const promise& rhs) = delete; - ~promise(); - - // assignment - promise& operator=(promise&& rhs) noexcept; - promise& operator=(const promise& rhs) = delete; - void swap(promise& other) noexcept; - - // retrieving the result - future get_future(); - - // setting the result - void set_value(const R& r); - void set_value(R&& r); - void set_exception(exception_ptr p); - - // setting the result with deferred notification - void set_value_at_thread_exit(const R& r); - void set_value_at_thread_exit(R&& r); - void set_exception_at_thread_exit(exception_ptr p); -}; - -template -class promise -{ -public: - promise(); - template - promise(allocator_arg_t, const Allocator& a); - promise(promise&& rhs) noexcept; - promise(const promise& rhs) = delete; - ~promise(); - - // assignment - promise& operator=(promise&& rhs) noexcept; - promise& operator=(const promise& rhs) = delete; - void swap(promise& other) noexcept; - - // retrieving the result - future get_future(); - - // setting the result - void set_value(R& r); - void set_exception(exception_ptr p); - - // setting the result with deferred notification - void set_value_at_thread_exit(R&); - void set_exception_at_thread_exit(exception_ptr p); -}; - -template <> -class promise -{ -public: - promise(); - template - promise(allocator_arg_t, const Allocator& a); - promise(promise&& rhs) noexcept; - promise(const promise& rhs) = delete; - ~promise(); - - // assignment - promise& operator=(promise&& rhs) noexcept; - promise& operator=(const promise& rhs) = delete; - void swap(promise& other) noexcept; - - // retrieving the result - future get_future(); - - // setting the result - void set_value(); - void set_exception(exception_ptr p); - - // setting the result with deferred notification - void set_value_at_thread_exit(); - void set_exception_at_thread_exit(exception_ptr p); -}; - -template void swap(promise& x, promise& y) noexcept; - -template - struct uses_allocator, Alloc> : public true_type {}; - -template -class future -{ -public: - future() noexcept; - future(future&&) noexcept; - future(const future& rhs) = delete; - ~future(); - future& operator=(const future& rhs) = delete; - future& operator=(future&&) noexcept; - shared_future share() noexcept; - - // retrieving the value - R get(); - - // functions to check state - bool valid() const noexcept; - - void wait() const; - template - future_status - wait_for(const chrono::duration& rel_time) const; - template - future_status - wait_until(const chrono::time_point& abs_time) const; -}; - -template -class future -{ -public: - future() noexcept; - future(future&&) noexcept; - future(const future& rhs) = delete; - ~future(); - future& operator=(const future& rhs) = delete; - future& operator=(future&&) noexcept; - shared_future share() noexcept; - - // retrieving the value - R& get(); - - // functions to check state - bool valid() const noexcept; - - void wait() const; - template - future_status - wait_for(const chrono::duration& rel_time) const; - template - future_status - wait_until(const chrono::time_point& abs_time) const; -}; - -template <> -class future -{ -public: - future() noexcept; - future(future&&) noexcept; - future(const future& rhs) = delete; - ~future(); - future& operator=(const future& rhs) = delete; - future& operator=(future&&) noexcept; - shared_future share() noexcept; - - // retrieving the value - void get(); - - // functions to check state - bool valid() const noexcept; - - void wait() const; - template - future_status - wait_for(const chrono::duration& rel_time) const; - template - future_status - wait_until(const chrono::time_point& abs_time) const; -}; - -template -class shared_future -{ -public: - shared_future() noexcept; - shared_future(const shared_future& rhs); - shared_future(future&&) noexcept; - shared_future(shared_future&& rhs) noexcept; - ~shared_future(); - shared_future& operator=(const shared_future& rhs); - shared_future& operator=(shared_future&& rhs) noexcept; - - // retrieving the value - const R& get() const; - - // functions to check state - bool valid() const noexcept; - - void wait() const; - template - future_status - wait_for(const chrono::duration& rel_time) const; - template - future_status - wait_until(const chrono::time_point& abs_time) const; -}; - -template -class shared_future -{ -public: - shared_future() noexcept; - shared_future(const shared_future& rhs); - shared_future(future&&) noexcept; - shared_future(shared_future&& rhs) noexcept; - ~shared_future(); - shared_future& operator=(const shared_future& rhs); - shared_future& operator=(shared_future&& rhs) noexcept; - - // retrieving the value - R& get() const; - - // functions to check state - bool valid() const noexcept; - - void wait() const; - template - future_status - wait_for(const chrono::duration& rel_time) const; - template - future_status - wait_until(const chrono::time_point& abs_time) const; -}; - -template <> -class shared_future -{ -public: - shared_future() noexcept; - shared_future(const shared_future& rhs); - shared_future(future&&) noexcept; - shared_future(shared_future&& rhs) noexcept; - ~shared_future(); - shared_future& operator=(const shared_future& rhs); - shared_future& operator=(shared_future&& rhs) noexcept; - - // retrieving the value - void get() const; - - // functions to check state - bool valid() const noexcept; - - void wait() const; - template - future_status - wait_for(const chrono::duration& rel_time) const; - template - future_status - wait_until(const chrono::time_point& abs_time) const; -}; - -template - future::type(typename decay::type...)>::type> - async(F&& f, Args&&... args); - -template - future::type(typename decay::type...)>::type> - async(launch policy, F&& f, Args&&... args); - -template class packaged_task; // undefined - -template -class packaged_task -{ -public: - typedef R result_type; // extension - - // construction and destruction - packaged_task() noexcept; - template - explicit packaged_task(F&& f); - template - packaged_task(allocator_arg_t, const Allocator& a, F&& f); - ~packaged_task(); - - // no copy - packaged_task(const packaged_task&) = delete; - packaged_task& operator=(const packaged_task&) = delete; - - // move support - packaged_task(packaged_task&& other) noexcept; - packaged_task& operator=(packaged_task&& other) noexcept; - void swap(packaged_task& other) noexcept; - - bool valid() const noexcept; - - // result retrieval - future get_future(); - - // execution - void operator()(ArgTypes... ); - void make_ready_at_thread_exit(ArgTypes...); - - void reset(); -}; - -template - void swap(packaged_task&) noexcept; - -template struct uses_allocator, Alloc>; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__availability> #include <__chrono/duration.h> diff --git a/libcxx/include/initializer_list b/libcxx/include/initializer_list --- a/libcxx/include/initializer_list +++ b/libcxx/include/initializer_list @@ -10,38 +10,6 @@ #ifndef _LIBCPP_INITIALIZER_LIST #define _LIBCPP_INITIALIZER_LIST -/* - initializer_list synopsis - -namespace std -{ - -template -class initializer_list -{ -public: - typedef E value_type; - typedef const E& reference; - typedef const E& const_reference; - typedef size_t size_type; - - typedef const E* iterator; - typedef const E* const_iterator; - - initializer_list() noexcept; // constexpr in C++14 - - size_t size() const noexcept; // constexpr in C++14 - const E* begin() const noexcept; // constexpr in C++14 - const E* end() const noexcept; // constexpr in C++14 -}; - -template const E* begin(initializer_list il) noexcept; // constexpr in C++14 -template const E* end(initializer_list il) noexcept; // constexpr in C++14 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include diff --git a/libcxx/include/inttypes.h b/libcxx/include/inttypes.h --- a/libcxx/include/inttypes.h +++ b/libcxx/include/inttypes.h @@ -15,226 +15,6 @@ #define _LIBCPP_INTTYPES_H #endif // _STD_TYPES_T -/* - inttypes.h synopsis - -This entire header is C99 / C++0X - -#include // includes - -Macros: - - PRId8 - PRId16 - PRId32 - PRId64 - - PRIdLEAST8 - PRIdLEAST16 - PRIdLEAST32 - PRIdLEAST64 - - PRIdFAST8 - PRIdFAST16 - PRIdFAST32 - PRIdFAST64 - - PRIdMAX - PRIdPTR - - PRIi8 - PRIi16 - PRIi32 - PRIi64 - - PRIiLEAST8 - PRIiLEAST16 - PRIiLEAST32 - PRIiLEAST64 - - PRIiFAST8 - PRIiFAST16 - PRIiFAST32 - PRIiFAST64 - - PRIiMAX - PRIiPTR - - PRIo8 - PRIo16 - PRIo32 - PRIo64 - - PRIoLEAST8 - PRIoLEAST16 - PRIoLEAST32 - PRIoLEAST64 - - PRIoFAST8 - PRIoFAST16 - PRIoFAST32 - PRIoFAST64 - - PRIoMAX - PRIoPTR - - PRIu8 - PRIu16 - PRIu32 - PRIu64 - - PRIuLEAST8 - PRIuLEAST16 - PRIuLEAST32 - PRIuLEAST64 - - PRIuFAST8 - PRIuFAST16 - PRIuFAST32 - PRIuFAST64 - - PRIuMAX - PRIuPTR - - PRIx8 - PRIx16 - PRIx32 - PRIx64 - - PRIxLEAST8 - PRIxLEAST16 - PRIxLEAST32 - PRIxLEAST64 - - PRIxFAST8 - PRIxFAST16 - PRIxFAST32 - PRIxFAST64 - - PRIxMAX - PRIxPTR - - PRIX8 - PRIX16 - PRIX32 - PRIX64 - - PRIXLEAST8 - PRIXLEAST16 - PRIXLEAST32 - PRIXLEAST64 - - PRIXFAST8 - PRIXFAST16 - PRIXFAST32 - PRIXFAST64 - - PRIXMAX - PRIXPTR - - SCNd8 - SCNd16 - SCNd32 - SCNd64 - - SCNdLEAST8 - SCNdLEAST16 - SCNdLEAST32 - SCNdLEAST64 - - SCNdFAST8 - SCNdFAST16 - SCNdFAST32 - SCNdFAST64 - - SCNdMAX - SCNdPTR - - SCNi8 - SCNi16 - SCNi32 - SCNi64 - - SCNiLEAST8 - SCNiLEAST16 - SCNiLEAST32 - SCNiLEAST64 - - SCNiFAST8 - SCNiFAST16 - SCNiFAST32 - SCNiFAST64 - - SCNiMAX - SCNiPTR - - SCNo8 - SCNo16 - SCNo32 - SCNo64 - - SCNoLEAST8 - SCNoLEAST16 - SCNoLEAST32 - SCNoLEAST64 - - SCNoFAST8 - SCNoFAST16 - SCNoFAST32 - SCNoFAST64 - - SCNoMAX - SCNoPTR - - SCNu8 - SCNu16 - SCNu32 - SCNu64 - - SCNuLEAST8 - SCNuLEAST16 - SCNuLEAST32 - SCNuLEAST64 - - SCNuFAST8 - SCNuFAST16 - SCNuFAST32 - SCNuFAST64 - - SCNuMAX - SCNuPTR - - SCNx8 - SCNx16 - SCNx32 - SCNx64 - - SCNxLEAST8 - SCNxLEAST16 - SCNxLEAST32 - SCNxLEAST64 - - SCNxFAST8 - SCNxFAST16 - SCNxFAST32 - SCNxFAST64 - - SCNxMAX - SCNxPTR - -Types: - - imaxdiv_t - -intmax_t imaxabs(intmax_t j); -imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); -intmax_t strtoimax(const char* restrict nptr, char** restrict endptr, int base); -uintmax_t strtoumax(const char* restrict nptr, char** restrict endptr, int base); -intmax_t wcstoimax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); -uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/iomanip b/libcxx/include/iomanip --- a/libcxx/include/iomanip +++ b/libcxx/include/iomanip @@ -10,38 +10,6 @@ #ifndef _LIBCPP_IOMANIP #define _LIBCPP_IOMANIP -/* - iomanip synopsis - -namespace std { - -// types T1, T2, ... are unspecified implementation types -T1 resetiosflags(ios_base::fmtflags mask); -T2 setiosflags (ios_base::fmtflags mask); -T3 setbase(int base); -template T4 setfill(charT c); -T5 setprecision(int n); -T6 setw(int n); -template T7 get_money(moneyT& mon, bool intl = false); -template T8 put_money(const moneyT& mon, bool intl = false); -template T9 get_time(struct tm* tmb, const charT* fmt); -template T10 put_time(const struct tm* tmb, const charT* fmt); - -template - T11 quoted(const charT* s, charT delim=charT('"'), charT escape=charT('\\')); // C++14 - -template - T12 quoted(const basic_string& s, - charT delim=charT('"'), charT escape=charT('\\')); // C++14 - -template - T13 quoted(basic_string& s, - charT delim=charT('"'), charT escape=charT('\\')); // C++14 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include diff --git a/libcxx/include/ios b/libcxx/include/ios --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -10,206 +10,6 @@ #ifndef _LIBCPP_IOS #define _LIBCPP_IOS -/* - ios synopsis - -#include - -namespace std -{ - -typedef OFF_T streamoff; -typedef SZ_T streamsize; -template class fpos; - -class ios_base -{ -public: - class failure; - - typedef T1 fmtflags; - static constexpr fmtflags boolalpha; - static constexpr fmtflags dec; - static constexpr fmtflags fixed; - static constexpr fmtflags hex; - static constexpr fmtflags internal; - static constexpr fmtflags left; - static constexpr fmtflags oct; - static constexpr fmtflags right; - static constexpr fmtflags scientific; - static constexpr fmtflags showbase; - static constexpr fmtflags showpoint; - static constexpr fmtflags showpos; - static constexpr fmtflags skipws; - static constexpr fmtflags unitbuf; - static constexpr fmtflags uppercase; - static constexpr fmtflags adjustfield; - static constexpr fmtflags basefield; - static constexpr fmtflags floatfield; - - typedef T2 iostate; - static constexpr iostate badbit; - static constexpr iostate eofbit; - static constexpr iostate failbit; - static constexpr iostate goodbit; - - typedef T3 openmode; - static constexpr openmode app; - static constexpr openmode ate; - static constexpr openmode binary; - static constexpr openmode in; - static constexpr openmode out; - static constexpr openmode trunc; - - typedef T4 seekdir; - static constexpr seekdir beg; - static constexpr seekdir cur; - static constexpr seekdir end; - - class Init; - - // 27.5.2.2 fmtflags state: - fmtflags flags() const; - fmtflags flags(fmtflags fmtfl); - fmtflags setf(fmtflags fmtfl); - fmtflags setf(fmtflags fmtfl, fmtflags mask); - void unsetf(fmtflags mask); - - streamsize precision() const; - streamsize precision(streamsize prec); - streamsize width() const; - streamsize width(streamsize wide); - - // 27.5.2.3 locales: - locale imbue(const locale& loc); - locale getloc() const; - - // 27.5.2.5 storage: - static int xalloc(); - long& iword(int index); - void*& pword(int index); - - // destructor - virtual ~ios_base(); - - // 27.5.2.6 callbacks; - enum event { erase_event, imbue_event, copyfmt_event }; - typedef void (*event_callback)(event, ios_base&, int index); - void register_callback(event_callback fn, int index); - - ios_base(const ios_base&) = delete; - ios_base& operator=(const ios_base&) = delete; - - static bool sync_with_stdio(bool sync = true); - -protected: - ios_base(); -}; - -template > -class basic_ios - : public ios_base -{ -public: - // types: - typedef charT char_type; - typedef typename traits::int_type int_type; // removed in C++17 - typedef typename traits::pos_type pos_type; // removed in C++17 - typedef typename traits::off_type off_type; // removed in C++17 - typedef traits traits_type; - - operator unspecified-bool-type() const; - bool operator!() const; - iostate rdstate() const; - void clear(iostate state = goodbit); - void setstate(iostate state); - bool good() const; - bool eof() const; - bool fail() const; - bool bad() const; - - iostate exceptions() const; - void exceptions(iostate except); - - // 27.5.4.1 Constructor/destructor: - explicit basic_ios(basic_streambuf* sb); - virtual ~basic_ios(); - - // 27.5.4.2 Members: - basic_ostream* tie() const; - basic_ostream* tie(basic_ostream* tiestr); - - basic_streambuf* rdbuf() const; - basic_streambuf* rdbuf(basic_streambuf* sb); - - basic_ios& copyfmt(const basic_ios& rhs); - - char_type fill() const; - char_type fill(char_type ch); - - locale imbue(const locale& loc); - - char narrow(char_type c, char dfault) const; - char_type widen(char c) const; - - basic_ios(const basic_ios& ) = delete; - basic_ios& operator=(const basic_ios&) = delete; - -protected: - basic_ios(); - void init(basic_streambuf* sb); - void move(basic_ios& rhs); - void swap(basic_ios& rhs) noexcept; - void set_rdbuf(basic_streambuf* sb); -}; - -// 27.5.5, manipulators: -ios_base& boolalpha (ios_base& str); -ios_base& noboolalpha(ios_base& str); -ios_base& showbase (ios_base& str); -ios_base& noshowbase (ios_base& str); -ios_base& showpoint (ios_base& str); -ios_base& noshowpoint(ios_base& str); -ios_base& showpos (ios_base& str); -ios_base& noshowpos (ios_base& str); -ios_base& skipws (ios_base& str); -ios_base& noskipws (ios_base& str); -ios_base& uppercase (ios_base& str); -ios_base& nouppercase(ios_base& str); -ios_base& unitbuf (ios_base& str); -ios_base& nounitbuf (ios_base& str); - -// 27.5.5.2 adjustfield: -ios_base& internal (ios_base& str); -ios_base& left (ios_base& str); -ios_base& right (ios_base& str); - -// 27.5.5.3 basefield: -ios_base& dec (ios_base& str); -ios_base& hex (ios_base& str); -ios_base& oct (ios_base& str); - -// 27.5.5.4 floatfield: -ios_base& fixed (ios_base& str); -ios_base& scientific (ios_base& str); -ios_base& hexfloat (ios_base& str); -ios_base& defaultfloat(ios_base& str); - -// 27.5.5.5 error reporting: -enum class io_errc -{ - stream = 1 -}; - -concept_map ErrorCodeEnum { }; -error_code make_error_code(io_errc e) noexcept; -error_condition make_error_condition(io_errc e) noexcept; -storage-class-specifier const error_category& iostream_category() noexcept; - -} // std - -*/ - #include <__config> #if defined(_LIBCPP_HAS_NO_LOCALIZATION) diff --git a/libcxx/include/iosfwd b/libcxx/include/iosfwd --- a/libcxx/include/iosfwd +++ b/libcxx/include/iosfwd @@ -10,90 +10,6 @@ #ifndef _LIBCPP_IOSFWD #define _LIBCPP_IOSFWD -/* - iosfwd synopsis - -namespace std -{ - -template struct char_traits; -template<> struct char_traits; -template<> struct char_traits; // C++20 -template<> struct char_traits; -template<> struct char_traits; -template<> struct char_traits; - -template class allocator; - -class ios_base; -template > class basic_ios; - -template > class basic_streambuf; -template > class basic_istream; -template > class basic_ostream; -template > class basic_iostream; - -template , class Allocator = allocator > - class basic_stringbuf; -template , class Allocator = allocator > - class basic_istringstream; -template , class Allocator = allocator > - class basic_ostringstream; -template , class Allocator = allocator > - class basic_stringstream; - -template > class basic_filebuf; -template > class basic_ifstream; -template > class basic_ofstream; -template > class basic_fstream; - -template > class istreambuf_iterator; -template > class ostreambuf_iterator; - -typedef basic_ios ios; -typedef basic_ios wios; - -typedef basic_streambuf streambuf; -typedef basic_istream istream; -typedef basic_ostream ostream; -typedef basic_iostream iostream; - -typedef basic_stringbuf stringbuf; -typedef basic_istringstream istringstream; -typedef basic_ostringstream ostringstream; -typedef basic_stringstream stringstream; - -typedef basic_filebuf filebuf; -typedef basic_ifstream ifstream; -typedef basic_ofstream ofstream; -typedef basic_fstream fstream; - -typedef basic_streambuf wstreambuf; -typedef basic_istream wistream; -typedef basic_ostream wostream; -typedef basic_iostream wiostream; - -typedef basic_stringbuf wstringbuf; -typedef basic_istringstream wistringstream; -typedef basic_ostringstream wostringstream; -typedef basic_stringstream wstringstream; - -typedef basic_filebuf wfilebuf; -typedef basic_ifstream wifstream; -typedef basic_ofstream wofstream; -typedef basic_fstream wfstream; - -template class fpos; -using streampos = fpos::state_type>; -using wstreampos = fpos::state_type>; -using u8streampos = fpos::state_type>; // C++20 -using u16streampos = fpos::state_type>; -using u32streampos = fpos::state_type>; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__fwd/string.h> diff --git a/libcxx/include/iostream b/libcxx/include/iostream --- a/libcxx/include/iostream +++ b/libcxx/include/iostream @@ -10,29 +10,6 @@ #ifndef _LIBCPP_IOSTREAM #define _LIBCPP_IOSTREAM -/* - iostream synopsis - -#include -#include -#include -#include - -namespace std { - -extern istream cin; -extern ostream cout; -extern ostream cerr; -extern ostream clog; -extern wistream wcin; -extern wostream wcout; -extern wostream wcerr; -extern wostream wclog; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include diff --git a/libcxx/include/istream b/libcxx/include/istream --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -10,154 +10,6 @@ #ifndef _LIBCPP_ISTREAM #define _LIBCPP_ISTREAM -/* - istream synopsis - -template > -class basic_istream - : virtual public basic_ios -{ -public: - // types (inherited from basic_ios (27.5.4)): - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // 27.7.1.1.1 Constructor/destructor: - explicit basic_istream(basic_streambuf* sb); - basic_istream(basic_istream&& rhs); - virtual ~basic_istream(); - - // 27.7.1.1.2 Assign/swap: - basic_istream& operator=(basic_istream&& rhs); - void swap(basic_istream& rhs); - - // 27.7.1.1.3 Prefix/suffix: - class sentry; - - // 27.7.1.2 Formatted input: - basic_istream& operator>>(basic_istream& (*pf)(basic_istream&)); - basic_istream& operator>>(basic_ios& - (*pf)(basic_ios&)); - basic_istream& operator>>(ios_base& (*pf)(ios_base&)); - basic_istream& operator>>(basic_streambuf* sb); - basic_istream& operator>>(bool& n); - basic_istream& operator>>(short& n); - basic_istream& operator>>(unsigned short& n); - basic_istream& operator>>(int& n); - basic_istream& operator>>(unsigned int& n); - basic_istream& operator>>(long& n); - basic_istream& operator>>(unsigned long& n); - basic_istream& operator>>(long long& n); - basic_istream& operator>>(unsigned long long& n); - basic_istream& operator>>(float& f); - basic_istream& operator>>(double& f); - basic_istream& operator>>(long double& f); - basic_istream& operator>>(void*& p); - - // 27.7.1.3 Unformatted input: - streamsize gcount() const; - int_type get(); - basic_istream& get(char_type& c); - basic_istream& get(char_type* s, streamsize n); - basic_istream& get(char_type* s, streamsize n, char_type delim); - basic_istream& get(basic_streambuf& sb); - basic_istream& get(basic_streambuf& sb, char_type delim); - - basic_istream& getline(char_type* s, streamsize n); - basic_istream& getline(char_type* s, streamsize n, char_type delim); - - basic_istream& ignore(streamsize n = 1, int_type delim = traits_type::eof()); - int_type peek(); - basic_istream& read (char_type* s, streamsize n); - streamsize readsome(char_type* s, streamsize n); - - basic_istream& putback(char_type c); - basic_istream& unget(); - int sync(); - - pos_type tellg(); - basic_istream& seekg(pos_type); - basic_istream& seekg(off_type, ios_base::seekdir); -protected: - basic_istream(const basic_istream& rhs) = delete; - basic_istream(basic_istream&& rhs); - // 27.7.2.1.2 Assign/swap: - basic_istream& operator=(const basic_istream& rhs) = delete; - basic_istream& operator=(basic_istream&& rhs); - void swap(basic_istream& rhs); -}; - -// 27.7.1.2.3 character extraction templates: -template - basic_istream& operator>>(basic_istream&, charT&); - -template - basic_istream& operator>>(basic_istream&, unsigned char&); - -template - basic_istream& operator>>(basic_istream&, signed char&); - -template - basic_istream& operator>>(basic_istream&, charT*); - -template - basic_istream& operator>>(basic_istream&, unsigned char*); - -template - basic_istream& operator>>(basic_istream&, signed char*); - -template - void - swap(basic_istream& x, basic_istream& y); - -typedef basic_istream istream; -typedef basic_istream wistream; - -template > -class basic_iostream : - public basic_istream, - public basic_ostream -{ -public: - // types: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // constructor/destructor - explicit basic_iostream(basic_streambuf* sb); - basic_iostream(basic_iostream&& rhs); - virtual ~basic_iostream(); - - // assign/swap - basic_iostream& operator=(basic_iostream&& rhs); - void swap(basic_iostream& rhs); -}; - -template - void - swap(basic_iostream& x, basic_iostream& y); - -typedef basic_iostream iostream; -typedef basic_iostream wiostream; - -template - basic_istream& - ws(basic_istream& is); - -// rvalue stream extraction -template - Stream&& operator>>(Stream&& is, T&& x); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__iterator/istreambuf_iterator.h> diff --git a/libcxx/include/iterator b/libcxx/include/iterator --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -10,670 +10,6 @@ #ifndef _LIBCPP_ITERATOR #define _LIBCPP_ITERATOR -/* - iterator synopsis - -#include - -namespace std -{ -template struct incrementable_traits; // since C++20 -template - using iter_difference_t = see below; // since C++20 - -template struct indirectly_readable_traits; // since C++20 -template - using iter_value_t = see below; // since C++20 - -template -struct iterator_traits; - -template - requires is_object_v // since C++20 -struct iterator_traits; - -template - using iter_reference_t = decltype(*declval()); - -namespace ranges::inline unspecified { - inline constexpr unspecified iter_move = unspecified; // since C++20, nodiscard as an extension -}} - -template - requires ... -using iter_rvalue_reference_t = decltype(ranges::iter_move(declval())); // since C++20 - -// [iterator.concepts], iterator concepts -// [iterator.concept.readable], concept indirectly_readable -template - concept indirectly_readable = see below; // since C++20 - -template - using iter_common_reference_t = - common_reference_t, iter_value_t&>; // since C++20 - -// [iterator.concept.writable], concept indirectly_writable -template - concept indirectly_writable = see below; // since C++20 - -// [iterator.concept.winc], concept weakly_incrementable -template - concept weakly_incrementable = see below; // since C++20 - -// [iterator.concept.inc], concept incrementable -template - concept incrementable = see below; // since C++20 - -// [iterator.concept.iterator], concept input_or_output_iterator - template - concept input_or_output_iterator = see below; // since C++20 - -// [iterator.concept.sentinel], concept sentinel_for -template - concept sentinel_for = see below; // since C++20 - -// [iterator.concept.sizedsentinel], concept sized_sentinel_for -template - inline constexpr bool disable_sized_sentinel_for = false; - -template - concept sized_sentinel_for = see below; - -// [iterator.concept.input], concept input_iterator -template - concept input_iterator = see below; // since C++20 - -// [iterator.concept.output], concept output_iterator -template - concept output_iterator = see below; // since C++20 - -// [iterator.concept.forward], concept forward_iterator -template - concept forward_iterator = see below; // since C++20 - -// [iterator.concept.bidir], concept bidirectional_iterator -template - concept bidirectional_iterator = see below; // since C++20 - -// [iterator.concept.random.access], concept random_access_iterator -template - concept random_access_iterator = see below; // since C++20 - -// [indirectcallable] -// [indirectcallable.indirectinvocable] -template - concept indirectly_unary_invocable = see below; // since C++20 - -template - concept indirectly_regular_unary_invocable = see below; // since C++20 - -template - concept indirect_unary_predicate = see below; // since C++20 - -template - concept indirect_binary_predicate = see below; // since C++20 - -template - concept indirect_equivalence_relation = see below; // since C++20 - -template - concept indirect_strict_weak_order = see below; // since C++20 - -template - using indirect_result_t = see below; // since C++20 - -// [projected], projected -template Proj> - struct projected; // since C++20 - -template Proj> - struct incrementable_traits>; // since C++20 - -// [alg.req.ind.move], concept indirectly_movable -template - concept indirectly_movable = see below; // since C++20 - -template - concept indirectly_movable_storable = see below; // since C++20 - -// [alg.req.ind.copy], concept indirectly_copyable -template - concept indirectly_copyable = see below; // since C++20 - -template - concept indirectly_copyable_storable = see below; // since C++20 - -// [alg.req.ind.swap], concept indirectly_swappable -template - concept indirectly_swappable = see below; // since C++20 - -template - concept indirectly_comparable = - indirect_binary_predicate, projected>; // since C++20 - -// [alg.req.permutable], concept permutable -template - concept permutable = see below; // since C++20 - - // [alg.req.mergeable], concept mergeable -template - concept mergeable = see below; // since C++20 - -// [alg.req.sortable], concept sortable -template - concept sortable = see below; // since C++20 - -template S> - requires (!same_as && copyable) -class common_iterator; // since C++20 - -template -struct iterator // deprecated in C++17 -{ - typedef T value_type; - typedef Distance difference_type; - typedef Pointer pointer; - typedef Reference reference; - typedef Category iterator_category; -}; - -struct input_iterator_tag {}; -struct output_iterator_tag {}; -struct forward_iterator_tag : public input_iterator_tag {}; -struct bidirectional_iterator_tag : public forward_iterator_tag {}; -struct random_access_iterator_tag : public bidirectional_iterator_tag {}; -struct contiguous_iterator_tag : public random_access_iterator_tag {}; - -// 27.4.3, iterator operations -template // constexpr in C++17 - constexpr void advance(InputIterator& i, Distance n); - -template // constexpr in C++17 - constexpr typename iterator_traits::difference_type - distance(InputIterator first, InputIterator last); - -template // constexpr in C++17 - constexpr InputIterator next(InputIterator x, -typename iterator_traits::difference_type n = 1); - -template // constexpr in C++17 - constexpr BidirectionalIterator prev(BidirectionalIterator x, - typename iterator_traits::difference_type n = 1); - -// [range.iter.ops], range iterator operations -namespace ranges { - // [range.iter.op.advance], ranges::advance - template - constexpr void advance(I& i, iter_difference_t n); // since C++20 - template S> - constexpr void advance(I& i, S bound); // since C++20 - template S> - constexpr iter_difference_t advance(I& i, iter_difference_t n, S bound); // since C++20 -} - -template -class reverse_iterator - : public iterator::iterator_category, // until C++17 - typename iterator_traits::value_type, - typename iterator_traits::difference_type, - typename iterator_traits::pointer, - typename iterator_traits::reference> -{ -protected: - Iterator current; -public: - using iterator_type = Iterator; - using iterator_concept = see below; // since C++20 - using iterator_category = typename iterator_traits::iterator_category; // since C++17, until C++20 - using iterator_category = see below; // since C++20 - using value_type = typename iterator_traits::value_type; // since C++17, until C++20 - using value_type = iter_value_t; // since C++20 - using difference_type = typename iterator_traits::difference_type; // until C++20 - using difference_type = iter_difference_t; // since C++20 - using pointer = typename iterator_traits::pointer; - using reference = typename iterator_traits::reference; // until C++20 - using reference = iter_reference_t; // since C++20 - - constexpr reverse_iterator(); - constexpr explicit reverse_iterator(Iterator x); - template constexpr reverse_iterator(const reverse_iterator& u); - template constexpr reverse_iterator& operator=(const reverse_iterator& u); - constexpr Iterator base() const; - constexpr reference operator*() const; - constexpr pointer operator->() const; // until C++20 - constexpr pointer operator->() const requires see below; // since C++20 - constexpr reverse_iterator& operator++(); - constexpr reverse_iterator operator++(int); - constexpr reverse_iterator& operator--(); - constexpr reverse_iterator operator--(int); - constexpr reverse_iterator operator+ (difference_type n) const; - constexpr reverse_iterator& operator+=(difference_type n); - constexpr reverse_iterator operator- (difference_type n) const; - constexpr reverse_iterator& operator-=(difference_type n); - constexpr unspecified operator[](difference_type n) const; - - friend constexpr iter_rvalue_reference_t - iter_move(const reverse_iterator& i) noexcept(see below); - template Iterator2> - friend constexpr void - iter_swap(const reverse_iterator& x, - const reverse_iterator& y) noexcept(see below); -}; - -template -constexpr bool // constexpr in C++17 -operator==(const reverse_iterator& x, const reverse_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator!=(const reverse_iterator& x, const reverse_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator<(const reverse_iterator& x, const reverse_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator>(const reverse_iterator& x, const reverse_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator<=(const reverse_iterator& x, const reverse_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator>=(const reverse_iterator& x, const reverse_iterator& y); - -template Iterator2> - constexpr compare_three_way_result_t - operator<=>(const reverse_iterator& x, - const reverse_iterator& y); - -template -constexpr auto -operator-(const reverse_iterator& x, const reverse_iterator& y) --> decltype(__y.base() - __x.base()); // constexpr in C++17 - -template -constexpr reverse_iterator -operator+(typename reverse_iterator::difference_type n, - const reverse_iterator& x); // constexpr in C++17 - -template -constexpr reverse_iterator make_reverse_iterator(Iterator i); // C++14, constexpr in C++17 - -template - requires (!sized_sentinel_for) - inline constexpr bool disable_sized_sentinel_for, - reverse_iterator> = true; - -template -class back_insert_iterator - : public iterator // until C++17 -{ -protected: - Container* container; -public: - typedef Container container_type; - typedef void value_type; - typedef void difference_type; // until C++20 - typedef ptrdiff_t difference_type; // since C++20 - typedef void reference; - typedef void pointer; - - explicit back_insert_iterator(Container& x); // constexpr in C++20 - back_insert_iterator& operator=(const typename Container::value_type& value); // constexpr in C++20 - back_insert_iterator& operator*(); // constexpr in C++20 - back_insert_iterator& operator++(); // constexpr in C++20 - back_insert_iterator operator++(int); // constexpr in C++20 -}; - -template back_insert_iterator back_inserter(Container& x); // constexpr in C++20 - -template -class front_insert_iterator - : public iterator // until C++17 -{ -protected: - Container* container; -public: - typedef Container container_type; - typedef void value_type; - typedef void difference_type; // until C++20 - typedef ptrdiff_t difference_type; // since C++20 - typedef void reference; - typedef void pointer; - - explicit front_insert_iterator(Container& x); // constexpr in C++20 - front_insert_iterator& operator=(const typename Container::value_type& value); // constexpr in C++20 - front_insert_iterator& operator*(); // constexpr in C++20 - front_insert_iterator& operator++(); // constexpr in C++20 - front_insert_iterator operator++(int); // constexpr in C++20 -}; - -template front_insert_iterator front_inserter(Container& x); // constexpr in C++20 - -template -class insert_iterator - : public iterator // until C++17 -{ -protected: - Container* container; - typename Container::iterator iter; -public: - typedef Container container_type; - typedef void value_type; - typedef void difference_type; // until C++20 - typedef ptrdiff_t difference_type; // since C++20 - typedef void reference; - typedef void pointer; - - insert_iterator(Container& x, typename Container::iterator i); // constexpr in C++20 - insert_iterator& operator=(const typename Container::value_type& value); // constexpr in C++20 - insert_iterator& operator*(); // constexpr in C++20 - insert_iterator& operator++(); // constexpr in C++20 - insert_iterator& operator++(int); // constexpr in C++20 -}; - -template -insert_iterator inserter(Container& x, typename Container::iterator i); // until C++20 -template -constexpr insert_iterator inserter(Container& x, ranges::iterator_t i); // since C++20 - -template -class move_iterator { -public: - using iterator_type = Iterator; - using iterator_concept = see below; // From C++20 - using iterator_category = see below; // not always present starting from C++20 - using value_type = iter_value_t; // Until C++20, iterator_traits::value_type - using difference_type = iter_difference_t; // Until C++20, iterator_traits::difference_type; - using pointer = Iterator; - using reference = iter_rvalue_reference_t; // Until C++20, value_type&& - - constexpr move_iterator(); // all the constexprs are in C++17 - constexpr explicit move_iterator(Iterator i); - template - constexpr move_iterator(const move_iterator& u); - template - constexpr move_iterator& operator=(const move_iterator& u); - - constexpr iterator_type base() const; // Until C++20 - constexpr const Iterator& base() const & noexcept; // From C++20 - constexpr Iterator base() &&; // From C++20 - - constexpr reference operator*() const; - constexpr pointer operator->() const; // Deprecated in C++20 - constexpr move_iterator& operator++(); - constexpr auto operator++(int); // Return type was move_iterator until C++20 - constexpr move_iterator& operator--(); - constexpr move_iterator operator--(int); - constexpr move_iterator operator+(difference_type n) const; - constexpr move_iterator& operator+=(difference_type n); - constexpr move_iterator operator-(difference_type n) const; - constexpr move_iterator& operator-=(difference_type n); - constexpr reference operator[](difference_type n) const; // Return type unspecified until C++20 - - template S> - friend constexpr bool - operator==(const move_iterator& x, const move_sentinel& y); // Since C++20 - template S> - friend constexpr iter_difference_t - operator-(const move_sentinel& x, const move_iterator& y); // Since C++20 - template S> - friend constexpr iter_difference_t - operator-(const move_iterator& x, const move_sentinel& y); // Since C++20 - friend constexpr iter_rvalue_reference_t - iter_move(const move_iterator& i) - noexcept(noexcept(ranges::iter_move(i.current))); // Since C++20 - template Iterator2> - friend constexpr void - iter_swap(const move_iterator& x, const move_iterator& y) - noexcept(noexcept(ranges::iter_swap(x.current, y.current))); // Since C++20 - -private: - Iterator current; // exposition only -}; - -template -constexpr bool // constexpr in C++17 -operator==(const move_iterator& x, const move_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator!=(const move_iterator& x, const move_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator<(const move_iterator& x, const move_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator<=(const move_iterator& x, const move_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator>(const move_iterator& x, const move_iterator& y); - -template -constexpr bool // constexpr in C++17 -operator>=(const move_iterator& x, const move_iterator& y); - -template -constexpr auto // constexpr in C++17 -operator-(const move_iterator& x, - const move_iterator& y) -> decltype(x.base() - y.base()); - -template -constexpr move_iterator operator+( // constexpr in C++17 - typename move_iterator::difference_type n, - const move_iterator& x); - -template // constexpr in C++17 -constexpr move_iterator make_move_iterator(const Iterator& i); - -template -class move_sentinel { -public: - constexpr move_sentinel(); - constexpr explicit move_sentinel(S s); - template - requires convertible_to - constexpr move_sentinel(const move_sentinel& s); - template - requires assignable_from - constexpr move_sentinel& operator=(const move_sentinel& s); - - constexpr S base() const; -private: - S last; // exposition only -}; - -// [default.sentinel], default sentinel -struct default_sentinel_t; -inline constexpr default_sentinel_t default_sentinel{}; - -// [iterators.counted], counted iterators -template class counted_iterator; - -template - requires see below - struct iterator_traits>; - -// [unreachable.sentinel], unreachable sentinel -struct unreachable_sentinel_t; -inline constexpr unreachable_sentinel_t unreachable_sentinel{}; - -template , class Distance = ptrdiff_t> -class istream_iterator - : public iterator // until C++17 -{ -public: - typedef input_iterator_tag iterator_category; - typedef T value_type; - typedef Distance difference_type; - typedef const T* pointer; - typedef const T& reference; - - typedef charT char_type; - typedef traits traits_type; - typedef basic_istream istream_type; - - istream_iterator(); // constexpr since C++11 - constexpr istream_iterator(default_sentinel_t); // since C++20 - istream_iterator(istream_type& s); - istream_iterator(const istream_iterator& x); - ~istream_iterator(); - - const T& operator*() const; - const T* operator->() const; - istream_iterator& operator++(); - istream_iterator operator++(int); - friend bool operator==(const istream_iterator& i, default_sentinel_t); // since C++20 -}; - -template -bool operator==(const istream_iterator& x, - const istream_iterator& y); -template -bool operator!=(const istream_iterator& x, - const istream_iterator& y); // until C++20 - -template > -class ostream_iterator - : public iterator // until C++17 -{ -public: - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; // until C++20 - typedef ptrdiff_t difference_type; // since C++20 - typedef void pointer; - typedef void reference; - - typedef charT char_type; - typedef traits traits_type; - typedef basic_ostream ostream_type; - - ostream_iterator(ostream_type& s); - ostream_iterator(ostream_type& s, const charT* delimiter); - ostream_iterator(const ostream_iterator& x); - ~ostream_iterator(); - ostream_iterator& operator=(const T& value); - - ostream_iterator& operator*(); - ostream_iterator& operator++(); - ostream_iterator& operator++(int); -}; - -template > -class istreambuf_iterator - : public iterator // until C++17 -{ -public: - typedef input_iterator_tag iterator_category; - typedef charT value_type; - typedef traits::off_type difference_type; - typedef unspecified pointer; - typedef charT reference; - - typedef charT char_type; - typedef traits traits_type; - typedef traits::int_type int_type; - typedef basic_streambuf streambuf_type; - typedef basic_istream istream_type; - - istreambuf_iterator() noexcept; // constexpr since C++11 - constexpr istreambuf_iterator(default_sentinel_t) noexcept; // since C++20 - istreambuf_iterator(istream_type& s) noexcept; - istreambuf_iterator(streambuf_type* s) noexcept; - istreambuf_iterator(a-private-type) noexcept; - - charT operator*() const; - pointer operator->() const; - istreambuf_iterator& operator++(); - a-private-type operator++(int); - - bool equal(const istreambuf_iterator& b) const; - friend bool operator==(const istreambuf_iterator& i, default_sentinel_t s); // since C++20 -}; - -template -bool operator==(const istreambuf_iterator& a, - const istreambuf_iterator& b); -template -bool operator!=(const istreambuf_iterator& a, - const istreambuf_iterator& b); // until C++20 - -template > -class ostreambuf_iterator - : public iterator // until C++17 -{ -public: - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; // until C++20 - typedef ptrdiff_t difference_type; // since C++20 - typedef void pointer; - typedef void reference; - - typedef charT char_type; - typedef traits traits_type; - typedef basic_streambuf streambuf_type; - typedef basic_ostream ostream_type; - - ostreambuf_iterator(ostream_type& s) noexcept; - ostreambuf_iterator(streambuf_type* s) noexcept; - ostreambuf_iterator& operator=(charT c); - ostreambuf_iterator& operator*(); - ostreambuf_iterator& operator++(); - ostreambuf_iterator& operator++(int); - bool failed() const noexcept; -}; - -template constexpr auto begin(C& c) -> decltype(c.begin()); -template constexpr auto begin(const C& c) -> decltype(c.begin()); -template constexpr auto end(C& c) -> decltype(c.end()); -template constexpr auto end(const C& c) -> decltype(c.end()); -template constexpr T* begin(T (&array)[N]); -template constexpr T* end(T (&array)[N]); - -template auto constexpr cbegin(const C& c) -> decltype(std::begin(c)); // C++14 -template auto constexpr cend(const C& c) -> decltype(std::end(c)); // C++14 -template auto constexpr rbegin(C& c) -> decltype(c.rbegin()); // C++14 -template auto constexpr rbegin(const C& c) -> decltype(c.rbegin()); // C++14 -template auto constexpr rend(C& c) -> decltype(c.rend()); // C++14 -template constexpr auto rend(const C& c) -> decltype(c.rend()); // C++14 -template reverse_iterator constexpr rbegin(initializer_list il); // C++14 -template reverse_iterator constexpr rend(initializer_list il); // C++14 -template reverse_iterator constexpr rbegin(T (&array)[N]); // C++14 -template reverse_iterator constexpr rend(T (&array)[N]); // C++14 -template constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14 -template constexpr auto crend(const C& c) -> decltype(std::rend(c)); // C++14 - -// 24.8, container access: -template constexpr auto size(const C& c) -> decltype(c.size()); // C++17 -template constexpr size_t size(const T (&array)[N]) noexcept; // C++17 - -template constexpr auto ssize(const C& c) - -> common_type_t>; // C++20 -template constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept; // C++20 - -template constexpr auto empty(const C& c) -> decltype(c.empty()); // C++17 -template constexpr bool empty(const T (&array)[N]) noexcept; // C++17 -template constexpr bool empty(initializer_list il) noexcept; // C++17 -template constexpr auto data(C& c) -> decltype(c.data()); // C++17 -template constexpr auto data(const C& c) -> decltype(c.data()); // C++17 -template constexpr T* data(T (&array)[N]) noexcept; // C++17 -template constexpr const E* data(initializer_list il) noexcept; // C++17 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__debug> diff --git a/libcxx/include/latch b/libcxx/include/latch --- a/libcxx/include/latch +++ b/libcxx/include/latch @@ -10,36 +10,6 @@ #ifndef _LIBCPP_LATCH #define _LIBCPP_LATCH -/* - latch synopsis - -namespace std -{ - - class latch - { - public: - static constexpr ptrdiff_t max() noexcept; - - constexpr explicit latch(ptrdiff_t __expected); - ~latch(); - - latch(const latch&) = delete; - latch& operator=(const latch&) = delete; - - void count_down(ptrdiff_t __update = 1); - bool try_wait() const noexcept; - void wait() const; - void arrive_and_wait(ptrdiff_t __update = 1); - - private: - ptrdiff_t __counter; // exposition only - }; - -} - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__atomic/atomic_base.h> #include <__atomic/atomic_sync.h> diff --git a/libcxx/include/limits b/libcxx/include/limits --- a/libcxx/include/limits +++ b/libcxx/include/limits @@ -10,98 +10,6 @@ #ifndef _LIBCPP_LIMITS #define _LIBCPP_LIMITS -/* - limits synopsis - -namespace std -{ - -template -class numeric_limits -{ -public: - static constexpr bool is_specialized = false; - static constexpr T min() noexcept; - static constexpr T max() noexcept; - static constexpr T lowest() noexcept; - - static constexpr int digits = 0; - static constexpr int digits10 = 0; - static constexpr int max_digits10 = 0; - static constexpr bool is_signed = false; - static constexpr bool is_integer = false; - static constexpr bool is_exact = false; - static constexpr int radix = 0; - static constexpr T epsilon() noexcept; - static constexpr T round_error() noexcept; - - static constexpr int min_exponent = 0; - static constexpr int min_exponent10 = 0; - static constexpr int max_exponent = 0; - static constexpr int max_exponent10 = 0; - - static constexpr bool has_infinity = false; - static constexpr bool has_quiet_NaN = false; - static constexpr bool has_signaling_NaN = false; - static constexpr float_denorm_style has_denorm = denorm_absent; - static constexpr bool has_denorm_loss = false; - static constexpr T infinity() noexcept; - static constexpr T quiet_NaN() noexcept; - static constexpr T signaling_NaN() noexcept; - static constexpr T denorm_min() noexcept; - - static constexpr bool is_iec559 = false; - static constexpr bool is_bounded = false; - static constexpr bool is_modulo = false; - - static constexpr bool traps = false; - static constexpr bool tinyness_before = false; - static constexpr float_round_style round_style = round_toward_zero; -}; - -enum float_round_style -{ - round_indeterminate = -1, - round_toward_zero = 0, - round_to_nearest = 1, - round_toward_infinity = 2, - round_toward_neg_infinity = 3 -}; - -enum float_denorm_style -{ - denorm_indeterminate = -1, - denorm_absent = 0, - denorm_present = 1 -}; - -template<> class numeric_limits; - -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; // C++20 -template<> class numeric_limits; -template<> class numeric_limits; - -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; - -template<> class numeric_limits; -template<> class numeric_limits; -template<> class numeric_limits; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__type_traits/is_arithmetic.h> diff --git a/libcxx/include/limits.h b/libcxx/include/limits.h --- a/libcxx/include/limits.h +++ b/libcxx/include/limits.h @@ -10,33 +10,6 @@ #ifndef _LIBCPP_LIMITS_H #define _LIBCPP_LIMITS_H -/* - limits.h synopsis - -Macros: - - CHAR_BIT - SCHAR_MIN - SCHAR_MAX - UCHAR_MAX - CHAR_MIN - CHAR_MAX - MB_LEN_MAX - SHRT_MIN - SHRT_MAX - USHRT_MAX - INT_MIN - INT_MAX - UINT_MAX - LONG_MIN - LONG_MAX - ULONG_MAX - LLONG_MIN // C99 - LLONG_MAX // C99 - ULLONG_MAX // C99 - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -10,179 +10,6 @@ #ifndef _LIBCPP_LIST #define _LIBCPP_LIST -/* - list synopsis - -namespace std -{ - -template > -class list -{ -public: - - // types: - typedef T value_type; - typedef Alloc allocator_type; - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - typedef typename allocator_type::pointer pointer; - typedef typename allocator_type::const_pointer const_pointer; - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef implementation-defined size_type; - typedef implementation-defined difference_type; - typedef reverse_iterator reverse_iterator; - typedef reverse_iterator const_reverse_iterator; - - list() - noexcept(is_nothrow_default_constructible::value); - explicit list(const allocator_type& a); - explicit list(size_type n); - explicit list(size_type n, const allocator_type& a); // C++14 - list(size_type n, const value_type& value); - list(size_type n, const value_type& value, const allocator_type& a); - template - list(Iter first, Iter last); - template - list(Iter first, Iter last, const allocator_type& a); - list(const list& x); - list(const list&, const allocator_type& a); - list(list&& x) - noexcept(is_nothrow_move_constructible::value); - list(list&&, const allocator_type& a); - list(initializer_list); - list(initializer_list, const allocator_type& a); - - ~list(); - - list& operator=(const list& x); - list& operator=(list&& x) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value); - list& operator=(initializer_list); - template - void assign(Iter first, Iter last); - void assign(size_type n, const value_type& t); - void assign(initializer_list); - - allocator_type get_allocator() const noexcept; - - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - reverse_iterator rbegin() noexcept; - const_reverse_iterator rbegin() const noexcept; - reverse_iterator rend() noexcept; - const_reverse_iterator rend() const noexcept; - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - template - reference emplace_front(Args&&... args); // reference in C++17 - void pop_front(); - template - reference emplace_back(Args&&... args); // reference in C++17 - void pop_back(); - void push_front(const value_type& x); - void push_front(value_type&& x); - void push_back(const value_type& x); - void push_back(value_type&& x); - template - iterator emplace(const_iterator position, Args&&... args); - iterator insert(const_iterator position, const value_type& x); - iterator insert(const_iterator position, value_type&& x); - iterator insert(const_iterator position, size_type n, const value_type& x); - template - iterator insert(const_iterator position, Iter first, Iter last); - iterator insert(const_iterator position, initializer_list il); - - iterator erase(const_iterator position); - iterator erase(const_iterator position, const_iterator last); - - void resize(size_type sz); - void resize(size_type sz, const value_type& c); - - void swap(list&) - noexcept(allocator_traits::is_always_equal::value); // C++17 - void clear() noexcept; - - void splice(const_iterator position, list& x); - void splice(const_iterator position, list&& x); - void splice(const_iterator position, list& x, const_iterator i); - void splice(const_iterator position, list&& x, const_iterator i); - void splice(const_iterator position, list& x, const_iterator first, - const_iterator last); - void splice(const_iterator position, list&& x, const_iterator first, - const_iterator last); - - size_type remove(const value_type& value); // void before C++20 - template - size_type remove_if(Pred pred); // void before C++20 - size_type unique(); // void before C++20 - template - size_type unique(BinaryPredicate binary_pred); // void before C++20 - void merge(list& x); - void merge(list&& x); - template - void merge(list& x, Compare comp); - template - void merge(list&& x, Compare comp); - void sort(); - template - void sort(Compare comp); - void reverse() noexcept; -}; - - -template ::value_type>> - list(InputIterator, InputIterator, Allocator = Allocator()) - -> list::value_type, Allocator>; // C++17 - -template - bool operator==(const list& x, const list& y); -template - bool operator< (const list& x, const list& y); // removed in C++20 -template - bool operator!=(const list& x, const list& y); // removed in C++20 -template - bool operator> (const list& x, const list& y); // removed in C++20 -template - bool operator>=(const list& x, const list& y); // removed in C++20 -template - bool operator<=(const list& x, const list& y); // removed in C++20 -template - synth-three-way-result operator<=>(const list& x, - const list& y); // since C++20 - -template - void swap(list& x, list& y) - noexcept(noexcept(x.swap(y))); - -template - typename list::size_type - erase(list& c, const U& value); // since C++20 -template - typename list::size_type - erase_if(list& c, Predicate pred); // since C++20 - -} // std - -*/ - #include <__algorithm/comp.h> #include <__algorithm/equal.h> #include <__algorithm/lexicographical_compare.h> diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -10,183 +10,6 @@ #ifndef _LIBCPP_LOCALE #define _LIBCPP_LOCALE -/* - locale synopsis - -namespace std -{ - -class locale -{ -public: - // types: - class facet; - class id; - - typedef int category; - static const category // values assigned here are for exposition only - none = 0x000, - collate = 0x010, - ctype = 0x020, - monetary = 0x040, - numeric = 0x080, - time = 0x100, - messages = 0x200, - all = collate | ctype | monetary | numeric | time | messages; - - // construct/copy/destroy: - locale() noexcept; - locale(const locale& other) noexcept; - explicit locale(const char* std_name); - explicit locale(const string& std_name); - locale(const locale& other, const char* std_name, category); - locale(const locale& other, const string& std_name, category); - template locale(const locale& other, Facet* f); - locale(const locale& other, const locale& one, category); - - ~locale(); // not virtual - - const locale& operator=(const locale& other) noexcept; - - template locale combine(const locale& other) const; - - // locale operations: - basic_string name() const; - bool operator==(const locale& other) const; - bool operator!=(const locale& other) const; - template - bool operator()(const basic_string& s1, - const basic_string& s2) const; - - // global locale objects: - static locale global(const locale&); - static const locale& classic(); -}; - -template const Facet& use_facet(const locale&); -template bool has_facet(const locale&) noexcept; - -// 22.3.3, convenience interfaces: -template bool isspace (charT c, const locale& loc); -template bool isprint (charT c, const locale& loc); -template bool iscntrl (charT c, const locale& loc); -template bool isupper (charT c, const locale& loc); -template bool islower (charT c, const locale& loc); -template bool isalpha (charT c, const locale& loc); -template bool isdigit (charT c, const locale& loc); -template bool ispunct (charT c, const locale& loc); -template bool isxdigit(charT c, const locale& loc); -template bool isalnum (charT c, const locale& loc); -template bool isgraph (charT c, const locale& loc); -template charT toupper(charT c, const locale& loc); -template charT tolower(charT c, const locale& loc); - -template, - class Byte_alloc = allocator> -class wstring_convert -{ -public: - typedef basic_string, Byte_alloc> byte_string; - typedef basic_string, Wide_alloc> wide_string; - typedef typename Codecvt::state_type state_type; - typedef typename wide_string::traits_type::int_type int_type; - - wstring_convert(Codecvt* pcvt = new Codecvt); // before C++14 - explicit wstring_convert(Codecvt* pcvt = new Codecvt); // before C++20 - wstring_convert() : wstring_convert(new Codecvt) {} // C++20 - explicit wstring_convert(Codecvt* pcvt); // C++20 - - wstring_convert(Codecvt* pcvt, state_type state); - explicit wstring_convert(const byte_string& byte_err, // explicit in C++14 - const wide_string& wide_err = wide_string()); - wstring_convert(const wstring_convert&) = delete; // C++14 - wstring_convert & operator=(const wstring_convert &) = delete; // C++14 - ~wstring_convert(); - - wide_string from_bytes(char byte); - wide_string from_bytes(const char* ptr); - wide_string from_bytes(const byte_string& str); - wide_string from_bytes(const char* first, const char* last); - - byte_string to_bytes(Elem wchar); - byte_string to_bytes(const Elem* wptr); - byte_string to_bytes(const wide_string& wstr); - byte_string to_bytes(const Elem* first, const Elem* last); - - size_t converted() const; // noexcept in C++14 - state_type state() const; -}; - -template > -class wbuffer_convert - : public basic_streambuf -{ -public: - typedef typename Tr::state_type state_type; - - wbuffer_convert(streambuf* bytebuf = 0, Codecvt* pcvt = new Codecvt, - state_type state = state_type()); // before C++14 - explicit wbuffer_convert(streambuf* bytebuf = nullptr, Codecvt* pcvt = new Codecvt, - state_type state = state_type()); // before C++20 - wbuffer_convert() : wbuffer_convert(nullptr) {} // C++20 - explicit wbuffer_convert(streambuf* bytebuf, Codecvt* pcvt = new Codecvt, - state_type state = state_type()); // C++20 - - wbuffer_convert(const wbuffer_convert&) = delete; // C++14 - wbuffer_convert & operator=(const wbuffer_convert &) = delete; // C++14 - ~wbuffer_convert(); // C++14 - - streambuf* rdbuf() const; - streambuf* rdbuf(streambuf* bytebuf); - - state_type state() const; -}; - -// 22.4.1 and 22.4.1.3, ctype: -class ctype_base; -template class ctype; -template <> class ctype; // specialization -template class ctype_byname; -template <> class ctype_byname; // specialization - -class codecvt_base; -template class codecvt; -template class codecvt_byname; - -// 22.4.2 and 22.4.3, numeric: -template class num_get; -template class num_put; -template class numpunct; -template class numpunct_byname; - -// 22.4.4, col lation: -template class collate; -template class collate_byname; - -// 22.4.5, date and time: -class time_base; -template class time_get; -template class time_get_byname; -template class time_put; -template class time_put_byname; - -// 22.4.6, money: -class money_base; -template class money_get; -template class money_put; -template class moneypunct; -template class moneypunct_byname; - -// 22.4.7, message retrieval: -class messages_base; -template class messages; -template class messages_byname; - -} // std - -*/ - #include <__algorithm/copy.h> #include <__algorithm/equal.h> #include <__algorithm/find.h> diff --git a/libcxx/include/locale.h b/libcxx/include/locale.h --- a/libcxx/include/locale.h +++ b/libcxx/include/locale.h @@ -10,29 +10,6 @@ #ifndef _LIBCPP_LOCALE_H #define _LIBCPP_LOCALE_H -/* - locale.h synopsis - -Macros: - - LC_ALL - LC_COLLATE - LC_CTYPE - LC_MONETARY - LC_NUMERIC - LC_TIME - -Types: - - lconv - -Functions: - - setlocale - localeconv - -*/ - #include <__config> #if defined(_LIBCPP_HAS_NO_LOCALIZATION) diff --git a/libcxx/include/map b/libcxx/include/map --- a/libcxx/include/map +++ b/libcxx/include/map @@ -10,534 +10,6 @@ #ifndef _LIBCPP_MAP #define _LIBCPP_MAP -/* - - map synopsis - -namespace std -{ - -template , - class Allocator = allocator>> -class map -{ -public: - // types: - typedef Key key_type; - typedef T mapped_type; - typedef pair value_type; - typedef Compare key_compare; - typedef Allocator allocator_type; - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - typedef typename allocator_type::pointer pointer; - typedef typename allocator_type::const_pointer const_pointer; - typedef typename allocator_type::size_type size_type; - typedef typename allocator_type::difference_type difference_type; - - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef unspecified node_type; // C++17 - typedef INSERT_RETURN_TYPE insert_return_type; // C++17 - - class value_compare - { - friend class map; - protected: - key_compare comp; - - value_compare(key_compare c); - public: - typedef bool result_type; // deprecated in C++17, removed in C++20 - typedef value_type first_argument_type; // deprecated in C++17, removed in C++20 - typedef value_type second_argument_type; // deprecated in C++17, removed in C++20 - bool operator()(const value_type& x, const value_type& y) const; - }; - - // construct/copy/destroy: - map() - noexcept( - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value && - is_nothrow_copy_constructible::value); - explicit map(const key_compare& comp); - map(const key_compare& comp, const allocator_type& a); - template - map(InputIterator first, InputIterator last, - const key_compare& comp = key_compare()); - template - map(InputIterator first, InputIterator last, - const key_compare& comp, const allocator_type& a); - map(const map& m); - map(map&& m) - noexcept( - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value); - explicit map(const allocator_type& a); - map(const map& m, const allocator_type& a); - map(map&& m, const allocator_type& a); - map(initializer_list il, const key_compare& comp = key_compare()); - map(initializer_list il, const key_compare& comp, const allocator_type& a); - template - map(InputIterator first, InputIterator last, const allocator_type& a) - : map(first, last, Compare(), a) {} // C++14 - map(initializer_list il, const allocator_type& a) - : map(il, Compare(), a) {} // C++14 - ~map(); - - map& operator=(const map& m); - map& operator=(map&& m) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); - map& operator=(initializer_list il); - - // iterators: - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - - reverse_iterator rbegin() noexcept; - const_reverse_iterator rbegin() const noexcept; - reverse_iterator rend() noexcept; - const_reverse_iterator rend() const noexcept; - - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - // capacity: - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - // element access: - mapped_type& operator[](const key_type& k); - mapped_type& operator[](key_type&& k); - - mapped_type& at(const key_type& k); - const mapped_type& at(const key_type& k) const; - - // modifiers: - template - pair emplace(Args&&... args); - template - iterator emplace_hint(const_iterator position, Args&&... args); - pair insert(const value_type& v); - pair insert( value_type&& v); // C++17 - template - pair insert(P&& p); - iterator insert(const_iterator position, const value_type& v); - iterator insert(const_iterator position, value_type&& v); // C++17 - template - iterator insert(const_iterator position, P&& p); - template - void insert(InputIterator first, InputIterator last); - void insert(initializer_list il); - - node_type extract(const_iterator position); // C++17 - node_type extract(const key_type& x); // C++17 - insert_return_type insert(node_type&& nh); // C++17 - iterator insert(const_iterator hint, node_type&& nh); // C++17 - - template - pair try_emplace(const key_type& k, Args&&... args); // C++17 - template - pair try_emplace(key_type&& k, Args&&... args); // C++17 - template - iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); // C++17 - template - iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // C++17 - template - pair insert_or_assign(const key_type& k, M&& obj); // C++17 - template - pair insert_or_assign(key_type&& k, M&& obj); // C++17 - template - iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); // C++17 - template - iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // C++17 - - iterator erase(const_iterator position); - iterator erase(iterator position); // C++14 - size_type erase(const key_type& k); - iterator erase(const_iterator first, const_iterator last); - void clear() noexcept; - - template - void merge(map& source); // C++17 - template - void merge(map&& source); // C++17 - template - void merge(multimap& source); // C++17 - template - void merge(multimap&& source); // C++17 - - void swap(map& m) - noexcept(allocator_traits::is_always_equal::value && - is_nothrow_swappable::value); // C++17 - - // observers: - allocator_type get_allocator() const noexcept; - key_compare key_comp() const; - value_compare value_comp() const; - - // map operations: - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - template - iterator find(const K& x); // C++14 - template - const_iterator find(const K& x) const; // C++14 - - template - size_type count(const K& x) const; // C++14 - size_type count(const key_type& k) const; - - bool contains(const key_type& x) const; // C++20 - template bool contains(const K& x) const; // C++20 - - iterator lower_bound(const key_type& k); - const_iterator lower_bound(const key_type& k) const; - template - iterator lower_bound(const K& x); // C++14 - template - const_iterator lower_bound(const K& x) const; // C++14 - - iterator upper_bound(const key_type& k); - const_iterator upper_bound(const key_type& k) const; - template - iterator upper_bound(const K& x); // C++14 - template - const_iterator upper_bound(const K& x) const; // C++14 - - pair equal_range(const key_type& k); - pair equal_range(const key_type& k) const; - template - pair equal_range(const K& x); // C++14 - template - pair equal_range(const K& x) const; // C++14 -}; - -template >, - class Allocator = allocator>> -map(InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator()) - -> map, iter_val_t, Compare, Allocator>; // C++17 - -template, - class Allocator = allocator>> -map(initializer_list>, Compare = Compare(), Allocator = Allocator()) - -> map; // C++17 - -template -map(InputIterator, InputIterator, Allocator) - -> map, iter_val_t, less>, - Allocator>; // C++17 - -template -map(initializer_list>, Allocator) -> map, Allocator>; // C++17 - -template -bool -operator==(const map& x, - const map& y); - -template -bool -operator< (const map& x, - const map& y); // removed in C++20 - -template -bool -operator!=(const map& x, - const map& y); // removed in C++20 - -template -bool -operator> (const map& x, - const map& y); // removed in C++20 - -template -bool -operator>=(const map& x, - const map& y); // removed in C++20 - -template -bool -operator<=(const map& x, - const map& y); // removed in C++20 - -template - synth-three-way-result> - operator<=>(const map& x, - const map& y); // since C++20 - -// specialized algorithms: -template -void -swap(map& x, map& y) - noexcept(noexcept(x.swap(y))); - -template -typename map::size_type -erase_if(map& c, Predicate pred); // C++20 - - -template , - class Allocator = allocator>> -class multimap -{ -public: - // types: - typedef Key key_type; - typedef T mapped_type; - typedef pair value_type; - typedef Compare key_compare; - typedef Allocator allocator_type; - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - typedef typename allocator_type::size_type size_type; - typedef typename allocator_type::difference_type difference_type; - typedef typename allocator_type::pointer pointer; - typedef typename allocator_type::const_pointer const_pointer; - - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef unspecified node_type; // C++17 - - class value_compare - { - friend class multimap; - protected: - key_compare comp; - value_compare(key_compare c); - public: - typedef bool result_type; // deprecated in C++17, removed in C++20 - typedef value_type first_argument_type; // deprecated in C++17, removed in C++20 - typedef value_type second_argument_type; // deprecated in C++17, removed in C++20 - bool operator()(const value_type& x, const value_type& y) const; - }; - - // construct/copy/destroy: - multimap() - noexcept( - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value && - is_nothrow_copy_constructible::value); - explicit multimap(const key_compare& comp); - multimap(const key_compare& comp, const allocator_type& a); - template - multimap(InputIterator first, InputIterator last, const key_compare& comp); - template - multimap(InputIterator first, InputIterator last, const key_compare& comp, - const allocator_type& a); - multimap(const multimap& m); - multimap(multimap&& m) - noexcept( - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value); - explicit multimap(const allocator_type& a); - multimap(const multimap& m, const allocator_type& a); - multimap(multimap&& m, const allocator_type& a); - multimap(initializer_list il, const key_compare& comp = key_compare()); - multimap(initializer_list il, const key_compare& comp, - const allocator_type& a); - template - multimap(InputIterator first, InputIterator last, const allocator_type& a) - : multimap(first, last, Compare(), a) {} // C++14 - multimap(initializer_list il, const allocator_type& a) - : multimap(il, Compare(), a) {} // C++14 - ~multimap(); - - multimap& operator=(const multimap& m); - multimap& operator=(multimap&& m) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); - multimap& operator=(initializer_list il); - - // iterators: - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - - reverse_iterator rbegin() noexcept; - const_reverse_iterator rbegin() const noexcept; - reverse_iterator rend() noexcept; - const_reverse_iterator rend() const noexcept; - - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - // capacity: - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - // modifiers: - template - iterator emplace(Args&&... args); - template - iterator emplace_hint(const_iterator position, Args&&... args); - iterator insert(const value_type& v); - iterator insert( value_type&& v); // C++17 - template - iterator insert(P&& p); - iterator insert(const_iterator position, const value_type& v); - iterator insert(const_iterator position, value_type&& v); // C++17 - template - iterator insert(const_iterator position, P&& p); - template - void insert(InputIterator first, InputIterator last); - void insert(initializer_list il); - - node_type extract(const_iterator position); // C++17 - node_type extract(const key_type& x); // C++17 - iterator insert(node_type&& nh); // C++17 - iterator insert(const_iterator hint, node_type&& nh); // C++17 - - iterator erase(const_iterator position); - iterator erase(iterator position); // C++14 - size_type erase(const key_type& k); - iterator erase(const_iterator first, const_iterator last); - void clear() noexcept; - - template - void merge(multimap& source); // C++17 - template - void merge(multimap&& source); // C++17 - template - void merge(map& source); // C++17 - template - void merge(map&& source); // C++17 - - void swap(multimap& m) - noexcept(allocator_traits::is_always_equal::value && - is_nothrow_swappable::value); // C++17 - - // observers: - allocator_type get_allocator() const noexcept; - key_compare key_comp() const; - value_compare value_comp() const; - - // map operations: - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - template - iterator find(const K& x); // C++14 - template - const_iterator find(const K& x) const; // C++14 - - template - size_type count(const K& x) const; // C++14 - size_type count(const key_type& k) const; - - bool contains(const key_type& x) const; // C++20 - template bool contains(const K& x) const; // C++20 - - iterator lower_bound(const key_type& k); - const_iterator lower_bound(const key_type& k) const; - template - iterator lower_bound(const K& x); // C++14 - template - const_iterator lower_bound(const K& x) const; // C++14 - - iterator upper_bound(const key_type& k); - const_iterator upper_bound(const key_type& k) const; - template - iterator upper_bound(const K& x); // C++14 - template - const_iterator upper_bound(const K& x) const; // C++14 - - pair equal_range(const key_type& k); - pair equal_range(const key_type& k) const; - template - pair equal_range(const K& x); // C++14 - template - pair equal_range(const K& x) const; // C++14 -}; - -template >, - class Allocator = allocator>> -multimap(InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator()) - -> multimap, iter_val_t, Compare, Allocator>; // C++17 - -template, - class Allocator = allocator>> -multimap(initializer_list>, Compare = Compare(), Allocator = Allocator()) - -> multimap; // C++17 - -template -multimap(InputIterator, InputIterator, Allocator) - -> multimap, iter_val_t, - less>, Allocator>; // C++17 - -template -multimap(initializer_list>, Allocator) - -> multimap, Allocator>; // C++17 - -template -bool -operator==(const multimap& x, - const multimap& y); - -template -bool -operator< (const multimap& x, - const multimap& y); // removed in C++20 - -template -bool -operator!=(const multimap& x, - const multimap& y); // removed in C++20 - -template -bool -operator> (const multimap& x, - const multimap& y); // removed in C++20 - -template -bool -operator>=(const multimap& x, - const multimap& y); // removed in C++20 - -template -bool -operator<=(const multimap& x, - const multimap& y); // removed in C++20 - -template - synth-three-way-result> - operator<=>(const multimap& x, - const multimap& y); // since c++20 - -// specialized algorithms: -template -void -swap(multimap& x, - multimap& y) - noexcept(noexcept(x.swap(y))); - -template -typename multimap::size_type -erase_if(multimap& c, Predicate pred); // C++20 - -} // std - -*/ - #include <__algorithm/equal.h> #include <__algorithm/lexicographical_compare.h> #include <__algorithm/lexicographical_compare_three_way.h> diff --git a/libcxx/include/math.h b/libcxx/include/math.h --- a/libcxx/include/math.h +++ b/libcxx/include/math.h @@ -10,287 +10,6 @@ #ifndef _LIBCPP_MATH_H #define _LIBCPP_MATH_H -/* - math.h synopsis - -Macros: - - HUGE_VAL - HUGE_VALF // C99 - HUGE_VALL // C99 - INFINITY // C99 - NAN // C99 - FP_INFINITE // C99 - FP_NAN // C99 - FP_NORMAL // C99 - FP_SUBNORMAL // C99 - FP_ZERO // C99 - FP_FAST_FMA // C99 - FP_FAST_FMAF // C99 - FP_FAST_FMAL // C99 - FP_ILOGB0 // C99 - FP_ILOGBNAN // C99 - MATH_ERRNO // C99 - MATH_ERREXCEPT // C99 - math_errhandling // C99 - -Types: - - float_t // C99 - double_t // C99 - -// C90 - -floating_point abs(floating_point x); - -floating_point acos (arithmetic x); -float acosf(float x); -long double acosl(long double x); - -floating_point asin (arithmetic x); -float asinf(float x); -long double asinl(long double x); - -floating_point atan (arithmetic x); -float atanf(float x); -long double atanl(long double x); - -floating_point atan2 (arithmetic y, arithmetic x); -float atan2f(float y, float x); -long double atan2l(long double y, long double x); - -floating_point ceil (arithmetic x); -float ceilf(float x); -long double ceill(long double x); - -floating_point cos (arithmetic x); -float cosf(float x); -long double cosl(long double x); - -floating_point cosh (arithmetic x); -float coshf(float x); -long double coshl(long double x); - -floating_point exp (arithmetic x); -float expf(float x); -long double expl(long double x); - -floating_point fabs (arithmetic x); -float fabsf(float x); -long double fabsl(long double x); - -floating_point floor (arithmetic x); -float floorf(float x); -long double floorl(long double x); - -floating_point fmod (arithmetic x, arithmetic y); -float fmodf(float x, float y); -long double fmodl(long double x, long double y); - -floating_point frexp (arithmetic value, int* exp); -float frexpf(float value, int* exp); -long double frexpl(long double value, int* exp); - -floating_point ldexp (arithmetic value, int exp); -float ldexpf(float value, int exp); -long double ldexpl(long double value, int exp); - -floating_point log (arithmetic x); -float logf(float x); -long double logl(long double x); - -floating_point log10 (arithmetic x); -float log10f(float x); -long double log10l(long double x); - -floating_point modf (floating_point value, floating_point* iptr); -float modff(float value, float* iptr); -long double modfl(long double value, long double* iptr); - -floating_point pow (arithmetic x, arithmetic y); -float powf(float x, float y); -long double powl(long double x, long double y); - -floating_point sin (arithmetic x); -float sinf(float x); -long double sinl(long double x); - -floating_point sinh (arithmetic x); -float sinhf(float x); -long double sinhl(long double x); - -floating_point sqrt (arithmetic x); -float sqrtf(float x); -long double sqrtl(long double x); - -floating_point tan (arithmetic x); -float tanf(float x); -long double tanl(long double x); - -floating_point tanh (arithmetic x); -float tanhf(float x); -long double tanhl(long double x); - -// C99 - -bool signbit(arithmetic x); - -int fpclassify(arithmetic x); - -bool isfinite(arithmetic x); -bool isinf(arithmetic x); -bool isnan(arithmetic x); -bool isnormal(arithmetic x); - -bool isgreater(arithmetic x, arithmetic y); -bool isgreaterequal(arithmetic x, arithmetic y); -bool isless(arithmetic x, arithmetic y); -bool islessequal(arithmetic x, arithmetic y); -bool islessgreater(arithmetic x, arithmetic y); -bool isunordered(arithmetic x, arithmetic y); - -floating_point acosh (arithmetic x); -float acoshf(float x); -long double acoshl(long double x); - -floating_point asinh (arithmetic x); -float asinhf(float x); -long double asinhl(long double x); - -floating_point atanh (arithmetic x); -float atanhf(float x); -long double atanhl(long double x); - -floating_point cbrt (arithmetic x); -float cbrtf(float x); -long double cbrtl(long double x); - -floating_point copysign (arithmetic x, arithmetic y); -float copysignf(float x, float y); -long double copysignl(long double x, long double y); - -floating_point erf (arithmetic x); -float erff(float x); -long double erfl(long double x); - -floating_point erfc (arithmetic x); -float erfcf(float x); -long double erfcl(long double x); - -floating_point exp2 (arithmetic x); -float exp2f(float x); -long double exp2l(long double x); - -floating_point expm1 (arithmetic x); -float expm1f(float x); -long double expm1l(long double x); - -floating_point fdim (arithmetic x, arithmetic y); -float fdimf(float x, float y); -long double fdiml(long double x, long double y); - -floating_point fma (arithmetic x, arithmetic y, arithmetic z); -float fmaf(float x, float y, float z); -long double fmal(long double x, long double y, long double z); - -floating_point fmax (arithmetic x, arithmetic y); -float fmaxf(float x, float y); -long double fmaxl(long double x, long double y); - -floating_point fmin (arithmetic x, arithmetic y); -float fminf(float x, float y); -long double fminl(long double x, long double y); - -floating_point hypot (arithmetic x, arithmetic y); -float hypotf(float x, float y); -long double hypotl(long double x, long double y); - -int ilogb (arithmetic x); -int ilogbf(float x); -int ilogbl(long double x); - -floating_point lgamma (arithmetic x); -float lgammaf(float x); -long double lgammal(long double x); - -long long llrint (arithmetic x); -long long llrintf(float x); -long long llrintl(long double x); - -long long llround (arithmetic x); -long long llroundf(float x); -long long llroundl(long double x); - -floating_point log1p (arithmetic x); -float log1pf(float x); -long double log1pl(long double x); - -floating_point log2 (arithmetic x); -float log2f(float x); -long double log2l(long double x); - -floating_point logb (arithmetic x); -float logbf(float x); -long double logbl(long double x); - -long lrint (arithmetic x); -long lrintf(float x); -long lrintl(long double x); - -long lround (arithmetic x); -long lroundf(float x); -long lroundl(long double x); - -double nan (const char* str); -float nanf(const char* str); -long double nanl(const char* str); - -floating_point nearbyint (arithmetic x); -float nearbyintf(float x); -long double nearbyintl(long double x); - -floating_point nextafter (arithmetic x, arithmetic y); -float nextafterf(float x, float y); -long double nextafterl(long double x, long double y); - -floating_point nexttoward (arithmetic x, long double y); -float nexttowardf(float x, long double y); -long double nexttowardl(long double x, long double y); - -floating_point remainder (arithmetic x, arithmetic y); -float remainderf(float x, float y); -long double remainderl(long double x, long double y); - -floating_point remquo (arithmetic x, arithmetic y, int* pquo); -float remquof(float x, float y, int* pquo); -long double remquol(long double x, long double y, int* pquo); - -floating_point rint (arithmetic x); -float rintf(float x); -long double rintl(long double x); - -floating_point round (arithmetic x); -float roundf(float x); -long double roundl(long double x); - -floating_point scalbln (arithmetic x, long ex); -float scalblnf(float x, long ex); -long double scalblnl(long double x, long ex); - -floating_point scalbn (arithmetic x, int ex); -float scalbnf(float x, int ex); -long double scalbnl(long double x, int ex); - -floating_point tgamma (arithmetic x); -float tgammaf(float x); -long double tgammal(long double x); - -floating_point trunc (arithmetic x); -float truncf(float x); -long double truncl(long double x); - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/memory b/libcxx/include/memory --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -10,873 +10,6 @@ #ifndef _LIBCPP_MEMORY #define _LIBCPP_MEMORY -/* - memory synopsis - -namespace std -{ - -struct allocator_arg_t { }; -inline constexpr allocator_arg_t allocator_arg = allocator_arg_t(); - -template struct uses_allocator; - -template -struct pointer_traits -{ - typedef Ptr pointer; - typedef
element_type; - typedef
difference_type; - - template using rebind =
; - - static pointer pointer_to(
); -}; - -template -struct pointer_traits -{ - typedef T* pointer; - typedef T element_type; - typedef ptrdiff_t difference_type; - - template using rebind = U*; - - static pointer pointer_to(
) noexcept; // constexpr in C++20 -}; - -template constexpr T* to_address(T* p) noexcept; // C++20 -template constexpr auto to_address(const Ptr& p) noexcept; // C++20 - -template -struct allocator_traits -{ - typedef Alloc allocator_type; - typedef typename allocator_type::value_type - value_type; - - typedef Alloc::pointer | value_type* pointer; - typedef Alloc::const_pointer - | pointer_traits::rebind - const_pointer; - typedef Alloc::void_pointer - | pointer_traits::rebind - void_pointer; - typedef Alloc::const_void_pointer - | pointer_traits::rebind - const_void_pointer; - typedef Alloc::difference_type - | pointer_traits::difference_type - difference_type; - typedef Alloc::size_type - | make_unsigned::type - size_type; - typedef Alloc::propagate_on_container_copy_assignment - | false_type propagate_on_container_copy_assignment; - typedef Alloc::propagate_on_container_move_assignment - | false_type propagate_on_container_move_assignment; - typedef Alloc::propagate_on_container_swap - | false_type propagate_on_container_swap; - typedef Alloc::is_always_equal - | is_empty is_always_equal; - - template using rebind_alloc = Alloc::rebind::other | Alloc; - template using rebind_traits = allocator_traits>; - - static pointer allocate(allocator_type& a, size_type n); // constexpr and [[nodiscard]] in C++20 - static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // constexpr and [[nodiscard]] in C++20 - - static void deallocate(allocator_type& a, pointer p, size_type n) noexcept; // constexpr in C++20 - - template - static void construct(allocator_type& a, T* p, Args&&... args); // constexpr in C++20 - - template - static void destroy(allocator_type& a, T* p); // constexpr in C++20 - - static size_type max_size(const allocator_type& a); // noexcept in C++14, constexpr in C++20 - static allocator_type select_on_container_copy_construction(const allocator_type& a); // constexpr in C++20 -}; - -template -struct allocation_result { - Pointer ptr; - size_t count; -}; // since C++23 - -template -[[nodiscard]] constexpr allocation_result::pointer> - allocate_at_least(Allocator& a, size_t n); // since C++23 - -template <> -class allocator // removed in C++20 -{ -public: - typedef void* pointer; - typedef const void* const_pointer; - typedef void value_type; - - template struct rebind {typedef allocator<_Up> other;}; -}; - -template -class allocator -{ -public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T* pointer; // deprecated in C++17, removed in C++20 - typedef const T* const_pointer; // deprecated in C++17, removed in C++20 - typedef typename add_lvalue_reference::type - reference; // deprecated in C++17, removed in C++20 - typedef typename add_lvalue_reference::type - const_reference; // deprecated in C++17, removed in C++20 - - typedef T value_type; - - template struct rebind {typedef allocator other;}; // deprecated in C++17, removed in C++20 - - typedef true_type propagate_on_container_move_assignment; - typedef true_type is_always_equal; - - constexpr allocator() noexcept; // constexpr in C++20 - constexpr allocator(const allocator&) noexcept; // constexpr in C++20 - template - constexpr allocator(const allocator&) noexcept; // constexpr in C++20 - ~allocator(); // constexpr in C++20 - pointer address(reference x) const noexcept; // deprecated in C++17, removed in C++20 - const_pointer address(const_reference x) const noexcept; // deprecated in C++17, removed in C++20 - T* allocate(size_t n, const void* hint); // deprecated in C++17, removed in C++20 - T* allocate(size_t n); // constexpr in C++20 - void deallocate(T* p, size_t n) noexcept; // constexpr in C++20 - size_type max_size() const noexcept; // deprecated in C++17, removed in C++20 - template - void construct(U* p, Args&&... args); // deprecated in C++17, removed in C++20 - template - void destroy(U* p); // deprecated in C++17, removed in C++20 -}; - -template -bool operator==(const allocator&, const allocator&) noexcept; // constexpr in C++20 - -template -bool operator!=(const allocator&, const allocator&) noexcept; // constexpr in C++20 - -template -class raw_storage_iterator // deprecated in C++17, removed in C++20 - : public iterator // until C++17 -{ -public: - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; // until C++20 - typedef ptrdiff_t difference_type; // since C++20 - typedef void pointer; - typedef void reference; - - explicit raw_storage_iterator(OutputIterator x); - raw_storage_iterator& operator*(); - raw_storage_iterator& operator=(const T& element); - raw_storage_iterator& operator++(); - raw_storage_iterator operator++(int); -}; - -template pair get_temporary_buffer(ptrdiff_t n) noexcept; -template void return_temporary_buffer(T* p) noexcept; - -template T* addressof(T& r) noexcept; -template T* addressof(const T&& r) noexcept = delete; - -template -ForwardIterator -uninitialized_copy(InputIterator first, InputIterator last, ForwardIterator result); - -namespace ranges { - -template -using uninitialized_copy_result = in_out_result; // since C++20 - -template Sentinel1, nothrow-forward-iterator OutputIterator, nothrow-sentinel-for Sentinel2> - requires constructible_from, iter_reference_t> -uninitialized_copy_result -uninitialized_copy(InputIterator ifirst, Sentinel1 ilast, OutputIterator ofirst, Sentinel2 olast); // since C++20 - -template - requires constructible_from, range_reference_t> -uninitialized_copy_result, borrowed_iterator_t> -uninitialized_copy(InputRange&& in_range, OutputRange&& out_range); // since C++20 - -} - -template -ForwardIterator -uninitialized_copy_n(InputIterator first, Size n, ForwardIterator result); - -namespace ranges { - -template -using uninitialized_copy_n_result = in_out_result; // since C++20 - -template Sentinel> - requires constructible_from, iter_reference_t> -uninitialized_copy_n_result -uninitialized_copy_n(InputIterator ifirst, iter_difference_t n, OutputIterator ofirst, Sentinel olast); // since C++20 - -} - -template -void uninitialized_fill(ForwardIterator first, ForwardIterator last, const T& x); - -namespace ranges { - -template Sentinel, class T> - requires constructible_from, const T&> -ForwardIterator uninitialized_fill(ForwardIterator first, Sentinel last, const T& x); // since C++20 - -template - requires constructible_from, const T&> -borrowed_iterator_t uninitialized_fill(ForwardRange&& range, const T& x); // since C++20 - -} - -template -ForwardIterator -uninitialized_fill_n(ForwardIterator first, Size n, const T& x); - -namespace ranges { - -template - requires constructible_from, const T&> -ForwardIterator uninitialized_fill_n(ForwardIterator first, iter_difference_t n); // since C++20 - -} - -template -constexpr T* construct_at(T* location, Args&& ...args); // since C++20 - -namespace ranges { - template - constexpr T* construct_at(T* location, Args&&... args); // since C++20 -} - -template -void destroy_at(T* location); // constexpr in C++20 - -namespace ranges { - template - constexpr void destroy_at(T* location) noexcept; // since C++20 -} - -template -void destroy(ForwardIterator first, ForwardIterator last); // constexpr in C++20 - -namespace ranges { - template Sentinel> - requires destructible> - constexpr InputIterator destroy(InputIterator first, Sentinel last) noexcept; // since C++20 - template - requires destructible> - constexpr borrowed_iterator_t destroy(InputRange&& range) noexcept; // since C++20 -} - -template -ForwardIterator destroy_n(ForwardIterator first, Size n); // constexpr in C++20 - -namespace ranges { - template - requires destructible> - constexpr InputIterator destroy_n(InputIterator first, iter_difference_t n) noexcept; // since C++20 -} - -template - ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result); - -namespace ranges { - -template -using uninitialized_move_result = in_out_result; // since C++20 - -template Sentinel1, nothrow-forward-iterator OutputIterator, nothrow-sentinel-for Sentinel2> - requires constructible_from, iter_rvalue_reference_t> -uninitialized_move_result -uninitialized_move(InputIterator ifirst, Sentinel1 ilast, OutputIterator ofirst, Sentinel2 olast); // since C++20 - -template - requires constructible_from, range_rvalue_reference_t> -uninitialized_move_result, borrowed_iterator_t> -uninitialized_move(InputRange&& in_range, OutputRange&& out_range); // since C++20 - -} - -template - pair uninitialized_move_n(InputIterator first, Size n, ForwardIterator result); - -namespace ranges { - -template -using uninitialized_move_n_result = in_out_result; // since C++20 - -template Sentinel> - requires constructible_from, iter_rvalue_reference_t> -uninitialized_move_n_result -uninitialized_move_n(InputIterator ifirst, iter_difference_t n, OutputIterator ofirst, Sentinel olast); // since C++20 - -} - -template - void uninitialized_value_construct(ForwardIterator first, ForwardIterator last); - -namespace ranges { - -template Sentinel> - requires default_initializable> - ForwardIterator uninitialized_value_construct(ForwardIterator first, Sentinel last); // since C++20 - -template - requires default_initializable> - borrowed_iterator_t uninitialized_value_construct(ForwardRange&& r); // since C++20 - -} - -template - ForwardIterator uninitialized_value_construct_n(ForwardIterator first, Size n); - -namespace ranges { - -template - requires default_initializable> - ForwardIterator uninitialized_value_construct_n(ForwardIterator first, iter_difference_t n); // since C++20 - -} - -template - void uninitialized_default_construct(ForwardIterator first, ForwardIterator last); - -namespace ranges { - -template Sentinel> - requires default_initializable> - ForwardIterator uninitialized_default_construct(ForwardIterator first, Sentinel last); // since C++20 - -template - requires default_initializable> - borrowed_iterator_t uninitialized_default_construct(ForwardRange&& r); // since C++20 - -} - -template - ForwardIterator uninitialized_default_construct_n(ForwardIterator first, Size n); - -namespace ranges { - -template - requires default_initializable> - ForwardIterator uninitialized_default_construct_n(ForwardIterator first, iter_difference_t n); // since C++20 - -} - -template struct auto_ptr_ref {}; // deprecated in C++11, removed in C++17 - -template -class auto_ptr // deprecated in C++11, removed in C++17 -{ -public: - typedef X element_type; - - explicit auto_ptr(X* p =0) throw(); - auto_ptr(auto_ptr&) throw(); - template auto_ptr(auto_ptr&) throw(); - auto_ptr& operator=(auto_ptr&) throw(); - template auto_ptr& operator=(auto_ptr&) throw(); - auto_ptr& operator=(auto_ptr_ref r) throw(); - ~auto_ptr() throw(); - - typename add_lvalue_reference::type operator*() const throw(); - X* operator->() const throw(); - X* get() const throw(); - X* release() throw(); - void reset(X* p =0) throw(); - - auto_ptr(auto_ptr_ref) throw(); - template operator auto_ptr_ref() throw(); - template operator auto_ptr() throw(); -}; - -template -struct default_delete -{ - constexpr default_delete() noexcept = default; - template constexpr default_delete(const default_delete&) noexcept; // constexpr since C++23 - - constexpr void operator()(T*) const noexcept; // constexpr since C++23 -}; - -template -struct default_delete -{ - constexpr default_delete() noexcept = default; - template constexpr default_delete(const default_delete &) noexcept; // constexpr since C++23 - constexpr void operator()(T*) const noexcept; // constexpr since C++23 - template void operator()(U*) const = delete; -}; - -template > -class unique_ptr -{ -public: - typedef see below pointer; - typedef T element_type; - typedef D deleter_type; - - // constructors - constexpr unique_ptr() noexcept; - constexpr explicit unique_ptr(pointer p) noexcept; // constexpr since C++23 - constexpr unique_ptr(pointer p, see below d1) noexcept; // constexpr since C++23 - constexpr unique_ptr(pointer p, see below d2) noexcept; // constexpr since C++23 - constexpr unique_ptr(unique_ptr&& u) noexcept; // constexpr since C++23 - constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { } - template - constexpr unique_ptr(unique_ptr&& u) noexcept; // constexpr since C++23 - template - unique_ptr(auto_ptr&& u) noexcept; // removed in C++17 - - // destructor - constexpr ~unique_ptr(); // constexpr since C++23 - - // assignment - constexpr unique_ptr& operator=(unique_ptr&& u) noexcept; // constexpr since C++23 - template - constexpr unique_ptr& operator=(unique_ptr&& u) noexcept; // constexpr since C++23 - constexpr unique_ptr& operator=(nullptr_t) noexcept; // constexpr since C++23 - - // observers - typename constexpr add_lvalue_reference::type operator*() const; // constexpr since C++23 - constexpr pointer operator->() const noexcept; // constexpr since C++23 - constexpr pointer get() const noexcept; // constexpr since C++23 - constexpr deleter_type& get_deleter() noexcept; // constexpr since C++23 - constexpr const deleter_type& get_deleter() const noexcept; // constexpr since C++23 - constexpr explicit operator bool() const noexcept; // constexpr since C++23 - - // modifiers - constexpr pointer release() noexcept; // constexpr since C++23 - constexpr void reset(pointer p = pointer()) noexcept; // constexpr since C++23 - constexpr void swap(unique_ptr& u) noexcept; // constexpr since C++23 -}; - -template -class unique_ptr -{ -public: - typedef implementation-defined pointer; - typedef T element_type; - typedef D deleter_type; - - // constructors - constexpr unique_ptr() noexcept; - constexpr explicit unique_ptr(pointer p) noexcept; // constexpr since C++23 - constexpr unique_ptr(pointer p, see below d) noexcept; // constexpr since C++23 - constexpr unique_ptr(pointer p, see below d) noexcept; // constexpr since C++23 - constexpr unique_ptr(unique_ptr&& u) noexcept; // constexpr since C++23 - template - constexpr unique_ptr(unique_ptr && u) noexcept; // constexpr since C++23 - constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { } - - // destructor - constexpr ~unique_ptr(); // constexpr since C++23 - - // assignment - constexpr unique_ptr& operator=(unique_ptr&& u) noexcept; // constexpr since C++23 - template - constexpr unique_ptr& operator=(unique_ptr && u) noexcept; // constexpr since C++23 - constexpr unique_ptr& operator=(nullptr_t) noexcept; // constexpr since C++23 - - // observers - constexpr T& operator[](size_t i) const; // constexpr since C++23 - constexpr pointer get() const noexcept; // constexpr since C++23 - constexpr deleter_type& get_deleter() noexcept; // constexpr since C++23 - constexpr const deleter_type& get_deleter() const noexcept; // constexpr since C++23 - constexpr explicit operator bool() const noexcept; // constexpr since C++23 - - // modifiers - constexpr pointer release() noexcept; // constexpr since C++23 - constexpr void reset(pointer p = pointer()) noexcept; // constexpr since C++23 - constexpr void reset(nullptr_t) noexcept; // constexpr since C++23 - template void reset(U) = delete; - constexpr void swap(unique_ptr& u) noexcept; // constexpr since C++23 -}; - -template - constexpr void swap(unique_ptr& x, unique_ptr& y) noexcept; // constexpr since C++23 - -template - constexpr bool operator==(const unique_ptr& x, const unique_ptr& y); // constexpr since C++23 -template - bool operator!=(const unique_ptr& x, const unique_ptr& y); // removed in C++20 -template - bool operator<(const unique_ptr& x, const unique_ptr& y); -template - bool operator<=(const unique_ptr& x, const unique_ptr& y); -template - bool operator>(const unique_ptr& x, const unique_ptr& y); -template - bool operator>=(const unique_ptr& x, const unique_ptr& y); -template - requires three_way_comparable_with::pointer, - typename unique_ptr::pointer> - compare_three_way_result_t::pointer, - typename unique_ptr::pointer> - operator<=>(const unique_ptr& x, const unique_ptr& y); // C++20 - -template - constexpr bool operator==(const unique_ptr& x, nullptr_t) noexcept; // constexpr since C++23 -template - bool operator==(nullptr_t, const unique_ptr& y) noexcept; // removed in C++20 -template - bool operator!=(const unique_ptr& x, nullptr_t) noexcept; // removed in C++20 -template - bool operator!=(nullptr_t, const unique_ptr& y) noexcept; // removed in C++20 - -template - constexpr bool operator<(const unique_ptr& x, nullptr_t); // constexpr since C++23 -template - constexpr bool operator<(nullptr_t, const unique_ptr& y); // constexpr since C++23 -template - constexpr bool operator<=(const unique_ptr& x, nullptr_t); // constexpr since C++23 -template - constexpr bool operator<=(nullptr_t, const unique_ptr& y); // constexpr since C++23 -template - constexpr bool operator>(const unique_ptr& x, nullptr_t); // constexpr since C++23 -template - constexpr bool operator>(nullptr_t, const unique_ptr& y); // constexpr since C++23 -template - constexpr bool operator>=(const unique_ptr& x, nullptr_t); // constexpr since C++23 -template - constexpr bool operator>=(nullptr_t, const unique_ptr& y); // constexpr since C++23 -template - requires three_way_comparable::pointer> - compare_three_way_result_t::pointer> - constexpr operator<=>(const unique_ptr& x, nullptr_t); // C++20, constexpr since C++23 - -class bad_weak_ptr - : public std::exception -{ - bad_weak_ptr() noexcept; -}; - -template -constexpr unique_ptr make_unique(Args&&... args); // C++14, constexpr since C++23 -template -constexpr unique_ptr make_unique(size_t n); // C++14, constexpr since C++23 -template unspecified make_unique(Args&&...) = delete; // C++14, T == U[N] - -template - constexpr unique_ptr make_unique_for_overwrite(); // T is not array, C++20, constexpr since C++23 -template - constexpr unique_ptr make_unique_for_overwrite(size_t n); // T is U[], C++20, constexpr since C++23 -template - unspecified make_unique_for_overwrite(Args&&...) = delete; // T is U[N], C++20 - -template - basic_ostream& operator<< (basic_ostream& os, unique_ptr const& p); - -template -class shared_ptr -{ -public: - typedef T element_type; // until C++17 - typedef remove_extent_t element_type; // since C++17 - typedef weak_ptr weak_type; // C++17 - - // constructors: - constexpr shared_ptr() noexcept; - template explicit shared_ptr(Y* p); - template shared_ptr(Y* p, D d); - template shared_ptr(Y* p, D d, A a); - template shared_ptr(nullptr_t p, D d); - template shared_ptr(nullptr_t p, D d, A a); - template shared_ptr(const shared_ptr& r, T *p) noexcept; - shared_ptr(const shared_ptr& r) noexcept; - template shared_ptr(const shared_ptr& r) noexcept; - shared_ptr(shared_ptr&& r) noexcept; - template shared_ptr(shared_ptr&& r) noexcept; - template explicit shared_ptr(const weak_ptr& r); - template shared_ptr(auto_ptr&& r); // removed in C++17 - template shared_ptr(unique_ptr&& r); - shared_ptr(nullptr_t) : shared_ptr() { } - - // destructor: - ~shared_ptr(); - - // assignment: - shared_ptr& operator=(const shared_ptr& r) noexcept; - template shared_ptr& operator=(const shared_ptr& r) noexcept; - shared_ptr& operator=(shared_ptr&& r) noexcept; - template shared_ptr& operator=(shared_ptr&& r); - template shared_ptr& operator=(auto_ptr&& r); // removed in C++17 - template shared_ptr& operator=(unique_ptr&& r); - - // modifiers: - void swap(shared_ptr& r) noexcept; - void reset() noexcept; - template void reset(Y* p); - template void reset(Y* p, D d); - template void reset(Y* p, D d, A a); - - // observers: - T* get() const noexcept; - T& operator*() const noexcept; - T* operator->() const noexcept; - long use_count() const noexcept; - bool unique() const noexcept; - explicit operator bool() const noexcept; - template bool owner_before(shared_ptr const& b) const noexcept; - template bool owner_before(weak_ptr const& b) const noexcept; -}; - -template -shared_ptr(weak_ptr) -> shared_ptr; -template -shared_ptr(unique_ptr) -> shared_ptr; - -// shared_ptr comparisons: -template - bool operator==(shared_ptr const& a, shared_ptr const& b) noexcept; -template - bool operator!=(shared_ptr const& a, shared_ptr const& b) noexcept; // removed in C++20 -template - bool operator<(shared_ptr const& a, shared_ptr const& b) noexcept; // removed in C++20 -template - bool operator>(shared_ptr const& a, shared_ptr const& b) noexcept; // removed in C++20 -template - bool operator<=(shared_ptr const& a, shared_ptr const& b) noexcept; // removed in C++20 -template - bool operator>=(shared_ptr const& a, shared_ptr const& b) noexcept; // removed in C++20 -template - strong_ordering operator<=>(shared_ptr const& a, shared_ptr const& b) noexcept; // C++20 - -template - bool operator==(const shared_ptr& x, nullptr_t) noexcept; -template - bool operator==(nullptr_t, const shared_ptr& y) noexcept; // removed in C++20 -template - bool operator!=(const shared_ptr& x, nullptr_t) noexcept; // removed in C++20 -template - bool operator!=(nullptr_t, const shared_ptr& y) noexcept; // removed in C++20 -template - bool operator<(const shared_ptr& x, nullptr_t) noexcept; // removed in C++20 -template - bool operator<(nullptr_t, const shared_ptr& y) noexcept; // removed in C++20 -template - bool operator<=(const shared_ptr& x, nullptr_t) noexcept; // removed in C++20 -template - bool operator<=(nullptr_t, const shared_ptr& y) noexcept; // removed in C++20 -template - bool operator>(const shared_ptr& x, nullptr_t) noexcept; // removed in C++20 -template - bool operator>(nullptr_t, const shared_ptr& y) noexcept; // removed in C++20 -template - bool operator>=(const shared_ptr& x, nullptr_t) noexcept; // removed in C++20 -template - bool operator>=(nullptr_t, const shared_ptr& y) noexcept; // removed in C++20 -template - strong_ordering operator<=>(shared_ptr const& x, nullptr_t) noexcept; // C++20 - -// shared_ptr specialized algorithms: -template void swap(shared_ptr& a, shared_ptr& b) noexcept; - -// shared_ptr casts: -template - shared_ptr static_pointer_cast(shared_ptr const& r) noexcept; -template - shared_ptr dynamic_pointer_cast(shared_ptr const& r) noexcept; -template - shared_ptr const_pointer_cast(shared_ptr const& r) noexcept; - -// shared_ptr I/O: -template - basic_ostream& operator<< (basic_ostream& os, shared_ptr const& p); - -// shared_ptr get_deleter: -template D* get_deleter(shared_ptr const& p) noexcept; - -template - shared_ptr make_shared(Args&&... args); // T is not an array -template - shared_ptr allocate_shared(const A& a, Args&&... args); // T is not an array - -template - shared_ptr make_shared(size_t N); // T is U[] (since C++20) -template - shared_ptr allocate_shared(const A& a, size_t N); // T is U[] (since C++20) - -template - shared_ptr make_shared(); // T is U[N] (since C++20) -template - shared_ptr allocate_shared(const A& a); // T is U[N] (since C++20) - -template - shared_ptr make_shared(size_t N, const remove_extent_t& u); // T is U[] (since C++20) -template - shared_ptr allocate_shared(const A& a, size_t N, const remove_extent_t& u); // T is U[] (since C++20) - -template shared_ptr - make_shared(const remove_extent_t& u); // T is U[N] (since C++20) -template - shared_ptr allocate_shared(const A& a, const remove_extent_t& u); // T is U[N] (since C++20) - -template - shared_ptr make_shared_for_overwrite(); // T is not U[], C++20 -template - shared_ptr allocate_shared_for_overwrite(const A& a); // T is not U[], C++20 - -template - shared_ptr make_shared_for_overwrite(size_t N); // T is U[], C++20 -template - shared_ptr allocate_shared_for_overwrite(const A& a, size_t N); // T is U[], C++20 - -template -class weak_ptr -{ -public: - typedef T element_type; // until C++17 - typedef remove_extent_t element_type; // since C++17 - - // constructors - constexpr weak_ptr() noexcept; - template weak_ptr(shared_ptr const& r) noexcept; - weak_ptr(weak_ptr const& r) noexcept; - template weak_ptr(weak_ptr const& r) noexcept; - weak_ptr(weak_ptr&& r) noexcept; // C++14 - template weak_ptr(weak_ptr&& r) noexcept; // C++14 - - // destructor - ~weak_ptr(); - - // assignment - weak_ptr& operator=(weak_ptr const& r) noexcept; - template weak_ptr& operator=(weak_ptr const& r) noexcept; - template weak_ptr& operator=(shared_ptr const& r) noexcept; - weak_ptr& operator=(weak_ptr&& r) noexcept; // C++14 - template weak_ptr& operator=(weak_ptr&& r) noexcept; // C++14 - - // modifiers - void swap(weak_ptr& r) noexcept; - void reset() noexcept; - - // observers - long use_count() const noexcept; - bool expired() const noexcept; - shared_ptr lock() const noexcept; - template bool owner_before(shared_ptr const& b) const noexcept; - template bool owner_before(weak_ptr const& b) const noexcept; -}; - -template -weak_ptr(shared_ptr) -> weak_ptr; - -// weak_ptr specialized algorithms: -template void swap(weak_ptr& a, weak_ptr& b) noexcept; - -// class owner_less: -template struct owner_less; - -template -struct owner_less > - : binary_function, shared_ptr, bool> -{ - typedef bool result_type; - bool operator()(shared_ptr const&, shared_ptr const&) const noexcept; - bool operator()(shared_ptr const&, weak_ptr const&) const noexcept; - bool operator()(weak_ptr const&, shared_ptr const&) const noexcept; -}; - -template -struct owner_less > - : binary_function, weak_ptr, bool> -{ - typedef bool result_type; - bool operator()(weak_ptr const&, weak_ptr const&) const noexcept; - bool operator()(shared_ptr const&, weak_ptr const&) const noexcept; - bool operator()(weak_ptr const&, shared_ptr const&) const noexcept; -}; - -template <> // Added in C++14 -struct owner_less -{ - template - bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept; - template - bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const noexcept; - template - bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept; - template - bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const noexcept; - - typedef void is_transparent; -}; - -template -class enable_shared_from_this -{ -protected: - constexpr enable_shared_from_this() noexcept; - enable_shared_from_this(enable_shared_from_this const&) noexcept; - enable_shared_from_this& operator=(enable_shared_from_this const&) noexcept; - ~enable_shared_from_this(); -public: - shared_ptr shared_from_this(); - shared_ptr shared_from_this() const; -}; - -template - bool atomic_is_lock_free(const shared_ptr* p); -template - shared_ptr atomic_load(const shared_ptr* p); -template - shared_ptr atomic_load_explicit(const shared_ptr* p, memory_order mo); -template - void atomic_store(shared_ptr* p, shared_ptr r); -template - void atomic_store_explicit(shared_ptr* p, shared_ptr r, memory_order mo); -template - shared_ptr atomic_exchange(shared_ptr* p, shared_ptr r); -template - shared_ptr - atomic_exchange_explicit(shared_ptr* p, shared_ptr r, memory_order mo); -template - bool - atomic_compare_exchange_weak(shared_ptr* p, shared_ptr* v, shared_ptr w); -template - bool - atomic_compare_exchange_strong( shared_ptr* p, shared_ptr* v, shared_ptr w); -template - bool - atomic_compare_exchange_weak_explicit(shared_ptr* p, shared_ptr* v, - shared_ptr w, memory_order success, - memory_order failure); -template - bool - atomic_compare_exchange_strong_explicit(shared_ptr* p, shared_ptr* v, - shared_ptr w, memory_order success, - memory_order failure); -// Hash support -template struct hash; -template struct hash >; -template struct hash >; - -template - inline constexpr bool uses_allocator_v = uses_allocator::value; - -// [ptr.align] -void* align(size_t alignment, size_t size, void*& ptr, size_t& space); - -template -[[nodiscard]] constexpr T* assume_aligned(T* ptr); // since C++20 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__memory/addressof.h> diff --git a/libcxx/include/memory_resource b/libcxx/include/memory_resource --- a/libcxx/include/memory_resource +++ b/libcxx/include/memory_resource @@ -10,45 +10,6 @@ #ifndef _LIBCPP_MEMORY_RESOURCE #define _LIBCPP_MEMORY_RESOURCE -/** - memory_resource synopsis - -// C++17 - -namespace std::pmr { - - class memory_resource; - - bool operator==(const memory_resource& a, - const memory_resource& b) noexcept; - bool operator!=(const memory_resource& a, - const memory_resource& b) noexcept; - - template class polymorphic_allocator; - - template - bool operator==(const polymorphic_allocator& a, - const polymorphic_allocator& b) noexcept; - template - bool operator!=(const polymorphic_allocator& a, - const polymorphic_allocator& b) noexcept; - - // Global memory resources - memory_resource* set_default_resource(memory_resource* r) noexcept; - memory_resource* get_default_resource() noexcept; - memory_resource* new_delete_resource() noexcept; - memory_resource* null_memory_resource() noexcept; - - // Pool resource classes - struct pool_options; - class synchronized_pool_resource; - class unsynchronized_pool_resource; - class monotonic_buffer_resource; - -} // namespace std::pmr - - */ - #include <__config> #include <__memory_resource/memory_resource.h> #include <__memory_resource/monotonic_buffer_resource.h> diff --git a/libcxx/include/mutex b/libcxx/include/mutex --- a/libcxx/include/mutex +++ b/libcxx/include/mutex @@ -10,182 +10,6 @@ #ifndef _LIBCPP_MUTEX #define _LIBCPP_MUTEX -/* - mutex synopsis - -namespace std -{ - -class mutex -{ -public: - constexpr mutex() noexcept; - ~mutex(); - - mutex(const mutex&) = delete; - mutex& operator=(const mutex&) = delete; - - void lock(); - bool try_lock(); - void unlock(); - - typedef pthread_mutex_t* native_handle_type; - native_handle_type native_handle(); -}; - -class recursive_mutex -{ -public: - recursive_mutex(); - ~recursive_mutex(); - - recursive_mutex(const recursive_mutex&) = delete; - recursive_mutex& operator=(const recursive_mutex&) = delete; - - void lock(); - bool try_lock() noexcept; - void unlock(); - - typedef pthread_mutex_t* native_handle_type; - native_handle_type native_handle(); -}; - -class timed_mutex -{ -public: - timed_mutex(); - ~timed_mutex(); - - timed_mutex(const timed_mutex&) = delete; - timed_mutex& operator=(const timed_mutex&) = delete; - - void lock(); - bool try_lock(); - template - bool try_lock_for(const chrono::duration& rel_time); - template - bool try_lock_until(const chrono::time_point& abs_time); - void unlock(); -}; - -class recursive_timed_mutex -{ -public: - recursive_timed_mutex(); - ~recursive_timed_mutex(); - - recursive_timed_mutex(const recursive_timed_mutex&) = delete; - recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete; - - void lock(); - bool try_lock() noexcept; - template - bool try_lock_for(const chrono::duration& rel_time); - template - bool try_lock_until(const chrono::time_point& abs_time); - void unlock(); -}; - -struct defer_lock_t { explicit defer_lock_t() = default; }; -struct try_to_lock_t { explicit try_to_lock_t() = default; }; -struct adopt_lock_t { explicit adopt_lock_t() = default; }; - -inline constexpr defer_lock_t defer_lock{}; -inline constexpr try_to_lock_t try_to_lock{}; -inline constexpr adopt_lock_t adopt_lock{}; - -template -class lock_guard -{ -public: - typedef Mutex mutex_type; - - explicit lock_guard(mutex_type& m); - lock_guard(mutex_type& m, adopt_lock_t); - ~lock_guard(); - - lock_guard(lock_guard const&) = delete; - lock_guard& operator=(lock_guard const&) = delete; -}; - -template -class scoped_lock // C++17 -{ -public: - using mutex_type = Mutex; // Only if sizeof...(MutexTypes) == 1 - - explicit scoped_lock(MutexTypes&... m); - scoped_lock(adopt_lock_t, MutexTypes&... m); - ~scoped_lock(); - scoped_lock(scoped_lock const&) = delete; - scoped_lock& operator=(scoped_lock const&) = delete; -private: - tuple pm; // exposition only -}; - -template -class unique_lock -{ -public: - typedef Mutex mutex_type; - unique_lock() noexcept; - explicit unique_lock(mutex_type& m); - unique_lock(mutex_type& m, defer_lock_t) noexcept; - unique_lock(mutex_type& m, try_to_lock_t); - unique_lock(mutex_type& m, adopt_lock_t); - template - unique_lock(mutex_type& m, const chrono::time_point& abs_time); - template - unique_lock(mutex_type& m, const chrono::duration& rel_time); - ~unique_lock(); - - unique_lock(unique_lock const&) = delete; - unique_lock& operator=(unique_lock const&) = delete; - - unique_lock(unique_lock&& u) noexcept; - unique_lock& operator=(unique_lock&& u) noexcept; - - void lock(); - bool try_lock(); - - template - bool try_lock_for(const chrono::duration& rel_time); - template - bool try_lock_until(const chrono::time_point& abs_time); - - void unlock(); - - void swap(unique_lock& u) noexcept; - mutex_type* release() noexcept; - - bool owns_lock() const noexcept; - explicit operator bool () const noexcept; - mutex_type* mutex() const noexcept; -}; - -template - void swap(unique_lock& x, unique_lock& y) noexcept; - -template - int try_lock(L1&, L2&, L3&...); -template - void lock(L1&, L2&, L3&...); - -struct once_flag -{ - constexpr once_flag() noexcept; - - once_flag(const once_flag&) = delete; - once_flag& operator=(const once_flag&) = delete; -}; - -template - void call_once(once_flag& flag, Callable&& func, Args&&... args); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__chrono/steady_clock.h> #include <__chrono/time_point.h> diff --git a/libcxx/include/new b/libcxx/include/new --- a/libcxx/include/new +++ b/libcxx/include/new @@ -10,82 +10,6 @@ #ifndef _LIBCPP_NEW #define _LIBCPP_NEW -/* - new synopsis - -namespace std -{ - -class bad_alloc - : public exception -{ -public: - bad_alloc() noexcept; - bad_alloc(const bad_alloc&) noexcept; - bad_alloc& operator=(const bad_alloc&) noexcept; - virtual const char* what() const noexcept; -}; - -class bad_array_new_length : public bad_alloc // C++14 -{ -public: - bad_array_new_length() noexcept; -}; - -enum class align_val_t : size_t {}; // C++17 - -struct destroying_delete_t { // C++20 - explicit destroying_delete_t() = default; -}; -inline constexpr destroying_delete_t destroying_delete{}; // C++20 - -struct nothrow_t { explicit nothrow_t() = default; }; -extern const nothrow_t nothrow; -typedef void (*new_handler)(); -new_handler set_new_handler(new_handler new_p) noexcept; -new_handler get_new_handler() noexcept; - -// 21.6.4, pointer optimization barrier -template constexpr T* launder(T* p) noexcept; // C++17 -} // std - -void* operator new(std::size_t size); // replaceable, nodiscard in C++20 -void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17, nodiscard in C++20 -void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++20 -void* operator new(std::size_t size, std::align_val_t alignment, - const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++20 -void operator delete(void* ptr) noexcept; // replaceable -void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14 -void operator delete(void* ptr, std::align_val_t alignment) noexcept; // replaceable, C++17 -void operator delete(void* ptr, std::size_t size, - std::align_val_t alignment) noexcept; // replaceable, C++17 -void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable -void operator delete(void* ptr, std:align_val_t alignment, - const std::nothrow_t&) noexcept; // replaceable, C++17 - -void* operator new[](std::size_t size); // replaceable, nodiscard in C++20 -void* operator new[](std::size_t size, - std::align_val_t alignment) noexcept; // replaceable, C++17, nodiscard in C++20 -void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++20 -void* operator new[](std::size_t size, std::align_val_t alignment, - const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++20 -void operator delete[](void* ptr) noexcept; // replaceable -void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14 -void operator delete[](void* ptr, - std::align_val_t alignment) noexcept; // replaceable, C++17 -void operator delete[](void* ptr, std::size_t size, - std::align_val_t alignment) noexcept; // replaceable, C++17 -void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable -void operator delete[](void* ptr, std::align_val_t alignment, - const std::nothrow_t&) noexcept; // replaceable, C++17 - -void* operator new (std::size_t size, void* ptr) noexcept; // nodiscard in C++20 -void* operator new[](std::size_t size, void* ptr) noexcept; // nodiscard in C++20 -void operator delete (void* ptr, void*) noexcept; -void operator delete[](void* ptr, void*) noexcept; - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__availability> #include <__config> diff --git a/libcxx/include/numbers b/libcxx/include/numbers --- a/libcxx/include/numbers +++ b/libcxx/include/numbers @@ -10,54 +10,6 @@ #ifndef _LIBCPP_NUMBERS #define _LIBCPP_NUMBERS -/* - numbers synopsis - -namespace std::numbers { - template inline constexpr T e_v = unspecified; - template inline constexpr T log2e_v = unspecified; - template inline constexpr T log10e_v = unspecified; - template inline constexpr T pi_v = unspecified; - template inline constexpr T inv_pi_v = unspecified; - template inline constexpr T inv_sqrtpi_v = unspecified; - template inline constexpr T ln2_v = unspecified; - template inline constexpr T ln10_v = unspecified; - template inline constexpr T sqrt2_v = unspecified; - template inline constexpr T sqrt3_v = unspecified; - template inline constexpr T inv_sqrt3_v = unspecified; - template inline constexpr T egamma_v = unspecified; - template inline constexpr T phi_v = unspecified; - - template inline constexpr T e_v = see below; - template inline constexpr T log2e_v = see below; - template inline constexpr T log10e_v = see below; - template inline constexpr T pi_v = see below; - template inline constexpr T inv_pi_v = see below; - template inline constexpr T inv_sqrtpi_v = see below; - template inline constexpr T ln2_v = see below; - template inline constexpr T ln10_v = see below; - template inline constexpr T sqrt2_v = see below; - template inline constexpr T sqrt3_v = see below; - template inline constexpr T inv_sqrt3_v = see below; - template inline constexpr T egamma_v = see below; - template inline constexpr T phi_v = see below; - - inline constexpr double e = e_v; - inline constexpr double log2e = log2e_v; - inline constexpr double log10e = log10e_v; - inline constexpr double pi = pi_v; - inline constexpr double inv_pi = inv_pi_v; - inline constexpr double inv_sqrtpi = inv_sqrtpi_v; - inline constexpr double ln2 = ln2_v; - inline constexpr double ln10 = ln10_v; - inline constexpr double sqrt2 = sqrt2_v; - inline constexpr double sqrt3 = sqrt3_v; - inline constexpr double inv_sqrt3 = inv_sqrt3_v; - inline constexpr double egamma = egamma_v; - inline constexpr double phi = phi_v; -} -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__concepts/arithmetic.h> #include <__config> diff --git a/libcxx/include/numeric b/libcxx/include/numeric --- a/libcxx/include/numeric +++ b/libcxx/include/numeric @@ -10,140 +10,6 @@ #ifndef _LIBCPP_NUMERIC #define _LIBCPP_NUMERIC -/* - numeric synopsis - -namespace std -{ - -template - constexpr T // constexpr since C++20 - accumulate(InputIterator first, InputIterator last, T init); - -template - constexpr T // constexpr since C++20 - accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); - -template - constexpr typename iterator_traits::value_type // constexpr since C++20 - reduce(InputIterator first, InputIterator last); // C++17 - -template - constexpr T // constexpr since C++20 - reduce(InputIterator first, InputIterator last, T init); // C++17 - -template - constexpr T // constexpr since C++20 - reduce(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); // C++17 - -template - constexpr T // constexpr since C++20 - inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init); - -template - constexpr T // constexpr since C++20 - inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, - T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); - - -template - constexpr T // constexpr since C++20 - transform_reduce(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, T init); // C++17 - -template - constexpr T // constexpr since C++20 - transform_reduce(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, T init, - BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); // C++17 - -template - constexpr T // constexpr since C++20 - transform_reduce(InputIterator first, InputIterator last, T init, - BinaryOperation binary_op, UnaryOperation unary_op); // C++17 - -template - constexpr OutputIterator // constexpr since C++20 - partial_sum(InputIterator first, InputIterator last, OutputIterator result); - -template - constexpr OutputIterator // constexpr since C++20 - partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op); - -template - constexpr OutputIterator // constexpr since C++20 - exclusive_scan(InputIterator first, InputIterator last, - OutputIterator result, T init); // C++17 - -template - constexpr OutputIterator // constexpr since C++20 - exclusive_scan(InputIterator first, InputIterator last, - OutputIterator result, T init, BinaryOperation binary_op); // C++17 - -template - constexpr OutputIterator // constexpr since C++20 - inclusive_scan(InputIterator first, InputIterator last, OutputIterator result); // C++17 - -template - constexpr OutputIterator // constexpr since C++20 - inclusive_scan(InputIterator first, InputIterator last, - OutputIterator result, BinaryOperation binary_op); // C++17 - -template - constexpr OutputIterator // constexpr since C++20 - inclusive_scan(InputIterator first, InputIterator last, - OutputIterator result, BinaryOperation binary_op, T init); // C++17 - -template - constexpr OutputIterator // constexpr since C++20 - transform_exclusive_scan(InputIterator first, InputIterator last, - OutputIterator result, T init, - BinaryOperation binary_op, UnaryOperation unary_op); // C++17 - -template - constexpr OutputIterator // constexpr since C++20 - transform_inclusive_scan(InputIterator first, InputIterator last, - OutputIterator result, - BinaryOperation binary_op, UnaryOperation unary_op); // C++17 - -template - constexpr OutputIterator // constexpr since C++20 - transform_inclusive_scan(InputIterator first, InputIterator last, - OutputIterator result, - BinaryOperation binary_op, UnaryOperation unary_op, - T init); // C++17 - -template - constexpr OutputIterator // constexpr since C++20 - adjacent_difference(InputIterator first, InputIterator last, OutputIterator result); - -template - constexpr OutputIterator // constexpr since C++20 - adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op); - -template - constexpr void // constexpr since C++20 - iota(ForwardIterator first, ForwardIterator last, T value); - -template - constexpr common_type_t gcd(M m, N n); // C++17 - -template - constexpr common_type_t lcm(M m, N n); // C++17 - -template - constexpr T midpoint(T a, T b) noexcept; // C++20 - -template - constexpr T* midpoint(T* a, T* b); // C++20 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include // for isnormal diff --git a/libcxx/include/optional b/libcxx/include/optional --- a/libcxx/include/optional +++ b/libcxx/include/optional @@ -10,154 +10,6 @@ #ifndef _LIBCPP_OPTIONAL #define _LIBCPP_OPTIONAL -/* - optional synopsis - -// C++1z - -namespace std { - // 23.6.3, optional for object types - template class optional; - - // 23.6.4, no-value state indicator - struct nullopt_t{see below }; - inline constexpr nullopt_t nullopt(unspecified ); - - // 23.6.5, class bad_optional_access - class bad_optional_access; - - // 23.6.6, relational operators - template - constexpr bool operator==(const optional&, const optional&); - template - constexpr bool operator!=(const optional&, const optional&); - template - constexpr bool operator<(const optional&, const optional&); - template - constexpr bool operator>(const optional&, const optional&); - template - constexpr bool operator<=(const optional&, const optional&); - template - constexpr bool operator>=(const optional&, const optional&); - - // 23.6.7 comparison with nullopt - template constexpr bool operator==(const optional&, nullopt_t) noexcept; - template constexpr bool operator==(nullopt_t, const optional&) noexcept; - template constexpr bool operator!=(const optional&, nullopt_t) noexcept; - template constexpr bool operator!=(nullopt_t, const optional&) noexcept; - template constexpr bool operator<(const optional&, nullopt_t) noexcept; - template constexpr bool operator<(nullopt_t, const optional&) noexcept; - template constexpr bool operator<=(const optional&, nullopt_t) noexcept; - template constexpr bool operator<=(nullopt_t, const optional&) noexcept; - template constexpr bool operator>(const optional&, nullopt_t) noexcept; - template constexpr bool operator>(nullopt_t, const optional&) noexcept; - template constexpr bool operator>=(const optional&, nullopt_t) noexcept; - template constexpr bool operator>=(nullopt_t, const optional&) noexcept; - - // 23.6.8, comparison with T - template constexpr bool operator==(const optional&, const U&); - template constexpr bool operator==(const T&, const optional&); - template constexpr bool operator!=(const optional&, const U&); - template constexpr bool operator!=(const T&, const optional&); - template constexpr bool operator<(const optional&, const U&); - template constexpr bool operator<(const T&, const optional&); - template constexpr bool operator<=(const optional&, const U&); - template constexpr bool operator<=(const T&, const optional&); - template constexpr bool operator>(const optional&, const U&); - template constexpr bool operator>(const T&, const optional&); - template constexpr bool operator>=(const optional&, const U&); - template constexpr bool operator>=(const T&, const optional&); - - // 23.6.9, specialized algorithms - template void swap(optional&, optional&) noexcept(see below ); // constexpr in C++20 - template constexpr optional make_optional(T&&); - template - constexpr optional make_optional(Args&&... args); - template - constexpr optional make_optional(initializer_list il, Args&&... args); - - // 23.6.10, hash support - template struct hash; - template struct hash>; - - template class optional { - public: - using value_type = T; - - // 23.6.3.1, constructors - constexpr optional() noexcept; - constexpr optional(nullopt_t) noexcept; - constexpr optional(const optional &); - constexpr optional(optional &&) noexcept(see below); - template constexpr explicit optional(in_place_t, Args &&...); - template - constexpr explicit optional(in_place_t, initializer_list, Args &&...); - template - constexpr explicit(see-below) optional(U &&); - template - explicit(see-below) optional(const optional &); // constexpr in C++20 - template - explicit(see-below) optional(optional &&); // constexpr in C++20 - - // 23.6.3.2, destructor - ~optional(); // constexpr in C++20 - - // 23.6.3.3, assignment - optional &operator=(nullopt_t) noexcept; // constexpr in C++20 - constexpr optional &operator=(const optional &); - constexpr optional &operator=(optional &&) noexcept(see below); - template optional &operator=(U &&); // constexpr in C++20 - template optional &operator=(const optional &); // constexpr in C++20 - template optional &operator=(optional &&); // constexpr in C++20 - template T& emplace(Args &&...); // constexpr in C++20 - template - T& emplace(initializer_list, Args &&...); // constexpr in C++20 - - // 23.6.3.4, swap - void swap(optional &) noexcept(see below ); // constexpr in C++20 - - // 23.6.3.5, observers - constexpr T const *operator->() const; - constexpr T *operator->(); - constexpr T const &operator*() const &; - constexpr T &operator*() &; - constexpr T &&operator*() &&; - constexpr const T &&operator*() const &&; - constexpr explicit operator bool() const noexcept; - constexpr bool has_value() const noexcept; - constexpr T const &value() const &; - constexpr T &value() &; - constexpr T &&value() &&; - constexpr const T &&value() const &&; - template constexpr T value_or(U &&) const &; - template constexpr T value_or(U &&) &&; - - // [optional.monadic], monadic operations - template constexpr auto and_then(F&& f) &; // since C++23 - template constexpr auto and_then(F&& f) &&; // since C++23 - template constexpr auto and_then(F&& f) const&; // since C++23 - template constexpr auto and_then(F&& f) const&&; // since C++23 - template constexpr auto transform(F&& f) &; // since C++23 - template constexpr auto transform(F&& f) &&; // since C++23 - template constexpr auto transform(F&& f) const&; // since C++23 - template constexpr auto transform(F&& f) const&&; // since C++23 - template constexpr optional or_else(F&& f) &&; // since C++23 - template constexpr optional or_else(F&& f) const&; // since C++23 - - // 23.6.3.6, modifiers - void reset() noexcept; // constexpr in C++20 - - private: - T *val; // exposition only - }; - -template - optional(T) -> optional; - -} // namespace std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__availability> #include <__concepts/invocable.h> diff --git a/libcxx/include/ostream b/libcxx/include/ostream --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -10,159 +10,6 @@ #ifndef _LIBCPP_OSTREAM #define _LIBCPP_OSTREAM -/* - ostream synopsis - -template > -class basic_ostream - : virtual public basic_ios -{ -public: - // types (inherited from basic_ios (27.5.4)): - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - // 27.7.2.2 Constructor/destructor: - explicit basic_ostream(basic_streambuf* sb); - basic_ostream(basic_ostream&& rhs); - virtual ~basic_ostream(); - - // 27.7.2.3 Assign/swap - basic_ostream& operator=(const basic_ostream& rhs) = delete; // C++14 - basic_ostream& operator=(basic_ostream&& rhs); - void swap(basic_ostream& rhs); - - // 27.7.2.4 Prefix/suffix: - class sentry; - - // 27.7.2.6 Formatted output: - basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&)); - basic_ostream& operator<<(basic_ios& (*pf)(basic_ios&)); - basic_ostream& operator<<(ios_base& (*pf)(ios_base&)); - basic_ostream& operator<<(bool n); - basic_ostream& operator<<(short n); - basic_ostream& operator<<(unsigned short n); - basic_ostream& operator<<(int n); - basic_ostream& operator<<(unsigned int n); - basic_ostream& operator<<(long n); - basic_ostream& operator<<(unsigned long n); - basic_ostream& operator<<(long long n); - basic_ostream& operator<<(unsigned long long n); - basic_ostream& operator<<(float f); - basic_ostream& operator<<(double f); - basic_ostream& operator<<(long double f); - basic_ostream& operator<<(const void* p); - basic_ostream& operator<<(const volatile void* val); // C++23 - basic_ostream& operator<<(basic_streambuf* sb); - basic_ostream& operator<<(nullptr_t); - - // 27.7.2.7 Unformatted output: - basic_ostream& put(char_type c); - basic_ostream& write(const char_type* s, streamsize n); - basic_ostream& flush(); - - // 27.7.2.5 seeks: - pos_type tellp(); - basic_ostream& seekp(pos_type); - basic_ostream& seekp(off_type, ios_base::seekdir); -protected: - basic_ostream(const basic_ostream& rhs) = delete; - basic_ostream(basic_ostream&& rhs); - // 27.7.3.3 Assign/swap - basic_ostream& operator=(basic_ostream& rhs) = delete; - basic_ostream& operator=(const basic_ostream&& rhs); - void swap(basic_ostream& rhs); -}; - -// 27.7.2.6.4 character inserters - -template - basic_ostream& operator<<(basic_ostream&, charT); - -template - basic_ostream& operator<<(basic_ostream&, char); - -template - basic_ostream& operator<<(basic_ostream&, char); - -// signed and unsigned - -template - basic_ostream& operator<<(basic_ostream&, signed char); - -template - basic_ostream& operator<<(basic_ostream&, unsigned char); - -// NTBS -template - basic_ostream& operator<<(basic_ostream&, const charT*); - -template - basic_ostream& operator<<(basic_ostream&, const char*); - -template - basic_ostream& operator<<(basic_ostream&, const char*); - -// signed and unsigned -template -basic_ostream& operator<<(basic_ostream&, const signed char*); - -template - basic_ostream& operator<<(basic_ostream&, const unsigned char*); - -// swap: -template - void swap(basic_ostream& x, basic_ostream& y); - -template - basic_ostream& endl(basic_ostream& os); - -template - basic_ostream& ends(basic_ostream& os); - -template - basic_ostream& flush(basic_ostream& os); - -// rvalue stream insertion -template - Stream&& operator<<(Stream&& os, const T& x); - -template -basic_ostream& operator<<(basic_ostream&, wchar_t) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, char8_t) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, char16_t) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, char32_t) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, char8_t) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, char16_t) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, char32_t) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, const wchar_t*) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, const char8_t*) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, const char16_t*) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, const char32_t*) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, const char8_t*) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, const char16_t*) = delete; // since C++20 -template -basic_ostream& operator<<(basic_ostream&, const char32_t*) = delete; // since C++20 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__exception/operations.h> diff --git a/libcxx/include/queue b/libcxx/include/queue --- a/libcxx/include/queue +++ b/libcxx/include/queue @@ -10,213 +10,6 @@ #ifndef _LIBCPP_QUEUE #define _LIBCPP_QUEUE -/* - queue synopsis - -namespace std -{ - -template > -class queue -{ -public: - typedef Container container_type; - typedef typename container_type::value_type value_type; - typedef typename container_type::reference reference; - typedef typename container_type::const_reference const_reference; - typedef typename container_type::size_type size_type; - -protected: - container_type c; - -public: - queue() = default; - ~queue() = default; - - queue(const queue& q) = default; - queue(queue&& q) = default; - - queue& operator=(const queue& q) = default; - queue& operator=(queue&& q) = default; - - explicit queue(const container_type& c); - explicit queue(container_type&& c) - template - queue(InputIterator first, InputIterator last); // since C++23 - template - explicit queue(const Alloc& a); - template - queue(const container_type& c, const Alloc& a); - template - queue(container_type&& c, const Alloc& a); - template - queue(const queue& q, const Alloc& a); - template - queue(queue&& q, const Alloc& a); - template - queue(InputIterator first, InputIterator last, const Alloc&); // since C++23 - - bool empty() const; - size_type size() const; - - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - - void push(const value_type& v); - void push(value_type&& v); - template reference emplace(Args&&... args); // reference in C++17 - void pop(); - - void swap(queue& q) noexcept(is_nothrow_swappable_v) -}; - -template - queue(Container) -> queue; // C++17 - -template - queue(InputIterator, InputIterator) -> queue>; // since C++23 - -template - queue(Container, Allocator) -> queue; // C++17 - -template - queue(InputIterator, InputIterator, Allocator) - -> queue, - deque, Allocator>>; // since C++23 - -template - bool operator==(const queue& x,const queue& y); - -template - bool operator< (const queue& x,const queue& y); - -template - bool operator!=(const queue& x,const queue& y); - -template - bool operator> (const queue& x,const queue& y); - -template - bool operator>=(const queue& x,const queue& y); - -template - bool operator<=(const queue& x,const queue& y); - -template - void swap(queue& x, queue& y) - noexcept(noexcept(x.swap(y))); - -template , - class Compare = less> -class priority_queue -{ -public: - typedef Container container_type; - typedef typename container_type::value_type value_type; - typedef typename container_type::reference reference; - typedef typename container_type::const_reference const_reference; - typedef typename container_type::size_type size_type; - -protected: - container_type c; - Compare comp; - -public: - priority_queue() : priority_queue(Compare()) {} // C++20 - explicit priority_queue(const Compare& x) : priority_queue(x, Container()) {} - priority_queue(const Compare& x, const Container&); - explicit priority_queue(const Compare& x = Compare(), Container&& = Container()); // before C++20 - priority_queue(const Compare& x, Container&&); // C++20 - template - priority_queue(InputIterator first, InputIterator last, - const Compare& comp = Compare()); - template - priority_queue(InputIterator first, InputIterator last, - const Compare& comp, const Container& c); - template - priority_queue(InputIterator first, InputIterator last, - const Compare& comp, Container&& c); - template - explicit priority_queue(const Alloc& a); - template - priority_queue(const Compare& comp, const Alloc& a); - template - priority_queue(const Compare& comp, const Container& c, - const Alloc& a); - template - priority_queue(const Compare& comp, Container&& c, - const Alloc& a); - template - priority_queue(InputIterator first, InputIterator last, - const Alloc& a); - template - priority_queue(InputIterator first, InputIterator last, - const Compare& comp, const Alloc& a); - template - priority_queue(InputIterator first, InputIterator last, - const Compare& comp, const Container& c, const Alloc& a); - template - priority_queue(InputIterator first, InputIterator last, - const Compare& comp, Container&& c, const Alloc& a); - template - priority_queue(const priority_queue& q, const Alloc& a); - template - priority_queue(priority_queue&& q, const Alloc& a); - - bool empty() const; - size_type size() const; - const_reference top() const; - - void push(const value_type& v); - void push(value_type&& v); - template void emplace(Args&&... args); - void pop(); - - void swap(priority_queue& q) - noexcept(is_nothrow_swappable_v && - is_nothrow_swappable_v) -}; - -template -priority_queue(Compare, Container) - -> priority_queue; // C++17 - -template>, - class Container = vector>> -priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container()) - -> priority_queue, Container, Compare>; // C++17 - -template -priority_queue(Compare, Container, Allocator) - -> priority_queue; // C++17 - -template -priority_queue(InputIterator, InputIterator, Allocator) - -> priority_queue, - vector, Allocator>, - less>>; // C++17 - -template -priority_queue(InputIterator, InputIterator, Compare, Allocator) - -> priority_queue, - vector, Allocator>, Compare>; // C++17 - -template -priority_queue(InputIterator, InputIterator, Compare, Container, Allocator) - -> priority_queue; // C++17 - -template - void swap(priority_queue& x, - priority_queue& y) - noexcept(noexcept(x.swap(y))); - -} // std - -*/ - #include <__algorithm/make_heap.h> #include <__algorithm/pop_heap.h> #include <__algorithm/push_heap.h> diff --git a/libcxx/include/random b/libcxx/include/random --- a/libcxx/include/random +++ b/libcxx/include/random @@ -10,1673 +10,6 @@ #ifndef _LIBCPP_RANDOM #define _LIBCPP_RANDOM -/* - random synopsis - -#include - -namespace std -{ -// [rand.req.urng], uniform random bit generator requirements -template -concept uniform_random_bit_generator = see below; // C++20 - -// Engines - -template -class linear_congruential_engine -{ -public: - // types - typedef UIntType result_type; - - // engine characteristics - static constexpr result_type multiplier = a; - static constexpr result_type increment = c; - static constexpr result_type modulus = m; - static constexpr result_type min() { return c == 0u ? 1u: 0u;} - static constexpr result_type max() { return m - 1u;} - static constexpr result_type default_seed = 1u; - - // constructors and seeding functions - explicit linear_congruential_engine(result_type s = default_seed); // before C++20 - linear_congruential_engine() : linear_congruential_engine(default_seed) {} // C++20 - explicit linear_congruential_engine(result_type s); // C++20 - template explicit linear_congruential_engine(Sseq& q); - void seed(result_type s = default_seed); - template void seed(Sseq& q); - - // generating functions - result_type operator()(); - void discard(unsigned long long z); -}; - -template -bool -operator==(const linear_congruential_engine& x, - const linear_congruential_engine& y); - -template -bool -operator!=(const linear_congruential_engine& x, - const linear_congruential_engine& y); - -template -basic_ostream& -operator<<(basic_ostream& os, - const linear_congruential_engine& x); - -template -basic_istream& -operator>>(basic_istream& is, - linear_congruential_engine& x); - -template -class mersenne_twister_engine -{ -public: - // types - typedef UIntType result_type; - - // engine characteristics - static constexpr size_t word_size = w; - static constexpr size_t state_size = n; - static constexpr size_t shift_size = m; - static constexpr size_t mask_bits = r; - static constexpr result_type xor_mask = a; - static constexpr size_t tempering_u = u; - static constexpr result_type tempering_d = d; - static constexpr size_t tempering_s = s; - static constexpr result_type tempering_b = b; - static constexpr size_t tempering_t = t; - static constexpr result_type tempering_c = c; - static constexpr size_t tempering_l = l; - static constexpr result_type initialization_multiplier = f; - static constexpr result_type min () { return 0; } - static constexpr result_type max() { return 2^w - 1; } - static constexpr result_type default_seed = 5489u; - - // constructors and seeding functions - explicit mersenne_twister_engine(result_type s = default_seed); // before C++20 - mersenne_twister_engine() : mersenne_twister_engine(default_seed) {} // C++20 - explicit mersenne_twister_engine(result_type s); // C++20 - template explicit mersenne_twister_engine(Sseq& q); - void seed(result_type value = default_seed); - template void seed(Sseq& q); - - // generating functions - result_type operator()(); - void discard(unsigned long long z); -}; - -template -bool -operator==( - const mersenne_twister_engine& x, - const mersenne_twister_engine& y); - -template -bool -operator!=( - const mersenne_twister_engine& x, - const mersenne_twister_engine& y); - -template -basic_ostream& -operator<<(basic_ostream& os, - const mersenne_twister_engine& x); - -template -basic_istream& -operator>>(basic_istream& is, - mersenne_twister_engine& x); - -template -class subtract_with_carry_engine -{ -public: - // types - typedef UIntType result_type; - - // engine characteristics - static constexpr size_t word_size = w; - static constexpr size_t short_lag = s; - static constexpr size_t long_lag = r; - static constexpr result_type min() { return 0; } - static constexpr result_type max() { return m-1; } - static constexpr result_type default_seed = 19780503u; - - // constructors and seeding functions - explicit subtract_with_carry_engine(result_type value = default_seed); // before C++20 - subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {} // C++20 - explicit subtract_with_carry_engine(result_type value); // C++20 - template explicit subtract_with_carry_engine(Sseq& q); - void seed(result_type value = default_seed); - template void seed(Sseq& q); - - // generating functions - result_type operator()(); - void discard(unsigned long long z); -}; - -template -bool -operator==( - const subtract_with_carry_engine& x, - const subtract_with_carry_engine& y); - -template -bool -operator!=( - const subtract_with_carry_engine& x, - const subtract_with_carry_engine& y); - -template -basic_ostream& -operator<<(basic_ostream& os, - const subtract_with_carry_engine& x); - -template -basic_istream& -operator>>(basic_istream& is, - subtract_with_carry_engine& x); - -template -class discard_block_engine -{ -public: - // types - typedef typename Engine::result_type result_type; - - // engine characteristics - static constexpr size_t block_size = p; - static constexpr size_t used_block = r; - static constexpr result_type min() { return Engine::min(); } - static constexpr result_type max() { return Engine::max(); } - - // constructors and seeding functions - discard_block_engine(); - explicit discard_block_engine(const Engine& e); - explicit discard_block_engine(Engine&& e); - explicit discard_block_engine(result_type s); - template explicit discard_block_engine(Sseq& q); - void seed(); - void seed(result_type s); - template void seed(Sseq& q); - - // generating functions - result_type operator()(); - void discard(unsigned long long z); - - // property functions - const Engine& base() const noexcept; -}; - -template -bool -operator==( - const discard_block_engine& x, - const discard_block_engine& y); - -template -bool -operator!=( - const discard_block_engine& x, - const discard_block_engine& y); - -template -basic_ostream& -operator<<(basic_ostream& os, - const discard_block_engine& x); - -template -basic_istream& -operator>>(basic_istream& is, - discard_block_engine& x); - -template -class independent_bits_engine -{ -public: - // types - typedef UIntType result_type; - - // engine characteristics - static constexpr result_type min() { return 0; } - static constexpr result_type max() { return 2^w - 1; } - - // constructors and seeding functions - independent_bits_engine(); - explicit independent_bits_engine(const Engine& e); - explicit independent_bits_engine(Engine&& e); - explicit independent_bits_engine(result_type s); - template explicit independent_bits_engine(Sseq& q); - void seed(); - void seed(result_type s); - template void seed(Sseq& q); - - // generating functions - result_type operator()(); void discard(unsigned long long z); - - // property functions - const Engine& base() const noexcept; -}; - -template -bool -operator==( - const independent_bits_engine& x, - const independent_bits_engine& y); - -template -bool -operator!=( - const independent_bits_engine& x, - const independent_bits_engine& y); - -template -basic_ostream& -operator<<(basic_ostream& os, - const independent_bits_engine& x); - -template -basic_istream& -operator>>(basic_istream& is, - independent_bits_engine& x); - -template -class shuffle_order_engine -{ -public: - // types - typedef typename Engine::result_type result_type; - - // engine characteristics - static constexpr size_t table_size = k; - static constexpr result_type min() { return Engine::min; } - static constexpr result_type max() { return Engine::max; } - - // constructors and seeding functions - shuffle_order_engine(); - explicit shuffle_order_engine(const Engine& e); - explicit shuffle_order_engine(Engine&& e); - explicit shuffle_order_engine(result_type s); - template explicit shuffle_order_engine(Sseq& q); - void seed(); - void seed(result_type s); - template void seed(Sseq& q); - - // generating functions - result_type operator()(); - void discard(unsigned long long z); - - // property functions - const Engine& base() const noexcept; -}; - -template -bool -operator==( - const shuffle_order_engine& x, - const shuffle_order_engine& y); - -template -bool -operator!=( - const shuffle_order_engine& x, - const shuffle_order_engine& y); - -template -basic_ostream& -operator<<(basic_ostream& os, - const shuffle_order_engine& x); - -template -basic_istream& -operator>>(basic_istream& is, - shuffle_order_engine& x); - -typedef linear_congruential_engine - minstd_rand0; -typedef linear_congruential_engine - minstd_rand; -typedef mersenne_twister_engine mt19937; -typedef mersenne_twister_engine mt19937_64; -typedef subtract_with_carry_engine ranlux24_base; -typedef subtract_with_carry_engine ranlux48_base; -typedef discard_block_engine ranlux24; -typedef discard_block_engine ranlux48; -typedef shuffle_order_engine knuth_b; -typedef minstd_rand default_random_engine; - -// Generators - -class random_device -{ -public: - // types - typedef unsigned int result_type; - - // generator characteristics - static constexpr result_type min() { return numeric_limits::min(); } - static constexpr result_type max() { return numeric_limits::max(); } - - // constructors - explicit random_device(const string& token = implementation-defined); // before C++20 - random_device() : random_device(implementation-defined) {} // C++20 - explicit random_device(const string& token); // C++20 - - // generating functions - result_type operator()(); - - // property functions - double entropy() const noexcept; - - // no copy functions - random_device(const random_device& ) = delete; - void operator=(const random_device& ) = delete; -}; - -// Utilities - -class seed_seq -{ -public: - // types - typedef uint_least32_t result_type; - - // constructors - seed_seq(); - template - seed_seq(initializer_list il); - template - seed_seq(InputIterator begin, InputIterator end); - - // generating functions - template - void generate(RandomAccessIterator begin, RandomAccessIterator end); - - // property functions - size_t size() const; - template - void param(OutputIterator dest) const; - - // no copy functions - seed_seq(const seed_seq&) = delete; - void operator=(const seed_seq& ) = delete; -}; - -template - RealType generate_canonical(URNG& g); - -// Distributions - -template -class uniform_int_distribution -{ -public: - // types - typedef IntType result_type; - - class param_type - { - public: - typedef uniform_int_distribution distribution_type; - - explicit param_type(IntType a = 0, - IntType b = numeric_limits::max()); - - result_type a() const; - result_type b() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructors and reset functions - explicit uniform_int_distribution(IntType a = 0, - IntType b = numeric_limits::max()); // before C++20 - uniform_int_distribution() : uniform_int_distribution(0) {} // C++20 - explicit uniform_int_distribution(IntType a, - IntType b = numeric_limits::max()); // C++20 - explicit uniform_int_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type a() const; - result_type b() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const uniform_int_distribution& x, - const uniform_int_distribution& y); - friend bool operator!=(const uniform_int_distribution& x, - const uniform_int_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const uniform_int_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - uniform_int_distribution& x); -}; - -template -class uniform_real_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef uniform_real_distribution distribution_type; - - explicit param_type(RealType a = 0, - RealType b = 1); - - result_type a() const; - result_type b() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructors and reset functions - explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20 - uniform_real_distribution() : uniform_real_distribution(0.0) {} // C++20 - explicit uniform_real_distribution(RealType a, RealType b = 1.0); // C++20 - explicit uniform_real_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type a() const; - result_type b() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const uniform_real_distribution& x, - const uniform_real_distribution& y); - friend bool operator!=(const uniform_real_distribution& x, - const uniform_real_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const uniform_real_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - uniform_real_distribution& x); -}; - -class bernoulli_distribution -{ -public: - // types - typedef bool result_type; - - class param_type - { - public: - typedef bernoulli_distribution distribution_type; - - explicit param_type(double p = 0.5); - - double p() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructors and reset functions - explicit bernoulli_distribution(double p = 0.5); // before C++20 - bernoulli_distribution() : bernoulli_distribution(0.5) {} // C++20 - explicit bernoulli_distribution(double p); // C++20 - explicit bernoulli_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - double p() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const bernoulli_distribution& x, - const bernoulli_distribution& y); - friend bool operator!=(const bernoulli_distribution& x, - const bernoulli_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const bernoulli_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - bernoulli_distribution& x); -}; - -template -class binomial_distribution -{ -public: - // types - typedef IntType result_type; - - class param_type - { - public: - typedef binomial_distribution distribution_type; - - explicit param_type(IntType t = 1, double p = 0.5); - - IntType t() const; - double p() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructors and reset functions - explicit binomial_distribution(IntType t = 1, double p = 0.5); // before C++20 - binomial_distribution() : binomial_distribution(1) {} // C++20 - explicit binomial_distribution(IntType t, double p = 0.5); // C++20 - explicit binomial_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - IntType t() const; - double p() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const binomial_distribution& x, - const binomial_distribution& y); - friend bool operator!=(const binomial_distribution& x, - const binomial_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const binomial_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - binomial_distribution& x); -}; - -template -class geometric_distribution -{ -public: - // types - typedef IntType result_type; - - class param_type - { - public: - typedef geometric_distribution distribution_type; - - explicit param_type(double p = 0.5); - - double p() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructors and reset functions - explicit geometric_distribution(double p = 0.5); // before C++20 - geometric_distribution() : geometric_distribution(0.5) {} // C++20 - explicit geometric_distribution(double p); // C++20 - explicit geometric_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - double p() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const geometric_distribution& x, - const geometric_distribution& y); - friend bool operator!=(const geometric_distribution& x, - const geometric_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const geometric_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - geometric_distribution& x); -}; - -template -class negative_binomial_distribution -{ -public: - // types - typedef IntType result_type; - - class param_type - { - public: - typedef negative_binomial_distribution distribution_type; - - explicit param_type(result_type k = 1, double p = 0.5); - - result_type k() const; - double p() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - explicit negative_binomial_distribution(IntType k = 1, double p = 0.5); // before C++20 - negative_binomial_distribution() : negative_binomial_distribution(1) {} // C++20 - explicit negative_binomial_distribution(IntType k, double p = 0.5); // C++20 - explicit negative_binomial_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type k() const; - double p() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const negative_binomial_distribution& x, - const negative_binomial_distribution& y); - friend bool operator!=(const negative_binomial_distribution& x, - const negative_binomial_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const negative_binomial_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - negative_binomial_distribution& x); -}; - -template -class poisson_distribution -{ -public: - // types - typedef IntType result_type; - - class param_type - { - public: - typedef poisson_distribution distribution_type; - - explicit param_type(double mean = 1.0); - - double mean() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructors and reset functions - explicit poisson_distribution(double mean = 1.0); // before C++20 - poisson_distribution() : poisson_distribution(1.0) {} // C++20 - explicit poisson_distribution(double mean); // C++20 - explicit poisson_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - double mean() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const poisson_distribution& x, - const poisson_distribution& y); - friend bool operator!=(const poisson_distribution& x, - const poisson_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const poisson_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - poisson_distribution& x); -}; - -template -class exponential_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef exponential_distribution distribution_type; - - explicit param_type(result_type lambda = 1.0); - - result_type lambda() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructors and reset functions - explicit exponential_distribution(RealType lambda = 1.0); // before C++20 - exponential_distribution() : exponential_distribution(1.0) {} // C++20 - explicit exponential_distribution(RealType lambda); // C++20 - explicit exponential_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type lambda() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const exponential_distribution& x, - const exponential_distribution& y); - friend bool operator!=(const exponential_distribution& x, - const exponential_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const exponential_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - exponential_distribution& x); -}; - -template -class gamma_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef gamma_distribution distribution_type; - - explicit param_type(result_type alpha = 1, result_type beta = 1); - - result_type alpha() const; - result_type beta() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructors and reset functions - explicit gamma_distribution(RealType alpha = 0.0, RealType beta = 1.0); // before C++20 - gamma_distribution() : gamma_distribution(0.0) {} // C++20 - explicit gamma_distribution(RealType alpha, RealType beta = 1.0); // C++20 - explicit gamma_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type alpha() const; - result_type beta() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const gamma_distribution& x, - const gamma_distribution& y); - friend bool operator!=(const gamma_distribution& x, - const gamma_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const gamma_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - gamma_distribution& x); -}; - -template -class weibull_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef weibull_distribution distribution_type; - - explicit param_type(result_type alpha = 1, result_type beta = 1); - - result_type a() const; - result_type b() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0); // before C++20 - weibull_distribution() : weibull_distribution(1.0) {} // C++20 - explicit weibull_distribution(RealType a, RealType b = 1.0); // C++20 - explicit weibull_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type a() const; - result_type b() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const weibull_distribution& x, - const weibull_distribution& y); - friend bool operator!=(const weibull_distribution& x, - const weibull_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const weibull_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - weibull_distribution& x); -}; - -template -class extreme_value_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef extreme_value_distribution distribution_type; - - explicit param_type(result_type a = 0, result_type b = 1); - - result_type a() const; - result_type b() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20 - extreme_value_distribution() : extreme_value_distribution(0.0) {} // C++20 - explicit extreme_value_distribution(RealType a, RealType b = 1.0); // C++20 - explicit extreme_value_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type a() const; - result_type b() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const extreme_value_distribution& x, - const extreme_value_distribution& y); - friend bool operator!=(const extreme_value_distribution& x, - const extreme_value_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const extreme_value_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - extreme_value_distribution& x); -}; - -template -class normal_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef normal_distribution distribution_type; - - explicit param_type(result_type mean = 0, result_type stddev = 1); - - result_type mean() const; - result_type stddev() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructors and reset functions - explicit normal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20 - normal_distribution() : normal_distribution(0.0) {} // C++20 - explicit normal_distribution(RealType mean, RealType stddev = 1.0); // C++20 - explicit normal_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type mean() const; - result_type stddev() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const normal_distribution& x, - const normal_distribution& y); - friend bool operator!=(const normal_distribution& x, - const normal_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const normal_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - normal_distribution& x); -}; - -template -class lognormal_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef lognormal_distribution distribution_type; - - explicit param_type(result_type m = 0, result_type s = 1); - - result_type m() const; - result_type s() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - explicit lognormal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20 - lognormal_distribution() : lognormal_distribution(0.0) {} // C++20 - explicit lognormal_distribution(RealType mean, RealType stddev = 1.0); // C++20 - explicit lognormal_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type m() const; - result_type s() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const lognormal_distribution& x, - const lognormal_distribution& y); - friend bool operator!=(const lognormal_distribution& x, - const lognormal_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const lognormal_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - lognormal_distribution& x); -}; - -template -class chi_squared_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef chi_squared_distribution distribution_type; - - explicit param_type(result_type n = 1); - - result_type n() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - explicit chi_squared_distribution(RealType n = 1.0); // before C++20 - chi_squared_distribution() : chi_squared_distribution(1.0) {} // C++20 - explicit chi_squared_distribution(RealType n); // C++20 - explicit chi_squared_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type n() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const chi_squared_distribution& x, - const chi_squared_distribution& y); - friend bool operator!=(const chi_squared_distribution& x, - const chi_squared_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const chi_squared_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - chi_squared_distribution& x); -}; - -template -class cauchy_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef cauchy_distribution distribution_type; - - explicit param_type(result_type a = 0, result_type b = 1); - - result_type a() const; - result_type b() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - explicit cauchy_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20 - cauchy_distribution() : cauchy_distribution(0.0) {} // C++20 - explicit cauchy_distribution(RealType a, RealType b = 1.0); // C++20 - explicit cauchy_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type a() const; - result_type b() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const cauchy_distribution& x, - const cauchy_distribution& y); - friend bool operator!=(const cauchy_distribution& x, - const cauchy_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const cauchy_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - cauchy_distribution& x); -}; - -template -class fisher_f_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef fisher_f_distribution distribution_type; - - explicit param_type(result_type m = 1, result_type n = 1); - - result_type m() const; - result_type n() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - explicit fisher_f_distribution(RealType m = 1.0, RealType n = 1.0); // before C++20 - fisher_f_distribution() : fisher_f_distribution(1.0) {} // C++20 - explicit fisher_f_distribution(RealType m, RealType n = 1.0); // C++20 - explicit fisher_f_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type m() const; - result_type n() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const fisher_f_distribution& x, - const fisher_f_distribution& y); - friend bool operator!=(const fisher_f_distribution& x, - const fisher_f_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const fisher_f_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - fisher_f_distribution& x); -}; - -template -class student_t_distribution -{ -public: - // types - typedef RealType result_type; - - class param_type - { - public: - typedef student_t_distribution distribution_type; - - explicit param_type(result_type n = 1); - - result_type n() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - explicit student_t_distribution(RealType n = 1.0); // before C++20 - student_t_distribution() : student_t_distribution(1.0) {} // C++20 - explicit student_t_distribution(RealType n); // C++20 - explicit student_t_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - result_type n() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const student_t_distribution& x, - const student_t_distribution& y); - friend bool operator!=(const student_t_distribution& x, - const student_t_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const student_t_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - student_t_distribution& x); -}; - -template -class discrete_distribution -{ -public: - // types - typedef IntType result_type; - - class param_type - { - public: - typedef discrete_distribution distribution_type; - - param_type(); - template - param_type(InputIterator firstW, InputIterator lastW); - param_type(initializer_list wl); - template - param_type(size_t nw, double xmin, double xmax, UnaryOperation fw); - - vector probabilities() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - discrete_distribution(); - template - discrete_distribution(InputIterator firstW, InputIterator lastW); - discrete_distribution(initializer_list wl); - template - discrete_distribution(size_t nw, double xmin, double xmax, - UnaryOperation fw); - explicit discrete_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - vector probabilities() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const discrete_distribution& x, - const discrete_distribution& y); - friend bool operator!=(const discrete_distribution& x, - const discrete_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const discrete_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - discrete_distribution& x); -}; - -template -class piecewise_constant_distribution -{ - // types - typedef RealType result_type; - - class param_type - { - public: - typedef piecewise_constant_distribution distribution_type; - - param_type(); - template - param_type(InputIteratorB firstB, InputIteratorB lastB, - InputIteratorW firstW); - template - param_type(initializer_list bl, UnaryOperation fw); - template - param_type(size_t nw, result_type xmin, result_type xmax, - UnaryOperation fw); - - vector intervals() const; - vector densities() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - piecewise_constant_distribution(); - template - piecewise_constant_distribution(InputIteratorB firstB, - InputIteratorB lastB, - InputIteratorW firstW); - template - piecewise_constant_distribution(initializer_list bl, - UnaryOperation fw); - template - piecewise_constant_distribution(size_t nw, result_type xmin, - result_type xmax, UnaryOperation fw); - explicit piecewise_constant_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - vector intervals() const; - vector densities() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const piecewise_constant_distribution& x, - const piecewise_constant_distribution& y); - friend bool operator!=(const piecewise_constant_distribution& x, - const piecewise_constant_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const piecewise_constant_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - piecewise_constant_distribution& x); -}; - -template -class piecewise_linear_distribution -{ - // types - typedef RealType result_type; - - class param_type - { - public: - typedef piecewise_linear_distribution distribution_type; - - param_type(); - template - param_type(InputIteratorB firstB, InputIteratorB lastB, - InputIteratorW firstW); - template - param_type(initializer_list bl, UnaryOperation fw); - template - param_type(size_t nw, result_type xmin, result_type xmax, - UnaryOperation fw); - - vector intervals() const; - vector densities() const; - - friend bool operator==(const param_type& x, const param_type& y); - friend bool operator!=(const param_type& x, const param_type& y); - }; - - // constructor and reset functions - piecewise_linear_distribution(); - template - piecewise_linear_distribution(InputIteratorB firstB, - InputIteratorB lastB, - InputIteratorW firstW); - - template - piecewise_linear_distribution(initializer_list bl, - UnaryOperation fw); - - template - piecewise_linear_distribution(size_t nw, result_type xmin, - result_type xmax, UnaryOperation fw); - - explicit piecewise_linear_distribution(const param_type& parm); - void reset(); - - // generating functions - template result_type operator()(URNG& g); - template result_type operator()(URNG& g, const param_type& parm); - - // property functions - vector intervals() const; - vector densities() const; - - param_type param() const; - void param(const param_type& parm); - - result_type min() const; - result_type max() const; - - friend bool operator==(const piecewise_linear_distribution& x, - const piecewise_linear_distribution& y); - friend bool operator!=(const piecewise_linear_distribution& x, - const piecewise_linear_distribution& y); - - template - friend - basic_ostream& - operator<<(basic_ostream& os, - const piecewise_linear_distribution& x); - - template - friend - basic_istream& - operator>>(basic_istream& is, - piecewise_linear_distribution& x); -}; - -} // std -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__random/bernoulli_distribution.h> diff --git a/libcxx/include/ranges b/libcxx/include/ranges --- a/libcxx/include/ranges +++ b/libcxx/include/ranges @@ -10,338 +10,6 @@ #ifndef _LIBCPP_RANGES #define _LIBCPP_RANGES -/* - -#include // see [compare.syn] -#include // see [initializer.list.syn] -#include // see [iterator.synopsis] - -namespace std::ranges { - inline namespace unspecified { - // [range.access], range access - inline constexpr unspecified begin = unspecified; - inline constexpr unspecified end = unspecified; - inline constexpr unspecified cbegin = unspecified; - inline constexpr unspecified cend = unspecified; - - inline constexpr unspecified size = unspecified; - inline constexpr unspecified ssize = unspecified; - } - - // [range.range], ranges - template - concept range = see below; - - template - inline constexpr bool enable_borrowed_range = false; - - template - using iterator_t = decltype(ranges::begin(declval())); - template - using sentinel_t = decltype(ranges::end(declval())); - template - using range_difference_t = iter_difference_t>; - template - using range_size_t = decltype(ranges::size(declval())); - template - using range_value_t = iter_value_t>; - template - using range_reference_t = iter_reference_t>; - template - using range_rvalue_reference_t = iter_rvalue_reference_t>; - template - using range_common_reference_t = iter_common_reference_t>; - - // [range.sized], sized ranges - template - inline constexpr bool disable_sized_range = false; - - template - concept sized_range = ...; - - // [range.view], views - template - inline constexpr bool enable_view = ...; - - struct view_base { }; - - template - concept view = ...; - - // [range.refinements], other range refinements - template - concept output_range = see below; - - template - concept input_range = see below; - - template - concept forward_range = see below; - - template - concept bidirectional_range = see below; - - template - concept random_access_range = see below; - - template - concept contiguous_range = see below; - - template - concept common_range = see below; - - template - concept viewable_range = see below; - - // [view.interface], class template view_interface - template - requires is_class_v && same_as> - class view_interface; - - // [range.subrange], sub-ranges - enum class subrange_kind : bool { unsized, sized }; - - template S = I, subrange_kind K = see below> - requires (K == subrange_kind::sized || !sized_sentinel_for) - class subrange; - - template - inline constexpr bool enable_borrowed_range> = true; - - // [range.dangling], dangling iterator handling - struct dangling; - - template - using borrowed_iterator_t = see below; - - template - using borrowed_subrange_t = see below; - - // [range.elements], elements view - template - requires see below - class elements_view; - - template - inline constexpr bool enable_borrowed_range> = - enable_borrowed_range; - - template - using keys_view = elements_view; - template - using values_view = elements_view; - - namespace views { - template - inline constexpr unspecified elements = unspecified; - inline constexpr auto keys = elements<0>; - inline constexpr auto values = elements<1>; - } - - // [range.empty], empty view - template - requires is_object_v - class empty_view; - - template - inline constexpr bool enable_borrowed_range> = true; - - namespace views { - template - inline constexpr empty_view empty{}; - } - - // [range.all], all view - namespace views { - inline constexpr unspecified all = unspecified; - - template - using all_t = decltype(all(declval())); - } - - template - requires is_object_v - class ref_view; - - template - inline constexpr bool enable_borrowed_range> = true; - - template - requires see below - class owning_view; - - template - inline constexpr bool enable_borrowed_range> = enable_borrowed_range; - - // [range.filter], filter view - template> Pred> - requires view && is_object_v - class filter_view; - - namespace views { - inline constexpr unspecified filter = unspecified; - } - - // [range.drop], drop view - template - class drop_view; - - template - inline constexpr bool enable_borrowed_range> = enable_borrowed_range; - - // [range.drop.while], drop while view - template - requires input_range && is_object_v && - indirect_unary_predicate> - class drop_while_view; - - template - inline constexpr bool enable_borrowed_range> = - enable_borrowed_range; - - namespace views { inline constexpr unspecified drop_while = unspecified; } - - // [range.transform], transform view - template - requires view && is_object_v && - regular_invocable> && - can-reference>> - class transform_view; - - // [range.counted], counted view - namespace views { inline constexpr unspecified counted = unspecified; } - - // [range.common], common view - template - requires (!common_range && copyable>) - class common_view; - - // [range.reverse], reverse view - template - requires bidirectional_range - class reverse_view; - - template - inline constexpr bool enable_borrowed_range> = enable_borrowed_range; - - template - inline constexpr bool enable_borrowed_range> = enable_borrowed_range; - - // [range.take], take view - template class take_view; - - template - inline constexpr bool enable_borrowed_range> = enable_borrowed_range; - - // [range.take.while], take while view - template - requires input_range && is_object_v && - indirect_unary_predicate> - class take_while_view; - - namespace views { inline constexpr unspecified take_while = unspecified; } - - template - requires is_object_v - class single_view; - - template - requires weakly-equality-comparable-with && copyable - class iota_view; - - template - inline constexpr bool enable_borrowed_range> = true; - - // [range.join], join view - template - requires view && input_range> - class join_view; - - // [range.lazy.split], lazy split view - template - concept tiny-range = see below; // exposition only - - template - requires view && view && - indirectly_comparable, iterator_t, ranges::equal_to> && - (forward_range || tiny-range) - class lazy_split_view; - - // [range.split], split view - template - requires view && view && - indirectly_comparable, iterator_t, ranges::equal_to> - class split_view; - - namespace views { - inline constexpr unspecified lazy_split = unspecified; - inline constexpr unspecified split = unspecified; - } - - // [range.istream], istream view - template> - requires see below - class basic_istream_view; - - template - using istream_view = basic_istream_view; - - template - using wistream_view = basic_istream_view; - - namespace views { template inline constexpr unspecified istream = unspecified; } - - // [range.zip], zip view - template - requires (view && ...) && (sizeof...(Views) > 0) - class zip_view; // C++2b - - template - inline constexpr bool enable_borrowed_range> = // C++2b - (enable_borrowed_range && ...); - - namespace views { inline constexpr unspecified zip = unspecified; } // C++2b - - // [range.as.rvalue] - template - requires input_range - class as_rvalue_view; // since C++23 - - namespace views { inline constexpr unspecified as_rvalue ) unspecified; } // since C++23 -} - -namespace std { - namespace views = ranges::views; - - template struct tuple_size; - template struct tuple_element; - - template - struct tuple_size> - : integral_constant {}; - - template - struct tuple_element<0, ranges::subrange> { - using type = I; - }; - - template - struct tuple_element<1, ranges::subrange> { - using type = S; - }; - - template - struct tuple_element<0, const ranges::subrange> { - using type = I; - }; - - template - struct tuple_element<1, const ranges::subrange> { - using type = S; - }; -} -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__ranges/access.h> diff --git a/libcxx/include/ratio b/libcxx/include/ratio --- a/libcxx/include/ratio +++ b/libcxx/include/ratio @@ -10,73 +10,6 @@ #ifndef _LIBCPP_RATIO #define _LIBCPP_RATIO -/* - ratio synopsis - -namespace std -{ - -template -class ratio -{ -public: - static constexpr intmax_t num; - static constexpr intmax_t den; - typedef ratio type; -}; - -// ratio arithmetic -template using ratio_add = ...; -template using ratio_subtract = ...; -template using ratio_multiply = ...; -template using ratio_divide = ...; - -// ratio comparison -template struct ratio_equal; -template struct ratio_not_equal; -template struct ratio_less; -template struct ratio_less_equal; -template struct ratio_greater; -template struct ratio_greater_equal; - -// convenience SI typedefs -typedef ratio<1, 1000000000000000000000000> yocto; // not supported -typedef ratio<1, 1000000000000000000000> zepto; // not supported -typedef ratio<1, 1000000000000000000> atto; -typedef ratio<1, 1000000000000000> femto; -typedef ratio<1, 1000000000000> pico; -typedef ratio<1, 1000000000> nano; -typedef ratio<1, 1000000> micro; -typedef ratio<1, 1000> milli; -typedef ratio<1, 100> centi; -typedef ratio<1, 10> deci; -typedef ratio< 10, 1> deca; -typedef ratio< 100, 1> hecto; -typedef ratio< 1000, 1> kilo; -typedef ratio< 1000000, 1> mega; -typedef ratio< 1000000000, 1> giga; -typedef ratio< 1000000000000, 1> tera; -typedef ratio< 1000000000000000, 1> peta; -typedef ratio< 1000000000000000000, 1> exa; -typedef ratio< 1000000000000000000000, 1> zetta; // not supported -typedef ratio<1000000000000000000000000, 1> yotta; // not supported - - // 20.11.5, ratio comparison - template inline constexpr bool ratio_equal_v - = ratio_equal::value; // C++17 - template inline constexpr bool ratio_not_equal_v - = ratio_not_equal::value; // C++17 - template inline constexpr bool ratio_less_v - = ratio_less::value; // C++17 - template inline constexpr bool ratio_less_equal_v - = ratio_less_equal::value; // C++17 - template inline constexpr bool ratio_greater_v - = ratio_greater::value; // C++17 - template inline constexpr bool ratio_greater_equal_v - = ratio_greater_equal::value; // C++17 -} -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__type_traits/integral_constant.h> diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -10,760 +10,6 @@ #ifndef _LIBCPP_REGEX #define _LIBCPP_REGEX -/* - regex synopsis - -#include - -namespace std -{ - -namespace regex_constants -{ - -enum syntax_option_type -{ - icase = unspecified, - nosubs = unspecified, - optimize = unspecified, - collate = unspecified, - ECMAScript = unspecified, - basic = unspecified, - extended = unspecified, - awk = unspecified, - grep = unspecified, - egrep = unspecified, - multiline = unspecified -}; - -constexpr syntax_option_type operator~(syntax_option_type f); -constexpr syntax_option_type operator&(syntax_option_type lhs, syntax_option_type rhs); -constexpr syntax_option_type operator|(syntax_option_type lhs, syntax_option_type rhs); - -enum match_flag_type -{ - match_default = 0, - match_not_bol = unspecified, - match_not_eol = unspecified, - match_not_bow = unspecified, - match_not_eow = unspecified, - match_any = unspecified, - match_not_null = unspecified, - match_continuous = unspecified, - match_prev_avail = unspecified, - format_default = 0, - format_sed = unspecified, - format_no_copy = unspecified, - format_first_only = unspecified -}; - -constexpr match_flag_type operator~(match_flag_type f); -constexpr match_flag_type operator&(match_flag_type lhs, match_flag_type rhs); -constexpr match_flag_type operator|(match_flag_type lhs, match_flag_type rhs); - -enum error_type -{ - error_collate = unspecified, - error_ctype = unspecified, - error_escape = unspecified, - error_backref = unspecified, - error_brack = unspecified, - error_paren = unspecified, - error_brace = unspecified, - error_badbrace = unspecified, - error_range = unspecified, - error_space = unspecified, - error_badrepeat = unspecified, - error_complexity = unspecified, - error_stack = unspecified -}; - -} // regex_constants - -class regex_error - : public runtime_error -{ -public: - explicit regex_error(regex_constants::error_type ecode); - regex_constants::error_type code() const; -}; - -template -struct regex_traits -{ -public: - typedef charT char_type; - typedef basic_string string_type; - typedef locale locale_type; - typedef /bitmask_type/ char_class_type; - - regex_traits(); - - static size_t length(const char_type* p); - charT translate(charT c) const; - charT translate_nocase(charT c) const; - template - string_type - transform(ForwardIterator first, ForwardIterator last) const; - template - string_type - transform_primary( ForwardIterator first, ForwardIterator last) const; - template - string_type - lookup_collatename(ForwardIterator first, ForwardIterator last) const; - template - char_class_type - lookup_classname(ForwardIterator first, ForwardIterator last, - bool icase = false) const; - bool isctype(charT c, char_class_type f) const; - int value(charT ch, int radix) const; - locale_type imbue(locale_type l); - locale_type getloc()const; -}; - -template > -class basic_regex -{ -public: - // types: - typedef charT value_type; - typedef traits traits_type; - typedef typename traits::string_type string_type; - typedef regex_constants::syntax_option_type flag_type; - typedef typename traits::locale_type locale_type; - - // constants: - static constexpr regex_constants::syntax_option_type icase = regex_constants::icase; - static constexpr regex_constants::syntax_option_type nosubs = regex_constants::nosubs; - static constexpr regex_constants::syntax_option_type optimize = regex_constants::optimize; - static constexpr regex_constants::syntax_option_type collate = regex_constants::collate; - static constexpr regex_constants::syntax_option_type ECMAScript = regex_constants::ECMAScript; - static constexpr regex_constants::syntax_option_type basic = regex_constants::basic; - static constexpr regex_constants::syntax_option_type extended = regex_constants::extended; - static constexpr regex_constants::syntax_option_type awk = regex_constants::awk; - static constexpr regex_constants::syntax_option_type grep = regex_constants::grep; - static constexpr regex_constants::syntax_option_type egrep = regex_constants::egrep; - static constexpr regex_constants::syntax_option_type multiline = regex_constants::multiline; - - // construct/copy/destroy: - basic_regex(); - explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript); - basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript); - basic_regex(const basic_regex&); - basic_regex(basic_regex&&) noexcept; - template - explicit basic_regex(const basic_string& p, - flag_type f = regex_constants::ECMAScript); - template - basic_regex(ForwardIterator first, ForwardIterator last, - flag_type f = regex_constants::ECMAScript); - basic_regex(initializer_list, flag_type = regex_constants::ECMAScript); - - ~basic_regex(); - - basic_regex& operator=(const basic_regex&); - basic_regex& operator=(basic_regex&&) noexcept; - basic_regex& operator=(const charT* ptr); - basic_regex& operator=(initializer_list il); - template - basic_regex& operator=(const basic_string& p); - - // assign: - basic_regex& assign(const basic_regex& that); - basic_regex& assign(basic_regex&& that) noexcept; - basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript); - basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript); - template - basic_regex& assign(const basic_string& s, - flag_type f = regex_constants::ECMAScript); - template - basic_regex& assign(InputIterator first, InputIterator last, - flag_type f = regex_constants::ECMAScript); - basic_regex& assign(initializer_list, flag_type f = regex_constants::ECMAScript); - - // const operations: - unsigned mark_count() const; - flag_type flags() const; - - // locale: - locale_type imbue(locale_type loc); - locale_type getloc() const; - - // swap: - void swap(basic_regex&); -}; - -template -basic_regex(ForwardIterator, ForwardIterator, - regex_constants::syntax_option_type = regex_constants::ECMAScript) - -> basic_regex::value_type>; // C++17 - -typedef basic_regex regex; -typedef basic_regex wregex; - -template - void swap(basic_regex& e1, basic_regex& e2); - -template -class sub_match - : public pair -{ -public: - typedef typename iterator_traits::value_type value_type; - typedef typename iterator_traits::difference_type difference_type; - typedef BidirectionalIterator iterator; - typedef basic_string string_type; - - bool matched; - - constexpr sub_match(); - - difference_type length() const; - operator string_type() const; - string_type str() const; - - int compare(const sub_match& s) const; - int compare(const string_type& s) const; - int compare(const value_type* s) const; - - void swap(sub_match& s) noexcept(see below); -}; - -typedef sub_match csub_match; -typedef sub_match wcsub_match; -typedef sub_match ssub_match; -typedef sub_match wssub_match; - -template - bool - operator==(const sub_match& lhs, const sub_match& rhs); - -template - bool - operator!=(const sub_match& lhs, const sub_match& rhs); - -template - bool - operator<(const sub_match& lhs, const sub_match& rhs); - -template - bool - operator<=(const sub_match& lhs, const sub_match& rhs); - -template - bool - operator>=(const sub_match& lhs, const sub_match& rhs); - -template - bool - operator>(const sub_match& lhs, const sub_match& rhs); - -template - bool - operator==(const basic_string::value_type, ST, SA>& lhs, - const sub_match& rhs); - -template - bool - operator!=(const basic_string::value_type, ST, SA>& lhs, - const sub_match& rhs); - -template - bool - operator<(const basic_string::value_type, ST, SA>& lhs, - const sub_match& rhs); - -template - bool - operator>(const basic_string::value_type, ST, SA>& lhs, - const sub_match& rhs); - -template - bool operator>=(const basic_string::value_type, ST, SA>& lhs, - const sub_match& rhs); - -template - bool - operator<=(const basic_string::value_type, ST, SA>& lhs, - const sub_match& rhs); - -template - bool - operator==(const sub_match& lhs, - const basic_string::value_type, ST, SA>& rhs); - -template - bool - operator!=(const sub_match& lhs, - const basic_string::value_type, ST, SA>& rhs); - -template - bool - operator<(const sub_match& lhs, - const basic_string::value_type, ST, SA>& rhs); - -template - bool operator>(const sub_match& lhs, - const basic_string::value_type, ST, SA>& rhs); - -template - bool - operator>=(const sub_match& lhs, - const basic_string::value_type, ST, SA>& rhs); - -template - bool - operator<=(const sub_match& lhs, - const basic_string::value_type, ST, SA>& rhs); - -template - bool - operator==(typename iterator_traits::value_type const* lhs, - const sub_match& rhs); - -template - bool - operator!=(typename iterator_traits::value_type const* lhs, - const sub_match& rhs); - -template - bool - operator<(typename iterator_traits::value_type const* lhs, - const sub_match& rhs); - -template - bool - operator>(typename iterator_traits::value_type const* lhs, - const sub_match& rhs); - -template - bool - operator>=(typename iterator_traits::value_type const* lhs, - const sub_match& rhs); - -template - bool - operator<=(typename iterator_traits::value_type const* lhs, - const sub_match& rhs); - -template - bool - operator==(const sub_match& lhs, - typename iterator_traits::value_type const* rhs); - -template - bool - operator!=(const sub_match& lhs, - typename iterator_traits::value_type const* rhs); - -template - bool - operator<(const sub_match& lhs, - typename iterator_traits::value_type const* rhs); - -template - bool - operator>(const sub_match& lhs, - typename iterator_traits::value_type const* rhs); - -template - bool - operator>=(const sub_match& lhs, - typename iterator_traits::value_type const* rhs); - -template - bool - operator<=(const sub_match& lhs, - typename iterator_traits::value_type const* rhs); - -template - bool - operator==(typename iterator_traits::value_type const& lhs, - const sub_match& rhs); - -template - bool - operator!=(typename iterator_traits::value_type const& lhs, - const sub_match& rhs); - -template - bool - operator<(typename iterator_traits::value_type const& lhs, - const sub_match& rhs); - -template - bool - operator>(typename iterator_traits::value_type const& lhs, - const sub_match& rhs); - -template - bool - operator>=(typename iterator_traits::value_type const& lhs, - const sub_match& rhs); - -template - bool - operator<=(typename iterator_traits::value_type const& lhs, - const sub_match& rhs); - -template - bool - operator==(const sub_match& lhs, - typename iterator_traits::value_type const& rhs); - -template - bool - operator!=(const sub_match& lhs, - typename iterator_traits::value_type const& rhs); - -template - bool - operator<(const sub_match& lhs, - typename iterator_traits::value_type const& rhs); - -template - bool - operator>(const sub_match& lhs, - typename iterator_traits::value_type const& rhs); - -template - bool - operator>=(const sub_match& lhs, - typename iterator_traits::value_type const& rhs); - -template - bool - operator<=(const sub_match& lhs, - typename iterator_traits::value_type const& rhs); - -template - basic_ostream& - operator<<(basic_ostream& os, const sub_match& m); - -template >> -class match_results -{ -public: - typedef sub_match value_type; - typedef const value_type& const_reference; - typedef value_type& reference; - typedef /implementation-defined/ const_iterator; - typedef const_iterator iterator; - typedef typename iterator_traits::difference_type difference_type; - typedef typename allocator_traits::size_type size_type; - typedef Allocator allocator_type; - typedef typename iterator_traits::value_type char_type; - typedef basic_string string_type; - - // construct/copy/destroy: - explicit match_results(const Allocator& a = Allocator()); // before C++20 - match_results() : match_results(Allocator()) {} // C++20 - explicit match_results(const Allocator& a); // C++20 - match_results(const match_results& m); - match_results(match_results&& m) noexcept; - match_results& operator=(const match_results& m); - match_results& operator=(match_results&& m); - ~match_results(); - - bool ready() const; - - // size: - size_type size() const; - size_type max_size() const; - bool empty() const; - - // element access: - difference_type length(size_type sub = 0) const; - difference_type position(size_type sub = 0) const; - string_type str(size_type sub = 0) const; - const_reference operator[](size_type n) const; - - const_reference prefix() const; - const_reference suffix() const; - - const_iterator begin() const; - const_iterator end() const; - const_iterator cbegin() const; - const_iterator cend() const; - - // format: - template - OutputIter - format(OutputIter out, const char_type* fmt_first, - const char_type* fmt_last, - regex_constants::match_flag_type flags = regex_constants::format_default) const; - template - OutputIter - format(OutputIter out, const basic_string& fmt, - regex_constants::match_flag_type flags = regex_constants::format_default) const; - template - basic_string - format(const basic_string& fmt, - regex_constants::match_flag_type flags = regex_constants::format_default) const; - string_type - format(const char_type* fmt, - regex_constants::match_flag_type flags = regex_constants::format_default) const; - - // allocator: - allocator_type get_allocator() const; - - // swap: - void swap(match_results& that); -}; - -typedef match_results cmatch; -typedef match_results wcmatch; -typedef match_results smatch; -typedef match_results wsmatch; - -template - bool - operator==(const match_results& m1, - const match_results& m2); - -template - bool - operator!=(const match_results& m1, - const match_results& m2); - -template - void - swap(match_results& m1, - match_results& m2); - -template - bool - regex_match(BidirectionalIterator first, BidirectionalIterator last, - match_results& m, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_match(BidirectionalIterator first, BidirectionalIterator last, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_match(const charT* str, match_results& m, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_match(const basic_string& s, - match_results::const_iterator, Allocator>& m, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_match(const basic_string&& s, - match_results::const_iterator, Allocator>& m, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default) = delete; // C++14 - -template - bool - regex_match(const charT* str, const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_match(const basic_string& s, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_search(BidirectionalIterator first, BidirectionalIterator last, - match_results& m, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_search(BidirectionalIterator first, BidirectionalIterator last, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_search(const charT* str, match_results& m, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_search(const charT* str, const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_search(const basic_string& s, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_search(const basic_string& s, - match_results::const_iterator, Allocator>& m, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - bool - regex_search(const basic_string&& s, - match_results::const_iterator, Allocator>& m, - const basic_regex& e, - regex_constants::match_flag_type flags = regex_constants::match_default) = delete; // C++14 - -template - OutputIterator - regex_replace(OutputIterator out, - BidirectionalIterator first, BidirectionalIterator last, - const basic_regex& e, - const basic_string& fmt, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - OutputIterator - regex_replace(OutputIterator out, - BidirectionalIterator first, BidirectionalIterator last, - const basic_regex& e, const charT* fmt, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - basic_string - regex_replace(const basic_string& s, - const basic_regex& e, - const basic_string& fmt, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - basic_string - regex_replace(const basic_string& s, - const basic_regex& e, const charT* fmt, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - basic_string - regex_replace(const charT* s, - const basic_regex& e, - const basic_string& fmt, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template - basic_string - regex_replace(const charT* s, - const basic_regex& e, - const charT* fmt, - regex_constants::match_flag_type flags = regex_constants::match_default); - -template ::value_type, - class traits = regex_traits> -class regex_iterator -{ -public: - typedef basic_regex regex_type; - typedef match_results value_type; - typedef ptrdiff_t difference_type; - typedef const value_type* pointer; - typedef const value_type& reference; - typedef forward_iterator_tag iterator_category; - - regex_iterator(); - regex_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type& re, - regex_constants::match_flag_type m = regex_constants::match_default); - regex_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type&& re, - regex_constants::match_flag_type m - = regex_constants::match_default) = delete; // C++14 - regex_iterator(const regex_iterator&); - regex_iterator& operator=(const regex_iterator&); - - bool operator==(const regex_iterator&) const; - bool operator!=(const regex_iterator&) const; - - const value_type& operator*() const; - const value_type* operator->() const; - - regex_iterator& operator++(); - regex_iterator operator++(int); -}; - -typedef regex_iterator cregex_iterator; -typedef regex_iterator wcregex_iterator; -typedef regex_iterator sregex_iterator; -typedef regex_iterator wsregex_iterator; - -template ::value_type, - class traits = regex_traits> -class regex_token_iterator -{ -public: - typedef basic_regex regex_type; - typedef sub_match value_type; - typedef ptrdiff_t difference_type; - typedef const value_type* pointer; - typedef const value_type& reference; - typedef forward_iterator_tag iterator_category; - - regex_token_iterator(); - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type& re, int submatch = 0, - regex_constants::match_flag_type m = regex_constants::match_default); - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type&& re, int submatch = 0, - regex_constants::match_flag_type m = regex_constants::match_default) = delete; // C++14 - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type& re, const vector& submatches, - regex_constants::match_flag_type m = regex_constants::match_default); - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type&& re, const vector& submatches, - regex_constants::match_flag_type m = regex_constants::match_default) = delete; // C++14 - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type& re, initializer_list submatches, - regex_constants::match_flag_type m = regex_constants::match_default); - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type&& re, initializer_list submatches, - regex_constants::match_flag_type m = regex_constants::match_default) = delete; // C++14 - template - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type& re, const int (&submatches)[N], - regex_constants::match_flag_type m = regex_constants::match_default); - template - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type&& re, const int (&submatches)[N], - regex_constants::match_flag_type m = regex_constants::match_default) = delete; // C++14 - regex_token_iterator(const regex_token_iterator&); - regex_token_iterator& operator=(const regex_token_iterator&); - - bool operator==(const regex_token_iterator&) const; - bool operator!=(const regex_token_iterator&) const; - - const value_type& operator*() const; - const value_type* operator->() const; - - regex_token_iterator& operator++(); - regex_token_iterator operator++(int); -}; - -typedef regex_token_iterator cregex_token_iterator; -typedef regex_token_iterator wcregex_token_iterator; -typedef regex_token_iterator sregex_token_iterator; -typedef regex_token_iterator wsregex_token_iterator; - -} // std -*/ - #include <__algorithm/find.h> #include <__algorithm/search.h> #include <__assert> // all public C++ headers provide the assertion handler diff --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator --- a/libcxx/include/scoped_allocator +++ b/libcxx/include/scoped_allocator @@ -10,105 +10,6 @@ #ifndef _LIBCPP_SCOPED_ALLOCATOR #define _LIBCPP_SCOPED_ALLOCATOR -/* - scoped_allocator synopsis - -namespace std -{ - -template -class scoped_allocator_adaptor : public OuterAlloc -{ - typedef allocator_traits OuterTraits; // exposition only - scoped_allocator_adaptor inner; // exposition only -public: - - typedef OuterAlloc outer_allocator_type; - typedef see below inner_allocator_type; - - typedef typename OuterTraits::value_type value_type; - typedef typename OuterTraits::size_type size_type; - typedef typename OuterTraits::difference_type difference_type; - typedef typename OuterTraits::pointer pointer; - typedef typename OuterTraits::const_pointer const_pointer; - typedef typename OuterTraits::void_pointer void_pointer; - typedef typename OuterTraits::const_void_pointer const_void_pointer; - - typedef see below propagate_on_container_copy_assignment; - typedef see below propagate_on_container_move_assignment; - typedef see below propagate_on_container_swap; - typedef see below is_always_equal; - - template - struct rebind - { - typedef scoped_allocator_adaptor< - OuterTraits::template rebind_alloc, InnerAllocs...> other; - }; - - scoped_allocator_adaptor(); - template - scoped_allocator_adaptor(OuterA2&& outerAlloc, - const InnerAllocs&... innerAllocs) noexcept; - scoped_allocator_adaptor(const scoped_allocator_adaptor& other) noexcept; - scoped_allocator_adaptor(scoped_allocator_adaptor&& other) noexcept; - template - scoped_allocator_adaptor(const scoped_allocator_adaptor& other) noexcept; - template - scoped_allocator_adaptor(const scoped_allocator_adaptor&& other) noexcept; - - scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&) = default; - scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default; - ~scoped_allocator_adaptor(); - - inner_allocator_type& inner_allocator() noexcept; - const inner_allocator_type& inner_allocator() const noexcept; - - outer_allocator_type& outer_allocator() noexcept; - const outer_allocator_type& outer_allocator() const noexcept; - - pointer allocate(size_type n); // [[nodiscard]] in C++20 - pointer allocate(size_type n, const_void_pointer hint); // [[nodiscard]] in C++20 - void deallocate(pointer p, size_type n) noexcept; - - size_type max_size() const; - template void construct(T* p, Args&& args); - template - void construct(pair* p, piecewise_construct t, tuple x, - tuple y); - template - void construct(pair* p); - template - void construct(pair* p, U&& x, V&& y); - template - void construct(pair* p, const pair& x); - template - void construct(pair* p, pair&& x); - template void destroy(T* p); - - template void destroy(T* p) noexcept; - - scoped_allocator_adaptor select_on_container_copy_construction() const noexcept; -}; - -template - scoped_allocator_adaptor(OuterAlloc, InnerAllocs...) - -> scoped_allocator_adaptor; - -template - bool - operator==(const scoped_allocator_adaptor& a, - const scoped_allocator_adaptor& b) noexcept; - -template - bool - operator!=(const scoped_allocator_adaptor& a, - const scoped_allocator_adaptor& b) noexcept; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__memory/allocator_traits.h> diff --git a/libcxx/include/semaphore b/libcxx/include/semaphore --- a/libcxx/include/semaphore +++ b/libcxx/include/semaphore @@ -10,41 +10,6 @@ #ifndef _LIBCPP_SEMAPHORE #define _LIBCPP_SEMAPHORE -/* - semaphore synopsis - -namespace std { - -template -class counting_semaphore -{ -public: -static constexpr ptrdiff_t max() noexcept; - -constexpr explicit counting_semaphore(ptrdiff_t desired); -~counting_semaphore(); - -counting_semaphore(const counting_semaphore&) = delete; -counting_semaphore& operator=(const counting_semaphore&) = delete; - -void release(ptrdiff_t update = 1); -void acquire(); -bool try_acquire() noexcept; -template - bool try_acquire_for(const chrono::duration& rel_time); -template - bool try_acquire_until(const chrono::time_point& abs_time); - -private: -ptrdiff_t counter; // exposition only -}; - -using binary_semaphore = counting_semaphore<1>; - -} - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__atomic/atomic_base.h> #include <__atomic/atomic_sync.h> diff --git a/libcxx/include/set b/libcxx/include/set --- a/libcxx/include/set +++ b/libcxx/include/set @@ -10,467 +10,6 @@ #ifndef _LIBCPP_SET #define _LIBCPP_SET -/* - - set synopsis - -namespace std -{ - -template , - class Allocator = allocator> -class set -{ -public: - // types: - typedef Key key_type; - typedef key_type value_type; - typedef Compare key_compare; - typedef key_compare value_compare; - typedef Allocator allocator_type; - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - typedef typename allocator_type::size_type size_type; - typedef typename allocator_type::difference_type difference_type; - typedef typename allocator_type::pointer pointer; - typedef typename allocator_type::const_pointer const_pointer; - - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef unspecified node_type; // C++17 - typedef INSERT_RETURN_TYPE insert_return_type; // C++17 - - // construct/copy/destroy: - set() - noexcept( - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value && - is_nothrow_copy_constructible::value); - explicit set(const value_compare& comp); - set(const value_compare& comp, const allocator_type& a); - template - set(InputIterator first, InputIterator last, - const value_compare& comp = value_compare()); - template - set(InputIterator first, InputIterator last, const value_compare& comp, - const allocator_type& a); - set(const set& s); - set(set&& s) - noexcept( - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value); - explicit set(const allocator_type& a); - set(const set& s, const allocator_type& a); - set(set&& s, const allocator_type& a); - set(initializer_list il, const value_compare& comp = value_compare()); - set(initializer_list il, const value_compare& comp, - const allocator_type& a); - template - set(InputIterator first, InputIterator last, const allocator_type& a) - : set(first, last, Compare(), a) {} // C++14 - set(initializer_list il, const allocator_type& a) - : set(il, Compare(), a) {} // C++14 - ~set(); - - set& operator=(const set& s); - set& operator=(set&& s) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); - set& operator=(initializer_list il); - - // iterators: - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - - reverse_iterator rbegin() noexcept; - const_reverse_iterator rbegin() const noexcept; - reverse_iterator rend() noexcept; - const_reverse_iterator rend() const noexcept; - - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - // capacity: - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - // modifiers: - template - pair emplace(Args&&... args); - template - iterator emplace_hint(const_iterator position, Args&&... args); - pair insert(const value_type& v); - pair insert(value_type&& v); - iterator insert(const_iterator position, const value_type& v); - iterator insert(const_iterator position, value_type&& v); - template - void insert(InputIterator first, InputIterator last); - void insert(initializer_list il); - - node_type extract(const_iterator position); // C++17 - node_type extract(const key_type& x); // C++17 - insert_return_type insert(node_type&& nh); // C++17 - iterator insert(const_iterator hint, node_type&& nh); // C++17 - - iterator erase(const_iterator position); - iterator erase(iterator position); // C++14 - size_type erase(const key_type& k); - iterator erase(const_iterator first, const_iterator last); - void clear() noexcept; - - template - void merge(set& source); // C++17 - template - void merge(set&& source); // C++17 - template - void merge(multiset& source); // C++17 - template - void merge(multiset&& source); // C++17 - - void swap(set& s) - noexcept( - __is_nothrow_swappable::value && - (!allocator_type::propagate_on_container_swap::value || - __is_nothrow_swappable::value)); - - // observers: - allocator_type get_allocator() const noexcept; - key_compare key_comp() const; - value_compare value_comp() const; - - // set operations: - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - template - iterator find(const K& x); - template - const_iterator find(const K& x) const; // C++14 - - template - size_type count(const K& x) const; // C++14 - size_type count(const key_type& k) const; - - bool contains(const key_type& x) const; // C++20 - template bool contains(const K& x) const; // C++20 - - iterator lower_bound(const key_type& k); - const_iterator lower_bound(const key_type& k) const; - template - iterator lower_bound(const K& x); // C++14 - template - const_iterator lower_bound(const K& x) const; // C++14 - - iterator upper_bound(const key_type& k); - const_iterator upper_bound(const key_type& k) const; - template - iterator upper_bound(const K& x); // C++14 - template - const_iterator upper_bound(const K& x) const; // C++14 - pair equal_range(const key_type& k); - pair equal_range(const key_type& k) const; - template - pair equal_range(const K& x); // C++14 - template - pair equal_range(const K& x) const; // C++14 -}; - -template ::value_type>, - class Allocator = allocator::value_type>> -set(InputIterator, InputIterator, - Compare = Compare(), Allocator = Allocator()) - -> set::value_type, Compare, Allocator>; // C++17 - -template, class Allocator = allocator> -set(initializer_list, Compare = Compare(), Allocator = Allocator()) - -> set; // C++17 - -template -set(InputIterator, InputIterator, Allocator) - -> set::value_type, - less::value_type>, Allocator>; // C++17 - -template -set(initializer_list, Allocator) -> set, Allocator>; // C++17 - -template -bool -operator==(const set& x, - const set& y); - -template -bool -operator< (const set& x, - const set& y); - -template -bool -operator!=(const set& x, - const set& y); - -template -bool -operator> (const set& x, - const set& y); - -template -bool -operator>=(const set& x, - const set& y); - -template -bool -operator<=(const set& x, - const set& y); - -// specialized algorithms: -template -void -swap(set& x, set& y) - noexcept(noexcept(x.swap(y))); - -template -typename set::size_type -erase_if(set& c, Predicate pred); // C++20 - -template , - class Allocator = allocator> -class multiset -{ -public: - // types: - typedef Key key_type; - typedef key_type value_type; - typedef Compare key_compare; - typedef key_compare value_compare; - typedef Allocator allocator_type; - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - typedef typename allocator_type::size_type size_type; - typedef typename allocator_type::difference_type difference_type; - typedef typename allocator_type::pointer pointer; - typedef typename allocator_type::const_pointer const_pointer; - - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef unspecified node_type; // C++17 - - // construct/copy/destroy: - multiset() - noexcept( - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value && - is_nothrow_copy_constructible::value); - explicit multiset(const value_compare& comp); - multiset(const value_compare& comp, const allocator_type& a); - template - multiset(InputIterator first, InputIterator last, - const value_compare& comp = value_compare()); - template - multiset(InputIterator first, InputIterator last, - const value_compare& comp, const allocator_type& a); - multiset(const multiset& s); - multiset(multiset&& s) - noexcept( - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value); - explicit multiset(const allocator_type& a); - multiset(const multiset& s, const allocator_type& a); - multiset(multiset&& s, const allocator_type& a); - multiset(initializer_list il, const value_compare& comp = value_compare()); - multiset(initializer_list il, const value_compare& comp, - const allocator_type& a); - template - multiset(InputIterator first, InputIterator last, const allocator_type& a) - : set(first, last, Compare(), a) {} // C++14 - multiset(initializer_list il, const allocator_type& a) - : set(il, Compare(), a) {} // C++14 - ~multiset(); - - multiset& operator=(const multiset& s); - multiset& operator=(multiset&& s) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); - multiset& operator=(initializer_list il); - - // iterators: - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - - reverse_iterator rbegin() noexcept; - const_reverse_iterator rbegin() const noexcept; - reverse_iterator rend() noexcept; - const_reverse_iterator rend() const noexcept; - - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - // capacity: - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - // modifiers: - template - iterator emplace(Args&&... args); - template - iterator emplace_hint(const_iterator position, Args&&... args); - iterator insert(const value_type& v); - iterator insert(value_type&& v); - iterator insert(const_iterator position, const value_type& v); - iterator insert(const_iterator position, value_type&& v); - template - void insert(InputIterator first, InputIterator last); - void insert(initializer_list il); - - node_type extract(const_iterator position); // C++17 - node_type extract(const key_type& x); // C++17 - iterator insert(node_type&& nh); // C++17 - iterator insert(const_iterator hint, node_type&& nh); // C++17 - - iterator erase(const_iterator position); - iterator erase(iterator position); // C++14 - size_type erase(const key_type& k); - iterator erase(const_iterator first, const_iterator last); - void clear() noexcept; - - template - void merge(multiset& source); // C++17 - template - void merge(multiset&& source); // C++17 - template - void merge(set& source); // C++17 - template - void merge(set&& source); // C++17 - - void swap(multiset& s) - noexcept( - __is_nothrow_swappable::value && - (!allocator_type::propagate_on_container_swap::value || - __is_nothrow_swappable::value)); - - // observers: - allocator_type get_allocator() const noexcept; - key_compare key_comp() const; - value_compare value_comp() const; - - // set operations: - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - template - iterator find(const K& x); - template - const_iterator find(const K& x) const; // C++14 - - template - size_type count(const K& x) const; // C++14 - size_type count(const key_type& k) const; - - bool contains(const key_type& x) const; // C++20 - template bool contains(const K& x) const; // C++20 - - iterator lower_bound(const key_type& k); - const_iterator lower_bound(const key_type& k) const; - template - iterator lower_bound(const K& x); // C++14 - template - const_iterator lower_bound(const K& x) const; // C++14 - - iterator upper_bound(const key_type& k); - const_iterator upper_bound(const key_type& k) const; - template - iterator upper_bound(const K& x); // C++14 - template - const_iterator upper_bound(const K& x) const; // C++14 - - pair equal_range(const key_type& k); - pair equal_range(const key_type& k) const; - template - pair equal_range(const K& x); // C++14 - template - pair equal_range(const K& x) const; // C++14 -}; - -template ::value_type>, - class Allocator = allocator::value_type>> -multiset(InputIterator, InputIterator, - Compare = Compare(), Allocator = Allocator()) - -> multiset::value_type, Compare, Allocator>; // C++17 - -template, class Allocator = allocator> -multiset(initializer_list, Compare = Compare(), Allocator = Allocator()) - -> multiset; // C++17 - -template -multiset(InputIterator, InputIterator, Allocator) - -> multiset::value_type, - less::value_type>, Allocator>; // C++17 - -template -multiset(initializer_list, Allocator) -> multiset, Allocator>; // C++17 - -template -bool -operator==(const multiset& x, - const multiset& y); - -template -bool -operator< (const multiset& x, - const multiset& y); - -template -bool -operator!=(const multiset& x, - const multiset& y); - -template -bool -operator> (const multiset& x, - const multiset& y); - -template -bool -operator>=(const multiset& x, - const multiset& y); - -template -bool -operator<=(const multiset& x, - const multiset& y); - -// specialized algorithms: -template -void -swap(multiset& x, multiset& y) - noexcept(noexcept(x.swap(y))); - -template -typename multiset::size_type -erase_if(multiset& c, Predicate pred); // C++20 - -} // std - -*/ - #include <__algorithm/equal.h> #include <__algorithm/lexicographical_compare.h> #include <__assert> // all public C++ headers provide the assertion handler diff --git a/libcxx/include/setjmp.h b/libcxx/include/setjmp.h --- a/libcxx/include/setjmp.h +++ b/libcxx/include/setjmp.h @@ -10,21 +10,6 @@ #ifndef _LIBCPP_SETJMP_H #define _LIBCPP_SETJMP_H -/* - setjmp.h synopsis - -Macros: - - setjmp - -Types: - - jmp_buf - -void longjmp(jmp_buf env, int val); - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/shared_mutex b/libcxx/include/shared_mutex --- a/libcxx/include/shared_mutex +++ b/libcxx/include/shared_mutex @@ -10,118 +10,6 @@ #ifndef _LIBCPP_SHARED_MUTEX #define _LIBCPP_SHARED_MUTEX -/* - shared_mutex synopsis - -// C++1y - -namespace std -{ - -class shared_mutex // C++17 -{ -public: - shared_mutex(); - ~shared_mutex(); - - shared_mutex(const shared_mutex&) = delete; - shared_mutex& operator=(const shared_mutex&) = delete; - - // Exclusive ownership - void lock(); // blocking - bool try_lock(); - void unlock(); - - // Shared ownership - void lock_shared(); // blocking - bool try_lock_shared(); - void unlock_shared(); - - typedef implementation-defined native_handle_type; // See 30.2.3 - native_handle_type native_handle(); // See 30.2.3 -}; - -class shared_timed_mutex -{ -public: - shared_timed_mutex(); - ~shared_timed_mutex(); - - shared_timed_mutex(const shared_timed_mutex&) = delete; - shared_timed_mutex& operator=(const shared_timed_mutex&) = delete; - - // Exclusive ownership - void lock(); // blocking - bool try_lock(); - template - bool try_lock_for(const chrono::duration& rel_time); - template - bool try_lock_until(const chrono::time_point& abs_time); - void unlock(); - - // Shared ownership - void lock_shared(); // blocking - bool try_lock_shared(); - template - bool - try_lock_shared_for(const chrono::duration& rel_time); - template - bool - try_lock_shared_until(const chrono::time_point& abs_time); - void unlock_shared(); -}; - -template -class shared_lock -{ -public: - typedef Mutex mutex_type; - - // Shared locking - shared_lock() noexcept; - explicit shared_lock(mutex_type& m); // blocking - shared_lock(mutex_type& m, defer_lock_t) noexcept; - shared_lock(mutex_type& m, try_to_lock_t); - shared_lock(mutex_type& m, adopt_lock_t); - template - shared_lock(mutex_type& m, - const chrono::time_point& abs_time); - template - shared_lock(mutex_type& m, - const chrono::duration& rel_time); - ~shared_lock(); - - shared_lock(shared_lock const&) = delete; - shared_lock& operator=(shared_lock const&) = delete; - - shared_lock(shared_lock&& u) noexcept; - shared_lock& operator=(shared_lock&& u) noexcept; - - void lock(); // blocking - bool try_lock(); - template - bool try_lock_for(const chrono::duration& rel_time); - template - bool try_lock_until(const chrono::time_point& abs_time); - void unlock(); - - // Setters - void swap(shared_lock& u) noexcept; - mutex_type* release() noexcept; - - // Getters - bool owns_lock() const noexcept; - explicit operator bool () const noexcept; - mutex_type* mutex() const noexcept; -}; - -template - void swap(shared_lock& x, shared_lock& y) noexcept; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__availability> #include <__chrono/duration.h> diff --git a/libcxx/include/source_location b/libcxx/include/source_location --- a/libcxx/include/source_location +++ b/libcxx/include/source_location @@ -10,21 +10,6 @@ #ifndef _LIBCPP_SOURCE_LOCATION #define _LIBCPP_SOURCE_LOCATION -/* source_location synopsis - -namespace std { - struct source_location { - static consteval source_location current() noexcept; - constexpr source_location() noexcept; - - constexpr uint_least32_t line() const noexcept; - constexpr uint_least32_t column() const noexcept; - constexpr const char* file_name() const noexcept; - constexpr const char* function_name() const noexcept; - }; -} -*/ - #include <__config> #include #include diff --git a/libcxx/include/span b/libcxx/include/span --- a/libcxx/include/span +++ b/libcxx/include/span @@ -10,123 +10,6 @@ #ifndef _LIBCPP_SPAN #define _LIBCPP_SPAN -/* - span synopsis - -namespace std { - -// constants -inline constexpr size_t dynamic_extent = numeric_limits::max(); - -// [views.span], class template span -template - class span; - -template - inline constexpr bool ranges::enable_view> = true; - -template - inline constexpr bool ranges::enable_borrowed_range> = true; - -// [span.objectrep], views of object representation -template - span as_bytes(span s) noexcept; - -template - span< byte, ((Extent == dynamic_extent) ? dynamic_extent : - (sizeof(ElementType) * Extent))> as_writable_bytes(span s) noexcept; - - -template -class span { -public: - // constants and types - using element_type = ElementType; - using value_type = remove_cv_t; - using size_type = size_t; - using difference_type = ptrdiff_t; - using pointer = element_type*; - using const_pointer = const element_type*; - using reference = element_type&; - using const_reference = const element_type&; - using iterator = implementation-defined; - using reverse_iterator = std::reverse_iterator; - static constexpr size_type extent = Extent; - - // [span.cons], span constructors, copy, assignment, and destructor - constexpr span() noexcept; - template - constexpr explicit(Extent != dynamic_extent) span(It first, size_type count); - template - constexpr explicit(Extent != dynamic_extent) span(It first, End last); - template - constexpr span(type_identity_t (&arr)[N]) noexcept; - template - constexpr span(array& arr) noexcept; - template - constexpr span(const array& arr) noexcept; - template - constexpr explicit(Extent != dynamic_extent) span(R&& r); - constexpr span(const span& other) noexcept = default; - template - constexpr explicit(Extent != dynamic_extent) span(const span& s) noexcept; - ~span() noexcept = default; - constexpr span& operator=(const span& other) noexcept = default; - - // [span.sub], span subviews - template - constexpr span first() const; - template - constexpr span last() const; - template - constexpr span subspan() const; - - constexpr span first(size_type count) const; - constexpr span last(size_type count) const; - constexpr span subspan(size_type offset, size_type count = dynamic_extent) const; - - // [span.obs], span observers - constexpr size_type size() const noexcept; - constexpr size_type size_bytes() const noexcept; - [[nodiscard]] constexpr bool empty() const noexcept; - - // [span.elem], span element access - constexpr reference operator[](size_type idx) const; - constexpr reference front() const; - constexpr reference back() const; - constexpr pointer data() const noexcept; - - // [span.iterators], span iterator support - constexpr iterator begin() const noexcept; - constexpr iterator end() const noexcept; - constexpr reverse_iterator rbegin() const noexcept; - constexpr reverse_iterator rend() const noexcept; - -private: - pointer data_; // exposition only - size_type size_; // exposition only -}; - -template - span(It, EndOrSize) -> span>>; - -template - span(T (&)[N]) -> span; - -template - span(array&) -> span; - -template - span(const array&) -> span; - -template - span(R&&) -> span>>; - -} // namespace std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__debug> diff --git a/libcxx/include/sstream b/libcxx/include/sstream --- a/libcxx/include/sstream +++ b/libcxx/include/sstream @@ -10,181 +10,6 @@ #ifndef _LIBCPP_SSTREAM #define _LIBCPP_SSTREAM -/* - sstream synopsis [sstream.syn] - -// Class template basic_stringbuf [stringbuf] -template , class Allocator = allocator > -class basic_stringbuf - : public basic_streambuf -{ -public: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - typedef Allocator allocator_type; - - // [stringbuf.cons] constructors: - explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out); // before C++20 - basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {} // C++20 - explicit basic_stringbuf(ios_base::openmode which); // C++20 - explicit basic_stringbuf(const basic_string& str, - ios_base::openmode which = ios_base::in | ios_base::out); - basic_stringbuf(basic_stringbuf&& rhs); - - // [stringbuf.assign] Assign and swap: - basic_stringbuf& operator=(basic_stringbuf&& rhs); - void swap(basic_stringbuf& rhs); - - // [stringbuf.members] Member functions: - basic_string str() const; - void str(const basic_string& s); - -protected: - // [stringbuf.virtuals] Overridden virtual functions: - virtual int_type underflow(); - virtual int_type pbackfail(int_type c = traits_type::eof()); - virtual int_type overflow (int_type c = traits_type::eof()); - virtual basic_streambuf* setbuf(char_type*, streamsize); - virtual pos_type seekoff(off_type off, ios_base::seekdir way, - ios_base::openmode which = ios_base::in | ios_base::out); - virtual pos_type seekpos(pos_type sp, - ios_base::openmode which = ios_base::in | ios_base::out); -}; - -// [stringbuf.assign] non member swap -template - void swap(basic_stringbuf& x, - basic_stringbuf& y); - -typedef basic_stringbuf stringbuf; -typedef basic_stringbuf wstringbuf; - -// Class template basic_istringstream [istringstream] -template , class Allocator = allocator > -class basic_istringstream - : public basic_istream -{ -public: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - typedef Allocator allocator_type; - - // [istringstream.cons] Constructors: - explicit basic_istringstream(ios_base::openmode which = ios_base::in); // before C++20 - basic_istringstream() : basic_istringstream(ios_base::in) {} // C++20 - explicit basic_istringstream(ios_base::openmode which); // C++20 - - explicit basic_istringstream(const basic_string& str, - ios_base::openmode which = ios_base::in); - basic_istringstream(basic_istringstream&& rhs); - - // [istringstream.assign] Assign and swap: - basic_istringstream& operator=(basic_istringstream&& rhs); - void swap(basic_istringstream& rhs); - - // [istringstream.members] Member functions: - basic_stringbuf* rdbuf() const; - basic_string str() const; - void str(const basic_string& s); -}; - -template - void swap(basic_istringstream& x, - basic_istringstream& y); - -typedef basic_istringstream istringstream; -typedef basic_istringstream wistringstream; - -// Class template basic_ostringstream [ostringstream] -template , class Allocator = allocator > -class basic_ostringstream - : public basic_ostream -{ -public: - // types: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - typedef Allocator allocator_type; - - // [ostringstream.cons] Constructors: - explicit basic_ostringstream(ios_base::openmode which = ios_base::out); // before C++20 - basic_ostringstream() : basic_ostringstream(ios_base::out) {} // C++20 - explicit basic_ostringstream(ios_base::openmode which); // C++20 - - explicit basic_ostringstream(const basic_string& str, - ios_base::openmode which = ios_base::out); - basic_ostringstream(basic_ostringstream&& rhs); - - // [ostringstream.assign] Assign and swap: - basic_ostringstream& operator=(basic_ostringstream&& rhs); - void swap(basic_ostringstream& rhs); - - // [ostringstream.members] Member functions: - basic_stringbuf* rdbuf() const; - basic_string str() const; - void str(const basic_string& s); -}; - -template - void swap(basic_ostringstream& x, - basic_ostringstream& y); - -typedef basic_ostringstream ostringstream; -typedef basic_ostringstream wostringstream; - -// Class template basic_stringstream [stringstream] -template , class Allocator = allocator > -class basic_stringstream - : public basic_iostream -{ -public: - // types: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - typedef Allocator allocator_type; - - // [stringstream.cons] constructors - explicit basic_stringstream(ios_base::openmode which = ios_base::out | ios_base::in); // before C++20 - basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {} // C++20 - explicit basic_stringstream(ios_base::openmode which); // C++20 - - explicit basic_stringstream(const basic_string& str, - ios_base::openmode which = ios_base::out|ios_base::in); - basic_stringstream(basic_stringstream&& rhs); - - // [stringstream.assign] Assign and swap: - basic_stringstream& operator=(basic_stringstream&& rhs); - void swap(basic_stringstream& rhs); - - // [stringstream.members] Member functions: - basic_stringbuf* rdbuf() const; - basic_string str() const; - void str(const basic_string& str); -}; - -template - void swap(basic_stringstream& x, - basic_stringstream& y); - -typedef basic_stringstream stringstream; -typedef basic_stringstream wstringstream; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__utility/swap.h> diff --git a/libcxx/include/stack b/libcxx/include/stack --- a/libcxx/include/stack +++ b/libcxx/include/stack @@ -10,94 +10,6 @@ #ifndef _LIBCPP_STACK #define _LIBCPP_STACK -/* - stack synopsis - -namespace std -{ - -template > -class stack -{ -public: - typedef Container container_type; - typedef typename container_type::value_type value_type; - typedef typename container_type::reference reference; - typedef typename container_type::const_reference const_reference; - typedef typename container_type::size_type size_type; - -protected: - container_type c; - -public: - stack() = default; - ~stack() = default; - - stack(const stack& q) = default; - stack(stack&& q) = default; - - stack& operator=(const stack& q) = default; - stack& operator=(stack&& q) = default; - - explicit stack(const container_type& c); - explicit stack(container_type&& c); - template stack(InputIterator first, InputIterator last); // since C++23 - template explicit stack(const Alloc& a); - template stack(const container_type& c, const Alloc& a); - template stack(container_type&& c, const Alloc& a); - template stack(const stack& c, const Alloc& a); - template stack(stack&& c, const Alloc& a); - template - stack(InputIterator first, InputIterator last, const Alloc&); // since C++23 - - bool empty() const; - size_type size() const; - reference top(); - const_reference top() const; - - void push(const value_type& x); - void push(value_type&& x); - template reference emplace(Args&&... args); // reference in C++17 - void pop(); - - void swap(stack& c) noexcept(is_nothrow_swappable_v) -}; - -template - stack(Container) -> stack; // C++17 - -template - stack(InputIterator, InputIterator) -> stack>; // since C++23 - -template - stack(Container, Allocator) -> stack; // C++17 - -template - stack(InputIterator, InputIterator, Allocator) - -> stack, - deque, Allocator>>; // since C++23 - -template - bool operator==(const stack& x, const stack& y); -template - bool operator< (const stack& x, const stack& y); -template - bool operator!=(const stack& x, const stack& y); -template - bool operator> (const stack& x, const stack& y); -template - bool operator>=(const stack& x, const stack& y); -template - bool operator<=(const stack& x, const stack& y); - -template - void swap(stack& x, stack& y) - noexcept(noexcept(x.swap(y))); - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__iterator/iterator_traits.h> diff --git a/libcxx/include/stdatomic.h b/libcxx/include/stdatomic.h --- a/libcxx/include/stdatomic.h +++ b/libcxx/include/stdatomic.h @@ -10,111 +10,6 @@ #ifndef _LIBCPP_STDATOMIC_H #define _LIBCPP_STDATOMIC_H -/* - stdatomic.h synopsis - -template - using std-atomic = std::atomic; // exposition only - -#define _Atomic(T) std-atomic - -#define ATOMIC_BOOL_LOCK_FREE see below -#define ATOMIC_CHAR_LOCK_FREE see below -#define ATOMIC_CHAR16_T_LOCK_FREE see below -#define ATOMIC_CHAR32_T_LOCK_FREE see below -#define ATOMIC_WCHAR_T_LOCK_FREE see below -#define ATOMIC_SHORT_LOCK_FREE see below -#define ATOMIC_INT_LOCK_FREE see below -#define ATOMIC_LONG_LOCK_FREE see below -#define ATOMIC_LLONG_LOCK_FREE see below -#define ATOMIC_POINTER_LOCK_FREE see below - -using std::memory_order // see below -using std::memory_order_relaxed // see below -using std::memory_order_consume // see below -using std::memory_order_acquire // see below -using std::memory_order_release // see below -using std::memory_order_acq_rel // see below -using std::memory_order_seq_cst // see below - -using std::atomic_flag // see below - -using std::atomic_bool // see below -using std::atomic_char // see below -using std::atomic_schar // see below -using std::atomic_uchar // see below -using std::atomic_short // see below -using std::atomic_ushort // see below -using std::atomic_int // see below -using std::atomic_uint // see below -using std::atomic_long // see below -using std::atomic_ulong // see below -using std::atomic_llong // see below -using std::atomic_ullong // see below -using std::atomic_char8_t // see below -using std::atomic_char16_t // see below -using std::atomic_char32_t // see below -using std::atomic_wchar_t // see below -using std::atomic_int8_t // see below -using std::atomic_uint8_t // see below -using std::atomic_int16_t // see below -using std::atomic_uint16_t // see below -using std::atomic_int32_t // see below -using std::atomic_uint32_t // see below -using std::atomic_int64_t // see below -using std::atomic_uint64_t // see below -using std::atomic_int_least8_t // see below -using std::atomic_uint_least8_t // see below -using std::atomic_int_least16_t // see below -using std::atomic_uint_least16_t // see below -using std::atomic_int_least32_t // see below -using std::atomic_uint_least32_t // see below -using std::atomic_int_least64_t // see below -using std::atomic_uint_least64_t // see below -using std::atomic_int_fast8_t // see below -using std::atomic_uint_fast8_t // see below -using std::atomic_int_fast16_t // see below -using std::atomic_uint_fast16_t // see below -using std::atomic_int_fast32_t // see below -using std::atomic_uint_fast32_t // see below -using std::atomic_int_fast64_t // see below -using std::atomic_uint_fast64_t // see below -using std::atomic_intptr_t // see below -using std::atomic_uintptr_t // see below -using std::atomic_size_t // see below -using std::atomic_ptrdiff_t // see below -using std::atomic_intmax_t // see below -using std::atomic_uintmax_t // see below - -using std::atomic_is_lock_free // see below -using std::atomic_load // see below -using std::atomic_load_explicit // see below -using std::atomic_store // see below -using std::atomic_store_explicit // see below -using std::atomic_exchange // see below -using std::atomic_exchange_explicit // see below -using std::atomic_compare_exchange_strong // see below -using std::atomic_compare_exchange_strong_explicit // see below -using std::atomic_compare_exchange_weak // see below -using std::atomic_compare_exchange_weak_explicit // see below -using std::atomic_fetch_add // see below -using std::atomic_fetch_add_explicit // see below -using std::atomic_fetch_sub // see below -using std::atomic_fetch_sub_explicit // see below -using std::atomic_fetch_or // see below -using std::atomic_fetch_or_explicit // see below -using std::atomic_fetch_and // see below -using std::atomic_fetch_and_explicit // see below -using std::atomic_flag_test_and_set // see below -using std::atomic_flag_test_and_set_explicit // see below -using std::atomic_flag_clear // see below -using std::atomic_flag_clear_explicit // see below - -using std::atomic_thread_fence // see below -using std::atomic_signal_fence // see below - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/stdbool.h b/libcxx/include/stdbool.h --- a/libcxx/include/stdbool.h +++ b/libcxx/include/stdbool.h @@ -10,15 +10,6 @@ #ifndef _LIBCPP_STDBOOL_H #define _LIBCPP_STDBOOL_H -/* - stdbool.h synopsis - -Macros: - - __bool_true_false_are_defined - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/stddef.h b/libcxx/include/stddef.h --- a/libcxx/include/stddef.h +++ b/libcxx/include/stddef.h @@ -19,23 +19,6 @@ #elif !defined(_LIBCPP_STDDEF_H) #define _LIBCPP_STDDEF_H -/* - stddef.h synopsis - -Macros: - - offsetof(type,member-designator) - NULL - -Types: - - ptrdiff_t - size_t - max_align_t // C++11 - nullptr_t - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept --- a/libcxx/include/stdexcept +++ b/libcxx/include/stdexcept @@ -10,37 +10,6 @@ #ifndef _LIBCPP_STDEXCEPT #define _LIBCPP_STDEXCEPT -/* - stdexcept synopsis - -namespace std -{ - -class logic_error; - class domain_error; - class invalid_argument; - class length_error; - class out_of_range; -class runtime_error; - class range_error; - class overflow_error; - class underflow_error; - -for each class xxx_error: - -class xxx_error : public exception // at least indirectly -{ -public: - explicit xxx_error(const string& what_arg); - explicit xxx_error(const char* what_arg); - - virtual const char* what() const noexcept // returns what_arg -}; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__exception/exception.h> diff --git a/libcxx/include/stdint.h b/libcxx/include/stdint.h --- a/libcxx/include/stdint.h +++ b/libcxx/include/stdint.h @@ -15,94 +15,6 @@ #define _LIBCPP_STDINT_H #endif // _STD_TYPES_T -/* - stdint.h synopsis - -Macros: - - INT8_MIN - INT16_MIN - INT32_MIN - INT64_MIN - - INT8_MAX - INT16_MAX - INT32_MAX - INT64_MAX - - UINT8_MAX - UINT16_MAX - UINT32_MAX - UINT64_MAX - - INT_LEAST8_MIN - INT_LEAST16_MIN - INT_LEAST32_MIN - INT_LEAST64_MIN - - INT_LEAST8_MAX - INT_LEAST16_MAX - INT_LEAST32_MAX - INT_LEAST64_MAX - - UINT_LEAST8_MAX - UINT_LEAST16_MAX - UINT_LEAST32_MAX - UINT_LEAST64_MAX - - INT_FAST8_MIN - INT_FAST16_MIN - INT_FAST32_MIN - INT_FAST64_MIN - - INT_FAST8_MAX - INT_FAST16_MAX - INT_FAST32_MAX - INT_FAST64_MAX - - UINT_FAST8_MAX - UINT_FAST16_MAX - UINT_FAST32_MAX - UINT_FAST64_MAX - - INTPTR_MIN - INTPTR_MAX - UINTPTR_MAX - - INTMAX_MIN - INTMAX_MAX - - UINTMAX_MAX - - PTRDIFF_MIN - PTRDIFF_MAX - - SIG_ATOMIC_MIN - SIG_ATOMIC_MAX - - SIZE_MAX - - WCHAR_MIN - WCHAR_MAX - - WINT_MIN - WINT_MAX - - INT8_C(value) - INT16_C(value) - INT32_C(value) - INT64_C(value) - - UINT8_C(value) - UINT16_C(value) - UINT32_C(value) - UINT64_C(value) - - INTMAX_C(value) - UINTMAX_C(value) - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/stdio.h b/libcxx/include/stdio.h --- a/libcxx/include/stdio.h +++ b/libcxx/include/stdio.h @@ -18,86 +18,6 @@ #elif !defined(_LIBCPP_STDIO_H) #define _LIBCPP_STDIO_H -/* - stdio.h synopsis - -Macros: - - BUFSIZ - EOF - FILENAME_MAX - FOPEN_MAX - L_tmpnam - NULL - SEEK_CUR - SEEK_END - SEEK_SET - TMP_MAX - _IOFBF - _IOLBF - _IONBF - stderr - stdin - stdout - -Types: - -FILE -fpos_t -size_t - -int remove(const char* filename); -int rename(const char* old, const char* new); -FILE* tmpfile(void); -char* tmpnam(char* s); -int fclose(FILE* stream); -int fflush(FILE* stream); -FILE* fopen(const char* restrict filename, const char* restrict mode); -FILE* freopen(const char* restrict filename, const char * restrict mode, - FILE * restrict stream); -void setbuf(FILE* restrict stream, char* restrict buf); -int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size); -int fprintf(FILE* restrict stream, const char* restrict format, ...); -int fscanf(FILE* restrict stream, const char * restrict format, ...); -int printf(const char* restrict format, ...); -int scanf(const char* restrict format, ...); -int snprintf(char* restrict s, size_t n, const char* restrict format, ...); // C99 -int sprintf(char* restrict s, const char* restrict format, ...); -int sscanf(const char* restrict s, const char* restrict format, ...); -int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg); -int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg); // C99 -int vprintf(const char* restrict format, va_list arg); -int vscanf(const char* restrict format, va_list arg); // C99 -int vsnprintf(char* restrict s, size_t n, const char* restrict format, // C99 - va_list arg); -int vsprintf(char* restrict s, const char* restrict format, va_list arg); -int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99 -int fgetc(FILE* stream); -char* fgets(char* restrict s, int n, FILE* restrict stream); -int fputc(int c, FILE* stream); -int fputs(const char* restrict s, FILE* restrict stream); -int getc(FILE* stream); -int getchar(void); -char* gets(char* s); // removed in C++14 -int putc(int c, FILE* stream); -int putchar(int c); -int puts(const char* s); -int ungetc(int c, FILE* stream); -size_t fread(void* restrict ptr, size_t size, size_t nmemb, - FILE* restrict stream); -size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb, - FILE* restrict stream); -int fgetpos(FILE* restrict stream, fpos_t* restrict pos); -int fseek(FILE* stream, long offset, int whence); -int fsetpos(FILE*stream, const fpos_t* pos); -long ftell(FILE* stream); -void rewind(FILE* stream); -void clearerr(FILE* stream); -int feof(FILE* stream); -int ferror(FILE* stream); -void perror(const char* s); -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/stdlib.h b/libcxx/include/stdlib.h --- a/libcxx/include/stdlib.h +++ b/libcxx/include/stdlib.h @@ -18,72 +18,6 @@ #elif !defined(_LIBCPP_STDLIB_H) #define _LIBCPP_STDLIB_H -/* - stdlib.h synopsis - -Macros: - - EXIT_FAILURE - EXIT_SUCCESS - MB_CUR_MAX - NULL - RAND_MAX - -Types: - - size_t - div_t - ldiv_t - lldiv_t // C99 - -double atof (const char* nptr); -int atoi (const char* nptr); -long atol (const char* nptr); -long long atoll(const char* nptr); // C99 -double strtod (const char* restrict nptr, char** restrict endptr); -float strtof (const char* restrict nptr, char** restrict endptr); // C99 -long double strtold (const char* restrict nptr, char** restrict endptr); // C99 -long strtol (const char* restrict nptr, char** restrict endptr, int base); -long long strtoll (const char* restrict nptr, char** restrict endptr, int base); // C99 -unsigned long strtoul (const char* restrict nptr, char** restrict endptr, int base); -unsigned long long strtoull(const char* restrict nptr, char** restrict endptr, int base); // C99 -int rand(void); -void srand(unsigned int seed); -void* calloc(size_t nmemb, size_t size); -void free(void* ptr); -void* malloc(size_t size); -void* realloc(void* ptr, size_t size); -void abort(void); -int atexit(void (*func)(void)); -void exit(int status); -void _Exit(int status); -char* getenv(const char* name); -int system(const char* string); -void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); -void qsort(void* base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); -int abs( int j); -long abs( long j); -long long abs(long long j); // C++0X -long labs( long j); -long long llabs(long long j); // C99 -div_t div( int numer, int denom); -ldiv_t div( long numer, long denom); -lldiv_t div(long long numer, long long denom); // C++0X -ldiv_t ldiv( long numer, long denom); -lldiv_t lldiv(long long numer, long long denom); // C99 -int mblen(const char* s, size_t n); -int mbtowc(wchar_t* restrict pwc, const char* restrict s, size_t n); -int wctomb(char* s, wchar_t wchar); -size_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n); -size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n); -int at_quick_exit(void (*func)(void)) // C++11 -void quick_exit(int status); // C++11 -void *aligned_alloc(size_t alignment, size_t size); // C11 - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/streambuf b/libcxx/include/streambuf --- a/libcxx/include/streambuf +++ b/libcxx/include/streambuf @@ -10,103 +10,6 @@ #ifndef _LIBCPP_STREAMBUF #define _LIBCPP_STREAMBUF -/* - streambuf synopsis - -namespace std -{ - -template > -class basic_streambuf -{ -public: - // types: - typedef charT char_type; - typedef traits traits_type; - typedef typename traits_type::int_type int_type; - typedef typename traits_type::pos_type pos_type; - typedef typename traits_type::off_type off_type; - - virtual ~basic_streambuf(); - - // 27.6.2.2.1 locales: - locale pubimbue(const locale& loc); - locale getloc() const; - - // 27.6.2.2.2 buffer and positioning: - basic_streambuf* pubsetbuf(char_type* s, streamsize n); - pos_type pubseekoff(off_type off, ios_base::seekdir way, - ios_base::openmode which = ios_base::in | ios_base::out); - pos_type pubseekpos(pos_type sp, - ios_base::openmode which = ios_base::in | ios_base::out); - int pubsync(); - - // Get and put areas: - // 27.6.2.2.3 Get area: - streamsize in_avail(); - int_type snextc(); - int_type sbumpc(); - int_type sgetc(); - streamsize sgetn(char_type* s, streamsize n); - - // 27.6.2.2.4 Putback: - int_type sputbackc(char_type c); - int_type sungetc(); - - // 27.6.2.2.5 Put area: - int_type sputc(char_type c); - streamsize sputn(const char_type* s, streamsize n); - -protected: - basic_streambuf(); - basic_streambuf(const basic_streambuf& rhs); - basic_streambuf& operator=(const basic_streambuf& rhs); - void swap(basic_streambuf& rhs); - - // 27.6.2.3.2 Get area: - char_type* eback() const; - char_type* gptr() const; - char_type* egptr() const; - void gbump(int n); - void setg(char_type* gbeg, char_type* gnext, char_type* gend); - - // 27.6.2.3.3 Put area: - char_type* pbase() const; - char_type* pptr() const; - char_type* epptr() const; - void pbump(int n); - void setp(char_type* pbeg, char_type* pend); - - // 27.6.2.4 virtual functions: - // 27.6.2.4.1 Locales: - virtual void imbue(const locale& loc); - - // 27.6.2.4.2 Buffer management and positioning: - virtual basic_streambuf* setbuf(char_type* s, streamsize n); - virtual pos_type seekoff(off_type off, ios_base::seekdir way, - ios_base::openmode which = ios_base::in | ios_base::out); - virtual pos_type seekpos(pos_type sp, - ios_base::openmode which = ios_base::in | ios_base::out); - virtual int sync(); - - // 27.6.2.4.3 Get area: - virtual streamsize showmanyc(); - virtual streamsize xsgetn(char_type* s, streamsize n); - virtual int_type underflow(); - virtual int_type uflow(); - - // 27.6.2.4.4 Putback: - virtual int_type pbackfail(int_type c = traits_type::eof()); - - // 27.6.2.4.5 Put area: - virtual streamsize xsputn(const char_type* s, streamsize n); - virtual int_type overflow (int_type c = traits_type::eof()); -}; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -10,530 +10,6 @@ #ifndef _LIBCPP_STRING #define _LIBCPP_STRING -/* - string synopsis - -#include -#include - -namespace std -{ - -template -class fpos -{ -private: - stateT st; -public: - fpos(streamoff = streamoff()); - - operator streamoff() const; - - stateT state() const; - void state(stateT); - - fpos& operator+=(streamoff); - fpos operator+ (streamoff) const; - fpos& operator-=(streamoff); - fpos operator- (streamoff) const; -}; - -template streamoff operator-(const fpos& x, const fpos& y); - -template bool operator==(const fpos& x, const fpos& y); -template bool operator!=(const fpos& x, const fpos& y); - -template -struct char_traits -{ - using char_type = charT; - using int_type = ...; - using off_type = streamoff; - using pos_type = streampos; - using state_type = mbstate_t; - using comparison_category = strong_ordering; // Since C++20 only for the specializations - // char, wchar_t, char8_t, char16_t, and char32_t. - - static void assign(char_type& c1, const char_type& c2) noexcept; - static constexpr bool eq(char_type c1, char_type c2) noexcept; - static constexpr bool lt(char_type c1, char_type c2) noexcept; - - static int compare(const char_type* s1, const char_type* s2, size_t n); - static size_t length(const char_type* s); - static const char_type* find(const char_type* s, size_t n, const char_type& a); - static char_type* move(char_type* s1, const char_type* s2, size_t n); - static char_type* copy(char_type* s1, const char_type* s2, size_t n); - static char_type* assign(char_type* s, size_t n, char_type a); - - static constexpr int_type not_eof(int_type c) noexcept; - static constexpr char_type to_char_type(int_type c) noexcept; - static constexpr int_type to_int_type(char_type c) noexcept; - static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept; - static constexpr int_type eof() noexcept; -}; - -template <> struct char_traits; -template <> struct char_traits; -template <> struct char_traits; // C++20 -template <> struct char_traits; -template <> struct char_traits; - -template, class Allocator = allocator > -class basic_string -{ -public: -// types: - typedef traits traits_type; - typedef typename traits_type::char_type value_type; - typedef Allocator allocator_type; - typedef typename allocator_type::size_type size_type; - typedef typename allocator_type::difference_type difference_type; - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - typedef typename allocator_type::pointer pointer; - typedef typename allocator_type::const_pointer const_pointer; - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - - static const size_type npos = -1; - - basic_string() - noexcept(is_nothrow_default_constructible::value); // constexpr since C++20 - explicit basic_string(const allocator_type& a); // constexpr since C++20 - basic_string(const basic_string& str); // constexpr since C++20 - basic_string(basic_string&& str) - noexcept(is_nothrow_move_constructible::value); // constexpr since C++20 - basic_string(const basic_string& str, size_type pos, - const allocator_type& a = allocator_type()); // constexpr since C++20 - basic_string(const basic_string& str, size_type pos, size_type n, - const Allocator& a = Allocator()); // constexpr since C++20 - constexpr basic_string( - basic_string&& str, size_type pos, const Allocator& a = Allocator()); // since C++23 - constexpr basic_string( - basic_string&& str, size_type pos, size_type n, const Allocator& a = Allocator()); // since C++23 - template - basic_string(const T& t, size_type pos, size_type n, const Allocator& a = Allocator()); // C++17, constexpr since C++20 - template - explicit basic_string(const T& t, const Allocator& a = Allocator()); // C++17, constexpr since C++20 - basic_string(const value_type* s, const allocator_type& a = allocator_type()); // constexpr since C++20 - basic_string(const value_type* s, size_type n, const allocator_type& a = allocator_type()); // constexpr since C++20 - basic_string(nullptr_t) = delete; // C++2b - basic_string(size_type n, value_type c, const allocator_type& a = allocator_type()); // constexpr since C++20 - template - basic_string(InputIterator begin, InputIterator end, - const allocator_type& a = allocator_type()); // constexpr since C++20 - basic_string(initializer_list, const Allocator& = Allocator()); // constexpr since C++20 - basic_string(const basic_string&, const Allocator&); // constexpr since C++20 - basic_string(basic_string&&, const Allocator&); // constexpr since C++20 - - ~basic_string(); // constexpr since C++20 - - operator basic_string_view() const noexcept; // constexpr since C++20 - - basic_string& operator=(const basic_string& str); // constexpr since C++20 - template - basic_string& operator=(const T& t); // C++17, constexpr since C++20 - basic_string& operator=(basic_string&& str) - noexcept( - allocator_type::propagate_on_container_move_assignment::value || - allocator_type::is_always_equal::value ); // C++17, constexpr since C++20 - basic_string& operator=(const value_type* s); // constexpr since C++20 - basic_string& operator=(nullptr_t) = delete; // C++2b - basic_string& operator=(value_type c); // constexpr since C++20 - basic_string& operator=(initializer_list); // constexpr since C++20 - - iterator begin() noexcept; // constexpr since C++20 - const_iterator begin() const noexcept; // constexpr since C++20 - iterator end() noexcept; // constexpr since C++20 - const_iterator end() const noexcept; // constexpr since C++20 - - reverse_iterator rbegin() noexcept; // constexpr since C++20 - const_reverse_iterator rbegin() const noexcept; // constexpr since C++20 - reverse_iterator rend() noexcept; // constexpr since C++20 - const_reverse_iterator rend() const noexcept; // constexpr since C++20 - - const_iterator cbegin() const noexcept; // constexpr since C++20 - const_iterator cend() const noexcept; // constexpr since C++20 - const_reverse_iterator crbegin() const noexcept; // constexpr since C++20 - const_reverse_iterator crend() const noexcept; // constexpr since C++20 - - size_type size() const noexcept; // constexpr since C++20 - size_type length() const noexcept; // constexpr since C++20 - size_type max_size() const noexcept; // constexpr since C++20 - size_type capacity() const noexcept; // constexpr since C++20 - - void resize(size_type n, value_type c); // constexpr since C++20 - void resize(size_type n); // constexpr since C++20 - - template - constexpr void resize_and_overwrite(size_type n, Operation op); // since C++23 - - void reserve(size_type res_arg); // constexpr since C++20 - void reserve(); // deprecated in C++20 - void shrink_to_fit(); // constexpr since C++20 - void clear() noexcept; // constexpr since C++20 - bool empty() const noexcept; // constexpr since C++20 - - const_reference operator[](size_type pos) const; // constexpr since C++20 - reference operator[](size_type pos); // constexpr since C++20 - - const_reference at(size_type n) const; // constexpr since C++20 - reference at(size_type n); // constexpr since C++20 - - basic_string& operator+=(const basic_string& str); // constexpr since C++20 - template - basic_string& operator+=(const T& t); // C++17, constexpr since C++20 - basic_string& operator+=(const value_type* s); // constexpr since C++20 - basic_string& operator+=(value_type c); // constexpr since C++20 - basic_string& operator+=(initializer_list); // constexpr since C++20 - - basic_string& append(const basic_string& str); // constexpr since C++20 - template - basic_string& append(const T& t); // C++17, constexpr since C++20 - basic_string& append(const basic_string& str, size_type pos, size_type n=npos); // C++14, constexpr since C++20 - template - basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17, constexpr since C++20 - basic_string& append(const value_type* s, size_type n); // constexpr since C++20 - basic_string& append(const value_type* s); // constexpr since C++20 - basic_string& append(size_type n, value_type c); // constexpr since C++20 - template - basic_string& append(InputIterator first, InputIterator last); // constexpr since C++20 - basic_string& append(initializer_list); // constexpr since C++20 - - void push_back(value_type c); // constexpr since C++20 - void pop_back(); // constexpr since C++20 - reference front(); // constexpr since C++20 - const_reference front() const; // constexpr since C++20 - reference back(); // constexpr since C++20 - const_reference back() const; // constexpr since C++20 - - basic_string& assign(const basic_string& str); // constexpr since C++20 - template - basic_string& assign(const T& t); // C++17, constexpr since C++20 - basic_string& assign(basic_string&& str); // constexpr since C++20 - basic_string& assign(const basic_string& str, size_type pos, size_type n=npos); // C++14, constexpr since C++20 - template - basic_string& assign(const T& t, size_type pos, size_type n=npos); // C++17, constexpr since C++20 - basic_string& assign(const value_type* s, size_type n); // constexpr since C++20 - basic_string& assign(const value_type* s); // constexpr since C++20 - basic_string& assign(size_type n, value_type c); // constexpr since C++20 - template - basic_string& assign(InputIterator first, InputIterator last); // constexpr since C++20 - basic_string& assign(initializer_list); // constexpr since C++20 - - basic_string& insert(size_type pos1, const basic_string& str); // constexpr since C++20 - template - basic_string& insert(size_type pos1, const T& t); // constexpr since C++20 - basic_string& insert(size_type pos1, const basic_string& str, - size_type pos2, size_type n); // constexpr since C++20 - template - basic_string& insert(size_type pos1, const T& t, size_type pos2, size_type n); // C++17, constexpr since C++20 - basic_string& insert(size_type pos, const value_type* s, size_type n=npos); // C++14, constexpr since C++20 - basic_string& insert(size_type pos, const value_type* s); // constexpr since C++20 - basic_string& insert(size_type pos, size_type n, value_type c); // constexpr since C++20 - iterator insert(const_iterator p, value_type c); // constexpr since C++20 - iterator insert(const_iterator p, size_type n, value_type c); // constexpr since C++20 - template - iterator insert(const_iterator p, InputIterator first, InputIterator last); // constexpr since C++20 - iterator insert(const_iterator p, initializer_list); // constexpr since C++20 - - basic_string& erase(size_type pos = 0, size_type n = npos); // constexpr since C++20 - iterator erase(const_iterator position); // constexpr since C++20 - iterator erase(const_iterator first, const_iterator last); // constexpr since C++20 - - basic_string& replace(size_type pos1, size_type n1, const basic_string& str); // constexpr since C++20 - template - basic_string& replace(size_type pos1, size_type n1, const T& t); // C++17, constexpr since C++20 - basic_string& replace(size_type pos1, size_type n1, const basic_string& str, - size_type pos2, size_type n2=npos); // C++14, constexpr since C++20 - template - basic_string& replace(size_type pos1, size_type n1, const T& t, - size_type pos2, size_type n); // C++17, constexpr since C++20 - basic_string& replace(size_type pos, size_type n1, const value_type* s, size_type n2); // constexpr since C++20 - basic_string& replace(size_type pos, size_type n1, const value_type* s); // constexpr since C++20 - basic_string& replace(size_type pos, size_type n1, size_type n2, value_type c); // constexpr since C++20 - basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str); // constexpr since C++20 - template - basic_string& replace(const_iterator i1, const_iterator i2, const T& t); // C++17, constexpr since C++20 - basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s, size_type n); // constexpr since C++20 - basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s); // constexpr since C++20 - basic_string& replace(const_iterator i1, const_iterator i2, size_type n, value_type c); // constexpr since C++20 - template - basic_string& replace(const_iterator i1, const_iterator i2, InputIterator j1, InputIterator j2); // constexpr since C++20 - basic_string& replace(const_iterator i1, const_iterator i2, initializer_list); // constexpr since C++20 - - size_type copy(value_type* s, size_type n, size_type pos = 0) const; // constexpr since C++20 - basic_string substr(size_type pos = 0, size_type n = npos) const; // constexpr in C++20, removed in C++23 - basic_string substr(size_type pos = 0, size_type n = npos) const&; // since C++23 - constexpr basic_string substr(size_type pos = 0, size_type n = npos) &&; // since C++23 - void swap(basic_string& str) - noexcept(allocator_traits::propagate_on_container_swap::value || - allocator_traits::is_always_equal::value); // C++17, constexpr since C++20 - - const value_type* c_str() const noexcept; // constexpr since C++20 - const value_type* data() const noexcept; // constexpr since C++20 - value_type* data() noexcept; // C++17, constexpr since C++20 - - allocator_type get_allocator() const noexcept; // constexpr since C++20 - - size_type find(const basic_string& str, size_type pos = 0) const noexcept; // constexpr since C++20 - template - size_type find(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension, constexpr since C++20 - size_type find(const value_type* s, size_type pos, size_type n) const noexcept; // constexpr since C++20 - size_type find(const value_type* s, size_type pos = 0) const noexcept; // constexpr since C++20 - size_type find(value_type c, size_type pos = 0) const noexcept; // constexpr since C++20 - - size_type rfind(const basic_string& str, size_type pos = npos) const noexcept; // constexpr since C++20 - template - size_type rfind(const T& t, size_type pos = npos) const noexcept; // C++17, noexcept as an extension, constexpr since C++20 - size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept; // constexpr since C++20 - size_type rfind(const value_type* s, size_type pos = npos) const noexcept; // constexpr since C++20 - size_type rfind(value_type c, size_type pos = npos) const noexcept; // constexpr since C++20 - - size_type find_first_of(const basic_string& str, size_type pos = 0) const noexcept; // constexpr since C++20 - template - size_type find_first_of(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension, constexpr since C++20 - size_type find_first_of(const value_type* s, size_type pos, size_type n) const noexcept; // constexpr since C++20 - size_type find_first_of(const value_type* s, size_type pos = 0) const noexcept; // constexpr since C++20 - size_type find_first_of(value_type c, size_type pos = 0) const noexcept; // constexpr since C++20 - - size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept; // constexpr since C++20 - template - size_type find_last_of(const T& t, size_type pos = npos) const noexcept noexcept; // C++17, noexcept as an extension, constexpr since C++20 - size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept; // constexpr since C++20 - size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept; // constexpr since C++20 - size_type find_last_of(value_type c, size_type pos = npos) const noexcept; // constexpr since C++20 - - size_type find_first_not_of(const basic_string& str, size_type pos = 0) const noexcept; // constexpr since C++20 - template - size_type find_first_not_of(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension, constexpr since C++20 - size_type find_first_not_of(const value_type* s, size_type pos, size_type n) const noexcept; // constexpr since C++20 - size_type find_first_not_of(const value_type* s, size_type pos = 0) const noexcept; // constexpr since C++20 - size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept; // constexpr since C++20 - - size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept; // constexpr since C++20 - template - size_type find_last_not_of(const T& t, size_type pos = npos) const noexcept; // C++17, noexcept as an extension, constexpr since C++20 - size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept; // constexpr since C++20 - size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept; // constexpr since C++20 - size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept; // constexpr since C++20 - - int compare(const basic_string& str) const noexcept; // constexpr since C++20 - template - int compare(const T& t) const noexcept; // C++17, noexcept as an extension, constexpr since C++20 - int compare(size_type pos1, size_type n1, const basic_string& str) const; // constexpr since C++20 - template - int compare(size_type pos1, size_type n1, const T& t) const; // C++17, constexpr since C++20 - int compare(size_type pos1, size_type n1, const basic_string& str, - size_type pos2, size_type n2=npos) const; // C++14, constexpr since C++20 - template - int compare(size_type pos1, size_type n1, const T& t, - size_type pos2, size_type n2=npos) const; // C++17, constexpr since C++20 - int compare(const value_type* s) const noexcept; // constexpr since C++20 - int compare(size_type pos1, size_type n1, const value_type* s) const; // constexpr since C++20 - int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const; // constexpr since C++20 - - constexpr bool starts_with(basic_string_view sv) const noexcept; // C++20 - constexpr bool starts_with(charT c) const noexcept; // C++20 - constexpr bool starts_with(const charT* s) const; // C++20 - constexpr bool ends_with(basic_string_view sv) const noexcept; // C++20 - constexpr bool ends_with(charT c) const noexcept; // C++20 - constexpr bool ends_with(const charT* s) const; // C++20 - - constexpr bool contains(basic_string_view sv) const noexcept; // C++2b - constexpr bool contains(charT c) const noexcept; // C++2b - constexpr bool contains(const charT* s) const; // C++2b -}; - -template::value_type>> -basic_string(InputIterator, InputIterator, Allocator = Allocator()) - -> basic_string::value_type, - char_traits::value_type>, - Allocator>; // C++17 - -template -basic_string -operator+(const basic_string& lhs, - const basic_string& rhs); // constexpr since C++20 - -template -basic_string -operator+(const charT* lhs , const basic_string&rhs); // constexpr since C++20 - -template -basic_string -operator+(charT lhs, const basic_string& rhs); // constexpr since C++20 - -template -basic_string -operator+(const basic_string& lhs, const charT* rhs); // constexpr since C++20 - -template -basic_string -operator+(const basic_string& lhs, charT rhs); // constexpr since C++20 - -template -bool operator==(const basic_string& lhs, - const basic_string& rhs) noexcept; // constexpr since C++20 - -template -bool operator==(const charT* lhs, const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator==(const basic_string& lhs, const charT* rhs) noexcept; // constexpr since C++20 - -template -bool operator!=(const basic_string& lhs, - const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator!=(const charT* lhs, const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator!=(const basic_string& lhs, const charT* rhs) noexcept; // removed in C++20 - -template -bool operator< (const basic_string& lhs, - const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator< (const basic_string& lhs, const charT* rhs) noexcept; // removed in C++20 - -template -bool operator< (const charT* lhs, const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator> (const basic_string& lhs, - const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator> (const basic_string& lhs, const charT* rhs) noexcept; // removed in C++20 - -template -bool operator> (const charT* lhs, const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator<=(const basic_string& lhs, - const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator<=(const basic_string& lhs, const charT* rhs) noexcept; // removed in C++20 - -template -bool operator<=(const charT* lhs, const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator>=(const basic_string& lhs, - const basic_string& rhs) noexcept; // removed in C++20 - -template -bool operator>=(const basic_string& lhs, const charT* rhs) noexcept; // removed in C++20 - -template -bool operator>=(const charT* lhs, const basic_string& rhs) noexcept; // removed in C++20 - -template // since C++20 -constexpr see below operator<=>(const basic_string& lhs, - const basic_string& rhs) noexcept; - -template // since C++20 -constexpr see below operator<=>(const basic_string& lhs, - const charT* rhs) noexcept; - -template -void swap(basic_string& lhs, - basic_string& rhs) - noexcept(noexcept(lhs.swap(rhs))); // constexpr since C++20 - -template -basic_istream& -operator>>(basic_istream& is, basic_string& str); - -template -basic_ostream& -operator<<(basic_ostream& os, const basic_string& str); - -template -basic_istream& -getline(basic_istream& is, basic_string& str, - charT delim); - -template -basic_istream& -getline(basic_istream& is, basic_string& str); - -template -typename basic_string::size_type -erase(basic_string& c, const U& value); // C++20 -template -typename basic_string::size_type -erase_if(basic_string& c, Predicate pred); // C++20 - -typedef basic_string string; -typedef basic_string wstring; -typedef basic_string u8string; // C++20 -typedef basic_string u16string; -typedef basic_string u32string; - -int stoi (const string& str, size_t* idx = nullptr, int base = 10); -long stol (const string& str, size_t* idx = nullptr, int base = 10); -unsigned long stoul (const string& str, size_t* idx = nullptr, int base = 10); -long long stoll (const string& str, size_t* idx = nullptr, int base = 10); -unsigned long long stoull(const string& str, size_t* idx = nullptr, int base = 10); - -float stof (const string& str, size_t* idx = nullptr); -double stod (const string& str, size_t* idx = nullptr); -long double stold(const string& str, size_t* idx = nullptr); - -string to_string(int val); -string to_string(unsigned val); -string to_string(long val); -string to_string(unsigned long val); -string to_string(long long val); -string to_string(unsigned long long val); -string to_string(float val); -string to_string(double val); -string to_string(long double val); - -int stoi (const wstring& str, size_t* idx = nullptr, int base = 10); -long stol (const wstring& str, size_t* idx = nullptr, int base = 10); -unsigned long stoul (const wstring& str, size_t* idx = nullptr, int base = 10); -long long stoll (const wstring& str, size_t* idx = nullptr, int base = 10); -unsigned long long stoull(const wstring& str, size_t* idx = nullptr, int base = 10); - -float stof (const wstring& str, size_t* idx = nullptr); -double stod (const wstring& str, size_t* idx = nullptr); -long double stold(const wstring& str, size_t* idx = nullptr); - -wstring to_wstring(int val); -wstring to_wstring(unsigned val); -wstring to_wstring(long val); -wstring to_wstring(unsigned long val); -wstring to_wstring(long long val); -wstring to_wstring(unsigned long long val); -wstring to_wstring(float val); -wstring to_wstring(double val); -wstring to_wstring(long double val); - -template <> struct hash; -template <> struct hash; // C++20 -template <> struct hash; -template <> struct hash; -template <> struct hash; - -basic_string operator "" s( const char *str, size_t len ); // C++14, constexpr since C++20 -basic_string operator "" s( const wchar_t *str, size_t len ); // C++14, constexpr since C++20 -constexpr basic_string operator "" s( const char8_t *str, size_t len ); // C++20 -basic_string operator "" s( const char16_t *str, size_t len ); // C++14, constexpr since C++20 -basic_string operator "" s( const char32_t *str, size_t len ); // C++14, constexpr since C++20 - -} // std - -*/ - #include <__algorithm/max.h> #include <__algorithm/min.h> #include <__algorithm/remove.h> diff --git a/libcxx/include/string.h b/libcxx/include/string.h --- a/libcxx/include/string.h +++ b/libcxx/include/string.h @@ -10,47 +10,6 @@ #ifndef _LIBCPP_STRING_H #define _LIBCPP_STRING_H -/* - string.h synopsis - -Macros: - - NULL - -Types: - - size_t - -void* memcpy(void* restrict s1, const void* restrict s2, size_t n); -void* memmove(void* s1, const void* s2, size_t n); -char* strcpy (char* restrict s1, const char* restrict s2); -char* strncpy(char* restrict s1, const char* restrict s2, size_t n); -char* strcat (char* restrict s1, const char* restrict s2); -char* strncat(char* restrict s1, const char* restrict s2, size_t n); -int memcmp(const void* s1, const void* s2, size_t n); -int strcmp (const char* s1, const char* s2); -int strncmp(const char* s1, const char* s2, size_t n); -int strcoll(const char* s1, const char* s2); -size_t strxfrm(char* restrict s1, const char* restrict s2, size_t n); -const void* memchr(const void* s, int c, size_t n); - void* memchr( void* s, int c, size_t n); -const char* strchr(const char* s, int c); - char* strchr( char* s, int c); -size_t strcspn(const char* s1, const char* s2); -const char* strpbrk(const char* s1, const char* s2); - char* strpbrk( char* s1, const char* s2); -const char* strrchr(const char* s, int c); - char* strrchr( char* s, int c); -size_t strspn(const char* s1, const char* s2); -const char* strstr(const char* s1, const char* s2); - char* strstr( char* s1, const char* s2); -char* strtok(char* restrict s1, const char* restrict s2); -void* memset(void* s, int c, size_t n); -char* strerror(int errnum); -size_t strlen(const char* s); - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/string_view b/libcxx/include/string_view --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -10,198 +10,6 @@ #ifndef _LIBCPP_STRING_VIEW #define _LIBCPP_STRING_VIEW -/* - - string_view synopsis - -#include - -namespace std { - - // 7.2, Class template basic_string_view - template> - class basic_string_view; - - template - inline constexpr bool ranges::enable_view> = true; - - template - inline constexpr bool ranges::enable_borrowed_range> = true; // C++20 - - // 7.9, basic_string_view non-member comparison functions - template - constexpr bool operator==(basic_string_view x, - basic_string_view y) noexcept; - template // Removed in C++20 - constexpr bool operator!=(basic_string_view x, - basic_string_view y) noexcept; - template // Removed in C++20 - constexpr bool operator< (basic_string_view x, - basic_string_view y) noexcept; - template // Removed in C++20 - constexpr bool operator> (basic_string_view x, - basic_string_view y) noexcept; - template // Removed in C++20 - constexpr bool operator<=(basic_string_view x, - basic_string_view y) noexcept; - template // Removed in C++20 - constexpr bool operator>=(basic_string_view x, - basic_string_view y) noexcept; - template // Since C++20 - constexpr see below operator<=>(basic_string_view x, - basic_string_view y) noexcept; - - // see below, sufficient additional overloads of comparison functions - - // 7.10, Inserters and extractors - template - basic_ostream& - operator<<(basic_ostream& os, - basic_string_view str); - - // basic_string_view typedef names - typedef basic_string_view string_view; - typedef basic_string_view u8string_view; // C++20 - typedef basic_string_view u16string_view; - typedef basic_string_view u32string_view; - typedef basic_string_view wstring_view; - - template> - class basic_string_view { - public: - // types - typedef traits traits_type; - typedef charT value_type; - typedef charT* pointer; - typedef const charT* const_pointer; - typedef charT& reference; - typedef const charT& const_reference; - typedef implementation-defined const_iterator; - typedef const_iterator iterator; - typedef reverse_iterator const_reverse_iterator; - typedef const_reverse_iterator reverse_iterator; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - static constexpr size_type npos = size_type(-1); - - // 7.3, basic_string_view constructors and assignment operators - constexpr basic_string_view() noexcept; - constexpr basic_string_view(const basic_string_view&) noexcept = default; - basic_string_view& operator=(const basic_string_view&) noexcept = default; - template - constexpr basic_string_view(const charT* str); - basic_string_view(nullptr_t) = delete; // C++2b - constexpr basic_string_view(const charT* str, size_type len); - template - constexpr basic_string_view(It begin, End end); // C++20 - template - constexpr basic_string_view(Range&& r); // C++23 - - // 7.4, basic_string_view iterator support - constexpr const_iterator begin() const noexcept; - constexpr const_iterator end() const noexcept; - constexpr const_iterator cbegin() const noexcept; - constexpr const_iterator cend() const noexcept; - const_reverse_iterator rbegin() const noexcept; - const_reverse_iterator rend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - // 7.5, basic_string_view capacity - constexpr size_type size() const noexcept; - constexpr size_type length() const noexcept; - constexpr size_type max_size() const noexcept; - constexpr bool empty() const noexcept; - - // 7.6, basic_string_view element access - constexpr const_reference operator[](size_type pos) const; - constexpr const_reference at(size_type pos) const; - constexpr const_reference front() const; - constexpr const_reference back() const; - constexpr const_pointer data() const noexcept; - - // 7.7, basic_string_view modifiers - constexpr void remove_prefix(size_type n); - constexpr void remove_suffix(size_type n); - constexpr void swap(basic_string_view& s) noexcept; - - size_type copy(charT* s, size_type n, size_type pos = 0) const; // constexpr in C++20 - - constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const; - constexpr int compare(basic_string_view s) const noexcept; - constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const; - constexpr int compare(size_type pos1, size_type n1, - basic_string_view s, size_type pos2, size_type n2) const; - constexpr int compare(const charT* s) const; - constexpr int compare(size_type pos1, size_type n1, const charT* s) const; - constexpr int compare(size_type pos1, size_type n1, - const charT* s, size_type n2) const; - constexpr size_type find(basic_string_view s, size_type pos = 0) const noexcept; - constexpr size_type find(charT c, size_type pos = 0) const noexcept; - constexpr size_type find(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension - constexpr size_type find(const charT* s, size_type pos = 0) const noexcept; // noexcept as an extension - constexpr size_type rfind(basic_string_view s, size_type pos = npos) const noexcept; - constexpr size_type rfind(charT c, size_type pos = npos) const noexcept; - constexpr size_type rfind(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension - constexpr size_type rfind(const charT* s, size_type pos = npos) const noexcept; // noexcept as an extension - constexpr size_type find_first_of(basic_string_view s, size_type pos = 0) const noexcept; - constexpr size_type find_first_of(charT c, size_type pos = 0) const noexcept; - constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension - constexpr size_type find_first_of(const charT* s, size_type pos = 0) const noexcept; // noexcept as an extension - constexpr size_type find_last_of(basic_string_view s, size_type pos = npos) const noexcept; - constexpr size_type find_last_of(charT c, size_type pos = npos) const noexcept; - constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension - constexpr size_type find_last_of(const charT* s, size_type pos = npos) const noexcept; // noexcept as an extension - constexpr size_type find_first_not_of(basic_string_view s, size_type pos = 0) const noexcept; - constexpr size_type find_first_not_of(charT c, size_type pos = 0) const noexcept; - constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension - constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const noexcept; // noexcept as an extension - constexpr size_type find_last_not_of(basic_string_view s, size_type pos = npos) const noexcept; - constexpr size_type find_last_not_of(charT c, size_type pos = npos) const noexcept; - constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const noexcept; // noexcept as an extension - constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const noexcept; // noexcept as an extension - - constexpr bool starts_with(basic_string_view s) const noexcept; // C++20 - constexpr bool starts_with(charT c) const noexcept; // C++20 - constexpr bool starts_with(const charT* s) const; // C++20 - constexpr bool ends_with(basic_string_view s) const noexcept; // C++20 - constexpr bool ends_with(charT c) const noexcept; // C++20 - constexpr bool ends_with(const charT* s) const; // C++20 - - constexpr bool contains(basic_string_view s) const noexcept; // C++2b - constexpr bool contains(charT c) const noexcept; // C++2b - constexpr bool contains(const charT* s) const; // C++2b - - private: - const_pointer data_; // exposition only - size_type size_; // exposition only - }; - - // basic_string_view deduction guides - template - basic_string_view(It, End) -> basic_string_view>; // C++20 - template - basic_string_view(Range&&) -> basic_string_view>; // C++23 - - // 7.11, Hash support - template struct hash; - template <> struct hash; - template <> struct hash; // C++20 - template <> struct hash; - template <> struct hash; - template <> struct hash; - - constexpr basic_string_view operator "" sv(const char *str, size_t len) noexcept; - constexpr basic_string_view operator "" sv(const wchar_t *str, size_t len) noexcept; - constexpr basic_string_view operator "" sv(const char8_t *str, size_t len) noexcept; // C++20 - constexpr basic_string_view operator "" sv(const char16_t *str, size_t len) noexcept; - constexpr basic_string_view operator "" sv(const char32_t *str, size_t len) noexcept; - -} // namespace std - - -*/ - #include <__algorithm/min.h> #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/strstream b/libcxx/include/strstream --- a/libcxx/include/strstream +++ b/libcxx/include/strstream @@ -10,125 +10,6 @@ #ifndef _LIBCPP_STRSTREAM #define _LIBCPP_STRSTREAM -/* - strstream synopsis - -class strstreambuf - : public basic_streambuf -{ -public: - explicit strstreambuf(streamsize alsize_arg = 0); // before C++20 - strstreambuf() : strstreambuf(0) {} // C++20 - explicit strstreambuf(streamsize alsize_arg); // C++20 - - strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*)); - strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = nullptr); - strstreambuf(const char* gnext_arg, streamsize n); - - strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = nullptr); - strstreambuf(const signed char* gnext_arg, streamsize n); - strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = nullptr); - strstreambuf(const unsigned char* gnext_arg, streamsize n); - - strstreambuf(strstreambuf&& rhs); - strstreambuf& operator=(strstreambuf&& rhs); - - virtual ~strstreambuf(); - - void swap(strstreambuf& rhs); - - void freeze(bool freezefl = true); - char* str(); - int pcount() const; - -protected: - virtual int_type overflow (int_type c = EOF); - virtual int_type pbackfail(int_type c = EOF); - virtual int_type underflow(); - virtual pos_type seekoff(off_type off, ios_base::seekdir way, - ios_base::openmode which = ios_base::in | ios_base::out); - virtual pos_type seekpos(pos_type sp, - ios_base::openmode which = ios_base::in | ios_base::out); - virtual streambuf* setbuf(char* s, streamsize n); - -private: - typedef T1 strstate; // exposition only - static const strstate allocated; // exposition only - static const strstate constant; // exposition only - static const strstate dynamic; // exposition only - static const strstate frozen; // exposition only - strstate strmode; // exposition only - streamsize alsize; // exposition only - void* (*palloc)(size_t); // exposition only - void (*pfree)(void*); // exposition only -}; - -class istrstream - : public basic_istream -{ -public: - explicit istrstream(const char* s); - explicit istrstream(char* s); - istrstream(const char* s, streamsize n); - istrstream(char* s, streamsize n); - - virtual ~istrstream(); - - strstreambuf* rdbuf() const; - char *str(); - -private: - strstreambuf sb; // exposition only -}; - -class ostrstream - : public basic_ostream -{ -public: - ostrstream(); - ostrstream(char* s, int n, ios_base::openmode mode = ios_base::out); - - virtual ~ostrstream(); - - strstreambuf* rdbuf() const; - void freeze(bool freezefl = true); - char* str(); - int pcount() const; - -private: - strstreambuf sb; // exposition only -}; - -class strstream - : public basic_iostream -{ -public: - // Types - typedef char char_type; - typedef char_traits::int_type int_type; - typedef char_traits::pos_type pos_type; - typedef char_traits::off_type off_type; - - // constructors/destructor - strstream(); - strstream(char* s, int n, ios_base::openmode mode = ios_base::in | ios_base::out); - - virtual ~strstream(); - - // Members: - strstreambuf* rdbuf() const; - void freeze(bool freezefl = true); - int pcount() const; - char* str(); - -private: - strstreambuf sb; // exposition only -}; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include diff --git a/libcxx/include/system_error b/libcxx/include/system_error --- a/libcxx/include/system_error +++ b/libcxx/include/system_error @@ -10,140 +10,6 @@ #ifndef _LIBCPP_SYSTEM_ERROR #define _LIBCPP_SYSTEM_ERROR -/* - system_error synopsis - -namespace std -{ - -class error_category -{ -public: - virtual ~error_category() noexcept; - - constexpr error_category(); - error_category(const error_category&) = delete; - error_category& operator=(const error_category&) = delete; - - virtual const char* name() const noexcept = 0; - virtual error_condition default_error_condition(int ev) const noexcept; - virtual bool equivalent(int code, const error_condition& condition) const noexcept; - virtual bool equivalent(const error_code& code, int condition) const noexcept; - virtual string message(int ev) const = 0; - - bool operator==(const error_category& rhs) const noexcept; - bool operator!=(const error_category& rhs) const noexcept; // removed in C++20 - bool operator<(const error_category& rhs) const noexcept; // removed in C++20 - strong_ordering operator<=>(const error_category& rhs) const noexcept; // C++20 -}; - -const error_category& generic_category() noexcept; -const error_category& system_category() noexcept; - -template struct is_error_code_enum - : public false_type {}; - -template struct is_error_condition_enum - : public false_type {}; - -template -inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17 - -template -inline constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value; // C++17 - -class error_code -{ -public: - // constructors: - error_code() noexcept; - error_code(int val, const error_category& cat) noexcept; - template - error_code(ErrorCodeEnum e) noexcept; - - // modifiers: - void assign(int val, const error_category& cat) noexcept; - template - error_code& operator=(ErrorCodeEnum e) noexcept; - void clear() noexcept; - - // observers: - int value() const noexcept; - const error_category& category() const noexcept; - error_condition default_error_condition() const noexcept; - string message() const; - explicit operator bool() const noexcept; -}; - -// non-member functions: -template - basic_ostream& - operator<<(basic_ostream& os, const error_code& ec); - -class error_condition -{ -public: - // constructors: - error_condition() noexcept; - error_condition(int val, const error_category& cat) noexcept; - template - error_condition(ErrorConditionEnum e) noexcept; - - // modifiers: - void assign(int val, const error_category& cat) noexcept; - template - error_condition& operator=(ErrorConditionEnum e) noexcept; - void clear() noexcept; - - // observers: - int value() const noexcept; - const error_category& category() const noexcept; - string message() const noexcept; - explicit operator bool() const noexcept; -}; - -class system_error - : public runtime_error -{ -public: - system_error(error_code ec, const string& what_arg); - system_error(error_code ec, const char* what_arg); - system_error(error_code ec); - system_error(int ev, const error_category& ecat, const string& what_arg); - system_error(int ev, const error_category& ecat, const char* what_arg); - system_error(int ev, const error_category& ecat); - - const error_code& code() const noexcept; - const char* what() const noexcept; -}; - -template <> struct is_error_condition_enum - : true_type { } - -error_code make_error_code(errc e) noexcept; -error_condition make_error_condition(errc e) noexcept; - -// Comparison operators: -bool operator==(const error_code& lhs, const error_code& rhs) noexcept; -bool operator==(const error_code& lhs, const error_condition& rhs) noexcept; -bool operator==(const error_condition& lhs, const error_code& rhs) noexcept; // removed in C++20 -bool operator==(const error_condition& lhs, const error_condition& rhs) noexcept; -bool operator!=(const error_code& lhs, const error_code& rhs) noexcept; // removed in C++20 -bool operator!=(const error_code& lhs, const error_condition& rhs) noexcept; // removed in C++20 -bool operator!=(const error_condition& lhs, const error_code& rhs) noexcept; // removed in C++20 -bool operator!=(const error_condition& lhs, const error_condition& rhs) noexcept; // removed in C++20 -bool operator<(const error_condition& lhs, const error_condition& rhs) noexcept; // removed in C++20 -bool operator<(const error_code& lhs, const error_code& rhs) noexcept; // removed in C++20 -strong_ordering operator<=>(const error_code& lhs, const error_code& rhs) noexcept; // C++20 -strong_ordering operator<=>(const error_condition& lhs, const error_condition& rhs) noexcept; // C++20 - -template <> struct hash; -template <> struct hash; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__errc> diff --git a/libcxx/include/tgmath.h b/libcxx/include/tgmath.h --- a/libcxx/include/tgmath.h +++ b/libcxx/include/tgmath.h @@ -10,13 +10,6 @@ #ifndef _LIBCPP_TGMATH_H #define _LIBCPP_TGMATH_H -/* - tgmath.h synopsis - -#include - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/thread b/libcxx/include/thread --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -10,79 +10,6 @@ #ifndef _LIBCPP_THREAD #define _LIBCPP_THREAD -/* - - thread synopsis - -namespace std -{ - -class thread -{ -public: - class id; - typedef pthread_t native_handle_type; - - thread() noexcept; - template explicit thread(F&& f, Args&&... args); - ~thread(); - - thread(const thread&) = delete; - thread(thread&& t) noexcept; - - thread& operator=(const thread&) = delete; - thread& operator=(thread&& t) noexcept; - - void swap(thread& t) noexcept; - - bool joinable() const noexcept; - void join(); - void detach(); - id get_id() const noexcept; - native_handle_type native_handle(); - - static unsigned hardware_concurrency() noexcept; -}; - -void swap(thread& x, thread& y) noexcept; - -class thread::id -{ -public: - id() noexcept; -}; - -bool operator==(thread::id x, thread::id y) noexcept; -bool operator!=(thread::id x, thread::id y) noexcept; // removed in C++20 -bool operator< (thread::id x, thread::id y) noexcept; // removed in C++20 -bool operator<=(thread::id x, thread::id y) noexcept; // removed in C++20 -bool operator> (thread::id x, thread::id y) noexcept; // removed in C++20 -bool operator>=(thread::id x, thread::id y) noexcept; // removed in C++20 -strong_ordering operator<=>(thread::id x, thread::id y) noexcept; // C++20 - -template -basic_ostream& -operator<<(basic_ostream& out, thread::id id); - -namespace this_thread -{ - -thread::id get_id() noexcept; - -void yield() noexcept; - -template -void sleep_until(const chrono::time_point& abs_time); - -template -void sleep_for(const chrono::duration& rel_time); - -} // this_thread - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__chrono/steady_clock.h> #include <__chrono/time_point.h> diff --git a/libcxx/include/tuple b/libcxx/include/tuple --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -10,197 +10,6 @@ #ifndef _LIBCPP_TUPLE #define _LIBCPP_TUPLE -/* - tuple synopsis - -namespace std -{ - -template -class tuple { -public: - explicit(see-below) constexpr tuple(); - explicit(see-below) tuple(const T&...); // constexpr in C++14 - template - explicit(see-below) tuple(U&&...); // constexpr in C++14 - tuple(const tuple&) = default; - tuple(tuple&&) = default; - - template - constexpr explicit(see-below) tuple(tuple&); // C++23 - template - explicit(see-below) tuple(const tuple&); // constexpr in C++14 - template - explicit(see-below) tuple(tuple&&); // constexpr in C++14 - template - constexpr explicit(see-below) tuple(const tuple&&); // C++23 - - template - constexpr explicit(see-below) tuple(pair&); // iff sizeof...(Types) == 2 // C++23 - template - explicit(see-below) tuple(const pair&); // iff sizeof...(T) == 2 // constexpr in C++14 - template - explicit(see-below) tuple(pair&&); // iff sizeof...(T) == 2 // constexpr in C++14 - template - constexpr explicit(see-below) tuple(const pair&&); // iff sizeof...(Types) == 2 // C++23 - - // allocator-extended constructors - template - tuple(allocator_arg_t, const Alloc& a); - template - explicit(see-below) tuple(allocator_arg_t, const Alloc& a, const T&...); // constexpr in C++20 - template - explicit(see-below) tuple(allocator_arg_t, const Alloc& a, U&&...); // constexpr in C++20 - template - tuple(allocator_arg_t, const Alloc& a, const tuple&); // constexpr in C++20 - template - tuple(allocator_arg_t, const Alloc& a, tuple&&); // constexpr in C++20 - template - constexpr explicit(see-below) - tuple(allocator_arg_t, const Alloc& a, tuple&); // C++23 - template - explicit(see-below) tuple(allocator_arg_t, const Alloc& a, const tuple&); // constexpr in C++20 - template - explicit(see-below) tuple(allocator_arg_t, const Alloc& a, tuple&&); // constexpr in C++20 - template - constexpr explicit(see-below) - tuple(allocator_arg_t, const Alloc& a, const tuple&&); // C++23 - template - constexpr explicit(see-below) - tuple(allocator_arg_t, const Alloc& a, pair&); // C++23 - template - explicit(see-below) tuple(allocator_arg_t, const Alloc& a, const pair&); // constexpr in C++20 - template - explicit(see-below) tuple(allocator_arg_t, const Alloc& a, pair&&); // constexpr in C++20 - template - constexpr explicit(see-below) - tuple(allocator_arg_t, const Alloc& a, const pair&&); // C++23 - - tuple& operator=(const tuple&); // constexpr in C++20 - constexpr const tuple& operator=(const tuple&) const; // C++23 - tuple& operator=(tuple&&) noexcept(is_nothrow_move_assignable_v && ...); // constexpr in C++20 - constexpr const tuple& operator=(tuple&&) const; // C++23 - template - tuple& operator=(const tuple&); // constexpr in C++20 - template - constexpr const tuple& operator=(const tuple&) const; // C++23 - template - tuple& operator=(tuple&&); // constexpr in C++20 - template - constexpr const tuple& operator=(tuple&&) const; // C++23 - template - tuple& operator=(const pair&); // iff sizeof...(T) == 2 // constexpr in C++20 - template - constexpr const tuple& operator=(const pair&) const; // iff sizeof...(Types) == 2 // C++23 - template - tuple& operator=(pair&&); // iff sizeof...(T) == 2 // constexpr in C++20 - template - constexpr const tuple& operator=(pair&&) const; // iff sizeof...(Types) == 2 // C++23 - - template - tuple& operator=(array const&) // iff sizeof...(T) == N, EXTENSION - template - tuple& operator=(array&&) // iff sizeof...(T) == N, EXTENSION - - void swap(tuple&) noexcept(AND(swap(declval(), declval())...)); // constexpr in C++20 - constexpr void swap(const tuple&) const noexcept(see-below); // C++23 -}; - - -template class TQual, template class UQual> // since C++23 - requires requires { typename tuple, UQual>...>; } -struct basic_common_reference, tuple, TQual, UQual> { - using type = tuple, UQual>...>; -}; - -template // since C++23 - requires requires { typename tuple...>; } -struct common_type, tuple> { - using type = tuple...>; -}; - -template -tuple(T...) -> tuple; // since C++17 -template -tuple(pair) -> tuple; // since C++17 -template -tuple(allocator_arg_t, Alloc, T...) -> tuple; // since C++17 -template -tuple(allocator_arg_t, Alloc, pair) -> tuple; // since C++17 -template -tuple(allocator_arg_t, Alloc, tuple) -> tuple; // since C++17 - -inline constexpr unspecified ignore; - -template tuple make_tuple(T&&...); // constexpr in C++14 -template tuple forward_as_tuple(T&&...) noexcept; // constexpr in C++14 -template tuple tie(T&...) noexcept; // constexpr in C++14 -template tuple tuple_cat(Tuples&&... tpls); // constexpr in C++14 - -// [tuple.apply], calling a function with a tuple of arguments: -template - constexpr decltype(auto) apply(F&& f, Tuple&& t); // C++17 -template - constexpr T make_from_tuple(Tuple&& t); // C++17 - -// 20.4.1.4, tuple helper classes: -template struct tuple_size; // undefined -template struct tuple_size>; -template - inline constexpr size_t tuple_size_v = tuple_size::value; // C++17 -template struct tuple_element; // undefined -template struct tuple_element>; -template - using tuple_element_t = typename tuple_element ::type; // C++14 - -// 20.4.1.5, element access: -template - typename tuple_element>::type& - get(tuple&) noexcept; // constexpr in C++14 -template - const typename tuple_element>::type& - get(const tuple&) noexcept; // constexpr in C++14 -template - typename tuple_element>::type&& - get(tuple&&) noexcept; // constexpr in C++14 -template - const typename tuple_element>::type&& - get(const tuple&&) noexcept; // constexpr in C++14 - -template - constexpr T1& get(tuple&) noexcept; // C++14 -template - constexpr const T1& get(const tuple&) noexcept; // C++14 -template - constexpr T1&& get(tuple&&) noexcept; // C++14 -template - constexpr const T1&& get(const tuple&&) noexcept; // C++14 - -// 20.4.1.6, relational operators: -template bool operator==(const tuple&, const tuple&); // constexpr in C++14 -template bool operator<(const tuple&, const tuple&); // constexpr in C++14, removed in C++20 -template bool operator!=(const tuple&, const tuple&); // constexpr in C++14, removed in C++20 -template bool operator>(const tuple&, const tuple&); // constexpr in C++14, removed in C++20 -template bool operator<=(const tuple&, const tuple&); // constexpr in C++14, removed in C++20 -template bool operator>=(const tuple&, const tuple&); // constexpr in C++14, removed in C++20 -template - constexpr common_comparison_category_t...> - operator<=>(const tuple&, const tuple&); // since C++20 - -template - struct uses_allocator, Alloc>; - -template - void - swap(tuple& x, tuple& y) noexcept(noexcept(x.swap(y))); - -template - constexpr void swap(const tuple& x, const tuple& y) noexcept(see-below); // C++23 - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__compare/common_comparison_category.h> #include <__compare/synth_three_way.h> diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -10,412 +10,6 @@ #ifndef _LIBCPP_TYPE_TRAITS #define _LIBCPP_TYPE_TRAITS -/* - type_traits synopsis - -namespace std -{ - - // helper class: - template struct integral_constant; - typedef integral_constant true_type; // C++11 - typedef integral_constant false_type; // C++11 - - template // C++14 - using bool_constant = integral_constant; // C++14 - typedef bool_constant true_type; // C++14 - typedef bool_constant false_type; // C++14 - - // helper traits - template struct enable_if; - template struct conditional; - - // Primary classification traits: - template struct is_void; - template struct is_null_pointer; // C++14 - template struct is_integral; - template struct is_floating_point; - template struct is_array; - template struct is_pointer; - template struct is_lvalue_reference; - template struct is_rvalue_reference; - template struct is_member_object_pointer; - template struct is_member_function_pointer; - template struct is_enum; - template struct is_union; - template struct is_class; - template struct is_function; - - // Secondary classification traits: - template struct is_reference; - template struct is_arithmetic; - template struct is_fundamental; - template struct is_member_pointer; - template struct is_scoped_enum; // C++2b - template struct is_scalar; - template struct is_object; - template struct is_compound; - - // Const-volatile properties and transformations: - template struct is_const; - template struct is_volatile; - template struct remove_const; - template struct remove_volatile; - template struct remove_cv; - template struct add_const; - template struct add_volatile; - template struct add_cv; - - // Reference transformations: - template struct remove_reference; - template struct add_lvalue_reference; - template struct add_rvalue_reference; - - // Pointer transformations: - template struct remove_pointer; - template struct add_pointer; - - template struct type_identity; // C++20 - template - using type_identity_t = typename type_identity::type; // C++20 - - // Integral properties: - template struct is_signed; - template struct is_unsigned; - template struct make_signed; - template struct make_unsigned; - - // Array properties and transformations: - template struct rank; - template struct extent; - template struct remove_extent; - template struct remove_all_extents; - - template struct is_bounded_array; // C++20 - template struct is_unbounded_array; // C++20 - - // Member introspection: - template struct is_pod; - template struct is_trivial; - template struct is_trivially_copyable; - template struct is_standard_layout; - template struct is_literal_type; // Deprecated in C++17; removed in C++20 - template struct is_empty; - template struct is_polymorphic; - template struct is_abstract; - template struct is_final; // C++14 - template struct is_aggregate; // C++17 - - template struct is_constructible; - template struct is_default_constructible; - template struct is_copy_constructible; - template struct is_move_constructible; - template struct is_assignable; - template struct is_copy_assignable; - template struct is_move_assignable; - template struct is_swappable_with; // C++17 - template struct is_swappable; // C++17 - template struct is_destructible; - - template struct is_trivially_constructible; - template struct is_trivially_default_constructible; - template struct is_trivially_copy_constructible; - template struct is_trivially_move_constructible; - template struct is_trivially_assignable; - template struct is_trivially_copy_assignable; - template struct is_trivially_move_assignable; - template struct is_trivially_destructible; - - template struct is_nothrow_constructible; - template struct is_nothrow_default_constructible; - template struct is_nothrow_copy_constructible; - template struct is_nothrow_move_constructible; - template struct is_nothrow_assignable; - template struct is_nothrow_copy_assignable; - template struct is_nothrow_move_assignable; - template struct is_nothrow_swappable_with; // C++17 - template struct is_nothrow_swappable; // C++17 - template struct is_nothrow_destructible; - - template struct has_virtual_destructor; - - template struct has_unique_object_representations; // C++17 - - // Relationships between types: - template struct is_same; - template struct is_base_of; - - template struct is_convertible; - template struct is_nothrow_convertible; // C++20 - template inline constexpr bool is_nothrow_convertible_v; // C++20 - - template struct is_invocable; - template struct is_invocable_r; - - template struct is_nothrow_invocable; - template struct is_nothrow_invocable_r; - - // Alignment properties and transformations: - template struct alignment_of; - template - struct aligned_storage; // deprecated in C++23 - template struct aligned_union; // deprecated in C++23 - template struct remove_cvref; // C++20 - - template struct decay; - template struct common_type; - template struct underlying_type; - template class result_of; // undefined; deprecated in C++17; removed in C++20 - template class result_of; // deprecated in C++17; removed in C++20 - template struct invoke_result; // C++17 - - // const-volatile modifications: - template - using remove_const_t = typename remove_const::type; // C++14 - template - using remove_volatile_t = typename remove_volatile::type; // C++14 - template - using remove_cv_t = typename remove_cv::type; // C++14 - template - using add_const_t = typename add_const::type; // C++14 - template - using add_volatile_t = typename add_volatile::type; // C++14 - template - using add_cv_t = typename add_cv::type; // C++14 - - // reference modifications: - template - using remove_reference_t = typename remove_reference::type; // C++14 - template - using add_lvalue_reference_t = typename add_lvalue_reference::type; // C++14 - template - using add_rvalue_reference_t = typename add_rvalue_reference::type; // C++14 - - // sign modifications: - template - using make_signed_t = typename make_signed::type; // C++14 - template - using make_unsigned_t = typename make_unsigned::type; // C++14 - - // array modifications: - template - using remove_extent_t = typename remove_extent::type; // C++14 - template - using remove_all_extents_t = typename remove_all_extents::type; // C++14 - - template - inline constexpr bool is_bounded_array_v - = is_bounded_array::value; // C++20 - inline constexpr bool is_unbounded_array_v - = is_unbounded_array::value; // C++20 - - // pointer modifications: - template - using remove_pointer_t = typename remove_pointer::type; // C++14 - template - using add_pointer_t = typename add_pointer::type; // C++14 - - // other transformations: - template - using aligned_storage_t = typename aligned_storage::type; // C++14 - template - using aligned_union_t = typename aligned_union::type; // C++14 - template - using remove_cvref_t = typename remove_cvref::type; // C++20 - template - using decay_t = typename decay::type; // C++14 - template - using enable_if_t = typename enable_if::type; // C++14 - template - using conditional_t = typename conditional::type; // C++14 - template - using common_type_t = typename common_type::type; // C++14 - template - using underlying_type_t = typename underlying_type::type; // C++14 - template - using result_of_t = typename result_of::type; // C++14; deprecated in C++17; removed in C++20 - template - using invoke_result_t = typename invoke_result::type; // C++17 - - template - using void_t = void; // C++17 - - // See C++14 20.10.4.1, primary type categories - template inline constexpr bool is_void_v - = is_void::value; // C++17 - template inline constexpr bool is_null_pointer_v - = is_null_pointer::value; // C++17 - template inline constexpr bool is_integral_v - = is_integral::value; // C++17 - template inline constexpr bool is_floating_point_v - = is_floating_point::value; // C++17 - template inline constexpr bool is_array_v - = is_array::value; // C++17 - template inline constexpr bool is_pointer_v - = is_pointer::value; // C++17 - template inline constexpr bool is_lvalue_reference_v - = is_lvalue_reference::value; // C++17 - template inline constexpr bool is_rvalue_reference_v - = is_rvalue_reference::value; // C++17 - template inline constexpr bool is_member_object_pointer_v - = is_member_object_pointer::value; // C++17 - template inline constexpr bool is_member_function_pointer_v - = is_member_function_pointer::value; // C++17 - template inline constexpr bool is_enum_v - = is_enum::value; // C++17 - template inline constexpr bool is_union_v - = is_union::value; // C++17 - template inline constexpr bool is_class_v - = is_class::value; // C++17 - template inline constexpr bool is_function_v - = is_function::value; // C++17 - - // See C++14 20.10.4.2, composite type categories - template inline constexpr bool is_reference_v - = is_reference::value; // C++17 - template inline constexpr bool is_arithmetic_v - = is_arithmetic::value; // C++17 - template inline constexpr bool is_fundamental_v - = is_fundamental::value; // C++17 - template inline constexpr bool is_object_v - = is_object::value; // C++17 - template inline constexpr bool is_scalar_v - = is_scalar::value; // C++17 - template inline constexpr bool is_compound_v - = is_compound::value; // C++17 - template inline constexpr bool is_member_pointer_v - = is_member_pointer::value; // C++17 - template inline constexpr bool is_scoped_enum_v - = is_scoped_enum::value; // C++2b - - // See C++14 20.10.4.3, type properties - template inline constexpr bool is_const_v - = is_const::value; // C++17 - template inline constexpr bool is_volatile_v - = is_volatile::value; // C++17 - template inline constexpr bool is_trivial_v - = is_trivial::value; // C++17 - template inline constexpr bool is_trivially_copyable_v - = is_trivially_copyable::value; // C++17 - template inline constexpr bool is_standard_layout_v - = is_standard_layout::value; // C++17 - template inline constexpr bool is_pod_v - = is_pod::value; // C++17 - template inline constexpr bool is_literal_type_v - = is_literal_type::value; // C++17; deprecated in C++17; removed in C++20 - template inline constexpr bool is_empty_v - = is_empty::value; // C++17 - template inline constexpr bool is_polymorphic_v - = is_polymorphic::value; // C++17 - template inline constexpr bool is_abstract_v - = is_abstract::value; // C++17 - template inline constexpr bool is_final_v - = is_final::value; // C++17 - template inline constexpr bool is_aggregate_v - = is_aggregate::value; // C++17 - template inline constexpr bool is_signed_v - = is_signed::value; // C++17 - template inline constexpr bool is_unsigned_v - = is_unsigned::value; // C++17 - template inline constexpr bool is_constructible_v - = is_constructible::value; // C++17 - template inline constexpr bool is_default_constructible_v - = is_default_constructible::value; // C++17 - template inline constexpr bool is_copy_constructible_v - = is_copy_constructible::value; // C++17 - template inline constexpr bool is_move_constructible_v - = is_move_constructible::value; // C++17 - template inline constexpr bool is_assignable_v - = is_assignable::value; // C++17 - template inline constexpr bool is_copy_assignable_v - = is_copy_assignable::value; // C++17 - template inline constexpr bool is_move_assignable_v - = is_move_assignable::value; // C++17 - template inline constexpr bool is_swappable_with_v - = is_swappable_with::value; // C++17 - template inline constexpr bool is_swappable_v - = is_swappable::value; // C++17 - template inline constexpr bool is_destructible_v - = is_destructible::value; // C++17 - template inline constexpr bool is_trivially_constructible_v - = is_trivially_constructible::value; // C++17 - template inline constexpr bool is_trivially_default_constructible_v - = is_trivially_default_constructible::value; // C++17 - template inline constexpr bool is_trivially_copy_constructible_v - = is_trivially_copy_constructible::value; // C++17 - template inline constexpr bool is_trivially_move_constructible_v - = is_trivially_move_constructible::value; // C++17 - template inline constexpr bool is_trivially_assignable_v - = is_trivially_assignable::value; // C++17 - template inline constexpr bool is_trivially_copy_assignable_v - = is_trivially_copy_assignable::value; // C++17 - template inline constexpr bool is_trivially_move_assignable_v - = is_trivially_move_assignable::value; // C++17 - template inline constexpr bool is_trivially_destructible_v - = is_trivially_destructible::value; // C++17 - template inline constexpr bool is_nothrow_constructible_v - = is_nothrow_constructible::value; // C++17 - template inline constexpr bool is_nothrow_default_constructible_v - = is_nothrow_default_constructible::value; // C++17 - template inline constexpr bool is_nothrow_copy_constructible_v - = is_nothrow_copy_constructible::value; // C++17 - template inline constexpr bool is_nothrow_move_constructible_v - = is_nothrow_move_constructible::value; // C++17 - template inline constexpr bool is_nothrow_assignable_v - = is_nothrow_assignable::value; // C++17 - template inline constexpr bool is_nothrow_copy_assignable_v - = is_nothrow_copy_assignable::value; // C++17 - template inline constexpr bool is_nothrow_move_assignable_v - = is_nothrow_move_assignable::value; // C++17 - template inline constexpr bool is_nothrow_swappable_with_v - = is_nothrow_swappable_with::value; // C++17 - template inline constexpr bool is_nothrow_swappable_v - = is_nothrow_swappable::value; // C++17 - template inline constexpr bool is_nothrow_destructible_v - = is_nothrow_destructible::value; // C++17 - template inline constexpr bool has_virtual_destructor_v - = has_virtual_destructor::value; // C++17 - template inline constexpr bool has_unique_object_representations_v // C++17 - = has_unique_object_representations::value; - - // See C++14 20.10.5, type property queries - template inline constexpr size_t alignment_of_v - = alignment_of::value; // C++17 - template inline constexpr size_t rank_v - = rank::value; // C++17 - template inline constexpr size_t extent_v - = extent::value; // C++17 - - // See C++14 20.10.6, type relations - template inline constexpr bool is_same_v - = is_same::value; // C++17 - template inline constexpr bool is_base_of_v - = is_base_of::value; // C++17 - template inline constexpr bool is_convertible_v - = is_convertible::value; // C++17 - template inline constexpr bool is_invocable_v - = is_invocable::value; // C++17 - template inline constexpr bool is_invocable_r_v - = is_invocable_r::value; // C++17 - template inline constexpr bool is_nothrow_invocable_v - = is_nothrow_invocable::value; // C++17 - template inline constexpr bool is_nothrow_invocable_r_v - = is_nothrow_invocable_r::value; // C++17 - - // [meta.logical], logical operator traits: - template struct conjunction; // C++17 - template - inline constexpr bool conjunction_v = conjunction::value; // C++17 - template struct disjunction; // C++17 - template - inline constexpr bool disjunction_v = disjunction::value; // C++17 - template struct negation; // C++17 - template - inline constexpr bool negation_v = negation::value; // C++17 - -} - -*/ #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__functional/invoke.h> diff --git a/libcxx/include/typeindex b/libcxx/include/typeindex --- a/libcxx/include/typeindex +++ b/libcxx/include/typeindex @@ -10,41 +10,6 @@ #ifndef _LIBCPP_TYPEINDEX #define _LIBCPP_TYPEINDEX -/* - - typeindex synopsis - -namespace std -{ - -class type_index -{ -public: - type_index(const type_info& rhs) noexcept; - - bool operator==(const type_index& rhs) const noexcept; - bool operator!=(const type_index& rhs) const noexcept; // removed in C++20 - bool operator< (const type_index& rhs) const noexcept; - bool operator<=(const type_index& rhs) const noexcept; - bool operator> (const type_index& rhs) const noexcept; - bool operator>=(const type_index& rhs) const noexcept; - strong_ordering operator<=>(const type_index& rhs) const noexcept; // C++20 - - size_t hash_code() const noexcept; - const char* name() const noexcept; -}; - -template <> -struct hash - : public unary_function -{ - size_t operator()(type_index index) const noexcept; -}; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__functional/unary_function.h> diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo --- a/libcxx/include/typeinfo +++ b/libcxx/include/typeinfo @@ -10,52 +10,6 @@ #ifndef __LIBCPP_TYPEINFO #define __LIBCPP_TYPEINFO -/* - - typeinfo synopsis - -namespace std { - -class type_info -{ -public: - virtual ~type_info(); - - bool operator==(const type_info& rhs) const noexcept; // constexpr since C++23 - bool operator!=(const type_info& rhs) const noexcept; // removed in C++20 - - bool before(const type_info& rhs) const noexcept; - size_t hash_code() const noexcept; - const char* name() const noexcept; - - type_info(const type_info& rhs) = delete; - type_info& operator=(const type_info& rhs) = delete; -}; - -class bad_cast - : public exception -{ -public: - bad_cast() noexcept; - bad_cast(const bad_cast&) noexcept; - bad_cast& operator=(const bad_cast&) noexcept; - virtual const char* what() const noexcept; -}; - -class bad_typeid - : public exception -{ -public: - bad_typeid() noexcept; - bad_typeid(const bad_typeid&) noexcept; - bad_typeid& operator=(const bad_typeid&) noexcept; - virtual const char* what() const noexcept; -}; - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__availability> #include <__config> diff --git a/libcxx/include/uchar.h b/libcxx/include/uchar.h --- a/libcxx/include/uchar.h +++ b/libcxx/include/uchar.h @@ -10,28 +10,6 @@ #ifndef _LIBCPP_UCHAR_H #define _LIBCPP_UCHAR_H -/* - uchar.h synopsis // since C++11 - -Macros: - - __STDC_UTF_16__ - __STDC_UTF_32__ - -Types: - - mbstate_t - size_t - -size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps); // since C++20 -size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps); // since C++20 -size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps); -size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps); -size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps); -size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps); - -*/ - #include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -10,510 +10,6 @@ #ifndef _LIBCPP_UNORDERED_MAP #define _LIBCPP_UNORDERED_MAP -/* - - unordered_map synopsis - -#include - -namespace std -{ - -template , class Pred = equal_to, - class Alloc = allocator>> -class unordered_map -{ -public: - // types - typedef Key key_type; - typedef T mapped_type; - typedef Hash hasher; - typedef Pred key_equal; - typedef Alloc allocator_type; - typedef pair value_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename allocator_traits::pointer pointer; - typedef typename allocator_traits::const_pointer const_pointer; - typedef typename allocator_traits::size_type size_type; - typedef typename allocator_traits::difference_type difference_type; - - typedef /unspecified/ iterator; - typedef /unspecified/ const_iterator; - typedef /unspecified/ local_iterator; - typedef /unspecified/ const_local_iterator; - - typedef unspecified node_type; // C++17 - typedef INSERT_RETURN_TYPE insert_return_type; // C++17 - - unordered_map() - noexcept( - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value); - explicit unordered_map(size_type n, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - template - unordered_map(InputIterator f, InputIterator l, - size_type n = 0, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - explicit unordered_map(const allocator_type&); - unordered_map(const unordered_map&); - unordered_map(const unordered_map&, const Allocator&); - unordered_map(unordered_map&&) - noexcept( - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value); - unordered_map(unordered_map&&, const Allocator&); - unordered_map(initializer_list, size_type n = 0, - const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - unordered_map(size_type n, const allocator_type& a) - : unordered_map(n, hasher(), key_equal(), a) {} // C++14 - unordered_map(size_type n, const hasher& hf, const allocator_type& a) - : unordered_map(n, hf, key_equal(), a) {} // C++14 - template - unordered_map(InputIterator f, InputIterator l, size_type n, const allocator_type& a) - : unordered_map(f, l, n, hasher(), key_equal(), a) {} // C++14 - template - unordered_map(InputIterator f, InputIterator l, size_type n, const hasher& hf, - const allocator_type& a) - : unordered_map(f, l, n, hf, key_equal(), a) {} // C++14 - unordered_map(initializer_list il, size_type n, const allocator_type& a) - : unordered_map(il, n, hasher(), key_equal(), a) {} // C++14 - unordered_map(initializer_list il, size_type n, const hasher& hf, - const allocator_type& a) - : unordered_map(il, n, hf, key_equal(), a) {} // C++14 - ~unordered_map(); - unordered_map& operator=(const unordered_map&); - unordered_map& operator=(unordered_map&&) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); - unordered_map& operator=(initializer_list); - - allocator_type get_allocator() const noexcept; - - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - iterator begin() noexcept; - iterator end() noexcept; - const_iterator begin() const noexcept; - const_iterator end() const noexcept; - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - - template - pair emplace(Args&&... args); - template - iterator emplace_hint(const_iterator position, Args&&... args); - pair insert(const value_type& obj); - template - pair insert(P&& obj); - iterator insert(const_iterator hint, const value_type& obj); - template - iterator insert(const_iterator hint, P&& obj); - template - void insert(InputIterator first, InputIterator last); - void insert(initializer_list); - - node_type extract(const_iterator position); // C++17 - node_type extract(const key_type& x); // C++17 - insert_return_type insert(node_type&& nh); // C++17 - iterator insert(const_iterator hint, node_type&& nh); // C++17 - - template - pair try_emplace(const key_type& k, Args&&... args); // C++17 - template - pair try_emplace(key_type&& k, Args&&... args); // C++17 - template - iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); // C++17 - template - iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // C++17 - template - pair insert_or_assign(const key_type& k, M&& obj); // C++17 - template - pair insert_or_assign(key_type&& k, M&& obj); // C++17 - template - iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); // C++17 - template - iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // C++17 - - iterator erase(const_iterator position); - iterator erase(iterator position); // C++14 - size_type erase(const key_type& k); - iterator erase(const_iterator first, const_iterator last); - void clear() noexcept; - - template - void merge(unordered_map& source); // C++17 - template - void merge(unordered_map&& source); // C++17 - template - void merge(unordered_multimap& source); // C++17 - template - void merge(unordered_multimap&& source); // C++17 - - void swap(unordered_map&) - noexcept( - (!allocator_type::propagate_on_container_swap::value || - __is_nothrow_swappable::value) && - __is_nothrow_swappable::value && - __is_nothrow_swappable::value); - - hasher hash_function() const; - key_equal key_eq() const; - - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - template - iterator find(const K& x); // C++20 - template - const_iterator find(const K& x) const; // C++20 - size_type count(const key_type& k) const; - template - size_type count(const K& k) const; // C++20 - bool contains(const key_type& k) const; // C++20 - template - bool contains(const K& k) const; // C++20 - pair equal_range(const key_type& k); - pair equal_range(const key_type& k) const; - template - pair equal_range(const K& k); // C++20 - template - pair equal_range(const K& k) const; // C++20 - - mapped_type& operator[](const key_type& k); - mapped_type& operator[](key_type&& k); - - mapped_type& at(const key_type& k); - const mapped_type& at(const key_type& k) const; - - size_type bucket_count() const noexcept; - size_type max_bucket_count() const noexcept; - - size_type bucket_size(size_type n) const; - size_type bucket(const key_type& k) const; - - local_iterator begin(size_type n); - local_iterator end(size_type n); - const_local_iterator begin(size_type n) const; - const_local_iterator end(size_type n) const; - const_local_iterator cbegin(size_type n) const; - const_local_iterator cend(size_type n) const; - - float load_factor() const noexcept; - float max_load_factor() const noexcept; - void max_load_factor(float z); - void rehash(size_type n); - void reserve(size_type n); -}; - -template>, class Pred = equal_to>, - class Allocator = allocator>> -unordered_map(InputIterator, InputIterator, typename see below::size_type = see below, - Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_map, iter_value_t, Hash, Pred, - Allocator>; // C++17 - -template, - class Pred = equal_to, class Allocator = allocator>> -unordered_map(initializer_list>, typename see below::size_type = see below, - Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_map; // C++17 - -template -unordered_map(InputIterator, InputIterator, typename see below::size_type, Allocator) - -> unordered_map, iter_val_t, - hash>, equal_to>, Allocator>; // C++17 - -template -unordered_map(InputIterator, InputIterator, Allocator) - -> unordered_map, iter_val_t, - hash>, equal_to>, Allocator>; // C++17 - -template -unordered_map(InputIterator, InputIterator, typename see below::size_type, Hash, Allocator) - -> unordered_map, iter_val_t, Hash, - equal_to>, Allocator>; // C++17 - -template -unordered_map(initializer_list>, typename see below::size_type, Allocator) - -> unordered_map, equal_to, Allocator>; // C++17 - -template -unordered_map(initializer_list>, Allocator) - -> unordered_map, equal_to, Allocator>; // C++17 - -template -unordered_map(initializer_list>, typename see below::size_type, Hash, Allocator) - -> unordered_map, Allocator>; // C++17 - -template - void swap(unordered_map& x, - unordered_map& y) - noexcept(noexcept(x.swap(y))); - -template - bool - operator==(const unordered_map& x, - const unordered_map& y); - -template - bool - operator!=(const unordered_map& x, - const unordered_map& y); - -template , class Pred = equal_to, - class Alloc = allocator>> -class unordered_multimap -{ -public: - // types - typedef Key key_type; - typedef T mapped_type; - typedef Hash hasher; - typedef Pred key_equal; - typedef Alloc allocator_type; - typedef pair value_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename allocator_traits::pointer pointer; - typedef typename allocator_traits::const_pointer const_pointer; - typedef typename allocator_traits::size_type size_type; - typedef typename allocator_traits::difference_type difference_type; - - typedef /unspecified/ iterator; - typedef /unspecified/ const_iterator; - typedef /unspecified/ local_iterator; - typedef /unspecified/ const_local_iterator; - - typedef unspecified node_type; // C++17 - - unordered_multimap() - noexcept( - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value); - explicit unordered_multimap(size_type n, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - template - unordered_multimap(InputIterator f, InputIterator l, - size_type n = 0, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - explicit unordered_multimap(const allocator_type&); - unordered_multimap(const unordered_multimap&); - unordered_multimap(const unordered_multimap&, const Allocator&); - unordered_multimap(unordered_multimap&&) - noexcept( - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value); - unordered_multimap(unordered_multimap&&, const Allocator&); - unordered_multimap(initializer_list, size_type n = 0, - const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - unordered_multimap(size_type n, const allocator_type& a) - : unordered_multimap(n, hasher(), key_equal(), a) {} // C++14 - unordered_multimap(size_type n, const hasher& hf, const allocator_type& a) - : unordered_multimap(n, hf, key_equal(), a) {} // C++14 - template - unordered_multimap(InputIterator f, InputIterator l, size_type n, const allocator_type& a) - : unordered_multimap(f, l, n, hasher(), key_equal(), a) {} // C++14 - template - unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf, - const allocator_type& a) - : unordered_multimap(f, l, n, hf, key_equal(), a) {} // C++14 - unordered_multimap(initializer_list il, size_type n, const allocator_type& a) - : unordered_multimap(il, n, hasher(), key_equal(), a) {} // C++14 - unordered_multimap(initializer_list il, size_type n, const hasher& hf, - const allocator_type& a) - : unordered_multimap(il, n, hf, key_equal(), a) {} // C++14 - ~unordered_multimap(); - unordered_multimap& operator=(const unordered_multimap&); - unordered_multimap& operator=(unordered_multimap&&) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); - unordered_multimap& operator=(initializer_list); - - allocator_type get_allocator() const noexcept; - - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - iterator begin() noexcept; - iterator end() noexcept; - const_iterator begin() const noexcept; - const_iterator end() const noexcept; - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - - template - iterator emplace(Args&&... args); - template - iterator emplace_hint(const_iterator position, Args&&... args); - iterator insert(const value_type& obj); - template - iterator insert(P&& obj); - iterator insert(const_iterator hint, const value_type& obj); - template - iterator insert(const_iterator hint, P&& obj); - template - void insert(InputIterator first, InputIterator last); - void insert(initializer_list); - - node_type extract(const_iterator position); // C++17 - node_type extract(const key_type& x); // C++17 - iterator insert(node_type&& nh); // C++17 - iterator insert(const_iterator hint, node_type&& nh); // C++17 - - iterator erase(const_iterator position); - iterator erase(iterator position); // C++14 - size_type erase(const key_type& k); - iterator erase(const_iterator first, const_iterator last); - void clear() noexcept; - - template - void merge(unordered_multimap& source); // C++17 - template - void merge(unordered_multimap&& source); // C++17 - template - void merge(unordered_map& source); // C++17 - template - void merge(unordered_map&& source); // C++17 - - void swap(unordered_multimap&) - noexcept( - (!allocator_type::propagate_on_container_swap::value || - __is_nothrow_swappable::value) && - __is_nothrow_swappable::value && - __is_nothrow_swappable::value); - - hasher hash_function() const; - key_equal key_eq() const; - - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - template - iterator find(const K& x); // C++20 - template - const_iterator find(const K& x) const; // C++20 - size_type count(const key_type& k) const; - template - size_type count(const K& k) const; // C++20 - bool contains(const key_type& k) const; // C++20 - template - bool contains(const K& k) const; // C++20 - pair equal_range(const key_type& k); - pair equal_range(const key_type& k) const; - template - pair equal_range(const K& k); // C++20 - template - pair equal_range(const K& k) const; // C++20 - - size_type bucket_count() const noexcept; - size_type max_bucket_count() const noexcept; - - size_type bucket_size(size_type n) const; - size_type bucket(const key_type& k) const; - - local_iterator begin(size_type n); - local_iterator end(size_type n); - const_local_iterator begin(size_type n) const; - const_local_iterator end(size_type n) const; - const_local_iterator cbegin(size_type n) const; - const_local_iterator cend(size_type n) const; - - float load_factor() const noexcept; - float max_load_factor() const noexcept; - void max_load_factor(float z); - void rehash(size_type n); - void reserve(size_type n); -}; - -template>, class Pred = equal_to>, - class Allocator = allocator>> -unordered_multimap(InputIterator, InputIterator, typename see below::size_type = see below, - Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_multimap, iter_value_t, Hash, Pred, - Allocator>; // C++17 - -template, - class Pred = equal_to, class Allocator = allocator>> -unordered_multimap(initializer_list>, typename see below::size_type = see below, - Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_multimap; // C++17 - -template -unordered_multimap(InputIterator, InputIterator, typename see below::size_type, Allocator) - -> unordered_multimap, iter_val_t, - hash>, equal_to>, Allocator>; // C++17 - -template -unordered_multimap(InputIterator, InputIterator, Allocator) - -> unordered_multimap, iter_val_t, - hash>, equal_to>, Allocator>; // C++17 - -template -unordered_multimap(InputIterator, InputIterator, typename see below::size_type, Hash, Allocator) - -> unordered_multimap, iter_val_t, Hash, - equal_to>, Allocator>; // C++17 - -template -unordered_multimap(initializer_list>, typename see below::size_type, Allocator) - -> unordered_multimap, equal_to, Allocator>; // C++17 - -template -unordered_multimap(initializer_list>, Allocator) - -> unordered_multimap, equal_to, Allocator>; // C++17 - -template -unordered_multimap(initializer_list>, typename see below::size_type, Hash, - Allocator) - -> unordered_multimap, Allocator>; // C++17 - -template - void swap(unordered_multimap& x, - unordered_multimap& y) - noexcept(noexcept(x.swap(y))); - -template - typename unordered_map::size_type - erase_if(unordered_map& c, Predicate pred); // C++20 - -template - typename unordered_multimap::size_type - erase_if(unordered_multimap& c, Predicate pred); // C++20 - -template - bool - operator==(const unordered_multimap& x, - const unordered_multimap& y); - -template - bool - operator!=(const unordered_multimap& x, - const unordered_multimap& y); - -} // std - -*/ - #include <__algorithm/is_permutation.h> #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -10,455 +10,6 @@ #ifndef _LIBCPP_UNORDERED_SET #define _LIBCPP_UNORDERED_SET -/* - - unordered_set synopsis - -#include - -namespace std -{ - -template , class Pred = equal_to, - class Alloc = allocator> -class unordered_set -{ -public: - // types - typedef Value key_type; - typedef key_type value_type; - typedef Hash hasher; - typedef Pred key_equal; - typedef Alloc allocator_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename allocator_traits::pointer pointer; - typedef typename allocator_traits::const_pointer const_pointer; - typedef typename allocator_traits::size_type size_type; - typedef typename allocator_traits::difference_type difference_type; - - typedef /unspecified/ iterator; - typedef /unspecified/ const_iterator; - typedef /unspecified/ local_iterator; - typedef /unspecified/ const_local_iterator; - - typedef unspecified node_type unspecified; // C++17 - typedef INSERT_RETURN_TYPE insert_return_type; // C++17 - - unordered_set() - noexcept( - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value); - explicit unordered_set(size_type n, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - template - unordered_set(InputIterator f, InputIterator l, - size_type n = 0, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - explicit unordered_set(const allocator_type&); - unordered_set(const unordered_set&); - unordered_set(const unordered_set&, const Allocator&); - unordered_set(unordered_set&&) - noexcept( - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value); - unordered_set(unordered_set&&, const Allocator&); - unordered_set(initializer_list, size_type n = 0, - const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - unordered_set(size_type n, const allocator_type& a); // C++14 - unordered_set(size_type n, const hasher& hf, const allocator_type& a); // C++14 - template - unordered_set(InputIterator f, InputIterator l, size_type n, const allocator_type& a); // C++14 - template - unordered_set(InputIterator f, InputIterator l, size_type n, - const hasher& hf, const allocator_type& a); // C++14 - unordered_set(initializer_list il, size_type n, const allocator_type& a); // C++14 - unordered_set(initializer_list il, size_type n, - const hasher& hf, const allocator_type& a); // C++14 - ~unordered_set(); - unordered_set& operator=(const unordered_set&); - unordered_set& operator=(unordered_set&&) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); - unordered_set& operator=(initializer_list); - - allocator_type get_allocator() const noexcept; - - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - iterator begin() noexcept; - iterator end() noexcept; - const_iterator begin() const noexcept; - const_iterator end() const noexcept; - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - - template - pair emplace(Args&&... args); - template - iterator emplace_hint(const_iterator position, Args&&... args); - pair insert(const value_type& obj); - pair insert(value_type&& obj); - iterator insert(const_iterator hint, const value_type& obj); - iterator insert(const_iterator hint, value_type&& obj); - template - void insert(InputIterator first, InputIterator last); - void insert(initializer_list); - - node_type extract(const_iterator position); // C++17 - node_type extract(const key_type& x); // C++17 - insert_return_type insert(node_type&& nh); // C++17 - iterator insert(const_iterator hint, node_type&& nh); // C++17 - - iterator erase(const_iterator position); - iterator erase(iterator position); // C++14 - size_type erase(const key_type& k); - iterator erase(const_iterator first, const_iterator last); - void clear() noexcept; - - template - void merge(unordered_set& source); // C++17 - template - void merge(unordered_set&& source); // C++17 - template - void merge(unordered_multiset& source); // C++17 - template - void merge(unordered_multiset&& source); // C++17 - - void swap(unordered_set&) - noexcept(allocator_traits::is_always_equal::value && - noexcept(swap(declval(), declval())) && - noexcept(swap(declval(), declval()))); // C++17 - - hasher hash_function() const; - key_equal key_eq() const; - - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - template - iterator find(const K& x); // C++20 - template - const_iterator find(const K& x) const; // C++20 - size_type count(const key_type& k) const; - template - size_type count(const K& k) const; // C++20 - bool contains(const key_type& k) const; // C++20 - template - bool contains(const K& k) const; // C++20 - pair equal_range(const key_type& k); - pair equal_range(const key_type& k) const; - template - pair equal_range(const K& k); // C++20 - template - pair equal_range(const K& k) const; // C++20 - - size_type bucket_count() const noexcept; - size_type max_bucket_count() const noexcept; - - size_type bucket_size(size_type n) const; - size_type bucket(const key_type& k) const; - - local_iterator begin(size_type n); - local_iterator end(size_type n); - const_local_iterator begin(size_type n) const; - const_local_iterator end(size_type n) const; - const_local_iterator cbegin(size_type n) const; - const_local_iterator cend(size_type n) const; - - float load_factor() const noexcept; - float max_load_factor() const noexcept; - void max_load_factor(float z); - void rehash(size_type n); - void reserve(size_type n); -}; - -template::value_type>, - class Pred = equal_to::value_type>, - class Allocator = allocator::value_type>> -unordered_set(InputIterator, InputIterator, typename see below::size_type = see below, - Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_set::value_type, - Hash, Pred, Allocator>; // C++17 - -template, - class Pred = equal_to, class Allocator = allocator> -unordered_set(initializer_list, typename see below::size_type = see below, - Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_set; // C++17 - -template -unordered_set(InputIterator, InputIterator, typename see below::size_type, Allocator) - -> unordered_set::value_type, - hash::value_type>, - equal_to::value_type>, - Allocator>; // C++17 - -template -unordered_set(InputIterator, InputIterator, typename see below::size_type, - Hash, Allocator) - -> unordered_set::value_type, Hash, - equal_to::value_type>, - Allocator>; // C++17 - -template -unordered_set(initializer_list, typename see below::size_type, Allocator) - -> unordered_set, equal_to, Allocator>; // C++17 - -template -unordered_set(initializer_list, typename see below::size_type, Hash, Allocator) - -> unordered_set, Allocator>; // C++17 - -template - void swap(unordered_set& x, - unordered_set& y) - noexcept(noexcept(x.swap(y))); - -template - bool - operator==(const unordered_set& x, - const unordered_set& y); - -template - bool - operator!=(const unordered_set& x, - const unordered_set& y); - -template , class Pred = equal_to, - class Alloc = allocator> -class unordered_multiset -{ -public: - // types - typedef Value key_type; - typedef key_type value_type; - typedef Hash hasher; - typedef Pred key_equal; - typedef Alloc allocator_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename allocator_traits::pointer pointer; - typedef typename allocator_traits::const_pointer const_pointer; - typedef typename allocator_traits::size_type size_type; - typedef typename allocator_traits::difference_type difference_type; - - typedef /unspecified/ iterator; - typedef /unspecified/ const_iterator; - typedef /unspecified/ local_iterator; - typedef /unspecified/ const_local_iterator; - - typedef unspecified node_type unspecified; // C++17 - - unordered_multiset() - noexcept( - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value && - is_nothrow_default_constructible::value); - explicit unordered_multiset(size_type n, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - template - unordered_multiset(InputIterator f, InputIterator l, - size_type n = 0, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - explicit unordered_multiset(const allocator_type&); - unordered_multiset(const unordered_multiset&); - unordered_multiset(const unordered_multiset&, const Allocator&); - unordered_multiset(unordered_multiset&&) - noexcept( - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value); - unordered_multiset(unordered_multiset&&, const Allocator&); - unordered_multiset(initializer_list, size_type n = /see below/, - const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - unordered_multiset(size_type n, const allocator_type& a); // C++14 - unordered_multiset(size_type n, const hasher& hf, const allocator_type& a); // C++14 - template - unordered_multiset(InputIterator f, InputIterator l, size_type n, const allocator_type& a); // C++14 - template - unordered_multiset(InputIterator f, InputIterator l, size_type n, - const hasher& hf, const allocator_type& a); // C++14 - unordered_multiset(initializer_list il, size_type n, const allocator_type& a); // C++14 - unordered_multiset(initializer_list il, size_type n, - const hasher& hf, const allocator_type& a); // C++14 - ~unordered_multiset(); - unordered_multiset& operator=(const unordered_multiset&); - unordered_multiset& operator=(unordered_multiset&&) - noexcept( - allocator_type::propagate_on_container_move_assignment::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); - unordered_multiset& operator=(initializer_list); - - allocator_type get_allocator() const noexcept; - - bool empty() const noexcept; - size_type size() const noexcept; - size_type max_size() const noexcept; - - iterator begin() noexcept; - iterator end() noexcept; - const_iterator begin() const noexcept; - const_iterator end() const noexcept; - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - - template - iterator emplace(Args&&... args); - template - iterator emplace_hint(const_iterator position, Args&&... args); - iterator insert(const value_type& obj); - iterator insert(value_type&& obj); - iterator insert(const_iterator hint, const value_type& obj); - iterator insert(const_iterator hint, value_type&& obj); - template - void insert(InputIterator first, InputIterator last); - void insert(initializer_list); - - node_type extract(const_iterator position); // C++17 - node_type extract(const key_type& x); // C++17 - iterator insert(node_type&& nh); // C++17 - iterator insert(const_iterator hint, node_type&& nh); // C++17 - - iterator erase(const_iterator position); - iterator erase(iterator position); // C++14 - size_type erase(const key_type& k); - iterator erase(const_iterator first, const_iterator last); - void clear() noexcept; - - template - void merge(unordered_multiset& source); // C++17 - template - void merge(unordered_multiset&& source); // C++17 - template - void merge(unordered_set& source); // C++17 - template - void merge(unordered_set&& source); // C++17 - - void swap(unordered_multiset&) - noexcept(allocator_traits::is_always_equal::value && - noexcept(swap(declval(), declval())) && - noexcept(swap(declval(), declval()))); // C++17 - - hasher hash_function() const; - key_equal key_eq() const; - - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - template - iterator find(const K& x); // C++20 - template - const_iterator find(const K& x) const; // C++20 - size_type count(const key_type& k) const; - template - size_type count(const K& k) const; // C++20 - bool contains(const key_type& k) const; // C++20 - template - bool contains(const K& k) const; // C++20 - pair equal_range(const key_type& k); - pair equal_range(const key_type& k) const; - template - pair equal_range(const K& k); // C++20 - template - pair equal_range(const K& k) const; // C++20 - - size_type bucket_count() const noexcept; - size_type max_bucket_count() const noexcept; - - size_type bucket_size(size_type n) const; - size_type bucket(const key_type& k) const; - - local_iterator begin(size_type n); - local_iterator end(size_type n); - const_local_iterator begin(size_type n) const; - const_local_iterator end(size_type n) const; - const_local_iterator cbegin(size_type n) const; - const_local_iterator cend(size_type n) const; - - float load_factor() const noexcept; - float max_load_factor() const noexcept; - void max_load_factor(float z); - void rehash(size_type n); - void reserve(size_type n); -}; - -template::value_type>, - class Pred = equal_to::value_type>, - class Allocator = allocator::value_type>> -unordered_multiset(InputIterator, InputIterator, see below::size_type = see below, - Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_multiset::value_type, - Hash, Pred, Allocator>; // C++17 - -template, - class Pred = equal_to, class Allocator = allocator> -unordered_multiset(initializer_list, typename see below::size_type = see below, - Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_multiset; // C++17 - -template -unordered_multiset(InputIterator, InputIterator, typename see below::size_type, Allocator) - -> unordered_multiset::value_type, - hash::value_type>, - equal_to::value_type>, - Allocator>; // C++17 - -template -unordered_multiset(InputIterator, InputIterator, typename see below::size_type, - Hash, Allocator) - -> unordered_multiset::value_type, Hash, - equal_to::value_type>, Allocator>; // C++17 - -template -unordered_multiset(initializer_list, typename see below::size_type, Allocator) - -> unordered_multiset, equal_to, Allocator>; // C++17 - -template -unordered_multiset(initializer_list, typename see below::size_type, Hash, Allocator) - -> unordered_multiset, Allocator>; // C++17 - -template - void swap(unordered_multiset& x, - unordered_multiset& y) - noexcept(noexcept(x.swap(y))); - -template - typename unordered_set::size_type - erase_if(unordered_set& c, Predicate pred); // C++20 - -template - typename unordered_multiset::size_type - erase_if(unordered_multiset& c, Predicate pred); // C++20 - - -template - bool - operator==(const unordered_multiset& x, - const unordered_multiset& y); - -template - bool - operator!=(const unordered_multiset& x, - const unordered_multiset& y); -} // std - -*/ - #include <__algorithm/is_permutation.h> #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/utility b/libcxx/include/utility --- a/libcxx/include/utility +++ b/libcxx/include/utility @@ -10,239 +10,6 @@ #ifndef _LIBCPP_UTILITY #define _LIBCPP_UTILITY -/* - utility synopsis - -#include - -namespace std -{ - -template - void - swap(T& a, T& b); - -namespace rel_ops -{ - template bool operator!=(const T&, const T&); - template bool operator> (const T&, const T&); - template bool operator<=(const T&, const T&); - template bool operator>=(const T&, const T&); -} - -template -void -swap(T& a, T& b) noexcept(is_nothrow_move_constructible::value && - is_nothrow_move_assignable::value); - -template -void -swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b))); - -template T&& forward(typename remove_reference::type& t) noexcept; // constexpr in C++14 -template T&& forward(typename remove_reference::type&& t) noexcept; // constexpr in C++14 - -template -[[nodiscard]] constexpr -auto forward_like(auto&& x) noexcept -> see below; // since C++23 - -template typename remove_reference::type&& move(T&&) noexcept; // constexpr in C++14 - -template - typename conditional - < - !is_nothrow_move_constructible::value && is_copy_constructible::value, - const T&, - T&& - >::type - move_if_noexcept(T& x) noexcept; // constexpr in C++14 - -template constexpr add_const_t& as_const(T& t) noexcept; // C++17 -template void as_const(const T&&) = delete; // C++17 - -template typename add_rvalue_reference::type declval() noexcept; - -template constexpr bool cmp_equal(T t, U u) noexcept; // C++20 -template constexpr bool cmp_not_equal(T t, U u) noexcept; // C++20 -template constexpr bool cmp_less(T t, U u) noexcept; // C++20 -template constexpr bool cmp_greater(T t, U u) noexcept; // C++20 -template constexpr bool cmp_less_equal(T t, U u) noexcept; // C++20 -template constexpr bool cmp_greater_equal(T t, U u) noexcept; // C++20 -template constexpr bool in_range(T t) noexcept; // C++20 - -template -struct pair -{ - typedef T1 first_type; - typedef T2 second_type; - - T1 first; - T2 second; - - pair(const pair&) = default; - pair(pair&&) = default; - explicit(see-below) constexpr pair(); - explicit(see-below) pair(const T1& x, const T2& y); // constexpr in C++14 - template explicit(see-below) pair(U&&, V&&); // constexpr in C++14 - template constexpr explicit(see below) pair(pair&); // since C++23 - template explicit(see-below) pair(const pair& p); // constexpr in C++14 - template explicit(see-below) pair(pair&& p); // constexpr in C++14 - template - constexpr explicit(see below) pair(const pair&&); // since C++23 - template - pair(piecewise_construct_t, tuple first_args, - tuple second_args); // constexpr in C++20 - - constexpr const pair& operator=(const pair& p) const; // since C++23 - template pair& operator=(const pair& p); // constexpr in C++20 - template - constexpr const pair& operator=(const pair& p) const; // since C++23 - pair& operator=(pair&& p) noexcept(is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); // constexpr in C++20 - constexpr const pair& operator=(pair&& p) const; // since C++23 - template pair& operator=(pair&& p); // constexpr in C++20 - template - constexpr const pair& operator=(pair&& p) const; // since C++23 - - void swap(pair& p) noexcept(is_nothrow_swappable_v && - is_nothrow_swappable_v); // constexpr in C++20 - constexpr void swap(const pair& p) const noexcept(see below); // since C++23 -}; - -template class TQual, template class UQual> -struct basic_common_reference, pair, TQual, UQual>; // since C++23 - -template -struct common_type, pair>; // since C++23 - -template pair(T1, T2) -> pair; - -template -bool operator==(const pair&, const pair&); // constexpr in C++14 -template -bool operator!=(const pair&, const pair&); // constexpr in C++14, removed in C++20 -template -bool operator< (const pair&, const pair&); // constexpr in C++14, removed in C++20 -template -bool operator> (const pair&, const pair&); // constexpr in C++14, removed in C++20 -template -bool operator>=(const pair&, const pair&); // constexpr in C++14, removed in C++20 -template -bool operator<=(const pair&, const pair&); // constexpr in C++14, removed in C++20 -template - constexpr common_comparison_type_t, - synth-three-way-result> - operator<=>(const pair&, const pair&); // C++20 - -template pair make_pair(T1&&, T2&&); // constexpr in C++14 -template -void -swap(pair& x, pair& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20 - -template // since C++23 -constexpr void swap(const pair& x, const pair& y) noexcept(noexcept(x.swap(y))); - -struct piecewise_construct_t { explicit piecewise_construct_t() = default; }; -inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); - -template struct tuple_size; -template struct tuple_element; - -template struct tuple_size >; -template struct tuple_element<0, pair >; -template struct tuple_element<1, pair >; - -template - typename tuple_element >::type& - get(pair&) noexcept; // constexpr in C++14 - -template - const typename tuple_element >::type& - get(const pair&) noexcept; // constexpr in C++14 - -template - typename tuple_element >::type&& - get(pair&&) noexcept; // constexpr in C++14 - -template - const typename tuple_element >::type&& - get(const pair&&) noexcept; // constexpr in C++14 - -template - constexpr T1& get(pair&) noexcept; // C++14 - -template - constexpr const T1& get(const pair&) noexcept; // C++14 - -template - constexpr T1&& get(pair&&) noexcept; // C++14 - -template - constexpr const T1&& get(const pair&&) noexcept; // C++14 - -template - constexpr T1& get(pair&) noexcept; // C++14 - -template - constexpr const T1& get(const pair&) noexcept; // C++14 - -template - constexpr T1&& get(pair&&) noexcept; // C++14 - -template - constexpr const T1&& get(const pair&&) noexcept; // C++14 - -// C++14 - -template -struct integer_sequence -{ - typedef T value_type; - - static constexpr size_t size() noexcept; -}; - -template - using index_sequence = integer_sequence; - -template - using make_integer_sequence = integer_sequence; -template - using make_index_sequence = make_integer_sequence; - -template - using index_sequence_for = make_index_sequence; - -template - constexpr T exchange(T& obj, U&& new_value) // constexpr in C++17, noexcept in C++23 - noexcept(is_nothrow_move_constructible::value && is_nothrow_assignable::value); - -// 20.2.7, in-place construction // C++17 -struct in_place_t { - explicit in_place_t() = default; -}; -inline constexpr in_place_t in_place{}; -template - struct in_place_type_t { - explicit in_place_type_t() = default; - }; -template - inline constexpr in_place_type_t in_place_type{}; -template - struct in_place_index_t { - explicit in_place_index_t() = default; - }; -template - inline constexpr in_place_index_t in_place_index{}; - -// [utility.underlying], to_underlying -template - constexpr underlying_type_t to_underlying( T value ) noexcept; // C++2b - -} // std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__utility/as_const.h> diff --git a/libcxx/include/valarray b/libcxx/include/valarray --- a/libcxx/include/valarray +++ b/libcxx/include/valarray @@ -10,337 +10,6 @@ #ifndef _LIBCPP_VALARRAY #define _LIBCPP_VALARRAY -/* - valarray synopsis - -namespace std -{ - -template -class valarray -{ -public: - typedef T value_type; - - // construct/destroy: - valarray(); - explicit valarray(size_t n); - valarray(const value_type& x, size_t n); - valarray(const value_type* px, size_t n); - valarray(const valarray& v); - valarray(valarray&& v) noexcept; - valarray(const slice_array& sa); - valarray(const gslice_array& ga); - valarray(const mask_array& ma); - valarray(const indirect_array& ia); - valarray(initializer_list il); - ~valarray(); - - // assignment: - valarray& operator=(const valarray& v); - valarray& operator=(valarray&& v) noexcept; - valarray& operator=(initializer_list il); - valarray& operator=(const value_type& x); - valarray& operator=(const slice_array& sa); - valarray& operator=(const gslice_array& ga); - valarray& operator=(const mask_array& ma); - valarray& operator=(const indirect_array& ia); - - // element access: - const value_type& operator[](size_t i) const; - value_type& operator[](size_t i); - - // subset operations: - valarray operator[](slice s) const; - slice_array operator[](slice s); - valarray operator[](const gslice& gs) const; - gslice_array operator[](const gslice& gs); - valarray operator[](const valarray& vb) const; - mask_array operator[](const valarray& vb); - valarray operator[](const valarray& vs) const; - indirect_array operator[](const valarray& vs); - - // unary operators: - valarray operator+() const; - valarray operator-() const; - valarray operator~() const; - valarray operator!() const; - - // computed assignment: - valarray& operator*= (const value_type& x); - valarray& operator/= (const value_type& x); - valarray& operator%= (const value_type& x); - valarray& operator+= (const value_type& x); - valarray& operator-= (const value_type& x); - valarray& operator^= (const value_type& x); - valarray& operator&= (const value_type& x); - valarray& operator|= (const value_type& x); - valarray& operator<<=(const value_type& x); - valarray& operator>>=(const value_type& x); - - valarray& operator*= (const valarray& v); - valarray& operator/= (const valarray& v); - valarray& operator%= (const valarray& v); - valarray& operator+= (const valarray& v); - valarray& operator-= (const valarray& v); - valarray& operator^= (const valarray& v); - valarray& operator|= (const valarray& v); - valarray& operator&= (const valarray& v); - valarray& operator<<=(const valarray& v); - valarray& operator>>=(const valarray& v); - - // member functions: - void swap(valarray& v) noexcept; - - size_t size() const; - - value_type sum() const; - value_type min() const; - value_type max() const; - - valarray shift (int i) const; - valarray cshift(int i) const; - valarray apply(value_type f(value_type)) const; - valarray apply(value_type f(const value_type&)) const; - void resize(size_t n, value_type x = value_type()); -}; - -template valarray(const T(&)[cnt], size_t) -> valarray; - -class slice -{ -public: - slice(); - slice(size_t start, size_t size, size_t stride); - - size_t start() const; - size_t size() const; - size_t stride() const; -}; - -template -class slice_array -{ -public: - typedef T value_type; - - const slice_array& operator=(const slice_array& sa) const; - void operator= (const valarray& v) const; - void operator*= (const valarray& v) const; - void operator/= (const valarray& v) const; - void operator%= (const valarray& v) const; - void operator+= (const valarray& v) const; - void operator-= (const valarray& v) const; - void operator^= (const valarray& v) const; - void operator&= (const valarray& v) const; - void operator|= (const valarray& v) const; - void operator<<=(const valarray& v) const; - void operator>>=(const valarray& v) const; - - void operator=(const value_type& x) const; - void operator=(const valarray& val_arr) const; - - slice_array() = delete; -}; - -class gslice -{ -public: - gslice(); - gslice(size_t start, const valarray& size, - const valarray& stride); - - size_t start() const; - valarray size() const; - valarray stride() const; -}; - -template -class gslice_array -{ -public: - typedef T value_type; - - void operator= (const valarray& v) const; - void operator*= (const valarray& v) const; - void operator/= (const valarray& v) const; - void operator%= (const valarray& v) const; - void operator+= (const valarray& v) const; - void operator-= (const valarray& v) const; - void operator^= (const valarray& v) const; - void operator&= (const valarray& v) const; - void operator|= (const valarray& v) const; - void operator<<=(const valarray& v) const; - void operator>>=(const valarray& v) const; - - gslice_array(const gslice_array& ga); - ~gslice_array(); - const gslice_array& operator=(const gslice_array& ga) const; - void operator=(const value_type& x) const; - - gslice_array() = delete; -}; - -template -class mask_array -{ -public: - typedef T value_type; - - void operator= (const valarray& v) const; - void operator*= (const valarray& v) const; - void operator/= (const valarray& v) const; - void operator%= (const valarray& v) const; - void operator+= (const valarray& v) const; - void operator-= (const valarray& v) const; - void operator^= (const valarray& v) const; - void operator&= (const valarray& v) const; - void operator|= (const valarray& v) const; - void operator<<=(const valarray& v) const; - void operator>>=(const valarray& v) const; - - mask_array(const mask_array& ma); - ~mask_array(); - const mask_array& operator=(const mask_array& ma) const; - void operator=(const value_type& x) const; - - mask_array() = delete; -}; - -template -class indirect_array -{ -public: - typedef T value_type; - - void operator= (const valarray& v) const; - void operator*= (const valarray& v) const; - void operator/= (const valarray& v) const; - void operator%= (const valarray& v) const; - void operator+= (const valarray& v) const; - void operator-= (const valarray& v) const; - void operator^= (const valarray& v) const; - void operator&= (const valarray& v) const; - void operator|= (const valarray& v) const; - void operator<<=(const valarray& v) const; - void operator>>=(const valarray& v) const; - - indirect_array(const indirect_array& ia); - ~indirect_array(); - const indirect_array& operator=(const indirect_array& ia) const; - void operator=(const value_type& x) const; - - indirect_array() = delete; -}; - -template void swap(valarray& x, valarray& y) noexcept; - -template valarray operator* (const valarray& x, const valarray& y); -template valarray operator* (const valarray& x, const T& y); -template valarray operator* (const T& x, const valarray& y); - -template valarray operator/ (const valarray& x, const valarray& y); -template valarray operator/ (const valarray& x, const T& y); -template valarray operator/ (const T& x, const valarray& y); - -template valarray operator% (const valarray& x, const valarray& y); -template valarray operator% (const valarray& x, const T& y); -template valarray operator% (const T& x, const valarray& y); - -template valarray operator+ (const valarray& x, const valarray& y); -template valarray operator+ (const valarray& x, const T& y); -template valarray operator+ (const T& x, const valarray& y); - -template valarray operator- (const valarray& x, const valarray& y); -template valarray operator- (const valarray& x, const T& y); -template valarray operator- (const T& x, const valarray& y); - -template valarray operator^ (const valarray& x, const valarray& y); -template valarray operator^ (const valarray& x, const T& y); -template valarray operator^ (const T& x, const valarray& y); - -template valarray operator& (const valarray& x, const valarray& y); -template valarray operator& (const valarray& x, const T& y); -template valarray operator& (const T& x, const valarray& y); - -template valarray operator| (const valarray& x, const valarray& y); -template valarray operator| (const valarray& x, const T& y); -template valarray operator| (const T& x, const valarray& y); - -template valarray operator<<(const valarray& x, const valarray& y); -template valarray operator<<(const valarray& x, const T& y); -template valarray operator<<(const T& x, const valarray& y); - -template valarray operator>>(const valarray& x, const valarray& y); -template valarray operator>>(const valarray& x, const T& y); -template valarray operator>>(const T& x, const valarray& y); - -template valarray operator&&(const valarray& x, const valarray& y); -template valarray operator&&(const valarray& x, const T& y); -template valarray operator&&(const T& x, const valarray& y); - -template valarray operator||(const valarray& x, const valarray& y); -template valarray operator||(const valarray& x, const T& y); -template valarray operator||(const T& x, const valarray& y); - -template valarray operator==(const valarray& x, const valarray& y); -template valarray operator==(const valarray& x, const T& y); -template valarray operator==(const T& x, const valarray& y); - -template valarray operator!=(const valarray& x, const valarray& y); -template valarray operator!=(const valarray& x, const T& y); -template valarray operator!=(const T& x, const valarray& y); - -template valarray operator< (const valarray& x, const valarray& y); -template valarray operator< (const valarray& x, const T& y); -template valarray operator< (const T& x, const valarray& y); - -template valarray operator> (const valarray& x, const valarray& y); -template valarray operator> (const valarray& x, const T& y); -template valarray operator> (const T& x, const valarray& y); - -template valarray operator<=(const valarray& x, const valarray& y); -template valarray operator<=(const valarray& x, const T& y); -template valarray operator<=(const T& x, const valarray& y); - -template valarray operator>=(const valarray& x, const valarray& y); -template valarray operator>=(const valarray& x, const T& y); -template valarray operator>=(const T& x, const valarray& y); - -template valarray abs (const valarray& x); -template valarray acos (const valarray& x); -template valarray asin (const valarray& x); -template valarray atan (const valarray& x); - -template valarray atan2(const valarray& x, const valarray& y); -template valarray atan2(const valarray& x, const T& y); -template valarray atan2(const T& x, const valarray& y); - -template valarray cos (const valarray& x); -template valarray cosh (const valarray& x); -template valarray exp (const valarray& x); -template valarray log (const valarray& x); -template valarray log10(const valarray& x); - -template valarray pow(const valarray& x, const valarray& y); -template valarray pow(const valarray& x, const T& y); -template valarray pow(const T& x, const valarray& y); - -template valarray sin (const valarray& x); -template valarray sinh (const valarray& x); -template valarray sqrt (const valarray& x); -template valarray tan (const valarray& x); -template valarray tanh (const valarray& x); - -template unspecified1 begin(valarray& v); -template unspecified2 begin(const valarray& v); -template unspecified1 end(valarray& v); -template unspecified2 end(const valarray& v); - -} // std - -*/ - #include <__algorithm/copy.h> #include <__algorithm/count.h> #include <__algorithm/fill.h> diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -10,200 +10,6 @@ #ifndef _LIBCPP_VARIANT #define _LIBCPP_VARIANT -/* - variant synopsis - -namespace std { - - // 20.7.2, class template variant - template - class variant { - public: - - // 20.7.2.1, constructors - constexpr variant() noexcept(see below); - constexpr variant(const variant&); - constexpr variant(variant&&) noexcept(see below); - - template constexpr variant(T&&) noexcept(see below); - - template - constexpr explicit variant(in_place_type_t, Args&&...); - - template - constexpr explicit variant( - in_place_type_t, initializer_list, Args&&...); - - template - constexpr explicit variant(in_place_index_t, Args&&...); - - template - constexpr explicit variant( - in_place_index_t, initializer_list, Args&&...); - - // 20.7.2.2, destructor - ~variant(); - - // 20.7.2.3, assignment - constexpr variant& operator=(const variant&); - constexpr variant& operator=(variant&&) noexcept(see below); - - template variant& operator=(T&&) noexcept(see below); - - // 20.7.2.4, modifiers - template - T& emplace(Args&&...); - - template - T& emplace(initializer_list, Args&&...); - - template - variant_alternative_t& emplace(Args&&...); - - template - variant_alternative_t& emplace(initializer_list, Args&&...); - - // 20.7.2.5, value status - constexpr bool valueless_by_exception() const noexcept; - constexpr size_t index() const noexcept; - - // 20.7.2.6, swap - void swap(variant&) noexcept(see below); - }; - - // 20.7.3, variant helper classes - template struct variant_size; // undefined - - template - inline constexpr size_t variant_size_v = variant_size::value; - - template struct variant_size; - template struct variant_size; - template struct variant_size; - - template - struct variant_size>; - - template struct variant_alternative; // undefined - - template - using variant_alternative_t = typename variant_alternative::type; - - template struct variant_alternative; - template struct variant_alternative; - template struct variant_alternative; - - template - struct variant_alternative>; - - inline constexpr size_t variant_npos = -1; - - // 20.7.4, value access - template - constexpr bool holds_alternative(const variant&) noexcept; - - template - constexpr variant_alternative_t>& - get(variant&); - - template - constexpr variant_alternative_t>&& - get(variant&&); - - template - constexpr variant_alternative_t> const& - get(const variant&); - - template - constexpr variant_alternative_t> const&& - get(const variant&&); - - template - constexpr T& get(variant&); - - template - constexpr T&& get(variant&&); - - template - constexpr const T& get(const variant&); - - template - constexpr const T&& get(const variant&&); - - template - constexpr add_pointer_t>> - get_if(variant*) noexcept; - - template - constexpr add_pointer_t>> - get_if(const variant*) noexcept; - - template - constexpr add_pointer_t - get_if(variant*) noexcept; - - template - constexpr add_pointer_t - get_if(const variant*) noexcept; - - // 20.7.5, relational operators - template - constexpr bool operator==(const variant&, const variant&); - - template - constexpr bool operator!=(const variant&, const variant&); - - template - constexpr bool operator<(const variant&, const variant&); - - template - constexpr bool operator>(const variant&, const variant&); - - template - constexpr bool operator<=(const variant&, const variant&); - - template - constexpr bool operator>=(const variant&, const variant&); - - template requires (three_way_comparable && ...) - constexpr common_comparison_category_t...> - operator<=>(const variant&, const variant&); // since C++20 - - // 20.7.6, visitation - template - constexpr see below visit(Visitor&&, Variants&&...); - - template - constexpr R visit(Visitor&&, Variants&&...); // since C++20 - - // 20.7.7, class monostate - struct monostate; - - // 20.7.8, monostate relational operators - constexpr bool operator==(monostate, monostate) noexcept; - constexpr bool operator!=(monostate, monostate) noexcept; // until C++20 - constexpr bool operator<(monostate, monostate) noexcept; // until C++20 - constexpr bool operator>(monostate, monostate) noexcept; // until C++20 - constexpr bool operator<=(monostate, monostate) noexcept; // until C++20 - constexpr bool operator>=(monostate, monostate) noexcept; // until C++20 - constexpr strong_ordering operator<=>(monostate, monostate) noexcept; // since C++20 - - // 20.7.9, specialized algorithms - template - void swap(variant&, variant&) noexcept(see below); - - // 20.7.10, class bad_variant_access - class bad_variant_access; - - // 20.7.11, hash support - template struct hash; - template struct hash>; - template <> struct hash; - -} // namespace std - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__availability> #include <__compare/common_comparison_category.h> diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -10,274 +10,6 @@ #ifndef _LIBCPP_VECTOR #define _LIBCPP_VECTOR -/* - vector synopsis - -namespace std -{ - -template > -class vector -{ -public: - typedef T value_type; - typedef Allocator allocator_type; - typedef typename allocator_type::reference reference; - typedef typename allocator_type::const_reference const_reference; - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef typename allocator_type::size_type size_type; - typedef typename allocator_type::difference_type difference_type; - typedef typename allocator_type::pointer pointer; - typedef typename allocator_type::const_pointer const_pointer; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - - vector() - noexcept(is_nothrow_default_constructible::value); - explicit vector(const allocator_type&); - explicit vector(size_type n); - explicit vector(size_type n, const allocator_type&); // C++14 - vector(size_type n, const value_type& value, const allocator_type& = allocator_type()); - template - vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type()); - vector(const vector& x); - vector(vector&& x) - noexcept(is_nothrow_move_constructible::value); - vector(initializer_list il); - vector(initializer_list il, const allocator_type& a); - ~vector(); - vector& operator=(const vector& x); - vector& operator=(vector&& x) - noexcept( - allocator_type::propagate_on_container_move_assignment::value || - allocator_type::is_always_equal::value); // C++17 - vector& operator=(initializer_list il); - template - void assign(InputIterator first, InputIterator last); - void assign(size_type n, const value_type& u); - void assign(initializer_list il); - - allocator_type get_allocator() const noexcept; - - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - - reverse_iterator rbegin() noexcept; - const_reverse_iterator rbegin() const noexcept; - reverse_iterator rend() noexcept; - const_reverse_iterator rend() const noexcept; - - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - size_type size() const noexcept; - size_type max_size() const noexcept; - size_type capacity() const noexcept; - bool empty() const noexcept; - void reserve(size_type n); - void shrink_to_fit() noexcept; - - reference operator[](size_type n); - const_reference operator[](size_type n) const; - reference at(size_type n); - const_reference at(size_type n) const; - - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - - value_type* data() noexcept; - const value_type* data() const noexcept; - - void push_back(const value_type& x); - void push_back(value_type&& x); - template - reference emplace_back(Args&&... args); // reference in C++17 - void pop_back(); - - template iterator emplace(const_iterator position, Args&&... args); - iterator insert(const_iterator position, const value_type& x); - iterator insert(const_iterator position, value_type&& x); - iterator insert(const_iterator position, size_type n, const value_type& x); - template - iterator insert(const_iterator position, InputIterator first, InputIterator last); - iterator insert(const_iterator position, initializer_list il); - - iterator erase(const_iterator position); - iterator erase(const_iterator first, const_iterator last); - - void clear() noexcept; - - void resize(size_type sz); - void resize(size_type sz, const value_type& c); - - void swap(vector&) - noexcept(allocator_traits::propagate_on_container_swap::value || - allocator_traits::is_always_equal::value); // C++17 - - bool __invariants() const; -}; - -template > -class vector -{ -public: - typedef bool value_type; - typedef Allocator allocator_type; - typedef implementation-defined iterator; - typedef implementation-defined const_iterator; - typedef typename allocator_type::size_type size_type; - typedef typename allocator_type::difference_type difference_type; - typedef iterator pointer; - typedef const_iterator const_pointer; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - - class reference - { - public: - reference(const reference&) noexcept; - operator bool() const noexcept; - reference& operator=(bool x) noexcept; - reference& operator=(const reference& x) noexcept; - iterator operator&() const noexcept; - void flip() noexcept; - }; - - class const_reference - { - public: - const_reference(const reference&) noexcept; - operator bool() const noexcept; - const_iterator operator&() const noexcept; - }; - - vector() - noexcept(is_nothrow_default_constructible::value); - explicit vector(const allocator_type&); - explicit vector(size_type n, const allocator_type& a = allocator_type()); // C++14 - vector(size_type n, const value_type& value, const allocator_type& = allocator_type()); - template - vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type()); - vector(const vector& x); - vector(vector&& x) - noexcept(is_nothrow_move_constructible::value); - vector(initializer_list il); - vector(initializer_list il, const allocator_type& a); - ~vector(); - vector& operator=(const vector& x); - vector& operator=(vector&& x) - noexcept( - allocator_type::propagate_on_container_move_assignment::value || - allocator_type::is_always_equal::value); // C++17 - vector& operator=(initializer_list il); - template - void assign(InputIterator first, InputIterator last); - void assign(size_type n, const value_type& u); - void assign(initializer_list il); - - allocator_type get_allocator() const noexcept; - - iterator begin() noexcept; - const_iterator begin() const noexcept; - iterator end() noexcept; - const_iterator end() const noexcept; - - reverse_iterator rbegin() noexcept; - const_reverse_iterator rbegin() const noexcept; - reverse_iterator rend() noexcept; - const_reverse_iterator rend() const noexcept; - - const_iterator cbegin() const noexcept; - const_iterator cend() const noexcept; - const_reverse_iterator crbegin() const noexcept; - const_reverse_iterator crend() const noexcept; - - size_type size() const noexcept; - size_type max_size() const noexcept; - size_type capacity() const noexcept; - bool empty() const noexcept; - void reserve(size_type n); - void shrink_to_fit() noexcept; - - reference operator[](size_type n); - const_reference operator[](size_type n) const; - reference at(size_type n); - const_reference at(size_type n) const; - - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - - void push_back(const value_type& x); - template reference emplace_back(Args&&... args); // C++14; reference in C++17 - void pop_back(); - - template iterator emplace(const_iterator position, Args&&... args); // C++14 - iterator insert(const_iterator position, const value_type& x); - iterator insert(const_iterator position, size_type n, const value_type& x); - template - iterator insert(const_iterator position, InputIterator first, InputIterator last); - iterator insert(const_iterator position, initializer_list il); - - iterator erase(const_iterator position); - iterator erase(const_iterator first, const_iterator last); - - void clear() noexcept; - - void resize(size_type sz); - void resize(size_type sz, value_type x); - - void swap(vector&) - noexcept(allocator_traits::propagate_on_container_swap::value || - allocator_traits::is_always_equal::value); // C++17 - void flip() noexcept; - - bool __invariants() const; -}; - -template ::value_type>> - vector(InputIterator, InputIterator, Allocator = Allocator()) - -> vector::value_type, Allocator>; // C++17 - -template struct hash>; - -template bool operator==(const vector& x, const vector& y); -template bool operator< (const vector& x, const vector& y); -template bool operator!=(const vector& x, const vector& y); -template bool operator> (const vector& x, const vector& y); -template bool operator>=(const vector& x, const vector& y); -template bool operator<=(const vector& x, const vector& y); - -template -void swap(vector& x, vector& y) - noexcept(noexcept(x.swap(y))); - -template -typename vector::size_type -erase(vector& c, const U& value); // C++20 -template -typename vector::size_type -erase_if(vector& c, Predicate pred); // C++20 - - -template - inline constexpr bool is-vector-bool-reference = see below; // exposition only, since C++23 - -template requires is-vector-bool-reference // Since C++23 - struct formatter; - -} // std - -*/ - #include <__algorithm/copy.h> #include <__algorithm/equal.h> #include <__algorithm/fill_n.h> diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -10,197 +10,6 @@ #ifndef _LIBCPP_VERSIONH #define _LIBCPP_VERSIONH -/* - version synopsis - -Macro name Value Headers -__cpp_lib_adaptor_iterator_pair_constructor 202106L -__cpp_lib_addressof_constexpr 201603L -__cpp_lib_allocate_at_least 202106L -__cpp_lib_allocator_traits_is_always_equal 201411L - - - -__cpp_lib_any 201606L -__cpp_lib_apply 201603L -__cpp_lib_array_constexpr 201811L - 201603L // C++17 -__cpp_lib_as_const 201510L -__cpp_lib_associative_heterogeneous_erasure 202110L - -__cpp_lib_assume_aligned 201811L -__cpp_lib_atomic_flag_test 201907L -__cpp_lib_atomic_float 201711L -__cpp_lib_atomic_is_always_lock_free 201603L -__cpp_lib_atomic_lock_free_type_aliases 201907L -__cpp_lib_atomic_ref 201806L -__cpp_lib_atomic_shared_ptr 201711L -__cpp_lib_atomic_value_initialization 201911L -__cpp_lib_atomic_wait 201907L -__cpp_lib_barrier 201907L -__cpp_lib_bind_back 202202L -__cpp_lib_bind_front 201907L -__cpp_lib_bit_cast 201806L -__cpp_lib_bitops 201907L -__cpp_lib_bool_constant 201505L -__cpp_lib_bounded_array_traits 201902L -__cpp_lib_boyer_moore_searcher 201603L -__cpp_lib_byte 201603L -__cpp_lib_byteswap 202110L -__cpp_lib_char8_t 201907L - - -__cpp_lib_chrono 201611L -__cpp_lib_chrono_udls 201304L -__cpp_lib_clamp 201603L -__cpp_lib_complex_udls 201309L -__cpp_lib_concepts 202002L -__cpp_lib_constexpr_algorithms 201806L -__cpp_lib_constexpr_bitset 202207L -__cpp_lib_constexpr_charconv 202207L -__cpp_lib_constexpr_cmath 202202L -__cpp_lib_constexpr_complex 201711L -__cpp_lib_constexpr_dynamic_alloc 201907L -__cpp_lib_constexpr_functional 201907L -__cpp_lib_constexpr_iterator 201811L -__cpp_lib_constexpr_memory 202202L - 201811L // C++20 -__cpp_lib_constexpr_numeric 201911L -__cpp_lib_constexpr_string 201907L -__cpp_lib_constexpr_string_view 201811L -__cpp_lib_constexpr_tuple 201811L -__cpp_lib_constexpr_typeinfo 202106L -__cpp_lib_constexpr_utility 201811L -__cpp_lib_constexpr_vector 201907L -__cpp_lib_coroutine 201902L -__cpp_lib_destroying_delete 201806L -__cpp_lib_enable_shared_from_this 201603L -__cpp_lib_endian 201907L -__cpp_lib_erase_if 202002L - - -__cpp_lib_exchange_function 201304L -__cpp_lib_execution 201902L - 201603L // C++17 -__cpp_lib_expected 202202L -__cpp_lib_filesystem 201703L -__cpp_lib_format 202106L -__cpp_lib_forward_like 202207L -__cpp_lib_gcd_lcm 201606L -__cpp_lib_generic_associative_lookup 201304L -__cpp_lib_generic_unordered_lookup 201811L -__cpp_lib_hardware_interference_size 201703L -__cpp_lib_has_unique_object_representations 201606L -__cpp_lib_hypot 201603L -__cpp_lib_incomplete_container_elements 201505L -__cpp_lib_int_pow2 202002L -__cpp_lib_integer_comparison_functions 202002L -__cpp_lib_integer_sequence 201304L -__cpp_lib_integral_constant_callable 201304L -__cpp_lib_interpolate 201902L -__cpp_lib_invoke 201411L -__cpp_lib_invoke_r 202106L -__cpp_lib_is_aggregate 201703L -__cpp_lib_is_constant_evaluated 201811L -__cpp_lib_is_final 201402L -__cpp_lib_is_invocable 201703L -__cpp_lib_is_layout_compatible 201907L -__cpp_lib_is_nothrow_convertible 201806L -__cpp_lib_is_null_pointer 201309L -__cpp_lib_is_pointer_interconvertible 201907L -__cpp_lib_is_scoped_enum 202011L -__cpp_lib_is_swappable 201603L -__cpp_lib_jthread 201911L -__cpp_lib_latch 201907L -__cpp_lib_launder 201606L -__cpp_lib_list_remove_return_type 201806L -__cpp_lib_logical_traits 201510L -__cpp_lib_make_from_tuple 201606L -__cpp_lib_make_reverse_iterator 201402L -__cpp_lib_make_unique 201304L -__cpp_lib_map_try_emplace 201411L -__cpp_lib_math_constants 201907L -__cpp_lib_math_special_functions 201603L -__cpp_lib_memory_resource 201603L -__cpp_lib_move_iterator_concept 202207L -__cpp_lib_move_only_function 202110L -__cpp_lib_node_extract 201606L - -__cpp_lib_nonmember_container_access 201411L - - - -__cpp_lib_not_fn 201603L -__cpp_lib_null_iterators 201304L -__cpp_lib_optional 202110L - 201606L // C++17 -__cpp_lib_out_ptr 202106L -__cpp_lib_parallel_algorithm 201603L -__cpp_lib_polymorphic_allocator 201902L -__cpp_lib_quoted_string_io 201304L -__cpp_lib_ranges 202106L - -__cpp_lib_ranges_as_rvalue 202207L -__cpp_lib_ranges_chunk 202202L -__cpp_lib_ranges_chunk_by 202202L -__cpp_lib_ranges_iota 202202L -__cpp_lib_ranges_join_with 202202L -__cpp_lib_ranges_slide 202202L -__cpp_lib_ranges_starts_ends_with 202106L -__cpp_lib_ranges_to_container 202202L - - - -__cpp_lib_ranges_zip 202110L -__cpp_lib_raw_memory_algorithms 201606L -__cpp_lib_reference_from_temporary 202202L -__cpp_lib_remove_cvref 201711L -__cpp_lib_result_of_sfinae 201210L -__cpp_lib_robust_nonmodifying_seq_ops 201304L -__cpp_lib_sample 201603L -__cpp_lib_scoped_lock 201703L -__cpp_lib_semaphore 201907L -__cpp_lib_shared_mutex 201505L -__cpp_lib_shared_ptr_arrays 201707L - 201611L // C++17 -__cpp_lib_shared_ptr_weak_type 201606L -__cpp_lib_shared_timed_mutex 201402L -__cpp_lib_shift 201806L -__cpp_lib_smart_ptr_for_overwrite 202002L -__cpp_lib_source_location 201907L -__cpp_lib_span 202002L -__cpp_lib_spanstream 202106L -__cpp_lib_ssize 201902L -__cpp_lib_stacktrace 202011L -__cpp_lib_starts_ends_with 201711L -__cpp_lib_stdatomic_h 202011L -__cpp_lib_string_contains 202011L -__cpp_lib_string_resize_and_overwrite 202110L -__cpp_lib_string_udls 201304L -__cpp_lib_string_view 201803L - 201606L // C++17 -__cpp_lib_syncbuf 201803L -__cpp_lib_three_way_comparison 201907L -__cpp_lib_to_address 201711L -__cpp_lib_to_array 201907L -__cpp_lib_to_chars 201611L -__cpp_lib_to_underlying 202102L -__cpp_lib_transformation_trait_aliases 201304L -__cpp_lib_transparent_operators 201510L - 201210L // C++14 -__cpp_lib_tuple_element_t 201402L -__cpp_lib_tuples_by_type 201304L -__cpp_lib_type_identity 201806L -__cpp_lib_type_trait_variable_templates 201510L -__cpp_lib_uncaught_exceptions 201411L -__cpp_lib_unordered_map_try_emplace 201411L -__cpp_lib_unreachable 202202L -__cpp_lib_unwrap_ref 201811L -__cpp_lib_variant 202102L -__cpp_lib_void_t 201411L - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> diff --git a/libcxx/include/wchar.h b/libcxx/include/wchar.h --- a/libcxx/include/wchar.h +++ b/libcxx/include/wchar.h @@ -18,93 +18,6 @@ #elif !defined(_LIBCPP_WCHAR_H) #define _LIBCPP_WCHAR_H -/* - wchar.h synopsis - -Macros: - - NULL - WCHAR_MAX - WCHAR_MIN - WEOF - -Types: - - mbstate_t - size_t - tm - wint_t - -int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...); -int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...); -int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...); -int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...); -int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); -int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); // C99 -int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg); -int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); // C99 -int vwprintf(const wchar_t* restrict format, va_list arg); -int vwscanf(const wchar_t* restrict format, va_list arg); // C99 -int wprintf(const wchar_t* restrict format, ...); -int wscanf(const wchar_t* restrict format, ...); -wint_t fgetwc(FILE* stream); -wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream); -wint_t fputwc(wchar_t c, FILE* stream); -int fputws(const wchar_t* restrict s, FILE* restrict stream); -int fwide(FILE* stream, int mode); -wint_t getwc(FILE* stream); -wint_t getwchar(); -wint_t putwc(wchar_t c, FILE* stream); -wint_t putwchar(wchar_t c); -wint_t ungetwc(wint_t c, FILE* stream); -double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr); -float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 -long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99 -long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); -long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 -unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); -unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99 -wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2); -wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2); -wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -int wcscmp(const wchar_t* s1, const wchar_t* s2); -int wcscoll(const wchar_t* s1, const wchar_t* s2); -int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); -size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -const wchar_t* wcschr(const wchar_t* s, wchar_t c); - wchar_t* wcschr( wchar_t* s, wchar_t c); -size_t wcscspn(const wchar_t* s1, const wchar_t* s2); -size_t wcslen(const wchar_t* s); -const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); - wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2); -const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); - wchar_t* wcsrchr( wchar_t* s, wchar_t c); -size_t wcsspn(const wchar_t* s1, const wchar_t* s2); -const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); - wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2); -wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr); -const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); - wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n); -int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n); -wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); -wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); -size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format, - const tm* restrict timeptr); -wint_t btowc(int c); -int wctob(wint_t c); -int mbsinit(const mbstate_t* ps); -size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps); -size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps); -size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps); -size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len, - mbstate_t* restrict ps); -size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, - mbstate_t* restrict ps); - -*/ - #include <__config> #include diff --git a/libcxx/include/wctype.h b/libcxx/include/wctype.h --- a/libcxx/include/wctype.h +++ b/libcxx/include/wctype.h @@ -10,40 +10,6 @@ #ifndef _LIBCPP_WCTYPE_H #define _LIBCPP_WCTYPE_H -/* - wctype.h synopsis - -Macros: - - WEOF - -Types: - - wint_t - wctrans_t - wctype_t - -int iswalnum(wint_t wc); -int iswalpha(wint_t wc); -int iswblank(wint_t wc); // C99 -int iswcntrl(wint_t wc); -int iswdigit(wint_t wc); -int iswgraph(wint_t wc); -int iswlower(wint_t wc); -int iswprint(wint_t wc); -int iswpunct(wint_t wc); -int iswspace(wint_t wc); -int iswupper(wint_t wc); -int iswxdigit(wint_t wc); -int iswctype(wint_t wc, wctype_t desc); -wctype_t wctype(const char* property); -wint_t towlower(wint_t wc); -wint_t towupper(wint_t wc); -wint_t towctrans(wint_t wc, wctrans_t desc); -wctrans_t wctrans(const char* property); - -*/ - #include <__config> #if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -810,14 +810,6 @@ return s return None -def get_last_std(d): - rev_dialects = get_std_dialects() - rev_dialects.reverse() - for s in rev_dialects: - if s in d.keys(): - return s - return None - def get_std_before(d, std): std_dialects = get_std_dialects() candidates = std_dialects[0:std_dialects.index(std)] @@ -896,40 +888,6 @@ for i in range(0, len(l), n): yield l[i:i + n] -def produce_version_synopsis(): - indent = 56 - header_indent = 56 + len("20XXYYL ") - result = "" - def indent_to(s, val): - if len(s) >= val: - return s - s += " " * (val - len(s)) - return s - line = indent_to("Macro name", indent) + "Value" - line = indent_to(line, header_indent) + "Headers" - result += line + "\n" - for tc in feature_test_macros: - prev_defined_std = get_last_std(tc["values"]) - line = "{name: <{indent}}{value}L ".format(name=tc['name'], indent=indent, - value=tc["values"][prev_defined_std]) - headers = list(tc["headers"]) - headers.remove("version") - for chunk in chunks(headers, 3): - line = indent_to(line, header_indent) - chunk = ['<%s>' % header for header in chunk] - line += ' '.join(chunk) - result += line - result += "\n" - line = "" - while True: - prev_defined_std = get_std_before(tc["values"], prev_defined_std) - if prev_defined_std is None: - break - result += "%s%sL // %s\n" % (indent_to("", indent), tc["values"][prev_defined_std], - prev_defined_std.replace("c++", "C++")) - return result - - def produce_version_header(): template="""// -*- C++ -*- //===----------------------------------------------------------------------===// @@ -943,13 +901,6 @@ #ifndef _LIBCPP_VERSIONH #define _LIBCPP_VERSIONH -/* - version synopsis - -{synopsis} - -*/ - #include <__assert> // all public C++ headers provide the assertion handler #include <__config> @@ -966,9 +917,7 @@ #endif // _LIBCPP_VERSIONH """ - version_str = template.format( - synopsis=produce_version_synopsis().strip(), - cxx_macros=produce_macros_definitions()) + version_str = template.format(cxx_macros=produce_macros_definitions()) version_header_path = os.path.join(include_path, 'version') with open(version_header_path, 'w', newline='\n') as f: f.write(version_str)