Swap a few APIs to reduce sign and implicit truncations required to work with it
[folly.git] / folly / DiscriminatedPtr.h
index 542064bddf81c9cc85b2cada74ddfb39fc454317..7fda96b914c7815c08b323525864a2517c2a13ee 100644 (file)
@@ -190,8 +190,8 @@ class DiscriminatedPtr {
    * Get the 1-based type index of T in Types.
    */
   template <typename T>
-  size_t typeIndex() const {
-    return dptr_detail::GetTypeIndex<T, Types...>::value;
+  uint16_t typeIndex() const {
+    return uint16_t(dptr_detail::GetTypeIndex<T, Types...>::value);
   }
 
   uint16_t index() const { return data_ >> 48; }