Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/xtensor/containers/xbuffer_adaptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ namespace xt
rhs.get_allocator()
);
pointer tmp = safe_init_allocate(al, rhs.m_size);
if (xtrivially_default_constructible<value_type>::value)
if (std::is_trivially_default_constructible<value_type>::value)
{
std::uninitialized_copy(rhs.m_data.get(), rhs.m_data.get() + rhs.m_size, tmp);
}
Expand Down
8 changes: 4 additions & 4 deletions include/xtensor/containers/xstorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ namespace xt
using pointer = typename traits::pointer;
using value_type = typename traits::value_type;
pointer res = alloc.allocate(size);
if (!xtrivially_default_constructible<value_type>::value)
if (!std::is_trivially_default_constructible<value_type>::value)
{
for (pointer p = res; p != res + size; ++p)
{
Expand All @@ -189,7 +189,7 @@ namespace xt
using value_type = typename traits::value_type;
if (ptr != nullptr)
{
if (!xtrivially_default_constructible<value_type>::value)
if (!std::is_trivially_default_constructible<value_type>::value)
{
for (pointer p = ptr; p != ptr + size; ++p)
{
Expand Down Expand Up @@ -325,7 +325,7 @@ namespace xt
rhs.get_allocator()
);
resize_impl(rhs.size());
if (xtrivially_default_constructible<value_type>::value)
if (std::is_trivially_default_constructible<value_type>::value)
{
std::uninitialized_copy(rhs.p_begin, rhs.p_end, p_begin);
}
Expand Down Expand Up @@ -1255,7 +1255,7 @@ namespace xt
template <class T, std::size_t N, class A, bool Init>
inline void svector<T, N, A, Init>::destroy_range(T* begin, T* end)
{
if (!xtrivially_default_constructible<T>::value)
if (!std::is_trivially_default_constructible<T>::value)
{
while (begin != end)
{
Expand Down
28 changes: 0 additions & 28 deletions include/xtensor/utils/xutils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,34 +609,6 @@ namespace xt
template <typename E>
concept iterator_concept = is_iterator<E>::value;

/********************************************
* xtrivial_default_construct implemenation *
********************************************/

#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7
// has_trivial_default_constructor has not been available since libstdc++-7.
#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1
#else
#if defined(_GLIBCXX_USE_CXX11_ABI)
#if _GLIBCXX_USE_CXX11_ABI || (defined(_GLIBCXX_USE_DUAL_ABI) && !_GLIBCXX_USE_DUAL_ABI)
#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1
#endif
#endif
#endif

#if !defined(__GNUG__) || defined(_LIBCPP_VERSION) || defined(XTENSOR_GLIBCXX_USE_CXX11_ABI)

template <class T>
using xtrivially_default_constructible = std::is_trivially_default_constructible<T>;

#else

template <class T>
using xtrivially_default_constructible = std::has_trivial_default_constructor<T>;

#endif
#undef XTENSOR_GLIBCXX_USE_CXX11_ABI

/*************************
* conditional type cast *
*************************/
Expand Down
Loading