Skip to content

Commit 4fc563f

Browse files
committed
Removed xtrivially_default_constructible
1 parent 61cebfe commit 4fc563f

3 files changed

Lines changed: 5 additions & 33 deletions

File tree

include/xtensor/containers/xbuffer_adaptor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ namespace xt
709709
rhs.get_allocator()
710710
);
711711
pointer tmp = safe_init_allocate(al, rhs.m_size);
712-
if (xtrivially_default_constructible<value_type>::value)
712+
if (std::is_trivially_default_constructible<value_type>::value)
713713
{
714714
std::uninitialized_copy(rhs.m_data.get(), rhs.m_data.get() + rhs.m_size, tmp);
715715
}

include/xtensor/containers/xstorage.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ namespace xt
167167
using pointer = typename traits::pointer;
168168
using value_type = typename traits::value_type;
169169
pointer res = alloc.allocate(size);
170-
if (!xtrivially_default_constructible<value_type>::value)
170+
if (!std::is_trivially_default_constructible<value_type>::value)
171171
{
172172
for (pointer p = res; p != res + size; ++p)
173173
{
@@ -189,7 +189,7 @@ namespace xt
189189
using value_type = typename traits::value_type;
190190
if (ptr != nullptr)
191191
{
192-
if (!xtrivially_default_constructible<value_type>::value)
192+
if (!std::is_trivially_default_constructible<value_type>::value)
193193
{
194194
for (pointer p = ptr; p != ptr + size; ++p)
195195
{
@@ -325,7 +325,7 @@ namespace xt
325325
rhs.get_allocator()
326326
);
327327
resize_impl(rhs.size());
328-
if (xtrivially_default_constructible<value_type>::value)
328+
if (std::is_trivially_default_constructible<value_type>::value)
329329
{
330330
std::uninitialized_copy(rhs.p_begin, rhs.p_end, p_begin);
331331
}
@@ -1255,7 +1255,7 @@ namespace xt
12551255
template <class T, std::size_t N, class A, bool Init>
12561256
inline void svector<T, N, A, Init>::destroy_range(T* begin, T* end)
12571257
{
1258-
if (!xtrivially_default_constructible<T>::value)
1258+
if (!std::is_trivially_default_constructible<T>::value)
12591259
{
12601260
while (begin != end)
12611261
{

include/xtensor/utils/xutils.hpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -609,34 +609,6 @@ namespace xt
609609
template <typename E>
610610
concept iterator_concept = is_iterator<E>::value;
611611

612-
/********************************************
613-
* xtrivial_default_construct implemenation *
614-
********************************************/
615-
616-
#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7
617-
// has_trivial_default_constructor has not been available since libstdc++-7.
618-
#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1
619-
#else
620-
#if defined(_GLIBCXX_USE_CXX11_ABI)
621-
#if _GLIBCXX_USE_CXX11_ABI || (defined(_GLIBCXX_USE_DUAL_ABI) && !_GLIBCXX_USE_DUAL_ABI)
622-
#define XTENSOR_GLIBCXX_USE_CXX11_ABI 1
623-
#endif
624-
#endif
625-
#endif
626-
627-
#if !defined(__GNUG__) || defined(_LIBCPP_VERSION) || defined(XTENSOR_GLIBCXX_USE_CXX11_ABI)
628-
629-
template <class T>
630-
using xtrivially_default_constructible = std::is_trivially_default_constructible<T>;
631-
632-
#else
633-
634-
template <class T>
635-
using xtrivially_default_constructible = std::has_trivial_default_constructor<T>;
636-
637-
#endif
638-
#undef XTENSOR_GLIBCXX_USE_CXX11_ABI
639-
640612
/*************************
641613
* conditional type cast *
642614
*************************/

0 commit comments

Comments
 (0)