blob: 41028c4485dfd9b9650c8063dd6a7aea913298b9 [file] [log] [blame]
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <iosfwd>
#include <iterator>
#include <type_traits>
#include <utility>
namespace base {
namespace internal {
// Uses expression SFINAE to detect whether using operator<< would work.
template <typename T, typename = void>
struct SupportsOstreamOperator : std::false_type {};
template <typename T>
struct SupportsOstreamOperator<T,
<< std::declval<T>()))>
: std::true_type {};
// Used to detech 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 {};
template <typename T>
struct is_iterator<
std::void_t<typename std::iterator_traits<T>::iterator_category>>
: std::true_type {};
} // namespace internal
} // namespace base