diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -10,640 +10,7 @@ #ifndef _LIBCPP_ALGORITHM #define _LIBCPP_ALGORITHM -/* - algorithm synopsis - -#include - -namespace std -{ - -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); - -template - constexpr ForwardIterator2 // constexpr in C++20 - swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); - -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 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 - -*/ +// Synopsis available at http://wg21.link/algorithm.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/any b/libcxx/include/any --- a/libcxx/include/any +++ b/libcxx/include/any @@ -10,75 +10,7 @@ #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 - -*/ +// Synopsis available at http://wg21.link/any.synop. #include <__availability> #include <__config> diff --git a/libcxx/include/array b/libcxx/include/array --- a/libcxx/include/array +++ b/libcxx/include/array @@ -10,103 +10,7 @@ #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 - -*/ +// Synopsis available at http://wg21.link/array.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/atomic b/libcxx/include/atomic --- a/libcxx/include/atomic +++ b/libcxx/include/atomic @@ -10,572 +10,7 @@ #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; -}; - - -template - bool atomic_is_lock_free(const volatile atomic* obj) noexcept; - -template - bool atomic_is_lock_free(const atomic* obj) noexcept; - -template - void atomic_store(volatile atomic* obj, T desr) noexcept; - -template - void atomic_store(atomic* obj, T desr) noexcept; - -template - void atomic_store_explicit(volatile atomic* obj, T desr, memory_order m) noexcept; - -template - void atomic_store_explicit(atomic* obj, T desr, memory_order m) noexcept; - -template - T atomic_load(const volatile atomic* obj) noexcept; - -template - T atomic_load(const atomic* obj) noexcept; - -template - T atomic_load_explicit(const volatile atomic* obj, memory_order m) noexcept; - -template - T atomic_load_explicit(const atomic* obj, memory_order m) noexcept; - -template - T atomic_exchange(volatile atomic* obj, T desr) noexcept; - -template - T atomic_exchange(atomic* obj, T desr) noexcept; - -template - T atomic_exchange_explicit(volatile atomic* obj, T desr, memory_order m) noexcept; - -template - T atomic_exchange_explicit(atomic* obj, T desr, memory_order m) noexcept; - -template - bool atomic_compare_exchange_weak(volatile atomic* obj, T* expc, T desr) noexcept; - -template - bool atomic_compare_exchange_weak(atomic* obj, T* expc, T desr) noexcept; - -template - bool atomic_compare_exchange_strong(volatile atomic* obj, T* expc, T desr) noexcept; - -template - bool atomic_compare_exchange_strong(atomic* obj, T* expc, T desr) noexcept; - -template - bool atomic_compare_exchange_weak_explicit(volatile atomic* obj, T* expc, - T desr, - memory_order s, memory_order f) noexcept; - -template - bool atomic_compare_exchange_weak_explicit(atomic* obj, T* expc, T desr, - memory_order s, memory_order f) noexcept; - -template - bool atomic_compare_exchange_strong_explicit(volatile atomic* obj, - T* expc, T desr, - memory_order s, memory_order f) noexcept; - -template - bool atomic_compare_exchange_strong_explicit(atomic* obj, T* expc, - T desr, - memory_order s, memory_order f) noexcept; - -template - void atomic_wait(const volatile atomic* obj, T old) noexcept; - -template - void atomic_wait(const atomic* obj, T old) noexcept; - -template - void atomic_wait_explicit(const volatile atomic* obj, T old, memory_order m) noexcept; - -template - void atomic_wait_explicit(const atomic* obj, T old, memory_order m) noexcept; - -template - void atomic_one(volatile atomic* obj) noexcept; - -template - void atomic_one(atomic* obj) noexcept; - -template - void atomic_all(volatile atomic* obj) noexcept; - -template - void atomic_all(atomic* obj) noexcept; - -template - Integral atomic_fetch_add(volatile atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_add(atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_add_explicit(volatile atomic* obj, Integral op, - memory_order m) noexcept; -template - Integral atomic_fetch_add_explicit(atomic* obj, Integral op, - memory_order m) noexcept; -template - Integral atomic_fetch_sub(volatile atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_sub(atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_sub_explicit(volatile atomic* obj, Integral op, - memory_order m) noexcept; - -template - Integral atomic_fetch_sub_explicit(atomic* obj, Integral op, - memory_order m) noexcept; - -template - Integral atomic_fetch_and(volatile atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_and(atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_and_explicit(volatile atomic* obj, Integral op, - memory_order m) noexcept; - -template - Integral atomic_fetch_and_explicit(atomic* obj, Integral op, - memory_order m) noexcept; - -template - Integral atomic_fetch_or(volatile atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_or(atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_or_explicit(volatile atomic* obj, Integral op, - memory_order m) noexcept; - -template - Integral atomic_fetch_or_explicit(atomic* obj, Integral op, - memory_order m) noexcept; - -template - Integral atomic_fetch_xor(volatile atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_xor(atomic* obj, Integral op) noexcept; - -template - Integral atomic_fetch_xor_explicit(volatile atomic* obj, Integral op, - memory_order m) noexcept; - -template - Integral atomic_fetch_xor_explicit(atomic* obj, Integral op, - memory_order m) noexcept; - -template - T* atomic_fetch_add(volatile atomic* obj, ptrdiff_t op) noexcept; - -template - T* atomic_fetch_add(atomic* obj, ptrdiff_t op) noexcept; - -template - T* atomic_fetch_add_explicit(volatile atomic* obj, ptrdiff_t op, - memory_order m) noexcept; - -template - T* atomic_fetch_add_explicit(atomic* obj, ptrdiff_t op, memory_order m) noexcept; - -template - T* atomic_fetch_sub(volatile atomic* obj, ptrdiff_t op) noexcept; - -template - T* atomic_fetch_sub(atomic* obj, ptrdiff_t op) noexcept; - -template - T* atomic_fetch_sub_explicit(volatile atomic* obj, ptrdiff_t op, - memory_order m) noexcept; - -template - T* atomic_fetch_sub_explicit(atomic* obj, ptrdiff_t op, memory_order m) 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, typename atomic::value_type desr) noexcept; - -template - void atomic_init(atomic* obj, typename atomic::value_type desr) noexcept; - -#define ATOMIC_VAR_INIT(value) see below - -#define ATOMIC_FLAG_INIT see below - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/atomics.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/barrier b/libcxx/include/barrier --- a/libcxx/include/barrier +++ b/libcxx/include/barrier @@ -10,40 +10,7 @@ #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 - }; - -} - -*/ +// Synopsis avaiable at http://wg21.link/barrier.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/bit b/libcxx/include/bit --- a/libcxx/include/bit +++ b/libcxx/include/bit @@ -10,49 +10,7 @@ #ifndef _LIBCPP_BIT #define _LIBCPP_BIT -/* - bit synopsis - -namespace std { - - // [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 T 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 - -*/ +// Synopsis avaiable at http://wg21.link/bit.syn. #include <__config> #include <__bits> // __libcpp_clz diff --git a/libcxx/include/bitset b/libcxx/include/bitset --- a/libcxx/include/bitset +++ b/libcxx/include/bitset @@ -10,107 +10,7 @@ #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')); - 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')); - - // 23.3.5.2 bitset operations: - bitset& operator&=(const bitset& rhs) noexcept; - bitset& operator|=(const bitset& rhs) noexcept; - bitset& operator^=(const bitset& rhs) noexcept; - bitset& operator<<=(size_t pos) noexcept; - bitset& operator>>=(size_t pos) noexcept; - bitset& set() noexcept; - bitset& set(size_t pos, bool val = true); - bitset& reset() noexcept; - bitset& reset(size_t pos); - bitset operator~() const noexcept; - bitset& flip() noexcept; - bitset& flip(size_t pos); - - // element access: - constexpr bool operator[](size_t pos) const; // for b[i]; - reference operator[](size_t pos); // for b[i]; - unsigned long to_ulong() const; - unsigned long long to_ullong() const; - template - basic_string to_string(charT zero = charT('0'), charT one = charT('1')) const; - template - basic_string > to_string(charT zero = charT('0'), charT one = charT('1')) const; - template - 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; - size_t count() const noexcept; - constexpr size_t size() const noexcept; - bool operator==(const bitset& rhs) const noexcept; - bool operator!=(const bitset& rhs) const noexcept; - bool test(size_t pos) const; - bool all() const noexcept; - bool any() const noexcept; - bool none() const noexcept; - bitset operator<<(size_t pos) const noexcept; - bitset operator>>(size_t pos) const noexcept; -}; - -// 23.3.5.3 bitset operators: -template -bitset operator&(const bitset&, const bitset&) noexcept; - -template -bitset operator|(const bitset&, const bitset&) noexcept; - -template -bitset operator^(const bitset&, const bitset&) noexcept; - -template -basic_istream& -operator>>(basic_istream& is, bitset& x); - -template -basic_ostream& -operator<<(basic_ostream& os, const bitset& x); - -template struct hash>; - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/bitset.syn. #include <__config> #include <__bit_reference> diff --git a/libcxx/include/cassert b/libcxx/include/cassert --- a/libcxx/include/cassert +++ b/libcxx/include/cassert @@ -7,14 +7,7 @@ // //===----------------------------------------------------------------------===// -/* - cassert synopsis - -Macros: - - assert - -*/ +// Synopsis avaiable at http://wg21.link/cassert.syn. #include <__config> #include diff --git a/libcxx/include/cctype b/libcxx/include/cctype --- a/libcxx/include/cctype +++ b/libcxx/include/cctype @@ -10,29 +10,7 @@ #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 -*/ +// Synopsis avaiable at http://wg21.link/cctype.syn. #include <__config> #include diff --git a/libcxx/include/cerrno b/libcxx/include/cerrno --- a/libcxx/include/cerrno +++ b/libcxx/include/cerrno @@ -10,17 +10,7 @@ #ifndef _LIBCPP_CERRNO #define _LIBCPP_CERRNO -/* - cerrno synopsis - -Macros: - - EDOM - EILSEQ // C99 - ERANGE - errno - -*/ +// Synopsis avaiable at http://wg21.link/cerrno.syn. #include <__config> #include diff --git a/libcxx/include/cfenv b/libcxx/include/cfenv --- a/libcxx/include/cfenv +++ b/libcxx/include/cfenv @@ -10,47 +10,7 @@ #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 -*/ +// Synopsis avaiable at http://wg21.link/cfenv.syn. #include <__config> #include diff --git a/libcxx/include/cfloat b/libcxx/include/cfloat --- a/libcxx/include/cfloat +++ b/libcxx/include/cfloat @@ -10,64 +10,7 @@ #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 -*/ +// Synopsis avaiable at http://wg21.link/cfloat.syn. #include <__config> #include diff --git a/libcxx/include/charconv b/libcxx/include/charconv --- a/libcxx/include/charconv +++ b/libcxx/include/charconv @@ -10,68 +10,7 @@ #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; - }; - - to_chars_result to_chars(char* first, char* last, see below value, - int base = 10); - - 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; - }; - - from_chars_result from_chars(const char* first, const char* last, - see below& value, int base = 10); - - from_chars_result from_chars(const char* first, const char* last, - float& value, - chars_format fmt = chars_format::general); - from_chars_result from_chars(const char* first, const char* last, - double& value, - chars_format fmt = chars_format::general); - from_chars_result from_chars(const char* first, const char* last, - long double& value, - chars_format fmt = chars_format::general); - -} // namespace std - -*/ +// Synopsis avaiable at http://wg21.link/charconv.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/chrono b/libcxx/include/chrono --- a/libcxx/include/chrono +++ b/libcxx/include/chrono @@ -10,818 +10,7 @@ #ifndef _LIBCPP_CHRONO #define _LIBCPP_CHRONO -/* - chrono synopsis - -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 { - - -template struct is_clock; // C++20 -template inline constexpr bool is_clock_v = is_clock::value; // C++20 - - -// 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); -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); - -// 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 is elsewhere - -// 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 utc_clock; // C++20 - -template - using utc_time = time_point; // C++20 -using utc_seconds = utc_time; // C++20 - -class tai_clock; // C++20 - -template - using tai_time = time_point; // C++20 -using tai_seconds = tai_time; // C++20 - -class file_clock; // C++20 - -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.7.9, time_point conversions template // C++20 -struct clock_time_conversion; - -template - auto clock_cast(const time_point& t); - -// 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 bool operator!=(const day& x, const day& y) noexcept; -constexpr bool operator< (const day& x, const day& y) noexcept; -constexpr bool operator> (const day& x, const day& y) noexcept; -constexpr bool operator<=(const day& x, const day& y) noexcept; -constexpr bool 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; - -// 25.8.4, class month // C++20 -class month; -constexpr bool operator==(const month& x, const month& y) noexcept; -constexpr bool operator!=(const month& x, const month& y) noexcept; -constexpr bool operator< (const month& x, const month& y) noexcept; -constexpr bool operator> (const month& x, const month& y) noexcept; -constexpr bool operator<=(const month& x, const month& y) noexcept; -constexpr bool 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; - -// 25.8.5, class year // C++20 -class year; -constexpr bool operator==(const year& x, const year& y) noexcept; -constexpr bool operator!=(const year& x, const year& y) noexcept; -constexpr bool operator< (const year& x, const year& y) noexcept; -constexpr bool operator> (const year& x, const year& y) noexcept; -constexpr bool operator<=(const year& x, const year& y) noexcept; -constexpr bool 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; - -// 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; - -// 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; - -// 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; - -// 25.8.9, class month_day // C++20 -class month_day; - -constexpr bool operator==(const month_day& x, const month_day& y) noexcept; -constexpr bool operator!=(const month_day& x, const month_day& y) noexcept; -constexpr bool operator< (const month_day& x, const month_day& y) noexcept; -constexpr bool operator> (const month_day& x, const month_day& y) noexcept; -constexpr bool operator<=(const month_day& x, const month_day& y) noexcept; -constexpr bool operator>=(const month_day& x, const month_day& y) noexcept; - - -// 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 bool operator!=(const month_day_last& x, const month_day_last& y) noexcept; -constexpr bool operator< (const month_day_last& x, const month_day_last& y) noexcept; -constexpr bool operator> (const month_day_last& x, const month_day_last& y) noexcept; -constexpr bool operator<=(const month_day_last& x, const month_day_last& y) noexcept; -constexpr bool operator>=(const month_day_last& x, const month_day_last& y) noexcept; - -// 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; - -// 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; - - -// 25.8.13, class year_month // C++20 -class year_month; - -constexpr bool operator==(const year_month& x, const year_month& y) noexcept; -constexpr bool operator!=(const year_month& x, const year_month& y) noexcept; -constexpr bool operator< (const year_month& x, const year_month& y) noexcept; -constexpr bool operator> (const year_month& x, const year_month& y) noexcept; -constexpr bool operator<=(const year_month& x, const year_month& y) noexcept; -constexpr bool 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; - -// 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 bool operator!=(const year_month_day& x, const year_month_day& y) noexcept; -constexpr bool operator< (const year_month_day& x, const year_month_day& y) noexcept; -constexpr bool operator> (const year_month_day& x, const year_month_day& y) noexcept; -constexpr bool operator<=(const year_month_day& x, const year_month_day& y) noexcept; -constexpr bool 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; - - -// 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 bool operator!=(const year_month_day_last& x, - const year_month_day_last& y) noexcept; -constexpr bool operator< (const year_month_day_last& x, - const year_month_day_last& y) noexcept; -constexpr bool operator> (const year_month_day_last& x, - const year_month_day_last& y) noexcept; -constexpr bool operator<=(const year_month_day_last& x, - const year_month_day_last& y) noexcept; -constexpr bool operator>=(const year_month_day_last& x, - const year_month_day_last& 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; - -// 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; - -// 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; - -// 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, hh_mm_ss const& hms); - -// 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.2, time zone database // C++20 -struct tzdb; -class tzdb_list; - -// 25.10.2.3, time zone database access // C++20 -const tzdb& get_tzdb(); -tzdb_list& get_tzdb_list(); -const time_zone* locate_zone(string_view tz_name); -const time_zone* current_zone(); - -// 25.10.2.4, remote time zone database support // C++20 -const tzdb& reload_tzdb(); -string remote_version(); - -// 25.10.3, exception classes // C++20 -class nonexistent_local_time; -class ambiguous_local_time; - -// 25.10.4, information classes // C++20 -struct sys_info; -struct local_info; - -// 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; - -// 25.10.6, class template zoned_traits // C++20 -template struct zoned_traits; - -// 25.10.7, class template zoned_time // C++20 -template class zoned_time; -using zoned_seconds = zoned_time; - -template - bool operator==(const zoned_time& x, - const zoned_time& y); -template - bool operator!=(const zoned_time& x, - const zoned_time& y); - -// 25.10.8, leap second support // C++20 -class leap; - -bool operator==(const leap& x, const leap& y); -bool operator!=(const leap& x, const leap& y); -bool operator< (const leap& x, const leap& y); -bool operator> (const leap& x, const leap& y); -bool operator<=(const leap& x, const leap& y); -bool operator>=(const leap& x, const leap& y); -template - bool operator==(const leap& x, const sys_time& y); -template - bool operator==(const sys_time& x, const leap& y); -template - bool operator!=(const leap& x, const sys_time& y); -template - bool operator!=(const sys_time& x, const leap& y); -template - bool operator< (const leap& x, const sys_time& y); -template - bool operator< (const sys_time& x, const leap& y); -template - bool operator> (const leap& x, const sys_time& y); -template - bool operator> (const sys_time& x, const leap& y); -template - bool operator<=(const leap& x, const sys_time& y); -template - bool operator<=(const sys_time& x, const leap& y); -template - bool operator>=(const leap& x, const sys_time& y); -template - bool operator>=(const sys_time& x, const leap& y); - -// 25.10.9, class link // C++20 -class link; -bool operator==(const link& x, const link& y); -bool operator!=(const link& x, const link& y); -bool operator< (const link& x, const link& y); -bool operator> (const link& x, const link& y); -bool operator<=(const link& x, const link& y); -bool operator>=(const link& x, const link& y); - -// 25.11, formatting // C++20 -template - basic_string - format(const charT* fmt, const Streamable& s); - -template - basic_string - format(const locale& loc, const charT* fmt, const Streamable& s); - -template - basic_string - format(const basic_string& fmt, const Streamable& s); - -template - basic_string - format(const locale& loc, const basic_string& fmt, - const Streamable& s); - -// 25.12, parsing // C++20 -template -unspecified - parse(const basic_string& format, Parsable& tp); - -template -unspecified - parse(const basic_string& format, Parsable& tp, - basic_string& abbrev); - -template -unspecified - parse(const basic_string& format, Parsable& tp, - minutes& offset); - -template -unspecified - parse(const basic_string& format, Parsable& tp, - basic_string& abbrev, minutes& offset); - -// 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 -*/ +// Synopsis avaiable at http://wg21.link/time.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/climits b/libcxx/include/climits --- a/libcxx/include/climits +++ b/libcxx/include/climits @@ -10,32 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/climits.syn. #include <__config> #include diff --git a/libcxx/include/clocale b/libcxx/include/clocale --- a/libcxx/include/clocale +++ b/libcxx/include/clocale @@ -10,29 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/clocale.syn. #include <__config> #include diff --git a/libcxx/include/cmath b/libcxx/include/cmath --- a/libcxx/include/cmath +++ b/libcxx/include/cmath @@ -10,299 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/cmath.syn. #include <__config> #include diff --git a/libcxx/include/codecvt b/libcxx/include/codecvt --- a/libcxx/include/codecvt +++ b/libcxx/include/codecvt @@ -10,49 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/locale.codecvt.general. #include <__config> #include <__locale> diff --git a/libcxx/include/compare b/libcxx/include/compare --- a/libcxx/include/compare +++ b/libcxx/include/compare @@ -10,115 +10,7 @@ #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.alg], comparison algorithms - template constexpr strong_ordering strong_order(const T& a, const T& b); - template constexpr weak_ordering weak_order(const T& a, const T& b); - template constexpr partial_ordering partial_order(const T& a, const T& b); - - // [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; - }; -} -*/ +// Synopsis avaiable at http://wg21.link/compare.syn. #include <__config> #include diff --git a/libcxx/include/complex b/libcxx/include/complex --- a/libcxx/include/complex +++ b/libcxx/include/complex @@ -10,226 +10,7 @@ #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); - void imag(T); - - complex& operator= (const T&); - complex& operator+=(const T&); - complex& operator-=(const T&); - complex& operator*=(const T&); - complex& operator/=(const T&); - - complex& operator=(const complex&); - template complex& operator= (const complex&); - template complex& operator+=(const complex&); - template complex& operator-=(const complex&); - template complex& operator*=(const complex&); - template complex& operator/=(const complex&); -}; - -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 float imag() const; - void imag(float); - - complex& operator= (float); - complex& operator+=(float); - complex& operator-=(float); - complex& operator*=(float); - complex& operator/=(float); - - complex& operator=(const complex&); - template complex& operator= (const complex&); - template complex& operator+=(const complex&); - template complex& operator-=(const complex&); - template complex& operator*=(const complex&); - template complex& operator/=(const complex&); -}; - -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 double imag() const; - void imag(double); - - complex& operator= (double); - complex& operator+=(double); - complex& operator-=(double); - complex& operator*=(double); - complex& operator/=(double); - complex& operator=(const complex&); - - template complex& operator= (const complex&); - template complex& operator+=(const complex&); - template complex& operator-=(const complex&); - template complex& operator*=(const complex&); - template complex& operator/=(const complex&); -}; - -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 long double imag() const; - void imag(long double); - - complex& operator=(const complex&); - complex& operator= (long double); - complex& operator+=(long double); - complex& operator-=(long double); - complex& operator*=(long double); - complex& operator/=(long double); - - template complex& operator= (const complex&); - template complex& operator+=(const complex&); - template complex& operator-=(const complex&); - template complex& operator*=(const complex&); - template complex& operator/=(const complex&); -}; - -// 26.3.6 operators: -template complex operator+(const complex&, const complex&); -template complex operator+(const complex&, const T&); -template complex operator+(const T&, const complex&); -template complex operator-(const complex&, const complex&); -template complex operator-(const complex&, const T&); -template complex operator-(const T&, const complex&); -template complex operator*(const complex&, const complex&); -template complex operator*(const complex&, const T&); -template complex operator*(const T&, const complex&); -template complex operator/(const complex&, const complex&); -template complex operator/(const complex&, const T&); -template complex operator/(const T&, const complex&); -template complex operator+(const complex&); -template complex operator-(const complex&); -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&); - long double norm(long double); - double norm(double); -template double norm(T); - float norm(float); - -template complex conj(const complex&); - complex conj(long double); - complex conj(double); -template complex conj(T); - complex conj(float); - -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 - -*/ +// Synopsis avaiable at http://wg21.link/complex.syn. #include <__config> #include diff --git a/libcxx/include/concepts b/libcxx/include/concepts --- a/libcxx/include/concepts +++ b/libcxx/include/concepts @@ -10,124 +10,7 @@ #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; -} - -*/ +// Synopsis avaiable at http://wg21.link/concepts.syn. #include <__config> #include <__functional_base> diff --git a/libcxx/include/condition_variable b/libcxx/include/condition_variable --- a/libcxx/include/condition_variable +++ b/libcxx/include/condition_variable @@ -10,101 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/condition.variable.syn. #include <__config> #include <__mutex_base> diff --git a/libcxx/include/csetjmp b/libcxx/include/csetjmp --- a/libcxx/include/csetjmp +++ b/libcxx/include/csetjmp @@ -10,25 +10,7 @@ #ifndef _LIBCPP_CSETJMP #define _LIBCPP_CSETJMP -/* - csetjmp synopsis - -Macros: - - setjmp - -namespace std -{ - -Types: - - jmp_buf - -void longjmp(jmp_buf env, int val); - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/csetjmp.syn. #include <__config> #include diff --git a/libcxx/include/csignal b/libcxx/include/csignal --- a/libcxx/include/csignal +++ b/libcxx/include/csignal @@ -10,34 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/csignal.syn. #include <__config> #include diff --git a/libcxx/include/cstdarg b/libcxx/include/cstdarg --- a/libcxx/include/cstdarg +++ b/libcxx/include/cstdarg @@ -10,26 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/cstdarg.syn. #include <__config> #include diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef --- a/libcxx/include/cstddef +++ b/libcxx/include/cstddef @@ -10,28 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/cstddef.syn. #include <__config> #include diff --git a/libcxx/include/cstdint b/libcxx/include/cstdint --- a/libcxx/include/cstdint +++ b/libcxx/include/cstdint @@ -10,135 +10,7 @@ #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 -*/ +// Synopsis avaiable at http://wg21.link/cstdint.syn. #include <__config> #include diff --git a/libcxx/include/cstdio b/libcxx/include/cstdio --- a/libcxx/include/cstdio +++ b/libcxx/include/cstdio @@ -10,90 +10,7 @@ #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 -*/ +// Synopsis avaiable at http://wg21.link/cstdio.syn. #include <__config> #include diff --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib --- a/libcxx/include/cstdlib +++ b/libcxx/include/cstdlib @@ -10,76 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/cstdlib.syn. #include <__config> #include diff --git a/libcxx/include/cstring b/libcxx/include/cstring --- a/libcxx/include/cstring +++ b/libcxx/include/cstring @@ -10,51 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/cstring.syn. #include <__config> #include diff --git a/libcxx/include/ctime b/libcxx/include/ctime --- a/libcxx/include/ctime +++ b/libcxx/include/ctime @@ -10,40 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/ctime.syn. #include <__config> #include diff --git a/libcxx/include/cwchar b/libcxx/include/cwchar --- a/libcxx/include/cwchar +++ b/libcxx/include/cwchar @@ -10,97 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/cwchar.syn. #include <__config> #include diff --git a/libcxx/include/cwctype b/libcxx/include/cwctype --- a/libcxx/include/cwctype +++ b/libcxx/include/cwctype @@ -10,44 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/cwtype.syn. #include <__config> #include diff --git a/libcxx/include/deque b/libcxx/include/deque --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -10,155 +10,7 @@ #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>; - -template - bool operator==(const deque& x, const deque& y); -template - bool operator< (const deque& x, const deque& y); -template - bool operator!=(const deque& x, const deque& y); -template - bool operator> (const deque& x, const deque& y); -template - bool operator>=(const deque& x, const deque& y); -template - bool operator<=(const deque& x, const deque& y); - -// 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 - -*/ +// Synopsis avaiable at http://wg21.link/deque.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/exception b/libcxx/include/exception --- a/libcxx/include/exception +++ b/libcxx/include/exception @@ -10,71 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/exception.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/filesystem b/libcxx/include/filesystem --- a/libcxx/include/filesystem +++ b/libcxx/include/filesystem @@ -8,226 +8,8 @@ //===----------------------------------------------------------------------===// #ifndef _LIBCPP_FILESYSTEM #define _LIBCPP_FILESYSTEM -/* - filesystem synopsis - namespace std { namespace filesystem { - - class path; - - void swap(path& lhs, path& rhs) noexcept; - size_t hash_value(const path& p) noexcept; - - bool operator==(const path& lhs, const path& rhs) noexcept; - bool operator!=(const path& lhs, const path& rhs) noexcept; - bool operator< (const path& lhs, const path& rhs) noexcept; - bool operator<=(const path& lhs, const path& rhs) noexcept; - bool operator> (const path& lhs, const path& rhs) noexcept; - bool operator>=(const path& lhs, const path& rhs) noexcept; - - path operator/ (const path& lhs, const path& rhs); - - // fs.path.io operators are friends of path. - template - friend basic_ostream& - operator<<(basic_ostream& os, const path& p); - - template - friend basic_istream& - operator>>(basic_istream& is, path& p); - - template - path u8path(const Source& source); - template - path u8path(InputIterator first, InputIterator last); - - class filesystem_error; - class directory_entry; - - class directory_iterator; - - // enable directory_iterator range-based for statements - directory_iterator begin(directory_iterator iter) noexcept; - directory_iterator end(const 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(const recursive_directory_iterator&) noexcept; - - class file_status; - - struct space_info - { - uintmax_t capacity; - uintmax_t free; - uintmax_t available; - }; - - 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); - - -} } // namespaces std::filesystem - -*/ +// Synopsis avaiable at http://wg21.link/fs.filesystem.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/format b/libcxx/include/format --- a/libcxx/include/format +++ b/libcxx/include/format @@ -10,50 +10,7 @@ #ifndef _LIBCPP_FORMAT #define _LIBCPP_FORMAT -/* - -namespace std { - // [format.error], class format_error - class format_error : public runtime_error { - public: - explicit format_error(const string& what_arg); - explicit format_error(const char* what_arg); - }; - - // [format.parse.ctx], class template basic_format_parse_context - template - class basic_format_parse_context { - public: - using char_type = charT; - using const_iterator = typename basic_string_view::const_iterator; - using iterator = const_iterator; - - private: - iterator begin_; // exposition only - iterator end_; // exposition only - enum indexing { unknown, manual, automatic }; // exposition only - indexing indexing_; // exposition only - size_t next_arg_id_; // exposition only - size_t num_args_; // exposition only - - public: - constexpr explicit basic_format_parse_context(basic_string_view fmt, - size_t num_args = 0) noexcept; - basic_format_parse_context(const basic_format_parse_context&) = delete; - basic_format_parse_context& operator=(const basic_format_parse_context&) = delete; - - constexpr const_iterator begin() const noexcept; - constexpr const_iterator end() const noexcept; - constexpr void advance_to(const_iterator it); - - constexpr size_t next_arg_id(); - constexpr void check_arg_id(size_t id); - }; - using format_parse_context = basic_format_parse_context; - using wformat_parse_context = basic_format_parse_context; -} - -*/ +// Synopsis avaiable at http://wg21.link/format.syn. #include <__config> #include <__format/format_error.h> diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -10,174 +10,7 @@ #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); - -template - bool operator!=(const forward_list& x, - const forward_list& y); - -template - bool operator> (const forward_list& x, - const forward_list& y); - -template - bool operator>=(const forward_list& x, - const forward_list& y); - -template - bool operator<=(const forward_list& x, - const forward_list& y); - -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 - -*/ +// Synopsis avaiable at http://wg21.link/forward.list.syn. #include <__config> #include <__utility/forward.h> diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -10,174 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/fstream.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/functional b/libcxx/include/functional --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -10,482 +10,7 @@ #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 - reference_wrapper(U&&); - reference_wrapper(const reference_wrapper& x) noexcept; - - // assignment - reference_wrapper& operator=(const reference_wrapper& x) noexcept; - - // access - operator T& () const noexcept; - T& get() const noexcept; - - // invoke - template - typename result_of::type - operator() (ArgTypes&&...) const; -}; - -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; -}; - -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 - -template - constexpr // constexpr in C++20 - invoke_result_t invoke(F&& f, Args&&... args) // C++17 - noexcept(is_nothrow_invocable_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 - -} // 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. - -*/ +// Synopsis avaiable at http://wg21.link/functional.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -10,356 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/future.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/initializer_list b/libcxx/include/initializer_list --- a/libcxx/include/initializer_list +++ b/libcxx/include/initializer_list @@ -10,37 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/initializer.list.syn. #include <__config> #include diff --git a/libcxx/include/iomanip b/libcxx/include/iomanip --- a/libcxx/include/iomanip +++ b/libcxx/include/iomanip @@ -10,37 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/iomanip.syn. #include <__config> #include <__string> diff --git a/libcxx/include/ios b/libcxx/include/ios --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -10,205 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/ios.syn. #include <__config> #include <__locale> diff --git a/libcxx/include/iosfwd b/libcxx/include/iosfwd --- a/libcxx/include/iosfwd +++ b/libcxx/include/iosfwd @@ -10,89 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/iosfwd.syn. #include <__config> #include // for mbstate_t diff --git a/libcxx/include/iostream b/libcxx/include/iostream --- a/libcxx/include/iostream +++ b/libcxx/include/iostream @@ -10,28 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/iostream.syn. #include <__config> #include diff --git a/libcxx/include/istream b/libcxx/include/istream --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -10,153 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/istream.syn. #include <__config> #include <__utility/forward.h> diff --git a/libcxx/include/iterator b/libcxx/include/iterator --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -10,549 +10,7 @@ #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.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 - -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 {}; - -// 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: - typedef Iterator iterator_type; - typedef typename iterator_traits::difference_type difference_type; - typedef typename iterator_traits::reference reference; - typedef typename iterator_traits::pointer pointer; - - 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; - 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 reference operator[](difference_type n) const; -}; - -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 -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 -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, Iterator i); // constexpr in C++20 - -template -class move_iterator { -public: - typedef Iterator iterator_type; - typedef typename iterator_traits::difference_type difference_type; - typedef Iterator pointer; - typedef typename iterator_traits::value_type value_type; - typedef typename iterator_traits::iterator_category iterator_category; - typedef value_type&& reference; - - 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; - constexpr reference operator*() const; - constexpr pointer operator->() const; - constexpr move_iterator& operator++(); - constexpr move_iterator operator++(int); - 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 unspecified operator[](difference_type n) const; -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); - -// [default.sentinel], default sentinel -struct default_sentinel_t; -inline constexpr default_sentinel_t default_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; - - constexpr istream_iterator(); - 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); -}; - -template -bool operator==(const istream_iterator& x, - const istream_iterator& y); -template -bool operator!=(const istream_iterator& x, - const istream_iterator& y); - -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; - 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; -}; - -template -bool operator==(const istreambuf_iterator& a, - const istreambuf_iterator& b); -template -bool operator!=(const istreambuf_iterator& a, - const istreambuf_iterator& b); - -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 - -*/ +// Synopsis avaiable at http://wg21.link/iterator.synopsis. #include <__config> #include <__debug> diff --git a/libcxx/include/latch b/libcxx/include/latch --- a/libcxx/include/latch +++ b/libcxx/include/latch @@ -10,35 +10,7 @@ #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 - }; - -} - -*/ +// Synopsis avaiable at http://wg21.link/latch.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/limits b/libcxx/include/limits --- a/libcxx/include/limits +++ b/libcxx/include/limits @@ -10,97 +10,8 @@ #ifndef _LIBCPP_LIMITS #define _LIBCPP_LIMITS -/* - limits synopsis +// Synopsis avaiable at http://wg21.link/limits.syn. -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 <__config> #include diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -10,175 +10,7 @@ #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); -template - bool operator!=(const list& x, const list& y); -template - bool operator> (const list& x, const list& y); -template - bool operator>=(const list& x, const list& y); -template - bool operator<=(const list& x, const list& y); - -template - void swap(list& x, list& y) - noexcept(noexcept(x.swap(y))); - -template - typename list::size_type - erase(list& c, const U& value); // C++20 -template - typename list::size_type - erase_if(list& c, Predicate pred); // C++20 - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/list.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -10,182 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/locale.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/map b/libcxx/include/map --- a/libcxx/include/map +++ b/libcxx/include/map @@ -10,484 +10,7 @@ #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 -bool -operator==(const map& x, - const map& y); - -template -bool -operator< (const map& x, - const map& y); - -template -bool -operator!=(const map& x, - const map& y); - -template -bool -operator> (const map& x, - const map& y); - -template -bool -operator>=(const map& x, - const map& y); - -template -bool -operator<=(const map& x, - const map& y); - -// 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 -bool -operator==(const multimap& x, - const multimap& y); - -template -bool -operator< (const multimap& x, - const multimap& y); - -template -bool -operator!=(const multimap& x, - const multimap& y); - -template -bool -operator> (const multimap& x, - const multimap& y); - -template -bool -operator>=(const multimap& x, - const multimap& y); - -template -bool -operator<=(const multimap& x, - const multimap& y); - -// 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 - -*/ +// Synopsis avaiable at http://wg21.link/associative.map.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/memory b/libcxx/include/memory --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -10,662 +10,7 @@ #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 <> -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); - -template -ForwardIterator -uninitialized_copy_n(InputIterator first, Size n, ForwardIterator result); - -template -void uninitialized_fill(ForwardIterator first, ForwardIterator last, const T& x); - -template -ForwardIterator -uninitialized_fill_n(ForwardIterator first, Size n, const T& x); - -template -constexpr T* construct_at(T* location, Args&& ...args); // since C++20 - -template -void destroy_at(T* location); // constexpr in C++20 - -template -void destroy(ForwardIterator first, ForwardIterator last); // constexpr in C++20 - -template -ForwardIterator destroy_n(ForwardIterator first, Size n); // constexpr in C++20 - -template - ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result); - -template - pair uninitialized_move_n(InputIterator first, Size n, ForwardIterator result); - -template - void uninitialized_value_construct(ForwardIterator first, ForwardIterator last); - -template - ForwardIterator uninitialized_value_construct_n(ForwardIterator first, Size n); - -template - void uninitialized_default_construct(ForwardIterator first, ForwardIterator last); - -template - ForwardIterator uninitialized_default_construct_n(ForwardIterator first, Size n); - -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 default_delete(const default_delete&) noexcept; - - void operator()(T*) const noexcept; -}; - -template -struct default_delete -{ - constexpr default_delete() noexcept = default; - void operator()(T*) const noexcept; - 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; - explicit unique_ptr(pointer p) noexcept; - unique_ptr(pointer p, see below d1) noexcept; - unique_ptr(pointer p, see below d2) noexcept; - unique_ptr(unique_ptr&& u) noexcept; - unique_ptr(nullptr_t) noexcept : unique_ptr() { } - template - unique_ptr(unique_ptr&& u) noexcept; - template - unique_ptr(auto_ptr&& u) noexcept; // removed in C++17 - - // destructor - ~unique_ptr(); - - // assignment - unique_ptr& operator=(unique_ptr&& u) noexcept; - template unique_ptr& operator=(unique_ptr&& u) noexcept; - unique_ptr& operator=(nullptr_t) noexcept; - - // observers - typename add_lvalue_reference::type operator*() const; - pointer operator->() const noexcept; - pointer get() const noexcept; - deleter_type& get_deleter() noexcept; - const deleter_type& get_deleter() const noexcept; - explicit operator bool() const noexcept; - - // modifiers - pointer release() noexcept; - void reset(pointer p = pointer()) noexcept; - void swap(unique_ptr& u) noexcept; -}; - -template -class unique_ptr -{ -public: - typedef implementation-defined pointer; - typedef T element_type; - typedef D deleter_type; - - // constructors - constexpr unique_ptr() noexcept; - explicit unique_ptr(pointer p) noexcept; - unique_ptr(pointer p, see below d) noexcept; - unique_ptr(pointer p, see below d) noexcept; - unique_ptr(unique_ptr&& u) noexcept; - unique_ptr(nullptr_t) noexcept : unique_ptr() { } - - // destructor - ~unique_ptr(); - - // assignment - unique_ptr& operator=(unique_ptr&& u) noexcept; - unique_ptr& operator=(nullptr_t) noexcept; - - // observers - T& operator[](size_t i) const; - pointer get() const noexcept; - deleter_type& get_deleter() noexcept; - const deleter_type& get_deleter() const noexcept; - explicit operator bool() const noexcept; - - // modifiers - pointer release() noexcept; - void reset(pointer p = pointer()) noexcept; - void reset(nullptr_t) noexcept; - template void reset(U) = delete; - void swap(unique_ptr& u) noexcept; -}; - -template - void swap(unique_ptr& x, unique_ptr& y) noexcept; - -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 - 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, nullptr_t) noexcept; -template - bool operator==(nullptr_t, const unique_ptr& y) noexcept; -template - bool operator!=(const unique_ptr& x, nullptr_t) noexcept; -template - bool operator!=(nullptr_t, const unique_ptr& y) noexcept; - -template - bool operator<(const unique_ptr& x, nullptr_t); -template - bool operator<(nullptr_t, const unique_ptr& y); -template - bool operator<=(const unique_ptr& x, nullptr_t); -template - bool operator<=(nullptr_t, const unique_ptr& y); -template - bool operator>(const unique_ptr& x, nullptr_t); -template - bool operator>(nullptr_t, const unique_ptr& y); -template - bool operator>=(const unique_ptr& x, nullptr_t); -template - bool operator>=(nullptr_t, const unique_ptr& y); - -class bad_weak_ptr - : public std::exception -{ - bad_weak_ptr() noexcept; -}; - -template unique_ptr make_unique(Args&&... args); // C++14 -template unique_ptr make_unique(size_t n); // C++14 -template unspecified make_unique(Args&&...) = delete; // C++14, T == U[N] - -template - basic_ostream& operator<< (basic_ostream& os, unique_ptr const& p); - -template -class shared_ptr -{ -public: - typedef T element_type; - 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; -template - bool operator<(shared_ptr const& a, shared_ptr const& b) noexcept; -template - bool operator>(shared_ptr const& a, shared_ptr const& b) noexcept; -template - bool operator<=(shared_ptr const& a, shared_ptr const& b) noexcept; -template - bool operator>=(shared_ptr const& a, shared_ptr const& b) noexcept; - -template - bool operator==(const shared_ptr& x, nullptr_t) noexcept; -template - bool operator==(nullptr_t, const shared_ptr& y) noexcept; -template - bool operator!=(const shared_ptr& x, nullptr_t) noexcept; -template - bool operator!=(nullptr_t, const shared_ptr& y) noexcept; -template - bool operator<(const shared_ptr& x, nullptr_t) noexcept; -template -bool operator<(nullptr_t, const shared_ptr& y) noexcept; -template - bool operator<=(const shared_ptr& x, nullptr_t) noexcept; -template - bool operator<=(nullptr_t, const shared_ptr& y) noexcept; -template - bool operator>(const shared_ptr& x, nullptr_t) noexcept; -template - bool operator>(nullptr_t, const shared_ptr& y) noexcept; -template - bool operator>=(const shared_ptr& x, nullptr_t) noexcept; -template - bool operator>=(nullptr_t, const shared_ptr& y) noexcept; - -// 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); -template - shared_ptr allocate_shared(const A& a, Args&&... args); - -template -class weak_ptr -{ -public: - typedef T element_type; - - // 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; - -// Pointer safety -enum class pointer_safety { relaxed, preferred, strict }; // since C++11 -void declare_reachable(void *p); // since C++11 -template T *undeclare_reachable(T *p); // since C++11 -void declare_no_pointers(char *p, size_t n); // since C++11 -void undeclare_no_pointers(char *p, size_t n); // since C++11 -pointer_safety get_pointer_safety() noexcept; // since C++11 - -void* align(size_t alignment, size_t size, void*& ptr, size_t& space); - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/memory.syn. #include <__config> #include <__functional_base> diff --git a/libcxx/include/mutex b/libcxx/include/mutex --- a/libcxx/include/mutex +++ b/libcxx/include/mutex @@ -10,181 +10,7 @@ #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; // If MutexTypes... consists of the single type Mutex - - 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 - -*/ +// Synopsis avaiable at http://wg21.link/mutex.syn. #include <__config> #include <__mutex_base> diff --git a/libcxx/include/new b/libcxx/include/new --- a/libcxx/include/new +++ b/libcxx/include/new @@ -10,81 +10,7 @@ #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; - -*/ +// Synopsis avaiable at http://wg21.link/new.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/numbers b/libcxx/include/numbers --- a/libcxx/include/numbers +++ b/libcxx/include/numbers @@ -10,53 +10,7 @@ #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; -} -*/ +// Synopsis avaiable at http://wg21.link/numbers.syn. #include <__config> #include diff --git a/libcxx/include/numeric b/libcxx/include/numeric --- a/libcxx/include/numeric +++ b/libcxx/include/numeric @@ -10,139 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/numeric.ops.overview. #include <__config> #include <__debug> diff --git a/libcxx/include/optional b/libcxx/include/optional --- a/libcxx/include/optional +++ b/libcxx/include/optional @@ -10,141 +10,7 @@ #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; - optional(const optional &); - 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 optional(U &&); - template - EXPLICIT optional(const optional &); // constexpr in C++20 - template - EXPLICIT 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 - optional &operator=(const optional &); // constexpr in C++20 - optional &operator=(optional &&) noexcept(see below); // constexpr in C++20 - 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 &&) &&; - - // 23.6.3.6, modifiers - void reset() noexcept; // constexpr in C++20 - - private: - T *val; // exposition only - }; - -template - optional(T) -> optional; - -} // namespace std - -*/ +// Synopsis avaiable at http://wg21.link/optional.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/ostream b/libcxx/include/ostream --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -10,128 +10,7 @@ #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<<(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); - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/ostream.syn. #include <__config> #include diff --git a/libcxx/include/queue b/libcxx/include/queue --- a/libcxx/include/queue +++ b/libcxx/include/queue @@ -10,173 +10,7 @@ #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 - 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); - - 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(Container, Allocator) -> queue; // C++17 - -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_type& c); - template - priority_queue(InputIterator first, InputIterator last, - const Compare& comp, container_type&& 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_type& c, - const Alloc& a); - template - priority_queue(const Compare& comp, container_type&& 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::value_type>, - class Container = vector::value_type>> -priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container()) - -> priority_queue::value_type, Container, Compare>; // C++17 - -template -priority_queue(Compare, Container, Allocator) - -> priority_queue; // C++17 - -template - void swap(priority_queue& x, - priority_queue& y) - noexcept(noexcept(x.swap(y))); - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/queue.syn. #include <__config> #include <__utility/forward.h> diff --git a/libcxx/include/random b/libcxx/include/random --- a/libcxx/include/random +++ b/libcxx/include/random @@ -10,1672 +10,7 @@ #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 -*/ +// Synopsis avaiable at http://wg21.link/rand.synopsis. #include <__config> #include <__random/uniform_int_distribution.h> diff --git a/libcxx/include/ranges b/libcxx/include/ranges --- a/libcxx/include/ranges +++ b/libcxx/include/ranges @@ -10,100 +10,7 @@ #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 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_value_t = iter_value_t>; - template - using range_reference_t = iter_reference_t>; - template - using range_rvalue_reference_t = iter_rvalue_reference_t>; - - // [range.sized] - 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 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; - - // [view.interface], class template view_interface - template - requires is_class_v && same_as> - class view_interface; - - // [range.empty], empty view - template - requires is_object_v - class empty_view; - - // [range.drop], drop view - template - class drop_view; - - template - inline constexpr bool enable_borrowed_range> = enable_borrowed_range; -} - -*/ +// Synopsis avaiable at http://wg21.link/ranges.syn. #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,72 +10,7 @@ #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 -} -*/ +// Synopsis avaiable at http://wg21.link/ratio.syn. #include <__config> #include diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -10,757 +10,7 @@ #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; -}; - -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 -*/ +// Synopsis avaiable at http://wg21.link/re.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/scoped_allocator b/libcxx/include/scoped_allocator --- a/libcxx/include/scoped_allocator +++ b/libcxx/include/scoped_allocator @@ -10,100 +10,7 @@ #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 - 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 - -*/ +// Synopsis avaiable at http://wg21.link/allocator.adaptor.syn. #include <__config> #include <__utility/forward.h> diff --git a/libcxx/include/semaphore b/libcxx/include/semaphore --- a/libcxx/include/semaphore +++ b/libcxx/include/semaphore @@ -9,41 +9,7 @@ #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>; - -} - -*/ +// Synopsis avaiable at http://wg21.link/semaphore.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/set b/libcxx/include/set --- a/libcxx/include/set +++ b/libcxx/include/set @@ -10,428 +10,7 @@ #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 -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 -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 - -*/ +// Synopsis avaiable at http://wg21.link/associative.set.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/shared_mutex b/libcxx/include/shared_mutex --- a/libcxx/include/shared_mutex +++ b/libcxx/include/shared_mutex @@ -10,117 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/shared.mutex.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/span b/libcxx/include/span --- a/libcxx/include/span +++ b/libcxx/include/span @@ -10,122 +10,7 @@ #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; - constexpr explicit(Extent != dynamic_extent) span(pointer ptr, size_type count); - constexpr explicit(Extent != dynamic_extent) span(pointer firstElem, pointer lastElem); - template - constexpr span(element_type (&arr)[N]) noexcept; - template - constexpr span(array& arr) noexcept; - template - constexpr span(const array& arr) noexcept; - template - constexpr explicit(Extent != dynamic_extent) span(Container& cont); - template - constexpr explicit(Extent != dynamic_extent) span(const Container& cont); - 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; - 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(T (&)[N]) -> span; - -template - span(array&) -> span; - -template - span(const array&) -> span; - -template - span(Container&) -> span; - -template - span(const Container&) -> span; - -} // namespace std - -*/ +// Synopsis avaiable at http://wg21.link/span.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/sstream b/libcxx/include/sstream --- a/libcxx/include/sstream +++ b/libcxx/include/sstream @@ -10,175 +10,7 @@ #ifndef _LIBCPP_SSTREAM #define _LIBCPP_SSTREAM -/* - sstream synopsis - -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; - - // 27.8.1.1 [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); - - // 27.8.1.2 Assign and swap: - basic_stringbuf& operator=(basic_stringbuf&& rhs); - void swap(basic_stringbuf& rhs); - - // 27.8.1.3 Get and set: - basic_string str() const; - void str(const basic_string& s); - -protected: - // 27.8.1.4 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); -}; - -template - void swap(basic_stringbuf& x, - basic_stringbuf& y); - -typedef basic_stringbuf stringbuf; -typedef basic_stringbuf wstringbuf; - -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; - - // 27.8.2.1 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); - - // 27.8.2.2 Assign and swap: - basic_istringstream& operator=(basic_istringstream&& rhs); - void swap(basic_istringstream& rhs); - - // 27.8.2.3 Members: - 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; - -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; - - // 27.8.3.1 Constructors/destructor: - 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); - - // 27.8.3.2 Assign/swap: - basic_ostringstream& operator=(basic_ostringstream&& rhs); - void swap(basic_ostringstream& rhs); - - // 27.8.3.3 Members: - 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; - -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; - - // constructors/destructor - 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); - - // 27.8.5.1 Assign/swap: - basic_stringstream& operator=(basic_stringstream&& rhs); - void swap(basic_stringstream& rhs); - - // Members: - 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 - -*/ +// Synopsis avaiable at http://wg21.link/sstream.syn. #include <__config> #include diff --git a/libcxx/include/stack b/libcxx/include/stack --- a/libcxx/include/stack +++ b/libcxx/include/stack @@ -10,82 +10,7 @@ #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 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); - - 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(Container, Allocator) -> stack; // C++17 - -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 - -*/ +// Synopsis avaiable at http://wg21.link/stack.syn. #include <__config> #include <__utility/forward.h> diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept --- a/libcxx/include/stdexcept +++ b/libcxx/include/stdexcept @@ -10,36 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/stdexcept.syn. #include <__config> #include diff --git a/libcxx/include/streambuf b/libcxx/include/streambuf --- a/libcxx/include/streambuf +++ b/libcxx/include/streambuf @@ -10,102 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/streambuf.syn. #include <__config> #include diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -10,508 +10,7 @@ #ifndef _LIBCPP_STRING #define _LIBCPP_STRING -/* - string synopsis - -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 -{ - typedef charT char_type; - typedef ... int_type; - typedef streamoff off_type; - typedef streampos pos_type; - typedef mbstate_t state_type; - - 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); - explicit basic_string(const allocator_type& a); - basic_string(const basic_string& str); - basic_string(basic_string&& str) - noexcept(is_nothrow_move_constructible::value); - basic_string(const basic_string& str, size_type pos, - const allocator_type& a = allocator_type()); - basic_string(const basic_string& str, size_type pos, size_type n, - const Allocator& a = Allocator()); - template - basic_string(const T& t, size_type pos, size_type n, const Allocator& a = Allocator()); // C++17 - template - explicit basic_string(const T& t, const Allocator& a = Allocator()); // C++17 - basic_string(const value_type* s, const allocator_type& a = allocator_type()); - basic_string(const value_type* s, size_type n, const allocator_type& a = allocator_type()); - basic_string(size_type n, value_type c, const allocator_type& a = allocator_type()); - template - basic_string(InputIterator begin, InputIterator end, - const allocator_type& a = allocator_type()); - basic_string(initializer_list, const Allocator& = Allocator()); - basic_string(const basic_string&, const Allocator&); - basic_string(basic_string&&, const Allocator&); - - ~basic_string(); - - operator basic_string_view() const noexcept; - - basic_string& operator=(const basic_string& str); - template - basic_string& operator=(const T& t); // C++17 - basic_string& operator=(basic_string&& str) - noexcept( - allocator_type::propagate_on_container_move_assignment::value || - allocator_type::is_always_equal::value ); // C++17 - basic_string& operator=(const value_type* s); - basic_string& operator=(value_type c); - basic_string& operator=(initializer_list); - - 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 length() const noexcept; - size_type max_size() const noexcept; - size_type capacity() const noexcept; - - void resize(size_type n, value_type c); - void resize(size_type n); - - void reserve(size_type res_arg); - void reserve(); // deprecated in C++20 - void shrink_to_fit(); - void clear() noexcept; - bool empty() const noexcept; - - const_reference operator[](size_type pos) const; - reference operator[](size_type pos); - - const_reference at(size_type n) const; - reference at(size_type n); - - basic_string& operator+=(const basic_string& str); - template - basic_string& operator+=(const T& t); // C++17 - basic_string& operator+=(const value_type* s); - basic_string& operator+=(value_type c); - basic_string& operator+=(initializer_list); - - basic_string& append(const basic_string& str); - template - basic_string& append(const T& t); // C++17 - basic_string& append(const basic_string& str, size_type pos, size_type n=npos); //C++14 - template - basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17 - basic_string& append(const value_type* s, size_type n); - basic_string& append(const value_type* s); - basic_string& append(size_type n, value_type c); - template - basic_string& append(InputIterator first, InputIterator last); - basic_string& append(initializer_list); - - void push_back(value_type c); - void pop_back(); - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - - basic_string& assign(const basic_string& str); - template - basic_string& assign(const T& t); // C++17 - basic_string& assign(basic_string&& str); - basic_string& assign(const basic_string& str, size_type pos, size_type n=npos); // C++14 - template - basic_string& assign(const T& t, size_type pos, size_type n=npos); // C++17 - basic_string& assign(const value_type* s, size_type n); - basic_string& assign(const value_type* s); - basic_string& assign(size_type n, value_type c); - template - basic_string& assign(InputIterator first, InputIterator last); - basic_string& assign(initializer_list); - - basic_string& insert(size_type pos1, const basic_string& str); - template - basic_string& insert(size_type pos1, const T& t); - basic_string& insert(size_type pos1, const basic_string& str, - size_type pos2, size_type n); - template - basic_string& insert(size_type pos1, const T& t, size_type pos2, size_type n); // C++17 - basic_string& insert(size_type pos, const value_type* s, size_type n=npos); //C++14 - basic_string& insert(size_type pos, const value_type* s); - basic_string& insert(size_type pos, size_type n, value_type c); - iterator insert(const_iterator p, value_type c); - iterator insert(const_iterator p, size_type n, value_type c); - template - iterator insert(const_iterator p, InputIterator first, InputIterator last); - iterator insert(const_iterator p, initializer_list); - - basic_string& erase(size_type pos = 0, size_type n = npos); - iterator erase(const_iterator position); - iterator erase(const_iterator first, const_iterator last); - - basic_string& replace(size_type pos1, size_type n1, const basic_string& str); - template - basic_string& replace(size_type pos1, size_type n1, const T& t); // C++17 - basic_string& replace(size_type pos1, size_type n1, const basic_string& str, - size_type pos2, size_type n2=npos); // C++14 - template - basic_string& replace(size_type pos1, size_type n1, const T& t, - size_type pos2, size_type n); // C++17 - basic_string& replace(size_type pos, size_type n1, const value_type* s, size_type n2); - basic_string& replace(size_type pos, size_type n1, const value_type* s); - basic_string& replace(size_type pos, size_type n1, size_type n2, value_type c); - basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str); - template - basic_string& replace(const_iterator i1, const_iterator i2, const T& t); // C++17 - basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s, size_type n); - basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s); - basic_string& replace(const_iterator i1, const_iterator i2, size_type n, value_type c); - template - basic_string& replace(const_iterator i1, const_iterator i2, InputIterator j1, InputIterator j2); - basic_string& replace(const_iterator i1, const_iterator i2, initializer_list); - - size_type copy(value_type* s, size_type n, size_type pos = 0) const; - basic_string substr(size_type pos = 0, size_type n = npos) const; - - void swap(basic_string& str) - noexcept(allocator_traits::propagate_on_container_swap::value || - allocator_traits::is_always_equal::value); // C++17 - - const value_type* c_str() const noexcept; - const value_type* data() const noexcept; - value_type* data() noexcept; // C++17 - - allocator_type get_allocator() const noexcept; - - size_type find(const basic_string& str, size_type pos = 0) const noexcept; - template - size_type find(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension - size_type find(const value_type* s, size_type pos, size_type n) const noexcept; - size_type find(const value_type* s, size_type pos = 0) const noexcept; - size_type find(value_type c, size_type pos = 0) const noexcept; - - size_type rfind(const basic_string& str, size_type pos = npos) const noexcept; - template - size_type rfind(const T& t, size_type pos = npos) const noexcept; // C++17, noexcept as an extension - size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept; - size_type rfind(const value_type* s, size_type pos = npos) const noexcept; - size_type rfind(value_type c, size_type pos = npos) const noexcept; - - size_type find_first_of(const basic_string& str, size_type pos = 0) const noexcept; - template - size_type find_first_of(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension - size_type find_first_of(const value_type* s, size_type pos, size_type n) const noexcept; - size_type find_first_of(const value_type* s, size_type pos = 0) const noexcept; - size_type find_first_of(value_type c, size_type pos = 0) const noexcept; - - size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept; - template - size_type find_last_of(const T& t, size_type pos = npos) const noexcept noexcept; // C++17, noexcept as an extension - size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept; - size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept; - size_type find_last_of(value_type c, size_type pos = npos) const noexcept; - - size_type find_first_not_of(const basic_string& str, size_type pos = 0) const noexcept; - template - size_type find_first_not_of(const T& t, size_type pos = 0) const noexcept; // C++17, noexcept as an extension - size_type find_first_not_of(const value_type* s, size_type pos, size_type n) const noexcept; - size_type find_first_not_of(const value_type* s, size_type pos = 0) const noexcept; - size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept; - - size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept; - template - size_type find_last_not_of(const T& t, size_type pos = npos) const noexcept; // C++17, noexcept as an extension - size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept; - size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept; - size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept; - - int compare(const basic_string& str) const noexcept; - template - int compare(const T& t) const noexcept; // C++17, noexcept as an extension - int compare(size_type pos1, size_type n1, const basic_string& str) const; - template - int compare(size_type pos1, size_type n1, const T& t) const; // C++17 - int compare(size_type pos1, size_type n1, const basic_string& str, - size_type pos2, size_type n2=npos) const; // C++14 - template - int compare(size_type pos1, size_type n1, const T& t, - size_type pos2, size_type n2=npos) const; // C++17 - int compare(const value_type* s) const noexcept; - int compare(size_type pos1, size_type n1, const value_type* s) const; - int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const; - - bool starts_with(basic_string_view sv) const noexcept; // C++20 - bool starts_with(charT c) const noexcept; // C++20 - bool starts_with(const charT* s) const; // C++20 - bool ends_with(basic_string_view sv) const noexcept; // C++20 - bool ends_with(charT c) const noexcept; // C++20 - 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 - - bool __invariants() const; -}; - -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); - -template -basic_string -operator+(const charT* lhs , const basic_string&rhs); - -template -basic_string -operator+(charT lhs, const basic_string& rhs); - -template -basic_string -operator+(const basic_string& lhs, const charT* rhs); - -template -basic_string -operator+(const basic_string& lhs, charT rhs); - -template -bool operator==(const basic_string& lhs, - const basic_string& rhs) noexcept; - -template -bool operator==(const charT* lhs, const basic_string& rhs) noexcept; - -template -bool operator==(const basic_string& lhs, const charT* rhs) noexcept; - -template -bool operator!=(const basic_string& lhs, - const basic_string& rhs) noexcept; - -template -bool operator!=(const charT* lhs, const basic_string& rhs) noexcept; - -template -bool operator!=(const basic_string& lhs, const charT* rhs) noexcept; - -template -bool operator< (const basic_string& lhs, - const basic_string& rhs) noexcept; - -template -bool operator< (const basic_string& lhs, const charT* rhs) noexcept; - -template -bool operator< (const charT* lhs, const basic_string& rhs) noexcept; - -template -bool operator> (const basic_string& lhs, - const basic_string& rhs) noexcept; - -template -bool operator> (const basic_string& lhs, const charT* rhs) noexcept; - -template -bool operator> (const charT* lhs, const basic_string& rhs) noexcept; - -template -bool operator<=(const basic_string& lhs, - const basic_string& rhs) noexcept; - -template -bool operator<=(const basic_string& lhs, const charT* rhs) noexcept; - -template -bool operator<=(const charT* lhs, const basic_string& rhs) noexcept; - -template -bool operator>=(const basic_string& lhs, - const basic_string& rhs) noexcept; - -template -bool operator>=(const basic_string& lhs, const charT* rhs) noexcept; - -template -bool operator>=(const charT* lhs, const basic_string& rhs) noexcept; - -template -void swap(basic_string& lhs, - basic_string& rhs) - noexcept(noexcept(lhs.swap(rhs))); - -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 -basic_string operator "" s( const wchar_t *str, size_t len ); // C++14 -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 -basic_string operator "" s( const char32_t *str, size_t len ); // C++14 - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/string.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/string_view b/libcxx/include/string_view --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -10,179 +10,7 @@ #ifndef _LIBCPP_STRING_VIEW #define _LIBCPP_STRING_VIEW -/* -string_view synopsis - -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 - constexpr bool operator!=(basic_string_view x, - basic_string_view y) noexcept; - template - constexpr bool operator< (basic_string_view x, - basic_string_view y) noexcept; - template - constexpr bool operator> (basic_string_view x, - basic_string_view y) noexcept; - template - constexpr bool operator<=(basic_string_view x, - basic_string_view y) noexcept; - template - constexpr bool 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); - constexpr basic_string_view(const charT* str, size_type len); - - // 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 - }; - - // 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 - - -*/ +// Synopsis avaiable at http://wg21.link/string.view.synop. #include <__config> #include <__debug> diff --git a/libcxx/include/strstream b/libcxx/include/strstream --- a/libcxx/include/strstream +++ b/libcxx/include/strstream @@ -10,124 +10,7 @@ #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 - -*/ +// Synopsis avaiable at http://wg21.link/depr.strstream.syn. #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,137 +10,7 @@ #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; - bool operator<(const error_category& rhs) const noexcept; -}; - -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 size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17 - -template -inline constexpr size_t 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: -bool operator<(const error_code& lhs, const error_code& rhs) noexcept; -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; -}; - -bool operator<(const error_condition& lhs, const error_condition& rhs) 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; -bool operator==(const error_condition& lhs, const error_condition& rhs) noexcept; -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; -bool operator!=(const error_condition& lhs, const error_condition& rhs) noexcept; - -template <> struct hash; -template <> struct hash; - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/system.error.syn. #include <__config> #include <__errc> diff --git a/libcxx/include/thread b/libcxx/include/thread --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -10,77 +10,7 @@ #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; -bool operator< (thread::id x, thread::id y) noexcept; -bool operator<=(thread::id x, thread::id y) noexcept; -bool operator> (thread::id x, thread::id y) noexcept; -bool operator>=(thread::id x, thread::id y) noexcept; - -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 - -*/ +// Synopsis avaiable at http://wg21.link/thread.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/tuple b/libcxx/include/tuple --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -10,144 +10,7 @@ #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 - explicit(see-below) tuple(const tuple&); // constexpr in C++14 - template - explicit(see-below) tuple(tuple&&); // constexpr in C++14 - 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 - - // 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 - 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 - 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 - - tuple& operator=(const tuple&); // constexpr in C++20 - tuple& operator=(tuple&&) noexcept(is_nothrow_move_assignable_v && ...); // constexpr in C++20 - template - tuple& operator=(const tuple&); // constexpr in C++20 - template - tuple& operator=(tuple&&); // constexpr in C++20 - template - tuple& operator=(const pair&); // iff sizeof...(T) == 2 // constexpr in C++20 - template - tuple& operator=(pair&&); // iff sizeof...(T) == 2 // constexpr in C++20 - - 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 -}; - -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 -template bool operator!=(const tuple&, const tuple&); // constexpr in C++14 -template bool operator>(const tuple&, const tuple&); // constexpr in C++14 -template bool operator<=(const tuple&, const tuple&); // constexpr in C++14 -template bool operator>=(const tuple&, const tuple&); // constexpr in C++14 - -template - struct uses_allocator, Alloc>; - -template - void - swap(tuple& x, tuple& y) noexcept(noexcept(x.swap(y))); - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/tuple.syn. #include <__config> #include <__functional_base> 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,8 @@ #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; - 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; - template struct aligned_union; - template struct remove_cvref; // C++20 - - template struct decay; - template struct common_type; - template struct underlying_type; - template class result_of; // undefined - template class result_of; - 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 - 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 - 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 +// Synopsis avaiable at http://wg21.link/meta.type.synop. -} - -*/ #include <__config> #include #include diff --git a/libcxx/include/typeindex b/libcxx/include/typeindex --- a/libcxx/include/typeindex +++ b/libcxx/include/typeindex @@ -10,39 +10,7 @@ #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; - 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; - - 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 - -*/ +// Synopsis avaiable at http://wg21.link/type.index.synopsis. #include <__config> #include <__functional_base> diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo --- a/libcxx/include/typeinfo +++ b/libcxx/include/typeinfo @@ -10,51 +10,7 @@ #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; - bool operator!=(const type_info& rhs) const noexcept; - - 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 - -*/ +// Synopsis avaiable at http://wg21.link/typeinfo.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -10,426 +10,7 @@ #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 - 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 - 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 - -*/ +// Synopsis avaiable at http://wg21.link/unord.map.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -10,381 +10,7 @@ #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 - 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 - 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 - -*/ +// Synopsis avaiable at http://wg21.link/unord.set.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/utility b/libcxx/include/utility --- a/libcxx/include/utility +++ b/libcxx/include/utility @@ -10,202 +10,7 @@ #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 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&& x, V&& y); // constexpr in C++14 - template explicit(see-below) pair(const pair& p); // constexpr in C++14 - template explicit(see-below) pair(pair&& p); // constexpr in C++14 - template - pair(piecewise_construct_t, tuple first_args, - tuple second_args); // constexpr in C++20 - - template pair& operator=(const pair& p); // constexpr in C++20 - pair& operator=(pair&& p) noexcept(is_nothrow_move_assignable::value && - is_nothrow_move_assignable::value); // constexpr in C++20 - template pair& operator=(pair&& p); // constexpr in C++20 - - void swap(pair& p) noexcept(is_nothrow_swappable_v && - is_nothrow_swappable_v); // constexpr in C++20 -}; - -template bool operator==(const pair&, const pair&); // constexpr in C++14 -template bool operator!=(const pair&, const pair&); // constexpr in C++14 -template bool operator< (const pair&, const pair&); // constexpr in C++14 -template bool operator> (const pair&, const pair&); // constexpr in C++14 -template bool operator>=(const pair&, const pair&); // constexpr in C++14 -template bool operator<=(const pair&, const pair&); // constexpr in C++14 - -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 - -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 - T exchange(T& obj, U&& new_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 - -*/ +// Synopsis avaiable at http://wg21.link/utility.syn. #include <__config> #include <__debug> diff --git a/libcxx/include/valarray b/libcxx/include/valarray --- a/libcxx/include/valarray +++ b/libcxx/include/valarray @@ -10,334 +10,7 @@ #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()); -}; - -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 - -*/ +// Synopsis avaiable at http://wg21.link/valarray.syn. #include <__config> #include diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -10,194 +10,7 @@ #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); - variant(const variant&); // constexpr in C++20 - variant(variant&&) noexcept(see below); // constexpr in C++20 - - 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 - variant& operator=(const variant&); // constexpr in C++20 - variant& operator=(variant&&) noexcept(see below); // constexpr in C++20 - - 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&); - - // 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; - constexpr bool operator<=(monostate, monostate) noexcept; - constexpr bool operator>=(monostate, monostate) noexcept; - constexpr bool operator==(monostate, monostate) noexcept; - constexpr bool operator!=(monostate, monostate) noexcept; - - // 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 - -*/ +// Synopsis avaiable at http://wg21.link/variant.syn. #include <__availability> #include <__config> diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -10,266 +10,7 @@ #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=(const 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>; - -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 - -} // std - -*/ +// Synopsis avaiable at http://wg21.link/vector.syn. #include <__config> #include <__bit_reference> diff --git a/libcxx/include/version b/libcxx/include/version --- a/libcxx/include/version +++ b/libcxx/include/version @@ -10,160 +10,7 @@ #ifndef _LIBCPP_VERSIONH #define _LIBCPP_VERSIONH -/* - version synopsis - -Macro name Value Headers -__cpp_lib_addressof_constexpr 201603L -__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_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_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_char8_t 201811L - - -__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_complex 201711L -__cpp_lib_constexpr_dynamic_alloc 201907L -__cpp_lib_constexpr_functional 201907L -__cpp_lib_constexpr_iterator 201811L -__cpp_lib_constexpr_memory 201811L -__cpp_lib_constexpr_numeric 201911L -__cpp_lib_constexpr_string 201811L -__cpp_lib_constexpr_string_view 201811L -__cpp_lib_constexpr_tuple 201811L -__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_filesystem 201703L -__cpp_lib_format 201907L -__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_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_node_extract 201606L - -__cpp_lib_nonmember_container_access 201411L - - - -__cpp_lib_not_fn 201603L -__cpp_lib_null_iterators 201304L -__cpp_lib_optional 201606L -__cpp_lib_parallel_algorithm 201603L -__cpp_lib_polymorphic_allocator 201902L -__cpp_lib_quoted_string_io 201304L -__cpp_lib_ranges 201811L - -__cpp_lib_raw_memory_algorithms 201606L -__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 201611L -__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_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_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_trait_variable_templates 201510L -__cpp_lib_uncaught_exceptions 201411L -__cpp_lib_unordered_map_try_emplace 201411L -__cpp_lib_unwrap_ref 201811L -__cpp_lib_variant 202102L -__cpp_lib_void_t 201411L - -*/ +// Synopsis avaiable at http://wg21.link/version.syn. #include <__config>