24 #ifndef PXR_BASE_TF_OSTREAM_METHODS_H
25 #define PXR_BASE_TF_OSTREAM_METHODS_H
50 #include <type_traits>
57 decltype(std::declval<std::ostream &>() << std::declval<T>(),
bool())
69 return Tf_IsOstreamable_Impl<T>(0);
74 template <
class T, u
int32_t N>
75 typename std::enable_if<PXR_NS::Tf_IsOstreamable<T>(), std::ostream &>::
type
79 for (
auto const &obj: v)
95 typename std::enable_if<PXR_NS::Tf_IsOstreamable<T>(), std::ostream &>::
type
96 operator<<(std::ostream &out,
const std::vector<T> &v)
99 for (
auto const &obj: v)
109 typename std::enable_if<PXR_NS::Tf_IsOstreamable<T>(), std::ostream &>::
type
110 operator<<(std::ostream &out,
const std::set<T> &v)
113 for (
auto const &obj: v)
123 typename std::enable_if<PXR_NS::Tf_IsOstreamable<T>(), std::ostream &>::
type
124 operator<<(std::ostream &out,
const std::list<T> &l)
127 for (
auto const &obj: l)
136 template <
class K,
class M,
class H,
class C,
class A>
137 typename std::enable_if<
138 PXR_NS::Tf_IsOstreamable<K>() && PXR_NS::Tf_IsOstreamable<M>(), std::ostream &>
::type
139 operator<<(std::ostream &out, const PXR_NS::TfHashMap<K, M, H, C, A> &
h)
142 for (
auto const &p:
h)
143 out <<
"<" << p.first <<
": " << p.second <<
"> ";
150 template <
class K,
class M>
151 typename std::enable_if<
152 PXR_NS::Tf_IsOstreamable<K>() && PXR_NS::Tf_IsOstreamable<M>(), std::ostream &>
::type
153 operator<<(std::ostream &out, const std::map<K, M> &
h)
156 for (
auto const &p:
h)
157 out <<
"<" << p.first <<
": " << p.second <<
"> ";
164 #endif // PXR_BASE_TF_OSTREAM_METHODS_H
PXR_NAMESPACE_OPEN_SCOPE constexpr auto Tf_IsOstreamable_Impl(int) -> decltype(std::declval< std::ostream & >()<< std::declval< T >(), bool())
constexpr bool Tf_IsOstreamable()
GLfloat GLfloat GLfloat GLfloat h
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE