Skip to content

Commit

Permalink
making adapt work with const_array.
Browse files Browse the repository at this point in the history
  • Loading branch information
vakokako committed Apr 8, 2021
1 parent 299be1d commit 4929a96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/xtensor/xcontainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ namespace xt
{
using type = std::allocator<T>; // fake allocator for testing
};


template <class T, std::size_t N>
struct allocator_type_impl<const_array<T, N>>
{
using type = std::allocator<T>; // fake allocator for testing
};

}

template <class T>
Expand Down
6 changes: 6 additions & 0 deletions include/xtensor/xshape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ namespace xt
{
static constexpr bool value = true;
};

template <class T, std::size_t N>
struct is_array<const_array<T, N>>
{
static constexpr bool value = true;
};

template <class S>
struct is_fixed : std::false_type
Expand Down

0 comments on commit 4929a96

Please sign in to comment.