Skip to content

Commit

Permalink
fix #ifdef
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Jan 10, 2022
1 parent 571ab48 commit c989c7e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions externals/coda-oss/modules/c++/sys/include/sys/TypeTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@

namespace sys
{
template <class T>
// workaround missing "is_trivially_copyable" in g++ < 5.0
#if defined(__GNUC__) && (__GNUC__ < 5)
template <typename T>
struct IsTriviallyCopyable final
{
static_assert(CODA_OSS_cplusplus < 201402L, "C++14 must have is_trivially_copyable.");
struct IsTriviallyCopyable final
{
// https://stackoverflow.com/a/31798726/8877
static constexpr bool value = __has_trivial_copy(T);
};
// https://stackoverflow.com/a/31798726/8877
static constexpr bool value = __has_trivial_copy(T);
};
#else
template <typename T>
using IsTriviallyCopyable = std::is_trivially_copyable<T>;
template <typename T>
using IsTriviallyCopyable = std::is_trivially_copyable<T>;
#endif
}

Expand Down

0 comments on commit c989c7e

Please sign in to comment.