| // Copyright 2011 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_TEMPLATE_UTIL_H_ |
| #define BASE_TEMPLATE_UTIL_H_ |
| // Used to detect whether the given type is an iterator. This is normally used |
| // with std::enable_if to provide disambiguation for functions that take |
| // templatzed iterators as input. |
| template <typename T, typename = void> |
| struct is_iterator : std::false_type {}; |
| std::void_t<typename std::iterator_traits<T>::iterator_category>> |
| // Helper to express preferences in an overload set. If more than one overload |
| // are available for a given set of parameters the overload with the higher |
| // priority will be chosen. |
| struct priority_tag : priority_tag<I - 1> {}; |
| struct priority_tag<0> {}; |
| #endif // BASE_TEMPLATE_UTIL_H_ |