@@ -1088,31 +1088,6 @@ namespace xt
10881088 return xfunction_type (detail::lambda_adapt<F>(std::forward<F>(lambda)), std::forward<E>(args)...);
10891089 }
10901090
1091- // Workaround for MSVC 2015 & GCC 4.9
1092- #if (defined(_MSC_VER) && _MSC_VER < 1910) || (defined(__GNUC__) && __GNUC__ < 5)
1093- #define XTENSOR_DISABLE_LAMBDA_FCT
1094- #endif
1095-
1096- #ifdef XTENSOR_DISABLE_LAMBDA_FCT
1097- struct square_fct
1098- {
1099- template <class T >
1100- auto operator ()(T x) const -> decltype(x * x)
1101- {
1102- return x * x;
1103- }
1104- };
1105-
1106- struct cube_fct
1107- {
1108- template <class T >
1109- auto operator ()(T x) const -> decltype(x * x * x)
1110- {
1111- return x * x * x;
1112- }
1113- };
1114- #endif
1115-
11161091 /* *
11171092 * @ingroup pow_functions
11181093 * @brief Square power function, equivalent to e1 * e1.
@@ -1125,15 +1100,11 @@ namespace xt
11251100 template <class E1 >
11261101 inline auto square (E1 && e1 ) noexcept
11271102 {
1128- #ifdef XTENSOR_DISABLE_LAMBDA_FCT
1129- return make_lambda_xfunction (square_fct{}, std::forward<E1 >(e1 ));
1130- #else
11311103 auto fnct = [](auto x) -> decltype (x * x)
11321104 {
11331105 return x * x;
11341106 };
11351107 return make_lambda_xfunction (std::move (fnct), std::forward<E1 >(e1 ));
1136- #endif
11371108 }
11381109
11391110 /* *
@@ -1148,18 +1119,13 @@ namespace xt
11481119 template <class E1 >
11491120 inline auto cube (E1 && e1 ) noexcept
11501121 {
1151- #ifdef XTENSOR_DISABLE_LAMBDA_FCT
1152- return make_lambda_xfunction (cube_fct{}, std::forward<E1 >(e1 ));
1153- #else
11541122 auto fnct = [](auto x) -> decltype (x * x * x)
11551123 {
11561124 return x * x * x;
11571125 };
11581126 return make_lambda_xfunction (std::move (fnct), std::forward<E1 >(e1 ));
1159- #endif
11601127 }
11611128
1162- #undef XTENSOR_DISABLE_LAMBDA_FCT
11631129
11641130 namespace detail
11651131 {
0 commit comments