Skip to content

Commit d509a41

Browse files
authored
xcontainer.hpp: Renamed a shadowing type name inside a function (#2208)
Renamed a shadowing types and names
1 parent ca1a90b commit d509a41

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

include/xtensor/xassign.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ namespace xt
334334

335335
static constexpr bool is_bool_conversion() { return is_bool<e2_value_type>::value && !is_bool<e1_value_type>::value; }
336336
static constexpr bool contiguous_layout() { return E1::contiguous_layout && E2::contiguous_layout; }
337-
static constexpr bool convertible_types() { return std::is_convertible<e2_value_type, e1_value_type>::value
337+
static constexpr bool convertible_types() { return std::is_convertible<e2_value_type, e1_value_type>::value
338338
&& !is_bool_conversion(); }
339339

340340
static constexpr bool use_xsimd() { return xt_simd::simd_traits<int8_t>::size > 1; }
@@ -345,7 +345,7 @@ namespace xt
345345
static constexpr bool simd_interface() { return has_simd_interface<E2, requested_value_type>(); }
346346

347347
public:
348-
348+
349349
// constexpr methods instead of constexpr data members avoid the need of definitions at namespace
350350
// scope of these data members (since they are odr-used).
351351

@@ -565,13 +565,13 @@ namespace xt
565565
template <class E1, class E2, layout_type L>
566566
inline void stepper_assigner<E1, E2, L>::run()
567567
{
568-
using size_type = typename E1::size_type;
568+
using tmp_size_type = typename E1::size_type;
569569
using argument_type = std::decay_t<decltype(*m_rhs)>;
570570
using result_type = std::decay_t<decltype(*m_lhs)>;
571571
constexpr bool needs_cast = has_assign_conversion<argument_type, result_type>::value;
572572

573-
size_type s = m_e1.size();
574-
for (size_type i = 0; i < s; ++i)
573+
tmp_size_type s = m_e1.size();
574+
for (tmp_size_type i = 0; i < s; ++i)
575575
{
576576
*m_lhs = conditional_cast<needs_cast, result_type>(*m_rhs);
577577
stepper_tools<L>::increment_stepper(*this, m_index, m_e1.shape());
@@ -906,7 +906,7 @@ namespace xt
906906
std::size_t inner_loop_size, outer_loop_size, cut;
907907
std::tie(inner_loop_size, outer_loop_size, cut) = strided_assign_detail::get_loop_sizes(e1, e2, is_row_major);
908908

909-
if ((is_row_major && cut == e1.dimension()) || (!is_row_major && cut == 0))
909+
if ((is_row_major && cut == e1.dimension()) || (!is_row_major && cut == 0))
910910
{
911911
return fallback_assigner(e1, e2).run();
912912
}

include/xtensor/xcontainer.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,14 +1026,14 @@ namespace xt
10261026
template <class S>
10271027
inline void xstrided_container<D>::reshape_impl(S&& _shape, std::true_type /* is signed */, layout_type layout)
10281028
{
1029-
using value_type = typename std::decay_t<S>::value_type;
1029+
using tmp_value_type = typename std::decay_t<S>::value_type;
10301030
auto new_size = compute_size(_shape);
10311031
if (this->size() % new_size)
10321032
{
10331033
XTENSOR_THROW(std::runtime_error, "Negative axis size cannot be inferred. Shape mismatch.");
10341034
}
10351035
std::decay_t<S> shape = _shape;
1036-
value_type accumulator = 1;
1036+
tmp_value_type accumulator = 1;
10371037
std::size_t neg_idx = 0;
10381038
std::size_t i = 0;
10391039
for(auto it = shape.begin(); it != shape.end(); ++it, i++)
@@ -1048,7 +1048,7 @@ namespace xt
10481048
}
10491049
if(accumulator < 0)
10501050
{
1051-
shape[neg_idx] = static_cast<value_type>(this->size()) / std::abs(accumulator);
1051+
shape[neg_idx] = static_cast<tmp_value_type>(this->size()) / std::abs(accumulator);
10521052
}
10531053
else if(this->size() != new_size)
10541054
{
@@ -1060,7 +1060,7 @@ namespace xt
10601060
resize_container(m_backstrides, m_shape.size());
10611061
compute_strides<D::static_layout>(m_shape, m_layout, m_strides, m_backstrides);
10621062
}
1063-
1063+
10641064
template <class D>
10651065
inline auto xstrided_container<D>::mutable_layout() noexcept -> layout_type&
10661066
{

include/xtensor/xgenerator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,14 +467,14 @@ namespace xt
467467
template <std::size_t dim, class I, class... Args>
468468
inline void xgenerator<F, R, S>::adapt_index(I& arg, Args&... args) const
469469
{
470-
using value_type = typename decltype(m_shape)::value_type;
470+
using tmp_value_type = typename decltype(m_shape)::value_type;
471471
if (sizeof...(Args) + 1 > m_shape.size())
472472
{
473473
adapt_index<dim>(args...);
474474
}
475475
else
476476
{
477-
if (static_cast<value_type>(arg) >= m_shape[dim] && m_shape[dim] == 1)
477+
if (static_cast<tmp_value_type>(arg) >= m_shape[dim] && m_shape[dim] == 1)
478478
{
479479
arg = 0;
480480
}

0 commit comments

Comments
 (0)