diff options
Diffstat (limited to 'libartbase/base/array_ref.h')
-rw-r--r-- | libartbase/base/array_ref.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libartbase/base/array_ref.h b/libartbase/base/array_ref.h index e8b3bceb71..064e26bc5f 100644 --- a/libartbase/base/array_ref.h +++ b/libartbase/base/array_ref.h @@ -203,6 +203,19 @@ bool operator!=(const ArrayRef<T>& lhs, const ArrayRef<T>& rhs) { return !(lhs == rhs); } +template<typename T> +std::ostream& operator<<(std::ostream& os, const ArrayRef<T>& ts) { + bool first = true; + os << "["; + for (const T& t : ts) { + if (!first) { os << ", "; } + first = false; + os << t; + } + os << "]"; + return os; +} + } // namespace art |