Skip to content

Commit 9e70992

Browse files
committed
Workaround for clang-cl
1 parent 18c7c1f commit 9e70992

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

include/xtensor/xreducer.hpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,19 +585,19 @@ namespace xt
585585
{
586586
}
587587

588-
reduce_functor_type get_reduce()
588+
reduce_functor_type get_reduce() const
589589
{
590-
return std::get<0>(*this);
590+
return std::get<0>(upcast());
591591
}
592592

593-
init_functor_type get_init()
593+
init_functor_type get_init() const
594594
{
595-
return std::get<1>(*this);
595+
return std::get<1>(upcast());
596596
}
597597

598-
merge_functor_type get_merge()
598+
merge_functor_type get_merge() const
599599
{
600-
return std::get<2>(*this);
600+
return std::get<2>(upcast());
601601
}
602602

603603
template<class NT>
@@ -608,6 +608,14 @@ namespace xt
608608
{
609609
return make_xreducer_functor(get_reduce(), get_init().template rebind<NT>(), get_merge());
610610
}
611+
612+
private:
613+
614+
// Workaround for clang-cl
615+
const base_type& upcast() const
616+
{
617+
return static_cast<const base_type&>(*this);
618+
}
611619
};
612620

613621
template <class RF>

0 commit comments

Comments
 (0)