Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions include/xtensor/utils/xutils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,74 +533,6 @@ namespace xt
return std::get<I>(static_cast<const std::tuple<Args...>&>(v));
}

/***************************
* apply_cv implementation *
***************************/

namespace detail
{
template <
class T,
class U,
bool = std::is_const<std::remove_reference_t<T>>::value,
bool = std::is_volatile<std::remove_reference_t<T>>::value>
struct apply_cv_impl
{
using type = U;
};

template <class T, class U>
struct apply_cv_impl<T, U, true, false>
{
using type = const U;
};

template <class T, class U>
struct apply_cv_impl<T, U, false, true>
{
using type = volatile U;
};

template <class T, class U>
struct apply_cv_impl<T, U, true, true>
{
using type = const volatile U;
};

template <class T, class U>
struct apply_cv_impl<T&, U, false, false>
{
using type = U&;
};

template <class T, class U>
struct apply_cv_impl<T&, U, true, false>
{
using type = const U&;
};

template <class T, class U>
struct apply_cv_impl<T&, U, false, true>
{
using type = volatile U&;
};

template <class T, class U>
struct apply_cv_impl<T&, U, true, true>
{
using type = const volatile U&;
};
}

template <class T, class U>
struct apply_cv
{
using type = typename detail::apply_cv_impl<T, U>::type;
};

template <class T, class U>
using apply_cv_t = typename apply_cv<T, U>::type;

/**************************
* to_array implementation *
***************************/
Expand Down
4 changes: 2 additions & 2 deletions include/xtensor/views/xaxis_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ namespace xt
using difference_type = typename xexpression_type::difference_type;
using shape_type = typename xexpression_type::shape_type;
using value_type = xstrided_view<CT, shape_type>;
using reference = std::remove_reference_t<apply_cv_t<CT, value_type>>;
using pointer = xtl::xclosure_pointer<std::remove_reference_t<apply_cv_t<CT, value_type>>>;
using reference = std::remove_reference_t<xtl::apply_cv_t<CT, value_type>>;
using pointer = xtl::xclosure_pointer<std::remove_reference_t<xtl::apply_cv_t<CT, value_type>>>;

using iterator_category = std::forward_iterator_tag;

Expand Down
4 changes: 2 additions & 2 deletions include/xtensor/views/xaxis_slice_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace xt
using shape_type = typename xexpression_type::shape_type;
using strides_type = typename xexpression_type::strides_type;
using value_type = xstrided_view<CT, shape_type>;
using reference = std::remove_reference_t<apply_cv_t<CT, value_type>>;
using pointer = xtl::xclosure_pointer<std::remove_reference_t<apply_cv_t<CT, value_type>>>;
using reference = std::remove_reference_t<xtl::apply_cv_t<CT, value_type>>;
using pointer = xtl::xclosure_pointer<std::remove_reference_t<xtl::apply_cv_t<CT, value_type>>>;

using iterator_category = std::forward_iterator_tag;

Expand Down