// Protocol Buffers - Google's data interchange format // Copyright 2024 Google LLC. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd #ifndef GOOGLE_PROTOBUF_HPB_TEMPLATE_HELP_H__ #define GOOGLE_PROTOBUF_HPB_TEMPLATE_HELP_H__ #include #include "google/protobuf/hpb/ptr.h" namespace hpb { namespace internal { template struct RemovePtr; template struct RemovePtr> { using type = T; }; template struct RemovePtr { using type = T; }; template using RemovePtrT = typename RemovePtr::type; template , typename = std::enable_if_t>> using PtrOrRaw = T; template inline constexpr bool IsHpbClass = false; template inline constexpr bool IsHpbClass>> = true; template using EnableIfHpbClass = std::enable_if_t>; template inline constexpr bool IsHpbClassThatHasExtensions = false; template inline constexpr bool IsHpbClassThatHasExtensions< T, std::enable_if_t && std::is_base_of_v>> = true; template using EnableIfHpbClassThatHasExtensions = std::enable_if_t>; template using EnableIfMutableProto = std::enable_if_t::value>; template using add_const_if_T_is_const = std::conditional_t, const T2, T2>; } // namespace internal } // namespace hpb #endif // GOOGLE_PROTOBUF_HPB_TEMPLATE_HELP_H__