StlStreamDeclarations.hpp
Go to the documentation of this file.
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 /// \file
5 /// Declares stream operators for STL containers
6 
7 #pragma once
8 
9 // Suppress warnings from this header since they can occur from not including
10 // StdHelpers later. This header is used only in TypeTraits.hpp so that
11 // is_streamable works correctly for STL types that have stream operators
12 // defined.
13 #ifdef __GNUC__
14 #pragma GCC system_header
15 #endif
16 
17 #include <array>
18 #include <deque>
19 #include <list>
20 #include <map>
21 #include <memory>
22 #include <set>
23 #include <tuple>
24 #include <unordered_map>
25 #include <unordered_set>
26 #include <vector>
27 
28 #include "Utilities/Requires.hpp"
29 
30 namespace tt {
31 template <typename S, typename T, typename>
33 } // namespace tt
34 
35 template <typename T>
36 std::ostream& operator<<(std::ostream& os, const std::list<T>& v);
37 
38 template <typename T>
39 std::ostream& operator<<(std::ostream& os, const std::vector<T>& v);
40 
41 template <typename T>
42 std::ostream& operator<<(std::ostream& os, const std::deque<T>& v);
43 
44 template <typename T, size_t N>
45 std::ostream& operator<<(std::ostream& os, const std::array<T, N>& a);
46 
47 template <typename... Args>
49 
50 template <typename K, typename V, typename H>
53 
54 template <typename K, typename V, typename C>
55 inline std::ostream& operator<<(std::ostream& os, const std::map<K, V, C>& m);
56 
57 template <typename T>
58 std::ostream& operator<<(std::ostream& os, const std::unordered_set<T>& v);
59 
60 template <typename T, typename C>
61 inline std::ostream& operator<<(std::ostream& os, const std::set<T, C>& v);
62 
63 template <typename T,
65 std::ostream& operator<<(std::ostream& os, const std::unique_ptr<T>& t);
66 
67 template <typename T,
69 std::ostream& operator<<(std::ostream& os, const std::shared_ptr<T>& t);
70 
71 template <typename T, typename U>
72 std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& t);
Check if type T has operator<<(S, T) defined.
Definition: StlStreamDeclarations.hpp:32
Defines the type alias Requires.
A collection of useful type traits.
Definition: TensorExpression.hpp:115
std::ostream & operator<<(std::ostream &os, const std::list< T > &v)
Output the items of a std::list.
Definition: StdHelpers.hpp:67
typename Requires_detail::requires_impl< B >::template_error_type_failed_to_meet_requirements_on_template_parameters Requires
Express requirements on the template parameters of a function or class, replaces std::enable_if_t ...
Definition: Requires.hpp:67