Commit d8647cc8 authored by tzik's avatar tzik Committed by Commit Bot

Adjust IsRefCountedType to avoid touching static AddRef() and Release()

The previous implementation of it checks if T::AddRef is available, but
it seems to fail on gcc on scoped_refptr, as it has private static
AddRef and Release.

This adjust the check to refer methods of T explicitly to avoid touching
the static member functions.

Change-Id: I7fde97a533df3b4a4b7ddbb0a8f7201c3744bd46
Reviewed-on: https://chromium-review.googlesource.com/933670Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539046}
parent feade5ca
......@@ -26,7 +26,9 @@ template <typename T, typename = void>
struct IsRefCountedType : std::false_type {};
template <typename T>
struct IsRefCountedType<T, void_t<decltype(&T::AddRef), decltype(&T::Release)>>
struct IsRefCountedType<T,
void_t<decltype(std::declval<T*>()->AddRef()),
decltype(std::declval<T*>()->Release())>>
: std::true_type {};
template <typename T>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment