Skip to content

Commit

Permalink
removing std namespace opening.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mykola Vankovych committed Aug 8, 2022
1 parent 351378a commit 956e95f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 32 deletions.
21 changes: 9 additions & 12 deletions include/xtensor/xfixed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,20 +959,17 @@ namespace xt
# pragma clang diagnostic ignored "-Wmismatched-tags"
#endif

namespace std
template <class ET, class S, xt::layout_type L, bool SH, class Tag>
class std::tuple_size<xt::xfixed_container<ET, S, L, SH, Tag>> :
public std::integral_constant<std::size_t, xt::detail::fixed_compute_size<S>::value>
{
template <class ET, class S, xt::layout_type L, bool SH, class Tag>
class tuple_size<xt::xfixed_container<ET, S, L, SH, Tag>> :
public integral_constant<std::size_t, xt::detail::fixed_compute_size<S>::value>
{
};
};

template <class ET, class S, xt::layout_type L, bool SH, class Tag>
class tuple_size<xt::xfixed_adaptor<ET, S, L, SH, Tag>> :
public integral_constant<std::size_t, xt::detail::fixed_compute_size<S>::value>
{
};
}
template <class ET, class S, xt::layout_type L, bool SH, class Tag>
class std::tuple_size<xt::xfixed_adaptor<ET, S, L, SH, Tag>> :
public std::integral_constant<std::size_t, xt::detail::fixed_compute_size<S>::value>
{
};

#if defined(__clang__)
# pragma clang diagnostic pop
Expand Down
37 changes: 17 additions & 20 deletions include/xtensor/xstorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,30 +1909,27 @@ namespace xt
# pragma clang diagnostic ignored "-Wmismatched-tags"
#endif

namespace std
template <class T, std::size_t N>
class std::tuple_size<xt::const_array<T, N>> :
public std::integral_constant<std::size_t, N>
{
template <class T, std::size_t N>
class tuple_size<xt::const_array<T, N>> :
public integral_constant<std::size_t, N>
{
};
};

template <std::size_t... N>
class tuple_size<xt::fixed_shape<N...>> :
public integral_constant<std::size_t, sizeof...(N)>
{
};
template <std::size_t... N>
class std::tuple_size<xt::fixed_shape<N...>> :
public std::integral_constant<std::size_t, sizeof...(N)>
{
};

template <class T, std::ptrdiff_t Start, std::ptrdiff_t End>
class tuple_size<xt::sequence_view<T, Start, End>> :
public integral_constant<std::size_t, std::size_t(End - Start)>
{
};
template <class T, std::ptrdiff_t Start, std::ptrdiff_t End>
class std::tuple_size<xt::sequence_view<T, Start, End>> :
public std::integral_constant<std::size_t, std::size_t(End - Start)>
{
};

// Undefine tuple size for not-known sequence view size
template <class T, std::ptrdiff_t Start>
class tuple_size<xt::sequence_view<T, Start, -1>>;
}
// Undefine tuple size for not-known sequence view size
template <class T, std::ptrdiff_t Start>
class std::tuple_size<xt::sequence_view<T, Start, -1>>;

#if defined(__clang__)
# pragma clang diagnostic pop
Expand Down

0 comments on commit 956e95f

Please sign in to comment.