Debian Codegraph @

podofo/3rdparty/chromium/numerics/ostream_operators.h

raw
1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_NUMERICS_OSTREAM_OPERATORS_H_
6 #define BASE_NUMERICS_OSTREAM_OPERATORS_H_
7
8 #include <ostream>
9
10 namespace chromium {
11 namespace base {
12 namespace internal {
13
14 template <typename T>
15 class ClampedNumeric;
16 template <typename T>
17 class StrictNumeric;
18
19 // Overload the ostream output operator to make logging work nicely.
20 template <typename T>
21 std::ostream& operator<<(std::ostream& os, const StrictNumeric<T>& value) {
22 os << static_cast<T>(value);
23 return os;
24 }
25
26 // Overload the ostream output operator to make logging work nicely.
27 template <typename T>
28 std::ostream& operator<<(std::ostream& os, const ClampedNumeric<T>& value) {
29 os << static_cast<T>(value);
30 return os;
31 }
32
33 } // namespace internal
34 } // namespace base
35 } // namespace chromium
36
37 #endif // BASE_NUMERICS_OSTREAM_OPERATORS_H_