diff options
Diffstat (limited to 'third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat')
14 files changed, 201 insertions, 51 deletions
diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/bit.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/bit.h index 1e9309417..d68a19878 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/bit.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/bit.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_BIT_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_BIT_H_ +#ifndef LIB_STDCOMPAT_BIT_H_ +#define LIB_STDCOMPAT_BIT_H_ #include <cstring> #include <limits> @@ -143,7 +143,7 @@ constexpr std::enable_if_t<std::is_unsigned<T>::value, bool> has_single_bit(T va } template <typename T> -constexpr std::enable_if_t<std::is_unsigned<T>::value, T> bit_width(T value) { +constexpr std::enable_if_t<std::is_unsigned<T>::value, int> bit_width(T value) { return internal::bit_width(value); } @@ -182,4 +182,4 @@ enum class endian { } // namespace cpp20 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_BIT_H_ +#endif // LIB_STDCOMPAT_BIT_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/functional.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/functional.h index 34d44e0d5..e14122cbd 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/functional.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/functional.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_FUNCTIONAL_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_FUNCTIONAL_H_ +#ifndef LIB_STDCOMPAT_FUNCTIONAL_H_ +#define LIB_STDCOMPAT_FUNCTIONAL_H_ #include "internal/functional.h" @@ -47,4 +47,4 @@ constexpr ::cpp20::internal::front_binder_t<F, Args...> bind_front(F&& f, Args&& } // namespace cpp20 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_FUNCTIONAL_H_ +#endif // LIB_STDCOMPAT_FUNCTIONAL_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/bit.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/bit.h index 92b33a633..62f046a74 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/bit.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/bit.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_BIT_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_BIT_H_ +#ifndef LIB_STDCOMPAT_INTERNAL_BIT_H_ +#define LIB_STDCOMPAT_INTERNAL_BIT_H_ #include <limits> #include <type_traits> @@ -183,9 +183,9 @@ popcount(T value) noexcept { } template <typename T> -constexpr std::enable_if_t<is_bit_type<T>::value, T> bit_width(T value) { - const T zeros_left = - (value == 0) ? std::numeric_limits<T>::digits : static_cast<T>(count_zeros_from_left(value)); +constexpr std::enable_if_t<is_bit_type<T>::value, int> bit_width(T value) { + const int zeros_left = (value == 0) ? std::numeric_limits<T>::digits + : static_cast<int>(count_zeros_from_left(value)); return std::numeric_limits<T>::digits - zeros_left; } @@ -209,7 +209,7 @@ bit_ceil(T value) { template <typename T> constexpr std::enable_if_t<is_bit_type<T>::value, T> bit_floor(T value) { - return static_cast<T>(T(1) << (bit_width(value) - T(1))); + return value == 0 ? 0 : static_cast<T>(T(1) << (static_cast<T>(bit_width(value)) - T(1))); } template <unsigned little, unsigned big> @@ -227,4 +227,4 @@ constexpr unsigned native_endianess() { } // namespace internal } // namespace cpp20 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_BIT_H_ +#endif // LIB_STDCOMPAT_INTERNAL_BIT_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/constructors.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/constructors.h index e86f2f108..ba592ac7b 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/constructors.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/constructors.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_CONSTRUCTORS_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_CONSTRUCTORS_H_ +#ifndef LIB_STDCOMPAT_INTERNAL_CONSTRUCTORS_H_ +#define LIB_STDCOMPAT_INTERNAL_CONSTRUCTORS_H_ #include <cstddef> #include <type_traits> @@ -97,4 +97,4 @@ struct modulate_copy_and_move } // namespace internal } // namespace cpp17 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_CONSTRUCTORS_H_ +#endif // LIB_STDCOMPAT_INTERNAL_CONSTRUCTORS_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/exception.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/exception.h index 74f4e8c08..f04a41201 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/exception.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/exception.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_EXCEPTION_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_EXCEPTION_H_ +#ifndef LIB_STDCOMPAT_INTERNAL_EXCEPTION_H_ +#define LIB_STDCOMPAT_INTERNAL_EXCEPTION_H_ #include <exception> @@ -53,4 +53,4 @@ inline constexpr void throw_or_abort_if_any(const char* reason, AbortIf... abort } // namespace internal } // namespace cpp17 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_EXCEPTION_H_ +#endif // LIB_STDCOMPAT_INTERNAL_EXCEPTION_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/functional.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/functional.h new file mode 100644 index 000000000..94700d2ef --- /dev/null +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/functional.h @@ -0,0 +1,146 @@ +// Copyright 2021 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef LIB_STDCOMPAT_INTERNAL_FUNCTIONAL_H_ +#define LIB_STDCOMPAT_INTERNAL_FUNCTIONAL_H_ + +#include <cstddef> +#include <functional> + +#include "../type_traits.h" +#include "../utility.h" + +namespace cpp17 { +namespace internal { + +// Definitions for the invoke functions in internal/type_traits.h. +// These collectively implement INVOKE from [func.require] ¶ 1. +template <typename MemFn, typename Class, typename T, typename... Args> +constexpr auto invoke(MemFn Class::*f, T&& obj, Args&&... args) + -> std::enable_if_t<invoke_pmf_base<MemFn, Class, T>, + decltype((std::forward<T>(obj).*f)(std::forward<Args>(args)...))> { + return (std::forward<T>(obj).*f)(std::forward<Args>(args)...); +} + +template <typename MemFn, typename Class, typename T, typename... Args> +constexpr auto invoke(MemFn Class::*f, T&& obj, Args&&... args) + -> std::enable_if_t<invoke_pmf_refwrap<MemFn, Class, T>, + decltype((obj.get().*f)(std::forward<Args>(args)...))> { + return (obj.get().*f)(std::forward<Args>(args)...); +} + +template <typename MemFn, typename Class, typename T, typename... Args> +constexpr auto invoke(MemFn Class::*f, T&& obj, Args&&... args) + -> std::enable_if_t<invoke_pmf_other<MemFn, Class, T>, + decltype(((*std::forward<T>(obj)).*f)(std::forward<Args>(args)...))> { + return (*std::forward<T>(obj).*f)(std::forward<Args>(args)...); +} + +template <typename MemObj, typename Class, typename T> +constexpr auto invoke(MemObj Class::*f, T&& obj) + -> std::enable_if_t<invoke_pmd_base<MemObj, Class, T>, decltype(std::forward<T>(obj).*f)> { + return std::forward<T>(obj).*f; +} + +template <typename MemObj, typename Class, typename T> +constexpr auto invoke(MemObj Class::*f, T&& obj) + -> std::enable_if_t<invoke_pmd_refwrap<MemObj, Class, T>, decltype(obj.get().*f)> { + return obj.get().*f; +} + +template <typename MemObj, typename Class, typename T> +constexpr auto invoke(MemObj Class::*f, T&& obj) + -> std::enable_if_t<invoke_pmd_other<MemObj, Class, T>, decltype((*std::forward<T>(obj)).*f)> { + return (*std::forward<T>(obj)).*f; +} + +template <typename F, typename... Args> +constexpr auto invoke(F&& f, Args&&... args) + -> decltype(std::forward<F>(f)(std::forward<Args>(args)...)) { + return std::forward<F>(f)(std::forward<Args>(args)...); +} + +} // namespace internal +} // namespace cpp17 + +namespace cpp20 { +namespace internal { + +template <typename Invocable, typename BoundTuple, std::size_t... Is, typename... CallArgs> +constexpr decltype(auto) invoke_with_bound(Invocable&& invocable, BoundTuple&& bound_args, + std::index_sequence<Is...>, CallArgs&&... call_args) { + return ::cpp17::internal::invoke(std::forward<Invocable>(invocable), + std::get<Is>(std::forward<BoundTuple>(bound_args))..., + std::forward<CallArgs>(call_args)...); +} + +template <typename FD, typename... BoundArgs> +class front_binder { + using bound_indices = std::index_sequence_for<BoundArgs...>; + + public: + template <typename F, typename... Args> + explicit constexpr front_binder(cpp17::in_place_t, F&& f, Args&&... args) noexcept( + cpp17::conjunction_v<std::is_nothrow_constructible<FD, F>, + std::is_nothrow_constructible<BoundArgs, Args>...>) + : fd_(std::forward<F>(f)), bound_args_(std::forward<Args>(args)...) { + // [func.bind.front] ¶ 2 + static_assert(cpp17::is_constructible_v<FD, F>, + "Must be able to construct decayed callable type."); + static_assert(cpp17::is_move_constructible_v<FD>, "Callable type must be move-constructible."); + static_assert(cpp17::conjunction_v<std::is_constructible<BoundArgs, Args>...>, + "Must be able to construct decayed bound argument types."); + static_assert(cpp17::conjunction_v<std::is_move_constructible<BoundArgs>...>, + "Bound argument types must be move-constructible."); + } + + constexpr front_binder(const front_binder&) = default; + constexpr front_binder& operator=(const front_binder&) = default; + constexpr front_binder(front_binder&&) noexcept = default; + constexpr front_binder& operator=(front_binder&&) noexcept = default; + + template <typename... CallArgs> + constexpr cpp17::invoke_result_t<FD&, BoundArgs&..., CallArgs&&...> + operator()(CallArgs&&... call_args) & noexcept( + cpp17::is_nothrow_invocable_v<FD&, BoundArgs&..., CallArgs&&...>) { + return invoke_with_bound(fd_, bound_args_, bound_indices(), + std::forward<CallArgs>(call_args)...); + } + + template <typename... CallArgs> + constexpr cpp17::invoke_result_t<const FD&, const BoundArgs&..., CallArgs&&...> + operator()(CallArgs&&... call_args) const& noexcept( + cpp17::is_nothrow_invocable_v<const FD&, const BoundArgs&..., CallArgs&&...>) { + return invoke_with_bound(fd_, bound_args_, bound_indices(), + std::forward<CallArgs>(call_args)...); + } + + template <typename... CallArgs> + constexpr cpp17::invoke_result_t<FD&&, BoundArgs&&..., CallArgs&&...> + operator()(CallArgs&&... call_args) && noexcept( + cpp17::is_nothrow_invocable_v<FD&&, BoundArgs&&..., CallArgs&&...>) { + return invoke_with_bound(std::move(fd_), std::move(bound_args_), bound_indices(), + std::forward<CallArgs>(call_args)...); + } + + template <typename... CallArgs> + constexpr cpp17::invoke_result_t<const FD&&, const BoundArgs&&..., CallArgs&&...> + operator()(CallArgs&&... call_args) const&& noexcept( + cpp17::is_nothrow_invocable_v<const FD&&, const BoundArgs&&..., CallArgs&&...>) { + return invoke_with_bound(std::move(fd_), std::move(bound_args_), bound_indices(), + std::forward<CallArgs>(call_args)...); + } + + private: + FD fd_; + std::tuple<BoundArgs...> bound_args_; +}; + +template <typename F, typename... BoundArgs> +using front_binder_t = front_binder<std::decay_t<F>, std::decay_t<BoundArgs>...>; + +} // namespace internal +} // namespace cpp20 + +#endif // LIB_STDCOMPAT_INTERNAL_FUNCTIONAL_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/storage.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/storage.h index 16c64d559..25570cae5 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/storage.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/storage.h @@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_STORAGE_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_STORAGE_H_ +#ifndef LIB_STDCOMPAT_INTERNAL_STORAGE_H_ +#define LIB_STDCOMPAT_INTERNAL_STORAGE_H_ #include <cstddef> #include <cstdint> #include <limits> +#include <new> #include <type_traits> #include "utility.h" @@ -844,4 +845,4 @@ using storage_type = decltype(make_storage<Ts...>(std::index_sequence_for<Ts...> } // namespace internal } // namespace cpp17 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_STORAGE_H_ +#endif // LIB_STDCOMPAT_INTERNAL_STORAGE_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/type_traits.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/type_traits.h index dced28d9f..23b544b57 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/type_traits.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/type_traits.h @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_TYPE_TRAITS_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_TYPE_TRAITS_H_ +#ifndef LIB_STDCOMPAT_INTERNAL_TYPE_TRAITS_H_ +#define LIB_STDCOMPAT_INTERNAL_TYPE_TRAITS_H_ +#include <functional> #include <type_traits> namespace cpp17 { @@ -17,11 +18,12 @@ static constexpr bool is_reference_wrapper<std::reference_wrapper<T>> = true; // These are from [func.require] ¶ 1.1-7 template <typename MemFn, typename Class, typename T> -static constexpr bool invoke_pmf_base = std::is_member_function_pointer<MemFn Class::*>::value&& - std::is_base_of<Class, std::remove_reference_t<T>>::value; +static constexpr bool invoke_pmf_base = std::is_member_function_pointer<MemFn Class::*>::value && + std::is_base_of<Class, std::remove_reference_t<T>>::value; template <typename MemFn, typename Class, typename T> -static constexpr bool invoke_pmf_refwrap = std::is_member_function_pointer<MemFn Class::*>::value&& +static constexpr bool invoke_pmf_refwrap = + std::is_member_function_pointer<MemFn Class::*>::value && is_reference_wrapper<std::remove_cv_t<std::remove_reference_t<T>>>; template <typename MemFn, typename Class, typename T> @@ -30,11 +32,12 @@ static constexpr bool invoke_pmf_other = !invoke_pmf_refwrap<MemFn, Class, T>; template <typename MemObj, typename Class, typename T> -static constexpr bool invoke_pmd_base = std::is_member_object_pointer<MemObj Class::*>::value&& - std::is_base_of<Class, std::remove_reference_t<T>>::value; +static constexpr bool invoke_pmd_base = std::is_member_object_pointer<MemObj Class::*>::value && + std::is_base_of<Class, std::remove_reference_t<T>>::value; template <typename MemObj, typename Class, typename T> -static constexpr bool invoke_pmd_refwrap = std::is_member_object_pointer<MemObj Class::*>::value&& +static constexpr bool invoke_pmd_refwrap = + std::is_member_object_pointer<MemObj Class::*>::value && is_reference_wrapper<std::remove_cv_t<std::remove_reference_t<T>>>; template <typename MemObj, typename Class, typename T> @@ -109,4 +112,4 @@ struct invoke_result<true, F, Args...> { } // namespace internal } // namespace cpp17 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_TYPE_TRAITS_H_ +#endif // LIB_STDCOMPAT_INTERNAL_TYPE_TRAITS_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/utility.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/utility.h index a5da381ae..edf7eaba1 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/utility.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/internal/utility.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_UTILITY_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_UTILITY_H_ +#ifndef LIB_STDCOMPAT_INTERNAL_UTILITY_H_ +#define LIB_STDCOMPAT_INTERNAL_UTILITY_H_ #include <cstddef> #include <utility> @@ -134,4 +134,4 @@ struct is_nothrow_swappable<T, void_t<decltype(swap(std::declval<T&>(), std::dec } // namespace internal } // namespace cpp17 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_INTERNAL_UTILITY_H_ +#endif // LIB_STDCOMPAT_INTERNAL_UTILITY_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/memory.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/memory.h index 2dc3198a4..b2b172c1e 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/memory.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/memory.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_MEMORY_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_MEMORY_H_ +#ifndef LIB_STDCOMPAT_MEMORY_H_ +#define LIB_STDCOMPAT_MEMORY_H_ #include <memory> @@ -63,4 +63,4 @@ constexpr typename std::pointer_traits<T>::element_type* to_address(const T& poi } // namespace cpp20 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_MEMORY_H_ +#endif // LIB_STDCOMPAT_MEMORY_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/optional.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/optional.h index bc6a421a0..d51b87e80 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/optional.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/optional.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_OPTIONAL_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_OPTIONAL_H_ +#ifndef LIB_STDCOMPAT_OPTIONAL_H_ +#define LIB_STDCOMPAT_OPTIONAL_H_ #include "utility.h" #include "version.h" @@ -472,4 +472,4 @@ constexpr bool operator>=(const T& lhs, const optional<U>& rhs) { #endif -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_OPTIONAL_H_ +#endif // LIB_STDCOMPAT_OPTIONAL_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/type_traits.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/type_traits.h index 8f0d80ede..a40baf976 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/type_traits.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/type_traits.h @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_TYPE_TRAITS_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_TYPE_TRAITS_H_ +#ifndef LIB_STDCOMPAT_TYPE_TRAITS_H_ +#define LIB_STDCOMPAT_TYPE_TRAITS_H_ #include <cstddef> -#include <tuple> #include <type_traits> +#include <utility> #include "internal/type_traits.h" #include "version.h" @@ -506,4 +506,4 @@ static constexpr bool is_scoped_enum_v = is_scoped_enum<T>::value; } // namespace cpp23 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_TYPE_TRAITS_H_ +#endif // LIB_STDCOMPAT_TYPE_TRAITS_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/utility.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/utility.h index fe0993d47..d056bb48e 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/utility.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/utility.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_UTILITY_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_UTILITY_H_ +#ifndef LIB_STDCOMPAT_UTILITY_H_ +#define LIB_STDCOMPAT_UTILITY_H_ #include <cstddef> #include <type_traits> @@ -115,4 +115,4 @@ constexpr T exchange(T& obj, U&& new_value) { } // namespace cpp20 -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_UTILITY_H_ +#endif // LIB_STDCOMPAT_UTILITY_H_ diff --git a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/version.h b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/version.h index c022e4b30..ca436c367 100644 --- a/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/version.h +++ b/third_party/fuchsia/repo/sdk/lib/stdcompat/include/lib/stdcompat/version.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_VERSION_H_ -#define LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_VERSION_H_ +#ifndef LIB_STDCOMPAT_VERSION_H_ +#define LIB_STDCOMPAT_VERSION_H_ // This <version> polyfills is meant to provide the feature testing macros for the rest of // the stdcompat library. It is not meant to be a full polyfill of <version>. @@ -76,4 +76,4 @@ #endif // __has_include(<version>) && !defined(LIB_STDCOMPAT_USE_POLYFILLS) -#endif // LIB_STDCOMPAT_INCLUDE_LIB_STDCOMPAT_VERSION_H_ +#endif // LIB_STDCOMPAT_VERSION_H_ |