Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Cleanup remaining utility header
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Feb 16, 2023
1 parent 822c150 commit cd13c4b
Showing 1 changed file with 57 additions and 36 deletions.
93 changes: 57 additions & 36 deletions include/cuda/std/detail/libcxx/include/utility
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b)));
template <class T> T&& forward(typename remove_reference<T>::type& t) noexcept; // constexpr in C++14
template <class T> T&& forward(typename remove_reference<T>::type&& t) noexcept; // constexpr in C++14
template <typename T>
[[nodiscard]] constexpr
auto forward_like(auto&& x) noexcept -> see below; // since C++23
template <class T> typename remove_reference<T>::type&& move(T&&) noexcept; // constexpr in C++14
template <class T>
Expand All @@ -58,6 +62,14 @@ template <class T> void as_const(const T&&) = delete; // C+
template <class T> typename add_rvalue_reference<T>::type declval() noexcept;
template<class T, class U> constexpr bool cmp_equal(T t, U u) noexcept; // C++20
template<class T, class U> constexpr bool cmp_not_equal(T t, U u) noexcept; // C++20
template<class T, class U> constexpr bool cmp_less(T t, U u) noexcept; // C++20
template<class T, class U> constexpr bool cmp_greater(T t, U u) noexcept; // C++20
template<class T, class U> constexpr bool cmp_less_equal(T t, U u) noexcept; // C++20
template<class T, class U> constexpr bool cmp_greater_equal(T t, U u) noexcept; // C++20
template<class R, class T> constexpr bool in_range(T t) noexcept; // C++20
template <class T1, class T2>
struct pair
{
Expand All @@ -71,33 +83,58 @@ struct pair
pair(pair&&) = default;
explicit(see-below) constexpr pair();
explicit(see-below) pair(const T1& x, const T2& y); // constexpr in C++14
template <class U, class V> explicit(see-below) pair(U&& x, V&& y); // constexpr in C++14
template <class U = T1, class V = T2> explicit(see-below) pair(U&&, V&&); // constexpr in C++14
template <class U, class V> constexpr explicit(see below) pair(pair<U, V>&); // since C++23
template <class U, class V> explicit(see-below) pair(const pair<U, V>& p); // constexpr in C++14
template <class U, class V> explicit(see-below) pair(pair<U, V>&& p); // constexpr in C++14
template <class U, class V>
constexpr explicit(see below) pair(const pair<U, V>&&); // since C++23
template <class... Args1, class... Args2>
pair(piecewise_construct_t, tuple<Args1...> first_args,
tuple<Args2...> second_args);
tuple<Args2...> second_args); // constexpr in C++20
template <class U, class V> pair& operator=(const pair<U, V>& p);
constexpr const pair& operator=(const pair& p) const; // since C++23
template <class U, class V> pair& operator=(const pair<U, V>& p); // constexpr in C++20
template <class U, class V>
constexpr const pair& operator=(const pair<U, V>& p) const; // since C++23
pair& operator=(pair&& p) noexcept(is_nothrow_move_assignable<T1>::value &&
is_nothrow_move_assignable<T2>::value);
template <class U, class V> pair& operator=(pair<U, V>&& p);
is_nothrow_move_assignable<T2>::value); // constexpr in C++20
constexpr const pair& operator=(pair&& p) const; // since C++23
template <class U, class V> pair& operator=(pair<U, V>&& p); // constexpr in C++20
template <class U, class V>
constexpr const pair& operator=(pair<U, V>&& p) const; // since C++23
void swap(pair& p) noexcept(is_nothrow_swappable_v<T1> &&
is_nothrow_swappable_v<T2>);
is_nothrow_swappable_v<T2>); // constexpr in C++20
constexpr void swap(const pair& p) const noexcept(see below); // since C++23
};
template<class T1, class T2, class U1, class U2, template<class> class TQual, template<class> class UQual>
struct basic_common_reference<pair<T1, T2>, pair<U1, U2>, TQual, UQual>; // since C++23
template<class T1, class T2, class U1, class U2>
struct common_type<pair<T1, T2>, pair<U1, U2>>; // since C++23
template<class T1, class T2> pair(T1, T2) -> pair<T1, T2>;
template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14, removed in C++20
template <class T1, class T2>
constexpr common_comparison_type_t<synth-three-way-result<T1>,
synth-three-way-result<T2>>
operator<=>(const pair<T1,T2>&, const pair<T1,T2>&); // C++20
template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&); // constexpr in C++14
template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&); // constexpr in C++14
template <class T1, class T2>
void
swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20
template<class T1, class T2>
constexpr void swap(const pair<T1, T2>& x, const pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); // since C++23
struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
Expand Down Expand Up @@ -171,7 +208,8 @@ template<class... T>
using index_sequence_for = make_index_sequence<sizeof...(T)>;
template<class T, class U=T>
T exchange(T& obj, U&& new_value);
constexpr T exchange(T& obj, U&& new_value)
noexcept(is_nothrow_move_constructible<T>::value && is_nothrow_assignable<T&, U>::value); // constexpr in C++17, noexcept in C++23
// 20.2.7, in-place construction // C++17
struct in_place_t {
Expand All @@ -191,20 +229,19 @@ template <size_t I>
template <size_t I>
inline constexpr in_place_index_t<I> in_place_index{};
// [utility.underlying], to_underlying
template <class T>
constexpr underlying_type_t<T> to_underlying( T value ) noexcept; // C++2b
} // std
*/

#ifndef __cuda_std__
#include <__config>
#include <type_traits>
#include <__debug>
#include <initializer_list>
#include <cstddef>
#include <cstring>
#include <cstdint>
#include <version>
#include <__debug>
#include <__pragma_push>
#endif //__cuda_std__

#include "__functional/binary_function.h"
Expand Down Expand Up @@ -251,20 +288,4 @@ template <size_t I>
#pragma GCC system_header
#endif

_LIBCUDACXX_BEGIN_NAMESPACE_STD

// This header is not currently supported. It exists to allow for the use of
// `unary_function`, needed by `<cuda/std/functional>`, which happens to be defined here.

// swap_ranges is defined in <type_traits>`

// swap is defined in <type_traits>


_LIBCUDACXX_END_NAMESPACE_STD

#ifndef __cuda_std__
#include <__pragma_pop>
#endif //__cuda_std__

#endif // _LIBCUDACXX_UTILITY

0 comments on commit cd13c4b

Please sign in to comment.