Skip to content

Commit 68c803b

Browse files
committed
making adapt work with const_array.
1 parent 299be1d commit 68c803b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

include/xtensor/xcontainer.hpp

+8
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ namespace xt
5252
{
5353
using type = std::allocator<T>; // fake allocator for testing
5454
};
55+
56+
57+
template <class T, std::size_t N>
58+
struct allocator_type_impl<const_array<T, N>>
59+
{
60+
using type = std::allocator<T>; // fake allocator for testing
61+
};
62+
5563
}
5664

5765
template <class T>

include/xtensor/xshape.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,12 @@ namespace xt
351351
{
352352
static constexpr bool value = true;
353353
};
354+
355+
template <class T, std::size_t N>
356+
struct is_array<const_array<T, N>>
357+
{
358+
static constexpr bool value = true;
359+
};
354360

355361
template <class S>
356362
struct is_fixed : std::false_type

0 commit comments

Comments
 (0)