Skip to content

Commit 3084585

Browse files
authored
Merge pull request #2555 from BioDataAnalysis/fixing_xadapt_pointers_check
fixing pointer type traits in xadapt.
2 parents 9525d1c + 4ad7215 commit 3084585

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: include/xtensor/xadapt.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace xt
8989
*/
9090
template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C, class SC,
9191
XTL_REQUIRES(detail::not_an_array<std::decay_t<SC>>,
92-
std::is_pointer<C>)>
92+
std::is_pointer<std::remove_reference_t<C>>)>
9393
inline auto adapt(C&& pointer, const SC& shape, layout_type l = L)
9494
{
9595
static_assert(!xtl::is_integral<SC>::value, "shape cannot be a integer");
@@ -247,7 +247,7 @@ namespace xt
247247
*/
248248
template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C, class SC,
249249
XTL_REQUIRES(detail::is_array<std::decay_t<SC>>,
250-
std::is_pointer<C>)>
250+
std::is_pointer<std::remove_reference_t<C>>)>
251251
inline auto adapt(C&& pointer, const SC& shape, layout_type l = L)
252252
{
253253
static_assert(!xtl::is_integral<SC>::value, "shape cannot be a integer");
@@ -390,7 +390,7 @@ namespace xt
390390
* @param shape the shape of the xtensor_fixed_adaptor
391391
*/
392392
template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C, std::size_t... X,
393-
XTL_REQUIRES(std::is_pointer<C>)>
393+
XTL_REQUIRES(std::is_pointer<std::remove_reference_t<C>>)>
394394
inline auto adapt(C&& pointer, const fixed_shape<X...>& /*shape*/)
395395
{
396396
using buffer_type = xbuffer_adaptor<C, xt::no_ownership, detail::default_allocator_for_ptr_t<C>>;

0 commit comments

Comments
 (0)