Remove cef_template_util.h (see #3362)

This file is no longer required after cherry-picking C++17 migration
changes from https://crbug.com/1320019.

This also fixes compile errors with Xcode 15:
__has_trivial_destructor is deprecated; use __is_trivially_destructible instead
This commit is contained in:
Marshall Greenblatt
2023-09-19 12:20:44 -04:00
parent cab404578d
commit 57d7d89b53
6 changed files with 10 additions and 433 deletions

View File

@ -34,8 +34,6 @@
#include <type_traits>
#include "include/base/cef_template_util.h"
// It is dangerous to post a task with a T* argument where T is a subtype of
// RefCounted(Base|ThreadSafeBase), since by the time the parameter is used, the
// object may already have been deleted since it was not held with a
@ -54,16 +52,16 @@ struct IsRefCountedType : std::false_type {};
template <typename T>
struct IsRefCountedType<T,
void_t<decltype(std::declval<T*>()->AddRef()),
decltype(std::declval<T*>()->Release())>>
std::void_t<decltype(std::declval<T*>()->AddRef()),
decltype(std::declval<T*>()->Release())>>
: std::true_type {};
// Human readable translation: you needed to be a scoped_refptr if you are a raw
// pointer type and are convertible to a RefCounted(Base|ThreadSafeBase) type.
template <typename T>
struct NeedsScopedRefptrButGetsRawPtr
: conjunction<std::is_pointer<T>,
IsRefCountedType<std::remove_pointer_t<T>>> {
: std::conjunction<std::is_pointer<T>,
IsRefCountedType<std::remove_pointer_t<T>>> {
static_assert(!std::is_reference<T>::value,
"NeedsScopedRefptrButGetsRawPtr requires non-reference type.");
};