#ifndef BASE_FUNCTIONAL_UNRETAINED_TRAITS_H_
#define BASE_FUNCTIONAL_UNRETAINED_TRAITS_H_
#include "build/build_config.h"
#include <type_traits>
struct ANativeWindow;
struct DBusMessage;
struct HWND__;
struct VkBuffer_T;
struct VkDeviceMemory_T;
struct VkImage_T;
struct VkSemaphore_T;
struct VmaAllocation_T;
struct WGPUAdapterImpl;
struct fpdf_action_t__;
struct fpdf_annotation_t__;
struct fpdf_attachment_t__;
struct fpdf_bookmark_t__;
struct fpdf_document_t__;
struct fpdf_form_handle_t__;
struct fpdf_page_t__;
struct fpdf_structelement_t__;
struct hb_set_t;
struct wl_gpu;
struct wl_shm;
struct wl_surface;
namespace base::internal {
template <typename T, typename = void>
inline constexpr bool IsCompleteTypeV = false;
template <typename T>
inline constexpr bool IsCompleteTypeV<T, std::void_t<decltype(sizeof(T))>> =
true;
template <typename T>
inline constexpr bool IsIncompleteTypeSafeForUnretained = false;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<void> = true;
template <typename R, typename... Args>
inline constexpr bool IsIncompleteTypeSafeForUnretained<R(Args...)> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<ANativeWindow> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<DBusMessage> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<HWND__> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<VkBuffer_T> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<VkDeviceMemory_T> =
true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<VkImage_T> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<VkSemaphore_T> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<VmaAllocation_T> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<WGPUAdapterImpl> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<fpdf_action_t__> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<fpdf_annotation_t__> =
true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<fpdf_attachment_t__> =
true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<fpdf_bookmark_t__> =
true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<fpdf_document_t__> =
true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<fpdf_form_handle_t__> =
true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<fpdf_page_t__> = true;
template <>
inline constexpr bool
IsIncompleteTypeSafeForUnretained<fpdf_structelement_t__> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<hb_set_t> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<wl_gpu> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<wl_shm> = true;
template <>
inline constexpr bool IsIncompleteTypeSafeForUnretained<wl_surface> = true;
template <typename T, typename SFINAE = void>
struct TypeSupportsUnretained {
#if !defined(UNIT_TEST) && !defined(OFFICIAL_BUILD)
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \
defined(FORCE_UNRETAINED_COMPLETENESS_CHECKS_FOR_TESTS)
static_assert(IsCompleteTypeV<T> ||
IsIncompleteTypeSafeForUnretained<std::remove_cv_t<T>>,
"T must be fully defined.");
#endif
#endif
static constexpr inline bool kValue = true;
};
template <typename T>
struct TypeSupportsUnretained<T, typename T::DisallowBaseUnretainedMarker> {
static constexpr inline bool kValue = false;
};
template <typename T>
static inline constexpr bool TypeSupportsUnretainedV =
TypeSupportsUnretained<T>::kValue;
}
#endif