diff options
author | Rob Hughes <robert.hughes@arm.com> | 2018-11-21 09:55:52 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2018-11-26 13:02:31 +0000 |
commit | 0214d7e7d075ae2b8534847d4d5fd9c485626694 (patch) | |
tree | 8eb34b04c6281ebc12a5309dacd3f60caaee61df /include/armnn/BackendId.hpp | |
parent | e02d60154d8230f555c832c1cce1865b54dc6589 (diff) | |
download | armnn-0214d7e7d075ae2b8534847d4d5fd9c485626694.tar.gz |
Fix compile errors on Windows
Change-Id: I40acb42360bfcda09485efb2a54144d8e35bdafb
Diffstat (limited to 'include/armnn/BackendId.hpp')
-rw-r--r-- | include/armnn/BackendId.hpp | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/include/armnn/BackendId.hpp b/include/armnn/BackendId.hpp index 72248bca34..8de985ec2f 100644 --- a/include/armnn/BackendId.hpp +++ b/include/armnn/BackendId.hpp @@ -132,31 +132,14 @@ private: std::string m_Id; }; -inline std::ostream& operator<<(std::ostream& os, const BackendId& id) -{ - os << id.Get(); - return os; -} - -template <template <class...> class TContainer> -inline std::ostream& operator<<(std::ostream& os, - const TContainer<BackendId>& ids) -{ - os << '['; - for (const auto& id : ids) { os << id << " "; } - os << ']'; - return os; } -using BackendIdSet = std::unordered_set<BackendId>; - -} // namespace armnn - namespace std { // make BackendId compatible with std hashtables by reusing the hash -// function for strings +// function for strings. +// Note this must come *before* the first use of unordered_set<BackendId>. template <> struct hash<armnn::BackendId> { @@ -168,3 +151,27 @@ struct hash<armnn::BackendId> }; } // namespace std + +namespace armnn +{ + +inline std::ostream& operator<<(std::ostream& os, const BackendId& id) +{ + os << id.Get(); + return os; +} + +template <template <typename...> class TContainer, typename... TContainerTemplateArgs> +std::ostream& operator<<(std::ostream& os, + const TContainer<BackendId, TContainerTemplateArgs...>& ids) +{ + os << '['; + for (const auto& id : ids) { os << id << " "; } + os << ']'; + return os; +} + +using BackendIdSet = std::unordered_set<BackendId>; + +} // namespace armnn + |