7#ifndef PXR_BASE_TF_BIT_UTILS_H
8#define PXR_BASE_TF_BIT_UTILS_H
18PXR_NAMESPACE_OPEN_SCOPE
27#define TF_BITS_FOR_VALUES(n) \
28 Tf_NumBits<n-1>::type::value
30template <
size_t N,
size_t SUM=0,
size_t BIT=
sizeof(N)*8/2>
38 typedef typename std::conditional<N >= (1ULL<<BIT),
39 Tf_NumBits<(N>>BIT), SUM+BIT, BIT/2>,
40 Tf_NumBits<N, SUM, BIT/2> >::type _func;
41 typedef typename _func::type type;
44template <
size_t N,
size_t SUM>
45struct Tf_NumBits<N, SUM, 0>
47 typedef std::integral_constant<size_t, SUM+1> type;
60#define TF_BITS_FOR_ENUM_VALUES(n) \
61 (TF_BITS_FOR_VALUES(n) + 1)
63PXR_NAMESPACE_CLOSE_SCOPE