Skip to content

Commit 72f74a8

Browse files
committed
Fixed lambda return type used in xfunxtion
1 parent 3b8e0c4 commit 72f74a8

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

include/xtensor/core/xfunction.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ namespace xt
608608
// leading to warning about signed/unsigned conversions in the deeper layers of the access methods
609609

610610
return std::apply(
611-
[&](auto&... e)
611+
[&](auto&... e) -> const_reference
612612
{
613613
XTENSOR_TRY(check_index(shape(), args...));
614614
XTENSOR_CHECK_DIMENSION(shape(), args...);
@@ -631,7 +631,7 @@ namespace xt
631631
inline auto xfunction<F, CT...>::flat(size_type index) const -> const_reference
632632
{
633633
return std::apply(
634-
[&](auto&... e)
634+
[&](auto&... e) -> const_reference
635635
{
636636
return m_f(e.data_element(index)...);
637637
},
@@ -665,7 +665,7 @@ namespace xt
665665
// The static cast prevents the compiler from instantiating the template methods with signed integers,
666666
// leading to warning about signed/unsigned conversions in the deeper layers of the access methods
667667
return std::apply(
668-
[&](const auto&... e)
668+
[&](const auto&... e) -> const_reference
669669
{
670670
return m_f(e.unchecked(static_cast<size_type>(args)...)...);
671671
},
@@ -685,7 +685,7 @@ namespace xt
685685
inline auto xfunction<F, CT...>::element(It first, It last) const -> const_reference
686686
{
687687
return std::apply(
688-
[&](auto&... e)
688+
[&](auto&... e) -> const_reference
689689
{
690690
XTENSOR_TRY(check_element_index(shape(), first, last));
691691
return m_f(e.element(first, last)...);
@@ -826,7 +826,7 @@ namespace xt
826826
inline auto xfunction<F, CT...>::data_element(size_type i) const -> const_reference
827827
{
828828
return std::apply(
829-
[&](auto&... e)
829+
[&](auto&... e) -> const_reference
830830
{
831831
return m_f(e.data_element(i)...);
832832
},
@@ -957,7 +957,7 @@ namespace xt
957957
inline auto xfunction_iterator<F, CT...>::operator*() const -> reference
958958
{
959959
return std::apply(
960-
[&](auto&... it)
960+
[&](auto&... it) -> reference
961961
{
962962
return (p_f->m_f)(*it...);
963963
},
@@ -1109,7 +1109,7 @@ namespace xt
11091109
inline auto xfunction_stepper<F, CT...>::operator*() const -> reference
11101110
{
11111111
return std::apply(
1112-
[&](auto&... e)
1112+
[&](auto&... e) -> reference
11131113
{
11141114
return (p_f->m_f)(*e...);
11151115
},

0 commit comments

Comments
 (0)