// Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_SCOPED_OBSERVATION_TRAITS_INTERNAL_H_ #define BASE_SCOPED_OBSERVATION_TRAITS_INTERNAL_H_ #include namespace base::internal { struct HasAddAndRemoveObserverMethodsHelper { template static auto Validate(Source* source, Observer* observer) -> decltype(source->AddObserver(observer), source->RemoveObserver(observer), std::true_type()); template static auto Validate(...) -> std::false_type; }; template inline constexpr bool HasAddAndRemoveObserverMethods = decltype(HasAddAndRemoveObserverMethodsHelper::Validate( nullptr, nullptr))::value; } // namespace base::internal #endif // BASE_SCOPED_OBSERVATION_TRAITS_INTERNAL_H_