Minor changes to match the internal version

pull/1025/head
Yangqing Jia 9 years ago
parent bbf64cee3d
commit 031558bd36
  1. 13
      src/google/protobuf/arena.h

@ -511,8 +511,7 @@ class LIBPROTOBUF_EXPORT Arena {
struct is_arena_constructable : struct is_arena_constructable :
public google::protobuf::internal::integral_constant<bool, public google::protobuf::internal::integral_constant<bool,
sizeof(InternalIsArenaConstructableHelper::ArenaConstructable< sizeof(InternalIsArenaConstructableHelper::ArenaConstructable<
const T>(static_cast<const T*>(0))) == const T>(static_cast<const T*>(0))) == sizeof(char)> {
sizeof(char)> {
}; };
private: private:
@ -574,6 +573,7 @@ class LIBPROTOBUF_EXPORT Arena {
return google::protobuf::internal::has_trivial_destructor<T>::value; return google::protobuf::internal::has_trivial_destructor<T>::value;
} }
private:
struct InternalIsDestructorSkippableHelper { struct InternalIsDestructorSkippableHelper {
template<typename U> template<typename U>
static char DestructorSkippable( static char DestructorSkippable(
@ -582,6 +582,7 @@ class LIBPROTOBUF_EXPORT Arena {
static double DestructorSkippable(...); static double DestructorSkippable(...);
}; };
public:
// Helper typetrait that indicates whether the desctructor of type T should be // Helper typetrait that indicates whether the desctructor of type T should be
// called when arena is destroyed at compile time. This is only to allow // called when arena is destroyed at compile time. This is only to allow
// construction of higher-level templated utilities. // construction of higher-level templated utilities.
@ -778,10 +779,10 @@ class LIBPROTOBUF_EXPORT Arena {
// which needs to declare google::protobuf::Map as friend of generated message. // which needs to declare google::protobuf::Map as friend of generated message.
template <typename T> template <typename T>
static void CreateInArenaStorage(T* ptr, Arena* arena) { static void CreateInArenaStorage(T* ptr, Arena* arena) {
CreateInArenaStorageInternal( CreateInArenaStorageInternal(ptr, arena,
ptr, arena, typename is_arena_constructable<T>::type()); typename is_arena_constructable<T>::type());
RegisterDestructorInternal( RegisterDestructorInternal(ptr, arena,
ptr, arena, typename is_destructor_skippable<T>::type()); typename is_destructor_skippable<T>::type());
} }
template <typename T> template <typename T>

Loading…
Cancel
Save