7 #ifndef PXR_BASE_TF_OSTREAM_METHODS_H
8 #define PXR_BASE_TF_OSTREAM_METHODS_H
33 #include <type_traits>
40 decltype(std::declval<std::ostream &>() << std::declval<T>(),
bool())
52 return Tf_IsOstreamable_Impl<T>(0);
57 template <
class T, u
int32_t N>
58 typename std::enable_if<PXR_NS::Tf_IsOstreamable<T>(), std::ostream &>::
type
62 for (
auto const &obj: v)
78 typename std::enable_if<PXR_NS::Tf_IsOstreamable<T>(), std::ostream &>::
type
79 operator<<(std::ostream &out,
const std::vector<T> &v)
82 for (
auto const &obj: v)
92 typename std::enable_if<PXR_NS::Tf_IsOstreamable<T>(), std::ostream &>::
type
93 operator<<(std::ostream &out,
const std::set<T> &v)
96 for (
auto const &obj: v)
106 typename std::enable_if<PXR_NS::Tf_IsOstreamable<T>(), std::ostream &>::
type
107 operator<<(std::ostream &out,
const std::list<T> &l)
110 for (
auto const &obj: l)
119 template <
class K,
class M,
class H,
class C,
class A>
120 typename std::enable_if<
121 PXR_NS::Tf_IsOstreamable<K>() && PXR_NS::Tf_IsOstreamable<M>(), std::ostream &>
::type
122 operator<<(std::ostream &out, const PXR_NS::TfHashMap<K, M, H, C, A> &
h)
125 for (
auto const &p:
h)
126 out <<
"<" << p.first <<
": " << p.second <<
"> ";
133 template <
class K,
class M>
134 typename std::enable_if<
135 PXR_NS::Tf_IsOstreamable<K>() && PXR_NS::Tf_IsOstreamable<M>(), std::ostream &>
::type
136 operator<<(std::ostream &out, const std::map<K, M> &
h)
139 for (
auto const &p:
h)
140 out <<
"<" << p.first <<
": " << p.second <<
"> ";
147 #endif // PXR_BASE_TF_OSTREAM_METHODS_H
GLint GLint GLsizei GLint GLenum GLenum type
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