Skip to content

Commit

Permalink
移除is_pod
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed May 12, 2020
1 parent 6092795 commit c5d28c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Development/Core/ydbase/base/hook/fp_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace base {
inline uintptr_t cast(const Argument input, typename std::enable_if<std::is_function<typename std::remove_reference<Argument>::type>::value, void>::type* = 0)
{
cast_union<uintptr_t, Argument> u;
static_assert(std::is_pod<Argument>::value, "Argument is not a pod.");
static_assert(std::is_trivially_copyable<Argument>::value, "Argument is not trivially copyable.");
static_assert((sizeof(Argument) == sizeof(u)) && (sizeof(Argument) == sizeof(uintptr_t)), "Argument and uintptr_t are not the same size.");
u.in = input;
return u.out;
Expand All @@ -37,15 +37,15 @@ namespace base {
inline uintptr_t cast(const Argument input, typename std::enable_if<!std::is_function<typename std::remove_reference<Argument>::type>::value && same_size<uintptr_t, Argument>::value, void>::type* = 0)
{
cast_union<uintptr_t, Argument> u;
static_assert(std::is_pod<Argument>::value, "Argument is not a pod.");
static_assert(std::is_trivially_copyable<Argument>::value, "Argument is not trivially copyable.");
u.in = input;
return u.out;
}

template <class Argument>
inline uintptr_t cast(const Argument input, typename std::enable_if<!std::is_function<typename std::remove_reference<Argument>::type>::value && !same_size<uintptr_t, Argument>::value, void>::type* = 0)
{
static_assert(std::is_pod<Argument>::value, "Argument is not a pod.");
static_assert(std::is_trivially_copyable<Argument>::value, "Argument is not trivially copyable.");
static_assert(sizeof(Argument) < sizeof(uintptr_t), "Argument can not be converted to uintptr_t.");
return static_cast<uintptr_t>(input);
}
Expand Down

1 comment on commit c5d28c4

@luciouskami
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移出is_pod是因为支持c++20标准吧。

Please sign in to comment.