const OptionalThriftValue getValue(
    const TypeInfo& typeInfo,
    const void* object) {
  if (typeInfo.get) {
    // Handle smart pointer and numerical types.
    return reinterpret_cast<OptionalThriftValue (*)(const void*)>(typeInfo.get)(
        object);
  }
  // Handle others.
  if (object) {
    return folly::make_optional<ThriftValue>(object);
  }
  return folly::none;
}
const OptionalThriftValue getValue(
    const TypeInfo& typeInfo,
    const void* object) {
  if (typeInfo.get) {
     
    return reinterpret_cast<OptionalThriftValue (*)(const void*)>(typeInfo.get)(
        object);
  }
   
  if (object) {
    return folly::make_optional<ThriftValue>(object);
  }
  return folly::none;
}