Skip to content

Commit

Permalink
Refinement to GCC 4 workaround
Browse files Browse the repository at this point in the history
Require either a trivial copy constructor or a trivial copy assignment,
but not both. This is slightly more relaxed than being
TriviallyCopyable, which requires that both are either trivial or
deleted, and that at least one is not deleted. With this check, one of
them could be user-provided.
  • Loading branch information
bmerry committed May 4, 2017
1 parent 51b51b6 commit fb8a4ed
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/pybind11/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ template <typename T> using is_pod_struct = all_of<
#else
// GCC 4 doesn't implement is_trivially_copyable, so approximate it
std::is_trivially_destructible<T>,
std::has_trivial_copy_constructor<T>,
std::has_trivial_copy_assign<T>,
satisfies_any_of<T, std::has_trivial_copy_constructor, std::has_trivial_copy_assign>,
#endif
satisfies_none_of<T, std::is_reference, std::is_array, is_std_array, std::is_arithmetic, is_complex, std::is_enum>
>;
Expand Down

0 comments on commit fb8a4ed

Please sign in to comment.