Skip to content

Commit b240aef

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 68a21c5 + 42d124c commit b240aef

21 files changed

Lines changed: 196 additions & 320 deletions

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/xcontainer.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ namespace xt
114114

115115
size_type size() const noexcept;
116116

117-
XTENSOR_CONSTEXPR_RETURN size_type dimension() const noexcept;
117+
constexpr size_type dimension() const noexcept;
118118

119-
XTENSOR_CONSTEXPR_RETURN const inner_shape_type& shape() const noexcept;
120-
XTENSOR_CONSTEXPR_RETURN const inner_strides_type& strides() const noexcept;
121-
XTENSOR_CONSTEXPR_RETURN const inner_backstrides_type& backstrides() const noexcept;
119+
constexpr const inner_shape_type& shape() const noexcept;
120+
constexpr const inner_strides_type& strides() const noexcept;
121+
constexpr const inner_backstrides_type& backstrides() const noexcept;
122122

123123
template <class T>
124124
void fill(const T& value);
@@ -373,7 +373,7 @@ namespace xt
373373
* Returns the number of dimensions of the container.
374374
*/
375375
template <class D>
376-
XTENSOR_CONSTEXPR_RETURN auto xcontainer<D>::dimension() const noexcept -> size_type
376+
constexpr auto xcontainer<D>::dimension() const noexcept -> size_type
377377
{
378378
return shape().size();
379379
}
@@ -382,7 +382,7 @@ namespace xt
382382
* Returns the shape of the container.
383383
*/
384384
template <class D>
385-
XTENSOR_CONSTEXPR_RETURN auto xcontainer<D>::shape() const noexcept -> const inner_shape_type&
385+
constexpr auto xcontainer<D>::shape() const noexcept -> const inner_shape_type&
386386
{
387387
return derived_cast().shape_impl();
388388
}
@@ -391,7 +391,7 @@ namespace xt
391391
* Returns the strides of the container.
392392
*/
393393
template <class D>
394-
XTENSOR_CONSTEXPR_RETURN auto xcontainer<D>::strides() const noexcept -> const inner_strides_type&
394+
constexpr auto xcontainer<D>::strides() const noexcept -> const inner_strides_type&
395395
{
396396
return derived_cast().strides_impl();
397397
}
@@ -400,7 +400,7 @@ namespace xt
400400
* Returns the backstrides of the container.
401401
*/
402402
template <class D>
403-
XTENSOR_CONSTEXPR_RETURN auto xcontainer<D>::backstrides() const noexcept -> const inner_backstrides_type&
403+
constexpr auto xcontainer<D>::backstrides() const noexcept -> const inner_backstrides_type&
404404
{
405405
return derived_cast().backstrides_impl();
406406
}

include/xtensor/containers/xfixed.hpp

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,7 @@ namespace xt
256256
using inner_backstrides_type = backstrides_type;
257257

258258
// NOTE: 0D (S::size() == 0) results in storage for 1 element (scalar)
259-
#if defined(_MSC_VER) && _MSC_VER < 1910 && !defined(_WIN64)
260-
// WORKAROUND FOR MSVC 2015 32 bit, fallback to unaligned container for 0D scalar case
261-
using storage_type = std::array<ET, detail::fixed_compute_size<S>::value>;
262-
#else
263259
using storage_type = aligned_array<ET, detail::fixed_compute_size<S>::value>;
264-
#endif
265260

266261
using reference = typename storage_type::reference;
267262
using const_reference = typename storage_type::const_reference;
@@ -373,9 +368,9 @@ namespace xt
373368
storage_type& storage_impl() noexcept;
374369
const storage_type& storage_impl() const noexcept;
375370

376-
XTENSOR_CONSTEXPR_RETURN const inner_shape_type& shape_impl() const noexcept;
377-
XTENSOR_CONSTEXPR_RETURN const inner_strides_type& strides_impl() const noexcept;
378-
XTENSOR_CONSTEXPR_RETURN const inner_backstrides_type& backstrides_impl() const noexcept;
371+
constexpr const inner_shape_type& shape_impl() const noexcept;
372+
constexpr const inner_strides_type& strides_impl() const noexcept;
373+
constexpr const inner_backstrides_type& backstrides_impl() const noexcept;
379374

380375
friend class xcontainer<xfixed_container<ET, S, L, SH, Tag>>;
381376
};
@@ -495,9 +490,9 @@ namespace xt
495490
storage_type& storage_impl() noexcept;
496491
const storage_type& storage_impl() const noexcept;
497492

498-
XTENSOR_CONSTEXPR_RETURN const inner_shape_type& shape_impl() const noexcept;
499-
XTENSOR_CONSTEXPR_RETURN const inner_strides_type& strides_impl() const noexcept;
500-
XTENSOR_CONSTEXPR_RETURN const inner_backstrides_type& backstrides_impl() const noexcept;
493+
constexpr const inner_shape_type& shape_impl() const noexcept;
494+
constexpr const inner_strides_type& strides_impl() const noexcept;
495+
constexpr const inner_backstrides_type& backstrides_impl() const noexcept;
501496

502497
friend class xcontainer<xfixed_adaptor<EC, S, L, SH, Tag>>;
503498
};
@@ -740,21 +735,20 @@ namespace xt
740735
}
741736

742737
template <class ET, class S, layout_type L, bool SH, class Tag>
743-
XTENSOR_CONSTEXPR_RETURN auto xfixed_container<ET, S, L, SH, Tag>::shape_impl() const noexcept
744-
-> const inner_shape_type&
738+
constexpr auto xfixed_container<ET, S, L, SH, Tag>::shape_impl() const noexcept -> const inner_shape_type&
745739
{
746740
return m_shape;
747741
}
748742

749743
template <class ET, class S, layout_type L, bool SH, class Tag>
750-
XTENSOR_CONSTEXPR_RETURN auto xfixed_container<ET, S, L, SH, Tag>::strides_impl() const noexcept
744+
constexpr auto xfixed_container<ET, S, L, SH, Tag>::strides_impl() const noexcept
751745
-> const inner_strides_type&
752746
{
753747
return m_strides;
754748
}
755749

756750
template <class ET, class S, layout_type L, bool SH, class Tag>
757-
XTENSOR_CONSTEXPR_RETURN auto xfixed_container<ET, S, L, SH, Tag>::backstrides_impl() const noexcept
751+
constexpr auto xfixed_container<ET, S, L, SH, Tag>::backstrides_impl() const noexcept
758752
-> const inner_backstrides_type&
759753
{
760754
return m_backstrides;
@@ -937,21 +931,20 @@ namespace xt
937931
}
938932

939933
template <class EC, class S, layout_type L, bool SH, class Tag>
940-
XTENSOR_CONSTEXPR_RETURN auto xfixed_adaptor<EC, S, L, SH, Tag>::shape_impl() const noexcept
941-
-> const inner_shape_type&
934+
constexpr auto xfixed_adaptor<EC, S, L, SH, Tag>::shape_impl() const noexcept -> const inner_shape_type&
942935
{
943936
return m_shape;
944937
}
945938

946939
template <class EC, class S, layout_type L, bool SH, class Tag>
947-
XTENSOR_CONSTEXPR_RETURN auto xfixed_adaptor<EC, S, L, SH, Tag>::strides_impl() const noexcept
940+
constexpr auto xfixed_adaptor<EC, S, L, SH, Tag>::strides_impl() const noexcept
948941
-> const inner_strides_type&
949942
{
950943
return m_strides;
951944
}
952945

953946
template <class EC, class S, layout_type L, bool SH, class Tag>
954-
XTENSOR_CONSTEXPR_RETURN auto xfixed_adaptor<EC, S, L, SH, Tag>::backstrides_impl() const noexcept
947+
constexpr auto xfixed_adaptor<EC, S, L, SH, Tag>::backstrides_impl() const noexcept
955948
-> const inner_backstrides_type&
956949
{
957950
return m_backstrides;

include/xtensor/containers/xscalar.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,25 +466,25 @@ namespace xt
466466
*****************************/
467467

468468
template <class CT>
469-
XTENSOR_CONSTEXPR_RETURN auto linear_begin(xscalar<CT>& c) noexcept -> decltype(c.dummy_begin())
469+
constexpr auto linear_begin(xscalar<CT>& c) noexcept -> decltype(c.dummy_begin())
470470
{
471471
return c.dummy_begin();
472472
}
473473

474474
template <class CT>
475-
XTENSOR_CONSTEXPR_RETURN auto linear_end(xscalar<CT>& c) noexcept -> decltype(c.dummy_end())
475+
constexpr auto linear_end(xscalar<CT>& c) noexcept -> decltype(c.dummy_end())
476476
{
477477
return c.dummy_end();
478478
}
479479

480480
template <class CT>
481-
XTENSOR_CONSTEXPR_RETURN auto linear_begin(const xscalar<CT>& c) noexcept -> decltype(c.dummy_begin())
481+
constexpr auto linear_begin(const xscalar<CT>& c) noexcept -> decltype(c.dummy_begin())
482482
{
483483
return c.dummy_begin();
484484
}
485485

486486
template <class CT>
487-
XTENSOR_CONSTEXPR_RETURN auto linear_end(const xscalar<CT>& c) noexcept -> decltype(c.dummy_end())
487+
constexpr auto linear_end(const xscalar<CT>& c) noexcept -> decltype(c.dummy_end())
488488
{
489489
return c.dummy_end();
490490
}

0 commit comments

Comments
 (0)